[Asterisk-Users] want to set a var in sip.conf
John Todd
jtodd at loligo.com
Wed May 19 01:17:54 MST 2004
At 12:10 AM -0600 on 5/19/04, brian k. west wrote:
>Just as a better example of how to use accountcode for this ... maybe we
>could add areacode= to sip.conf and pull that into a var instead of wasting
>the accountcode for this.... hrm...
>
>[1234567]
>username=whatever
>secret=whatever
>context=phones
>accountcode=920
>
> then in extensions.conf
>
>[outbound]
>exten => NXXXXXX,1,goto(1${ACCOUNTCODE}${EXTEN},1)
>
>[phones]
>include => outbound
Actually, this gives me an interesting idea. Why can't we just set
variables on SIP (and other?) channels on the inbound side, just like
we do with spooled calls?
Here's what would seem to be an obvious usage case from sip.conf:
[2221]
type=friend
secret=b3edowo32AA
host=dynamic
mailbox=2221 at local
context=intern
canreinvite=no
nat=1
setvar=salesmanager="Bill Smith"
setvar=secretary=1233
setvar=secretaryname="Smithers"
setvar=clublikeaseal="yes"
All of those variables would be "pre-set" upon delivery of the call
into the extension logic. Anyone up to take this one? It sounds
pretty easy, and would possibly be a lot more sane than creating
different contexts for every entry that had different values. It's
also easily extended across all channel types.
JT
More information about the asterisk-users
mailing list