This question is related to How to get the return status when originating a call?
I try to originate a call via AMI which works great when i use a trunk name as context. The call first goes outbound and when the called person picks up, the person got connected to an internal extension. Now i would like to use outbound-allroutes so asterisk selects the right outbound rule / trunk itself. I guess it doesn’t work because i set up each outbound rule to only match one single extension, f.e.:
- Outbound rule: OUT_700
- Dial pattern:
- Match pattern: X.
- CallerID: 700
So the generated extensions_additional.conf looks like that:
[outrt-7] ; 700
include => outrt-7-custom
exten => _X.,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _X./700,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _X./700,n,Gosub(sub-record-check,s,1(out,${EXTEN},dontcare))
exten => _X./700,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _X./700,n,Set(_NODEST=)
exten => _X./700,n,Macro(dialout-trunk,23,${EXTEN},,off)
exten => _X./700,n,Macro(dialout-trunk,4,${EXTEN},,off)
exten => _X./700,n,Macro(outisbusy,)
Now if i originate the call, this happens on CLI:
-- Called 01234567@outbound-allroutes
-- Executing [01234567@outbound-allroutes:1] Macro("Local/01234567@outbound-allroutes-0000009f;2", "user-callerid,LIMIT,EXTERNAL,") in new stack
-- Executing [s@macro-user-callerid:1] Set("Local/01234567@outbound-allroutes-0000009f;2", "TOUCH_MONITOR=1459437919.4929") in new stack
-- Executing [s@macro-user-callerid:2] Set("Local/01234567@outbound-allroutes-0000009f;2", "AMPUSER=01234567") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("Local/01234567@outbound-allroutes-0000009f;2", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("Local/01234567@outbound-allroutes-0000009f;2", "1?Set(REALCALLERIDNUM=01234567)") in new stack
-- Executing [s@macro-user-callerid:5] Set("Local/01234567@outbound-allroutes-0000009f;2", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("Local/01234567@outbound-allroutes-0000009f;2", "0?limit") in new stack
-- Executing [s@macro-user-callerid:7] Set("Local/01234567@outbound-allroutes-0000009f;2", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:8] GotoIf("Local/01234567@outbound-allroutes-0000009f;2", "1?report") in new stack
-- Goto (macro-user-callerid,s,15)
-- Executing [s@macro-user-callerid:15] GotoIf("Local/01234567@outbound-allroutes-0000009f;2", "1?continue") in new stack
-- Goto (macro-user-callerid,s,28)
-- Executing [s@macro-user-callerid:28] Set("Local/01234567@outbound-allroutes-0000009f;2", "CALLERID(number)=01234567") in new stack
-- Executing [s@macro-user-callerid:29] Set("Local/01234567@outbound-allroutes-0000009f;2", "CALLERID(name)=Mister Smith") in new stack
-- Executing [s@macro-user-callerid:30] Set("Local/01234567@outbound-allroutes-0000009f;2", "CDR(cnum)=01234567") in new stack
-- Executing [s@macro-user-callerid:31] Set("Local/01234567@outbound-allroutes-0000009f;2", "CDR(cnam)=Mister Smith") in new stack
-- Executing [s@macro-user-callerid:32] Set("Local/01234567@outbound-allroutes-0000009f;2", "CHANNEL(language)=de") in new stack
-- Auto fallthrough, channel 'Local/01234567@outbound-allroutes-0000009f;2' status is 'UNKNOWN'
I tried to set EXTEN=700 or DID=700 by fputs($oSocket, “Variable: DID=$ext\r\n”); but it doesn’t help.