Issue with DIDs and inbound routing

Hi,

My system is:
CentOS 5.4 x86_64
DAHDI Version: 2.2.0
Asterisk 1.4.27.1
freepbx-2.6.0RC2

I have an Openvox A1200P with a FXS and a FXO mdoule 1 & 2 respectively, I created a ZAP channel DID with the channel number and pSTN line number 2891168, then I went on and created an inbound route using this DID, but whenever I dial in this shows up on my logs.

pbxCLI>
– Starting simple switch on ‘DAHDI/2-1’
– Executing [s@from-zaptel:1] NoOp(“DAHDI/2-1”, "Entering from-zaptel with DID == ") in new stack
– Executing [s@from-zaptel:2] Ringing(“DAHDI/2-1”, “”) in new stack
– Executing [s@from-zaptel:3] Set(“DAHDI/2-1”, “DID=s”) in new stack
– Executing [s@from-zaptel:4] NoOp(“DAHDI/2-1”, “DID is now s”) in new stack
– Executing [s@from-zaptel:5] GotoIf(“DAHDI/2-1”, “0?zapok:notzap”) in new stack
– Goto (from-zaptel,s,6)
– Executing [s@from-zaptel:6] Goto(“DAHDI/2-1”, “from-pstn|s|1”) in new stack
– Goto (from-pstn,s,1)
– Executing [s@from-pstn:1] NoOp(“DAHDI/2-1”, “No DID or CID Match”) in new stack
– Executing [s@from-pstn:2] Answer(“DAHDI/2-1”, “”) in new stack
– Executing [s@from-pstn:3] Wait(“DAHDI/2-1”, “2”) in new stack
– Executing [s@from-pstn:4] Playback(“DAHDI/2-1”, “ss-noservice”) in new stack
– <DAHDI/2-1> Playing ‘ss-noservice’ (language ‘en’)
pbx
CLI>

It reports no DID and its created in FreePBX, so what I did was to create a “catch-all” inbound route and it works. The weirdest thing is that it was working and after I upgraded to this version this stopped working.

When using the Any CID/Any DID mode it does work:

pbx*CLI>
– Starting simple switch on ‘DAHDI/2-1’
– Executing [s@from-zaptel:1] NoOp(“DAHDI/2-1”, "Entering from-zaptel with DID == ") in new stack
– Executing [s@from-zaptel:2] Ringing(“DAHDI/2-1”, “”) in new stack
– Executing [s@from-zaptel:3] Set(“DAHDI/2-1”, “DID=s”) in new stack
– Executing [s@from-zaptel:4] NoOp(“DAHDI/2-1”, “DID is now s”) in new stack
– Executing [s@from-zaptel:5] GotoIf(“DAHDI/2-1”, “0?zapok:notzap”) in new stack
– Goto (from-zaptel,s,6)
– Executing [s@from-zaptel:6] Goto(“DAHDI/2-1”, “from-pstn|s|1”) in new stack
– Goto (from-pstn,s,1)
– Executing [s@from-pstn:1] Set(“DAHDI/2-1”, “__FROM_DID=s”) in new stack
– Executing [s@from-pstn:2] ExecIf(“DAHDI/2-1”, “1 |Set|CALLERID(name)=17431160”) in new stack
– Executing [s@from-pstn:3] Set(“DAHDI/2-1”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
– Executing [s@from-pstn:4] SetCallerPres(“DAHDI/2-1”, “allowed_not_screened”) in new stack
– Executing [s@from-pstn:5] Set(“DAHDI/2-1”, "_RGPREFIX=BOG: ") in new stack
– Executing [s@from-pstn:6] Set(“DAHDI/2-1”, “CALLERID(name)=BOG: 17431160”) in new stack
– Executing [s@from-pstn:7] Goto(“DAHDI/2-1”, “ivr-2|s|1”) in new stack
– Goto (ivr-2,s,1)
– Executing [s@ivr-2:1] Set(“DAHDI/2-1”, “MSG=dghvoip/bach-bwv899-breemer”) in new stack
– Executing [s@ivr-2:2] Set(“DAHDI/2-1”, “LOOPCOUNT=0”) in new stack
– Executing [s@ivr-2:3] Set(“DAHDI/2-1”, “__DIR-CONTEXT=default”) in new stack
– Executing [s@ivr-2:4] Set(“DAHDI/2-1”, “_IVR_CONTEXT_ivr-2=”) in new stack
– Executing [s@ivr-2:5] Set(“DAHDI/2-1”, “_IVR_CONTEXT=ivr-2”) in new stack
– Executing [s@ivr-2:6] GotoIf(“DAHDI/2-1”, “0?begin”) in new stack
– Executing [s@ivr-2:7] Answer(“DAHDI/2-1”, “”) in new stack
– Executing [s@ivr-2:8] Wait(“DAHDI/2-1”, “1”) in new stack
– Executing [s@ivr-2:9] Set(“DAHDI/2-1”, “TIMEOUT(digit)=3”) in new stack
– Digit timeout set to 3
– Executing [s@ivr-2:10] Set(“DAHDI/2-1”, “TIMEOUT(response)=2”) in new stack
– Response timeout set to 2
– Executing [s@ivr-2:11] Set(“DAHDI/2-1”, “__IVR_RETVM=RETURN”) in new stack
– Executing [s@ivr-2:12] ExecIf(“DAHDI/2-1”, “1|Background|dghvoip/bach-bwv899-breemer”) in new stack
– <DAHDI/2-1> Playing ‘dghvoip/bach-bwv899-breemer’ (language ‘en’)
– Executing [s@ivr-2:13] WaitExten(“DAHDI/2-1”, “|”) in new stack
– Timeout on DAHDI/2-1, going to ‘t’
– Executing [t@ivr-2:1] DBdel(“DAHDI/2-1”, “”) in new stack
– Executing [t@ivr-2:2] Set(“DAHDI/2-1”, “__NODEST=”) in new stack
– Executing [t@ivr-2:3] Goto(“DAHDI/2-1”, “ext-group|600|1”) in new stack
– Goto (ext-group,600,1)
– Executing [600@ext-group:1] Macro(“DAHDI/2-1”, “user-callerid|”) in new stack
– Executing [s@macro-user-callerid:1] Set(“DAHDI/2-1”, “AMPUSER=17431160”) in new stack
– Executing [s@macro-user-callerid:2] GotoIf(“DAHDI/2-1”, “0?report”) in new stack
– Executing [s@macro-user-callerid:3] ExecIf(“DAHDI/2-1”, “1|Set|REALCALLERIDNUM=17431160”) in new stack
– Executing [s@macro-user-callerid:4] Set(“DAHDI/2-1”, “AMPUSER=”) in new stack
– Executing [s@macro-user-callerid:5] Set(“DAHDI/2-1”, “AMPUSERCIDNAME=”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“DAHDI/2-1”, “1?report”) in new stack
– Goto (macro-user-callerid,s,9)
– Executing [s@macro-user-callerid:9] GotoIf(“DAHDI/2-1”, “0?continue”) in new stack
– Executing [s@macro-user-callerid:10] Set(“DAHDI/2-1”, “__TTL=64”) in new stack
– Executing [s@macro-user-callerid:11] GotoIf(“DAHDI/2-1”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,18)
– Executing [s@macro-user-callerid:18] NoOp(“DAHDI/2-1”, “Using CallerID “BOG: 17431160” <17431160>”) in new stack
– Executing [600@ext-group:2] GotoIf(“DAHDI/2-1”, “1?skipdb”) in new stack
– Goto (ext-group,600,4)
– Executing [600@ext-group:4] Set(“DAHDI/2-1”, “__NODEST=”) in new stack
– Executing [600@ext-group:5] Set(“DAHDI/2-1”, “__BLKVM_OVERRIDE=BLKVM/600/DAHDI/2-1”) in new stack
– Executing [600@ext-group:6] Set(“DAHDI/2-1”, “__BLKVM_BASE=600”) in new stack
– Executing [600@ext-group:7] Set(“DAHDI/2-1”, “DB(BLKVM/600/DAHDI/2-1)=TRUE”) in new stack
– Executing [600@ext-group:8] Set(“DAHDI/2-1”, “RRNODEST=”) in new stack
– Executing [600@ext-group:9] Set(“DAHDI/2-1”, “__NODEST=600”) in new stack
– Executing [600@ext-group:10] Set(“DAHDI/2-1”, “RecordMethod=Group”) in new stack
– Executing [600@ext-group:11] Macro(“DAHDI/2-1”, “record-enable|101-103-111|Group”) in new stack
– Executing [s@macro-record-enable:1] MacroExit(“DAHDI/2-1”, “”) in new stack
– Executing [600@ext-group:12] Set(“DAHDI/2-1”, “RingGroupMethod=ringall”) in new stack
– Executing [600@ext-group:13] Macro(“DAHDI/2-1”, “dial|20|TtWwr|101-103-111”) in new stack
– Executing [s@macro-dial:1] GotoIf(“DAHDI/2-1”, “1?dial”) in new stack
– Goto (macro-dial,s,3)
– Executing [s@macro-dial:3] AGI(“DAHDI/2-1”, “dialparties.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
dialparties.agi: Caller ID name is ‘BOG: 17431160’ number is '17431160’
dialparties.agi: USE_CONFIRMATION: 'FALSE’
dialparties.agi: RINGGROUP_INDEX: ''
dialparties.agi: Methodology of ring is ‘ringall’
– dialparties.agi: Added extension 101 to extension map
– dialparties.agi: Added extension 103 to extension map
– dialparties.agi: Added extension 111 to extension map
– dialparties.agi: Extension 101 cf is disabled
– dialparties.agi: Extension 103 cf is disabled
– dialparties.agi: Extension 111 cf is disabled
– dialparties.agi: Extension 101 do not disturb is disabled
– dialparties.agi: Extension 103 do not disturb is disabled
– dialparties.agi: Extension 111 do not disturb is disabled
> dialparties.agi: extnum 101 has: cw: 1; hascfb: 0 [] hascfu: 0 []
– dialparties.agi: dbset CALLTRACE/101 to 17431160
> dialparties.agi: extnum 103 has: cw: 1; hascfb: 0 [] hascfu: 0 []
– dialparties.agi: dbset CALLTRACE/103 to 17431160
> dialparties.agi: extnum 111 has: cw: 1; hascfb: 0 [] hascfu: 0 []
– dialparties.agi: dbset CALLTRACE/111 to 17431160
– dialparties.agi: Filtered ARG3: 101-103-111
> dialparties.agi: NODEST: 600 adding M(auto-blkvm) to dialopts: TtWwrM(auto-blkvm)
> dialparties.agi: NODEST: 600 blkvm enabled macro already in dialopts: TtWwrM(auto-blkvm)
== Manager ‘admin’ logged off from 127.0.0.1
– AGI Script dialparties.agi completed, returning 0
– Executing [s@macro-dial:7] Dial(“DAHDI/2-1”, “SIP/101&SIP/103&DAHDI/1|20|TtWwrM(auto-blkvm)”) in new stack
[Dec 11 17:59:00] WARNING[3157]: app_dial.c:1296 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Unknown)
– Called 103
– Called 1
– DAHDI/1-1 is ringing
– SIP/103-00000008 is ringing
– DAHDI/1-1 is ringing
– DAHDI/1-1 answered DAHDI/2-1

Shall this be a FreePBX bug or a user bug?.

Thanks.

From one tadpole to another:

I had something similar where I was trying to point an Inbound Route to a specific Extension. It would not work, but Catch-All did. Upon inquiry I was told to do this:

Use Tools / Config Edit to change zapata.conf and zapata-channels from context=from-pstn to context=from-zaptel

Hope that helps

Hi,

And thanks for that quick reply; but all of that is setup correctly look at dahdi-channels.conf:

; Autogenerated by /usr/sbin/dahdi_genconf on Fri Dec 11 02:15:27 2009
; If you edit this file and execute /usr/sbin/dahdi_genconf again,
; your manual changes will be LOST.
; Dahdi Channels Configurations (chan_dahdi.conf)
;
; This is not intended to be a complete chan_dahdi.conf. Rather, it is intended
; to be #include-d by /etc/chan_dahdi.conf that will include the global settings
;

; Span 1: OPVXA1200/12 “OpenVox A1200P/A800P Board 13” (MASTER)
; Skip channel=1(FXS) – freepbx option.
;;; line="2 OPVXA1200/12/1 FXSKS"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-zaptel
channel => 2
callerid=
group=
context=default

and dahdi_additional.conf

[root@pbx asterisk]# cat zapata_additional.conf
;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make ;
; custom modifications, details at: http://freepbx.org/configuration_files ;
;--------------------------------------------------------------------------------;
;

;;;;;;[111]
signalling=fxo_ks
pickupgroup=
mailbox=111@device
immediate=no
echotraining=800
echocancelwhenbridged=no
echocancel=yes
context=from-internal
callprogress=no
callgroup=
callerid=device <111>
busydetect=no
busycount=7
accountcode=
channel=>1

Also, I’m directing the inbound route to a ring group and the same issue.

It’s frustrating all of this, if you know fo any other solution please let me know.

Thanks again.

http://www.freepbx.org/forum/freepbx/users/problem-with-inbound-calls

Thanks again but you pointed an article on SIP DID issues and I’m experiencing this with a DAHDI trunk.

Here is another guess: I am thinking that CID or DID info is not being passed and not matching as a result.

Another thing I had to do when I configured the incoming route to a specific extension, was I set the DID to that incoming extension, and I had to put the check in CID Priority Route.

And for some reason I had to restart the system for it to take hold.