[Dundi] dundi lookup in a other tree

Jonathan Thurman jonathan at thurmantech.com
Sun Apr 4 15:04:39 CDT 2010


On Sun, Apr 4, 2010 at 11:45 AM, DUNDi Peering <dundi at swissirc.net> wrote:

> I'm Using Asterisk 1.6.2.0~rc2-0ubuntu1.2 built by buildd @ crested
> on a x86_64 running Linux on 2010-01-04 02:36:22 UTC on a Ubuntu

You might want to try this on a newer version.  1.6.2.6 is out now and
might have resolved an issue (but I don't know if it did)


> This i was also trying but it dont work,
>
>     -- Executing [00041xxxxxxxxx at sNE-PSTN:1] NoOp("SIP/+41yyyyyyyyy-ebbb3038", "DOING DUNDi sNE-PSTN LOOKUP") in new stack
>     -- Executing [00041xxxxxxxxx at sNE-PSTN:2] Set("SIP/+41yyyyyyyyy-ebbb3038", "dundiresult=") in new stack

The query returned an empty string, which means it failed.

Did you make sure to reload the dialplan after making your changes?

>     -- Executing [00041xxxxxxxxx at sNE-PSTN:3] NoOp("SIP/+41yyyyyyyyy-ebbb3038", "EXTEN Ausgabe 00041xxxxxxxxx") in new stack
>     -- Executing [00041xxxxxxxxx at sNE-PSTN:4] NoOp("SIP/+41yyyyyyyyy-ebbb3038", "Dundi Ausgabe ") in new stack
>     -- Executing [00041xxxxxxxxx at sNE-PSTN:5] GotoIf("SIP/+41yyyyyyyyy-ebbb3038", "1?:30") in new stack
>     -- Executing [00041xxxxxxxxx at sNE-PSTN:6] GotoIf("SIP/+41yyyyyyyyy-ebbb3038", "1?20:30") in new stack

You probably don't need to check for an empty result twice, but this
isn't hurting anything.

>     -- Goto (sNE-PSTN,00041xxxxxxxxx,20)
>     -- Executing [00041xxxxxxxxx at sNE-PSTN:20] NoOp("SIP/+41yyyyyyyyy-ebbb3038", "DUNDi sNE-PSTN Failed") in new stack
>     -- Executing [00041xxxxxxxxx at sNE-PSTN:21] Return("SIP/+41yyyyyyyyy-ebbb3038", "") in new stack
>     -- Executing [00041xxxxxxxxx at sip-41yyyyyyyyy:4] Hangup("SIP/+41yyyyyyyyy-ebbb3038", "") in new stack
>   == Spawn extension (sip-41yyyyyyyyy, 00041xxxxxxxxx, 4) exited non-zero on 'SIP/+41yyyyyyyyy-ebbb3038'

----

Here is an example of what works for me on Asterisk 1.6.1, NOT tested on 1.6.2:

; DUNDi Lookup
exten => _1NXXNXXXXXX,n,Set(DUNDI_GW=${DUNDILOOKUP(${EXTEN}|not-e164-context)})
exten => _1NXXNXXXXXX,n,GotoIf($[${ISNULL(${DUNDI_GW})}]?no-dundi)
exten => _1NXXNXXXXXX,n,Dial(${DUNDI_GW})
exten => _1NXXNXXXXXX,n(no-dundi),Verbose(3,outbound: No DUNDi peer available)

----
Here it is adapted for you (using a label for the gotoif), again NOT TESTED:

exten => _000XXX.,1,NoOp(DOING DUNDi sNE-PSTN LOOKUP)
exten => _000XXX.,n,Set(dundiresult=${DUNDILOOKUP(${EXTEN}|dundi-sNE)})
exten => _000XXX.,n,GotoIf($[${ISNULL(${dundiresult})}]?no-dundi)

exten => _000XXX.,n,NoOp(DUNDi sNE-PSTN Successful)
exten => _000XXX.,n,NoOp(Call from ${CALLERID(name)} over DUNDi out)

exten => _000XXX.,n,macro(call,${dundiresult})
exten => _000XXX.,n,Return

exten => _000XXX.,n(no-dundi),NoOp(DUNDi sNE-PSTN Failed)
exten => _000XXX.,n,Return

----

The CHANGES file for 1.6.2 also mentioned:

  * Added two new dialplan functions, DUNDIQUERY and DUNDIRESULT.  These
     functions will allow you to initiate a DUNDi query from the dialplan,
     find out how many results there are, and access each one.

So you might want to take a look at those to see if they work.  You
might also get more responses from the Asterisk Users mailing list.

-Jonathan



More information about the Dundi mailing list