[asterisk-users] dial out with channel variable; sub-string usage

thufir hawat.thufir at gmail.com
Sun Apr 12 19:31:08 CDT 2015


On 15-04-09 12:06 PM, Chad Wallace wrote:
>> but don't know where to put those lines.  I have BABY defined as
>> >channel variable:
>> >
>> >BABY = SIP/babytel_out
>> >
>> >but that seems circular, somehow.
> You put them in the context for your clients... From what you show
> below, I'd say they go in the "local_200" context.  You can verify
> this by looking in sip.conf, in the section that starts with [200],
> find the line that starts with "context=".  It's probably
> "context=local_200".  Then you put the outbound dialplan in that context
> in extensions.conf.  Mind you, then 200 is the only phone that can dial
> out.  201 can only dial 200 and nothing else.


Wait a minute, slow down.  I re-installed, same sort of problem:

vici:~ #
vici:~ # asterisk -rx "sip show peers"
Name/username             Host Dyn Forcerport ACL Port     Status
300/300                   (Unspecified) D   N             0        UNKNOWN
301/301                   192.168.0.24 D   N             5060     OK (29 
ms)
302/302                   (Unspecified) D   N             0        UNKNOWN
gs102/gs102               (Unspecified) D   N             0        UNKNOWN
testcarrier/19876543210 198.38.7.34                                  
N             5065 OK (82 ms)
5 sip peers [Monitored: 2 online, 3 offline Unmonitored: 0 online, 0 
offline]
vici:~ #
vici:~ # asterisk -rx "sip show peer testcarrier"


   * Name       : testcarrier
   Secret       : <Set>
   MD5Secret    : <Not set>
   Remote Secret: <Not set>
   Context      : default


I simply want "all" outbound calls to go through a specific context, I 
think, if I understand how the channel passes control to the correct 
context.  I want, or need, an "outbound" context?

I know that the text has an example of ServerA routing through serverB.  
Simply add a line, like:


exten => _9x.,1,Dial(SIP/${EXTEN:1}@babytel_out)

or


exten => _9x.,1,Dial(${BABY}/${EXTEN:1})

Which just brings me back to...the context for BABY...is...?  BABY is a 
channel variable.  In the above CLI output, the channel variable is 
testcarrier, which has a context of "default".

Each channel variable maps to at most one context?  Many channel 
variables can map to a single context?



thanks,

Thufir




More information about the asterisk-users mailing list