[asterisk-users] Bug or feature: SIP chanvars not overriden

Tilghman Lesher tlesher at digium.com
Wed Nov 11 15:05:11 CST 2009


On Wednesday 11 November 2009 14:23:31 Olivier wrote:
> Hello,
>
> Using 1.6.2-rc5, my settings include:
>
> [local-phone](!)
>     context=mylocal
>     type=friend
>     nat=no
>     canreinvite=no
>     host=dynamic
>     qualify=yes
>     dtmf=info
>     language=fr
>     call-limit=5
>     subscribecontext=subs
>     disallow=all
>     allow=alaw
>     t38pt_udptl=no
>     setvar=accountcode=foo
>
> [168](local-phone)
> defaultuser=168
> secret=pass168
> callerid=John Doe<168>
> mailbox=168
> setvar=longcid=015555555
> setvar=accountcode=bar
>
>
> CLI> sip show peer 168
> ...
>   Variables    :
>                  accountcode = bar
>                  longcid = 015555555
>                  accountcode = foo
>
>
> When running, ${SIPPEER(168,chanvar[accountcode])}) is valued to foo
> (instead of bar).
> Would you rate it as a feature ?

Neither.  It's a misunderstanding on your part of how this all works.  The
equivalent of your entry above is the context:

[168]
context=mylocal
type=friend
nat=no
canreinvite=no
host=dynamic
qualify=yes
dtmf=info
language=fr
call-limit=5
subscribecontext=subs
disallow=all
allow=alaw
t38pt_udptl=no
setvar=accountcode=foo
defaultuser=168
secret=pass168
callerid=John Doe<168>
mailbox=168
setvar=longcid=015555555
setvar=accountcode=bar

The FIRST value is the value which takes precedence, not the last.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-users mailing list