FreePBX 2.4 DUNDi basic settings

I am trying to use the new DUNDi support in FreePBX 2.4. I am also new to DUNDi in general.

I have 2 identical asterisk test servers (clones) in which only one of them has the SIP extension 4777.

I would like to make a call to 4777.

If I dial 4777 from an extension registered to the same * server where 4777 is registered then the call is established.

If I dial 4777 from an extension registered on the other * server then the call is unsuccessful and it doesn’t even call the DUNDi macro because it goes through ext-local and doesn’t find 4777.

So on the * server without the 4777 extension I defined an Outbound route with dial pattern 77773|. and trunk sequence 0 DUNDI/priv.

I then dialed 777734777 from SIP extension 4053 and that went through the FreePBX DUNDi macro but the call failed with CHANUNAVAIL.

On * PBX where extension 4777 does not exist (inf-voip2):

asterisk -vr

Asterisk 1.2.21.1, Copyright © 1999 - 2007 Digium, Inc. and others.
Created by Mark Spencer <[email protected]>
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘show license’ for details.

Connected to Asterisk 1.2.21.1 currently running on inf-voip2 (pid = 10544)
Verbosity is at least 3
inf-voip2CLI> dundi debug
DUNDi Debugging Enabled
– Executing Macro(“SIP/4053-08146958”, “user-callerid|SKIPTTL|”) in new stack
– Executing NoOp(“SIP/4053-08146958”, “user-callerid: device 4053”) in new stack
– Executing Set(“SIP/4053-08146958”, “AMPUSER=4053”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “0?report”) in new stack
– Executing ExecIf(“SIP/4053-08146958”, “1|Set|REALCALLERIDNUM=4053”) in new stack
– Executing NoOp(“SIP/4053-08146958”, “REALCALLERIDNUM is 4053”) in new stack
– Executing Set(“SIP/4053-08146958”, “AMPUSER=4053”) in new stack
– Executing Set(“SIP/4053-08146958”, “AMPUSERCIDNAME=TEST”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “0?report”) in new stack
– Executing Set(“SIP/4053-08146958”, “AMPUSERCID=7021”) in new stack
– Executing Set(“SIP/4053-08146958”, “CALLERID(all)=“TEST” <7021>”) in new stack
– Executing Set(“SIP/4053-08146958”, “REALCALLERIDNUM=4053”) in new stack
– Executing ExecIf(“SIP/4053-08146958”, “0|Set|LANGUAGE()=”) in new stack
– Executing NoOp(“SIP/4053-08146958”, “TTL: ARG1: SKIPTTL”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,23)
– Executing NoOp(“SIP/4053-08146958”, “Using CallerID “TEST” <7021>”) in new stack
– Executing Set(“SIP/4053-08146958”, “_NODEST=”) in new stack
– Executing Macro(“SIP/4053-08146958”, “record-enable|4053|OUT|”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “0?2:4”) in new stack
– Goto (macro-record-enable,s,4)
– Executing AGI(“SIP/4053-08146958”, “recordingcheck|20080222-111914|1203675554.11”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20080222-111914|1203675554.11: Outbound recording not enabled
– AGI Script recordingcheck completed, returning 0
– Executing NoOp(“SIP/4053-08146958”, “No recording needed”) in new stack
– Executing Macro(“SIP/4053-08146958”, “dialout-dundi|4|4777||”) in new stack
– Executing Set(“SIP/4053-08146958”, “DIAL_TRUNK=4”) in new stack
– Executing ExecIf(“SIP/4053-08146958”, “0|Authenticate|”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “0?disabletrunk|1”) in new stack
– Executing Set(“SIP/4053-08146958”, “DIAL_NUMBER=4777”) in new stack
– Executing Set(“SIP/4053-08146958”, “DIAL_TRUNK_OPTIONS=tTwW”) in new stack
– Executing Set(“SIP/4053-08146958”, “GROUP()=OUT_4”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “1?nomax”) in new stack
– Goto (macro-dialout-dundi,s,9)
– Executing GotoIf(“SIP/4053-08146958”, “0?skipoutcid”) in new stack
– Executing Set(“SIP/4053-08146958”, “DIAL_TRUNK_OPTIONS=TWf”) in new stack
– Executing Macro(“SIP/4053-08146958”, “outbound-callerid|4”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “1?start”) in new stack
– Goto (macro-outbound-callerid,s,3)
– Executing NoOp(“SIP/4053-08146958”, “REALCALLERIDNUM is 4053”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,9)
– Executing Set(“SIP/4053-08146958”, “USEROUTCID=”) in new stack
– Executing Set(“SIP/4053-08146958”, “EMERGENCYCID=”) in new stack
– Executing Set(“SIP/4053-08146958”, “TRUNKOUTCID=”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,16)
– Executing GotoIf(“SIP/4053-08146958”, “1?usercid”) in new stack
– Goto (macro-outbound-callerid,s,18)
– Executing GotoIf(“SIP/4053-08146958”, “1?report”) in new stack
– Goto (macro-outbound-callerid,s,22)
– Executing NoOp(“SIP/4053-08146958”, “CallerID set to “TEST” <7021>”) in new stack
– Executing AGI(“SIP/4053-08146958”, “fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
== fixlocalprefix: Dialpattern 4777 matched. 4777 -> 4777
– AGI Script fixlocalprefix completed, returning 0
– Executing Set(“SIP/4053-08146958”, “OUTNUM=4777”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “1?gocall”) in new stack
– Goto (macro-dialout-dundi,s,16)
– Executing Macro(“SIP/4053-08146958”, “dialout-dundi-predial-hook|”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “0?bypass|1”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “0?customtrunk”) in new stack
– Executing Macro(“SIP/4053-08146958”, “dundi-4|4777”) in new stack
– Executing Goto(“SIP/4053-08146958”, “4777|1”) in new stack
– Goto (macro-dundi-4,4777,1)
ETx-Frame Retry[No] – OSeqno: 000 ISeqno: 000 Type: DPDISCOVER (Command)
Flags: 00 STrans: 10914 DTrans: 00000 [192.168.250.27:4520]
VERSION : 1
DIRECT EID : 00:1d:60:39:e9:1b
CALLED NUMBER : 4777
CALLED CONTEXT : priv
TTL : 2
inf-voip2
CLI>
Tx-Frame Retry[No] – OSeqno: 000 ISeqno: 000 Type: ENCRYPT (Command)
Flags: 00 STrans: 10914 DTrans: 00000 [192.168.250.27:4520]
ENTITY IDENT : 00:1d:60:39:e9:1b
KEYCRC32 : 1692224221
ENCDATA : [IV 87d27c54a04d66499b1157465a00880a] 4 encrypted blocks
inf-voip2CLI>
Rx-Frame Retry[No] – OSeqno: 000 ISeqno: 001 Type: ACK (Response)
Flags: 00 STrans: 24837 DTrans: 10914 [192.168.250.27:4520]
Rx-Frame Retry[No] – OSeqno: 000 ISeqno: 001 Type: ENCRYPT (Command)
Flags: 00 STrans: 24837 DTrans: 10914 [192.168.250.27:4520]
ENCDATA : [IV 2341df4dc29d0b55753302115cf1c066] 7 encrypted blocks
inf-voip2
CLI>
Erx-Frame Retry[No] – OSeqno: 000 ISeqno: 001 Type: DPRESPONSE (Response)
Flags: 00 STrans: 24837 DTrans: 10914 [192.168.250.27:4520] (Final)
ANSWER : [EXISTS] 0 <IAX/priv:FKWJAwcQfyohX68Lbrxwaw@$192.168.250.27/${NUMBER}> from [00:1d:60:b0:25:10]
HINT : [UNAFFECTED]
EXPIRATION : 5
inf-voip2CLI>
Tx-Frame Retry[No] – OSeqno: 001 ISeqno: 001 Type: ACK (Response)
Flags: 00 STrans: 10914 DTrans: 24837 [192.168.250.27:4520] (Final)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing Goto(“SIP/4053-08146958”, “s-CHANUNAVAIL|1”) in new stack
– Goto (macro-dialout-dundi,s-CHANUNAVAIL,1)
– Executing GotoIf(“SIP/4053-08146958”, “1?noreport”) in new stack
– Goto (macro-dialout-dundi,s-CHANUNAVAIL,3)
– Executing NoOp(“SIP/4053-08146958”, “TRUNK Dial failed due to CHANUNAVAIL - failing through to other trunks”) in new stack
– Executing Macro(“SIP/4053-08146958”, “dialout-trunk|11|4777||”) in new stack
– Executing Set(“SIP/4053-08146958”, “DIAL_TRUNK=11”) in new stack
– Executing ExecIf(“SIP/4053-08146958”, “0|Authenticate|”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “0?disabletrunk|1”) in new stack
– Executing Set(“SIP/4053-08146958”, “DIAL_NUMBER=4777”) in new stack
– Executing Set(“SIP/4053-08146958”, “DIAL_TRUNK_OPTIONS=tTwW”) in new stack
– Executing Set(“SIP/4053-08146958”, “GROUP()=OUT_11”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing GotoIf(“SIP/4053-08146958”, “0?skipoutcid”) in new stack
– Executing Set(“SIP/4053-08146958”, “DIAL_TRUNK_OPTIONS=TWf”) in new stack
– Executing Macro(“SIP/4053-08146958”, “outbound-callerid|11”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “1?start”) in new stack
– Goto (macro-outbound-callerid,s,3)
– Executing NoOp(“SIP/4053-08146958”, “REALCALLERIDNUM is 4053”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,9)
– Executing Set(“SIP/4053-08146958”, “USEROUTCID=”) in new stack
– Executing Set(“SIP/4053-08146958”, “EMERGENCYCID=”) in new stack
– Executing Set(“SIP/4053-08146958”, “TRUNKOUTCID=”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,16)
– Executing GotoIf(“SIP/4053-08146958”, “1?usercid”) in new stack
– Goto (macro-outbound-callerid,s,18)
– Executing GotoIf(“SIP/4053-08146958”, “1?report”) in new stack
– Goto (macro-outbound-callerid,s,22)
– Executing NoOp(“SIP/4053-08146958”, “CallerID set to “TEST” <7021>”) in new stack
– Executing AGI(“SIP/4053-08146958”, “fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
– AGI Script fixlocalprefix completed, returning 0
– Executing Set(“SIP/4053-08146958”, “OUTNUM=4777”) in new stack
– Executing Set(“SIP/4053-08146958”, “custom=IAX2/priv”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “1?gocall”) in new stack
– Goto (macro-dialout-trunk,s,17)
– Executing Macro(“SIP/4053-08146958”, “dialout-trunk-predial-hook|”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “0?bypass|1”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “0?customtrunk”) in new stack
– Executing Dial(“SIP/4053-08146958”, “IAX2/priv/4777|300|TWf”) in new stack
== Everyone is busy/congested at this time (1:0/0/1)
– Executing Goto(“SIP/4053-08146958”, “s-CHANUNAVAIL|1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing GotoIf(“SIP/4053-08146958”, “1?noreport”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,3)
– Executing NoOp(“SIP/4053-08146958”, “TRUNK Dial failed due to CHANUNAVAIL - failing through to other trunks”) in new stack
– Executing Macro(“SIP/4053-08146958”, “outisbusy|”) in new stack
– Executing Playback(“SIP/4053-08146958”, “all-circuits-busy-now|noanswer”) in new stack
– Playing ‘all-circuits-busy-now’ (language ‘es’)
– Executing Playback(“SIP/4053-08146958”, “pls-try-call-later|noanswer”) in new stack
– Playing ‘pls-try-call-later’ (language ‘es’)
– Executing Macro(“SIP/4053-08146958”, “hangupcall”) in new stack
– Executing ResetCDR(“SIP/4053-08146958”, “w”) in new stack
– Executing NoCDR(“SIP/4053-08146958”, “”) in new stack
– Executing GotoIf(“SIP/4053-08146958”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,6)
– Executing GotoIf(“SIP/4053-08146958”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing GotoIf(“SIP/4053-08146958”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,11)
– Executing Hangup(“SIP/4053-08146958”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/4053-08146958’ in macro ‘hangupcall’
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/4053-08146958’ in macro ‘outisbusy’
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/4053-08146958’
inf-voip2
CLI> quit

On * PBX where extension 4777 exists (inf-voip1):

asterisk -vr

Asterisk 1.2.21.1, Copyright © 1999 - 2007 Digium, Inc. and others.
Created by Mark Spencer <[email protected]>
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘show license’ for details.

Connected to Asterisk 1.2.21.1 currently running on inf-voip1 (pid = 10448)
– Remote UNIX connection
Verbosity is at least 3
inf-voip1CLI> dundi debug
DUNDi Debugging Enabled
Rx-Frame Retry[No] – OSeqno: 000 ISeqno: 000 Type: ENCRYPT (Command)
Flags: 00 STrans: 10914 DTrans: 00000 [192.168.250.128:4520]
ENTITY IDENT : 00:1d:60:39:e9:1b
KEYCRC32 : 1692224221
ENCDATA : [IV 87d27c54a04d66499b1157465a00880a] 4 encrypted blocks
inf-voip1
CLI>
Erx-Frame Retry[No] – OSeqno: 000 ISeqno: 000 Type: DPDISCOVER (Command)
Flags: 00 STrans: 10914 DTrans: 00000 [192.168.250.128:4520]
VERSION : 1
DIRECT EID : 00:1d:60:39:e9:1b
CALLED NUMBER : 4777
CALLED CONTEXT : priv
TTL : 2
inf-voip1CLI>
Tx-Frame Retry[No] – OSeqno: 000 ISeqno: 001 Type: ACK (Response)
Flags: 00 STrans: 24837 DTrans: 10914 [192.168.250.128:4520]
ETx-Frame Retry[No] – OSeqno: 000 ISeqno: 001 Type: DPRESPONSE (Response)
Flags: 00 STrans: 24837 DTrans: 10914 [192.168.250.128:4520] (Final)
ANSWER : [EXISTS] 0 <IAX/priv:FKWJAwcQfyohX68Lbrxwaw@$192.168.250.27/${NUMBER}> from [00:1d:60:b0:25:10]
HINT : [UNAFFECTED]
EXPIRATION : 5
inf-voip1
CLI>
Tx-Frame Retry[No] – OSeqno: 000 ISeqno: 001 Type: ENCRYPT (Command)
Flags: 00 STrans: 24837 DTrans: 10914 [192.168.250.128:4520]
ENCDATA : [IV 2341df4dc29d0b55753302115cf1c066] 7 encrypted blocks
inf-voip1CLI>
Rx-Frame Retry[No] – OSeqno: 001 ISeqno: 001 Type: ACK (Response)
Flags: 00 STrans: 10914 DTrans: 24837 [192.168.250.128:4520] (Final)
inf-voip1
CLI> quit

On both * servers:

cat iax_additional.conf

[priv]
type=friend ; or peer
dbsecret=dundi/secret
context=dundi-extens

extensions_custom.conf contains:

[dundi-extens]
include => ext-local

On * PBX where extension 4777 does not exist (inf-voip2):

cat dundi.conf

[general]
entityid=00:1D:60:39:E9:1B
cachetime=5
ttl=2
autokill=yes

[mappings]
priv => dundi-extens,0,IAX2,priv:${SECRET}@$192.168.250.128/${NUMBER},nopartial

; This is * PBX where extension 4777 exists (inf-voip1):
[00:1D:60:B0:25:10]
model = symmetric
host = 192.168.250.27
inkey = dundi
outkey = dundi
include = priv
permit = priv
qualify = yes
order = primary

On * PBX where extension 4777 exists (inf-voip1):

cat dundi.conf

[general]
entityid=00:1D:60:B0:25:10
cachetime=5
ttl=2
autokill=yes

[mappings]
priv => dundi-extens,0,IAX2,priv:${SECRET}@$192.168.250.27/${NUMBER},nopartial

; This is * PBX where extension 4777 does not exist (inf-voip2):
[00:1D:60:39:E9:1B]
model = symmetric
host = 192.168.250.128
inkey = dundi
outkey = dundi
include = priv
permit = priv
qualify = yes
order = primary

So it seems that “dundi lookups” actually work as expected but there’s something wrong with my dialplan.

Can anyone give me a clue as to what I could try?

Vieri

I just noticed that the ${NUMBER} variable is not replaced by 4777.
Is this normal?

ANSWER : [EXISTS] 0 <IAX/priv:FKWJAwcQfyohX68Lbrxwaw@$192.168.250.27/${NUMBER}> from [00:1d:60:b0:25:10]

Stupid me. I took away the left-over $ from the IP address and the dundi lookups seem correct now.