[asterisk-users] Specifying DID for outbound calls
Stephen Reese
rsreese at gmail.com
Sun Dec 19 17:49:01 UTC 2010
> You can check the channel-name to see which extension is making the
> call and set the CallerID accordingly. The channel-name will be
> something like "SIP/201-abc23ef34" or "SIP/User1-def34abc51". The 201
> or User1 part depends on how you put the username in sip.conf You can
> use the CUT function to get the calling extension and then jump to the
> correct CallerID. I've used something like this:
>
> [outgoing]
> exten => _1NXXNXXXXXX,1,Set(Outgoing=${CUT(CHANNEL,/,2)})
> exten => _1NXXNXXXXXX,n,Set(Outgoing=${CUT(Outgoing,-,1)})
> exten => _1NXXNXXXXXX,n,GotoIf($["${Outgoing}" = "User2"]?20:10)
> exten => _1NXXNXXXXXX,10,Set(CALLERID(num)=3012323434)
> exten => _1NXXNXXXXXX,n,Set(CALLERID(name)="User1")
> exten => _1NXXNXXXXXX,n,Dial(SIP/${EXTEN}@vitel-outbound)
> exten => _1NXXNXXXXXX,n,Goto(h,1)
> exten => _1NXXNXXXXXX,20,Set(CALLERID(num)=3013232322)
> exten => _1NXXNXXXXXX,n,Set(CALLERID(name)="User2")
> exten => _1NXXNXXXXXX,n,Dial(SIP/${EXTEN}@vitel-outbound)
> exten => _1NXXNXXXXXX,n,Goto(h,1)
>
> But in my case I had two different domains. E.g.
> Dial(SIP/${EXTEN}@provider-ID1) and Dial(SIP/${EXTEN}@provider-ID2)
> instead of setting the CallerID.
>
> Not that the Cut doesn't work correctly if you use a minus-sign in the username.
>
> Best regards,
> Jeroen Eeuwes
Thanks Jeroen, though it is still not firing correct, I have provided
a little more information.
Here are the channel-names:
SIP/201-0000000a
SIP/101-00000012
Here is the extension information from the sip.conf:
[101]
type=friend
username=101
secret=0000
mailbox=101
callerid="User One" <101>
host=dynamic
nat=yes
dtmfmode=rfc2833
canreinvite=no
reinvite=no
qualify=yes
[201]
type=friend
username=201
secret=0000
mailbox=201
callerid="User Two" <201>
host=dynamic
nat=yes
dtmfmode=rfc2833
canreinvite=no
reinvite=no
qualify=yes
Here is the updated outgoing context that you provided with a few updates.
[outgoing]
exten => _1NXXNXXXXXX,1,Set(Outgoing=${CUT(CHANNEL,/,2)})
exten => _1NXXNXXXXXX,n,Set(Outgoing=${CUT(Outgoing,-,1)})
exten => _1NXXNXXXXXX,n,GotoIf($["${Outgoing}" = "User Two"]?20:10)
exten => _1NXXNXXXXXX,10,Set(CALLERID(num)=3012323434)
exten => _1NXXNXXXXXX,n,Set(CALLERID(name)="User One")
exten => _1NXXNXXXXXX,n,Dial(SIP/${EXTEN}@vitel-outbound)
exten => _1NXXNXXXXXX,n,Goto(h,1)
exten => _1NXXNXXXXXX,20,Set(CALLERID(num)=3013232322)
exten => _1NXXNXXXXXX,n,Set(CALLERID(name)="User Two")
exten => _1NXXNXXXXXX,n,Dial(SIP/${EXTEN}@vitel-outbound)
exten => _1NXXNXXXXXX,n,Goto(h,1)
Based on the information above, what should be altered to correctly
associated the number with the relevant extension?
Thanks
More information about the asterisk-users
mailing list