[asterisk-users] Specifying DID for outbound calls
Joshua Colp
jcolp at digium.com
Sun Dec 19 20:00:04 UTC 2010
----- Original Message -----
> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Joshua
> Colp
> Sent: Sunday, December 19, 2010 2:40 PM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [asterisk-users] Specifying DID for outbound calls
>
> ----- Original Message -----
> > The host I am working with has two accounts from the same DID
> > provider. Incoming calls work correctly and dial the appropriate
> > extensions. This also allows incoming calls to be billed
> > appropriately
> > to the
> > individual DID accounts.
> >
> > Outgoing calls from either extension default to the first DID, i.e.
> > calls from either extension have the same callerID. How can an
> > extension specify separate outgoing contexts so the correct number
> > is
> > associated with it, also allowing the SIP provider to recognize the
> > difference for billing purposes, or is there a better way?
> >
> > In short I'm looking to associate an outgoing call from an extension
> > with a specific number.
> >
> > Here's the sip.conf for both accounts as they are using IP routing,
> > I'm assuming I do not have to perform auth based to separate the two
> > accounts for outgoing calls:
>
> I'm surprised nobody has suggested using the setvar functionality.
> It's
> extremely
> useful for stuff like this and would allow you to keep all CallerID
> information
> with the actual configuration of the device.
>
> Using a configuration entry for sip.conf in another response as an
> example:
>
> [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
> setvar=EXTERNAL_CALLERID="User One" <3012323434>
>
> And then in extensions.conf:
>
> exten => _1NXXNXXXXXX,1,Set(CALLERID(all)=${EXTERNAL_CALLERID})
> exten => _1NXXNXXXXXX,n,Dial(SIP/${EXTEN}@vitel-outbound)
>
> Of course you could add some sanity checking there to make sure that
> ${EXTERNAL_CALLERID} contains a value and if not default to your
> main DID.
>
>
> How would that work if a user has 3 different callerids, and the use
> of
> realtime?
If there are 3 different CallerIDs then you would have three differently
named dialplan variables containing the appropriate CallerID information
for each. The logic would have to know which dialplan variable to use depending
on the situation, but it would already have to know that regardless.
The only difference is having the CallerID stored with the device configuration
versus in dialplan logic itself.
As for realtime I have not utilized setvar with it but it may be possible to
separate each variable and value using &, just a theory though.
--
Joshua Colp
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com & www.asterisk.org
More information about the asterisk-users
mailing list