[asterisk-users] Passing variables between two DUNDi/IAX2 peers

Richard Lyman pchammer at dynx.net
Wed Mar 5 08:37:37 CST 2008


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).






More information about the asterisk-users mailing list