[asterisk-users] Passing variables between two DUNDi/IAX2 peers
Vieri
rentorbuy at yahoo.com
Thu Mar 6 11:44:26 CST 2008
--- Craig Guy <craig.a.guy at gmail.com> wrote:
> I believe that IAXVAR in Asterisk 1.6 will do what
> you want. I have a
> backport of this for Asterisk 1.2.14 or so floating
> around somewhere but it
> hasn't been maintained or used for months, may not
> be compatible with the
> 1.6 implementation and I offer it with no support
> whatsoever.
I'd like to give it a try if you can tell me where to
download it.
I noticed that overloading the EXTEN variable does
actually work but not if I use SIP's regcontext
feature and DUNDi's nopartial option.
I want to take advantage of regcontext but I also need
to pass a variable. Basically, I need to send the
UNIQUEID var to the remote peer for logging purposes
(and maybe other values).
If I use regcontext/nopartial and place a call to
4065^${UNIQUEID}, the asterisk log reports:
Mar 6 18:30:06 DEBUG[10457] pbx_dundi.c: Got
canonical message 13 (0), 96 bytes data
Mar 6 18:30:06 DEBUG[10457] pbx_dundi.c: Got
canonical message 1 (0), 42 bytes data
Mar 6 18:30:06 DEBUG[10457] pbx_dundi.c: Answering
query for '4065^1204824606.83 at priv'!
Mar 6 18:30:06 DEBUG[26691] pbx_dundi.c: Whee,
looking up '4065^1204824606.83 at priv' for
'00:1d:60:39:e9:1b'
Mar 6 18:30:06 DEBUG[26691] pbx_dundi.c: Registering
request for '4065^1204824606.83 at priv' on behalf of
'00:1d:60:39:e9:1b' crc '00000000'
Mar 6 18:30:06 DEBUG[26691] db.c: Unable to find key
'001D6039E91B/4065^1204824606.83/priv/e00000000' in
family 'dundi/cache'
Mar 6 18:30:06 DEBUG[26691] db.c: Unable to find key
'001D6039E91B/4065^1204824606.83/priv/e00000000' in
family 'dundi/cache'
Mar 6 18:30:06 DEBUG[26691] db.c: Unable to find key
'001D6039E91B/4065^1204824606.83/priv/r001D6039E91B'
in family 'dundi/cache'
Mar 6 18:30:06 DEBUG[26691] db.c: Unable to find key
'hint/001D6039E91B/4/priv/e00000000' in family
'dundi/cache'
(...cut to save space...)
Mar 6 18:30:06 DEBUG[26691] db.c: Unable to find key
'hint/001D6039E91B/4065^1204824606.83/priv/e00000000'
in family 'dundi/cache'
Mar 6 18:30:06 DEBUG[26691] db.c: Unable to find key
'hint/001D6039E91B/4065^1204824606.83/priv/e00000000'
in family 'dundi/cache'
Mar 6 18:30:06 DEBUG[26691] db.c: Unable to find key
'hint/001D6039E91B/4065^1204824606.83/priv/r001D6039E91B'
in family 'dundi/cache'
Mar 6 18:30:06 DEBUG[26691] pbx_dundi.c: Avoiding
'00:1d:60:39:e9:1b' in transaction
and it obviously fails because dundi is looking up
4065^1204824606.83 in "regcontext" but it doesn't
exist (4065 is the registered SIP extension).
So unless someone suggests a better solution, I'd be
happy to try out the 1.2 backport of IAXVAR (if you
can find it somewhere).
Thanks!
> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com
> [mailto:asterisk-users-bounces at lists.digium.com] On
> Behalf Of Vieri
> Sent: Thursday, 6 March 2008 2:57 AM
> To: Asterisk Users Mailing List - Non-Commercial
> Discussion
> Subject: Re: [asterisk-users] Passing variables
> between two DUNDi/IAX2 peers
>
>
> --- Richard Lyman <pchammer at dynx.net> wrote:
>
> > Vieri wrote:
> > > Hi.
> > >
> > > I am trying to pass a variable from one Asterisk
> > PBX
> > > to another.
> > >
> > > I'm using DUNDi with IAX2. Is there a way to do
> > it?
> > >
> > > I tried the following but it fails.
> > >
> > > On peer1:
> > >
> > > [dundi-outgoing]
> > > switch => DUNDI/priv
> > > exten => s,1,Set(CDR(userfield)=test)
> > > exten => s,2,Set(DUNDIVAR=${ARG1}#TEST)
> > > exten => s,3,NoOp(Passing ${DUNDIVAR} to DUNDi
> > peer.)
> > > exten => s,4,Goto(${DUNDIVAR},1)
> > >
> > > On peer2:
> > >
> > > [dundi-incoming]
> > > exten => _X.,1,NoOp(Received EXTEN ${EXTEN}.)
> > > exten => _X.,n,Set(EXTTODIAL=${CUT(EXTEN|#|1)})
> > > exten => _X.,n,Set(DUNDIVAR=${CUT(EXTEN|#|2)})
> > > exten => _X.,1,NoOp(Extracted extension
> > ${EXTTODIAL}
> > > and DUNDi variable ${DUNDIVAR})
> > > exten =>
> > _X.,n,Goto(local-extensions,${EXTTODIAL},1)
> > >
> > > If I try a test call then nothing ever reaches
> > peer2.
> > > However, if I remove #TEST from DUNDIVAR in
> > > dundi-outgoing and
> > Goto(local-extensions,${EXTEN},1)
> > > in dundi-incoming then the call is established
> > > correctly.
> > >
> > > I guess the _X. pattern match is wrong?
> > >
> > > How can I match an alphanumeric string?
> > >
> > > Thanks,
> > >
> > > Vieri
> > >
> > >
> >
> > you would have to use type 'friend' as user/peer
> do
> > not pass channel
> > variables (unless it has been changed in
> > 1.4/1.6/trunk).
>
> In iax.conf I have (on both peers):
>
> [priv]
> type=friend
> dbsecret=dundi/secret
> context=dundi-incoming
>
> and I am running Asterisk 1.2.21.1 on peer1 and
> 1.2.26.2 on peer2.
>
> Any ideas as to why it's not "working"?
> Or could anyone please suggest an alternative
> method?
>
> Thanks!
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
More information about the asterisk-users
mailing list