Simple routing problem

I have installed Asteric@home and a TDM400P card on a machine here, the card is in the 2 port configuration, 1 fxs and 1 fxo.

Everthing so far is working properly with SIP phones, I can call out, in and inbetween extensions. My problem comes when I enable the analog extension, I am still able to make calls from the analog phone to other internal extensions and external phone numbers but if I try to make an external call on one of the SIP phones it goes to the analog extension. If I delete the extension and restart Asterisk all is fine again and the SIP phones can once again make external calls.

I was hoping someone may be able to help point me in the right direction as to where to look for the cause of the problem. I have copied my zapata-auto.conf below and it looks to be correct with the appropriate channels assigned to the correct groups, I have double checked my outgoing routing configs also and verified that they are correct. Is it possible that this could be a hardware or driver issue?

; Autogenerated by /usr/local/sbin/genzaptelconf – do not hand edit
; Zaptel Channels Configurations (zapata.conf)
;
; This is not intended to be a complete zapata.conf. Rather, it is intended
; to be #include-d by /etc/zapata.conf that will include the global settings
;
callerid=asreceived

; Span 1: WCTDM/0 "Wildcard TDM400P REV I Board 1"
signalling=fxo_ks
; Note: this is an extension. Create a ZAP extension in AMP for Channel 1
context=from-internal
group=1
channel => 1

; channel 2, WCTDM, inactive.
; channel 3, WCTDM, inactive.
signalling=fxs_ks
; Note: this is a trunk. Create a ZAP trunk in AMP for Channel 4
context=from-pstn
group=0
channel => 4

Also if I simply take the analog extension off hook, the out going calls are properly routed.

Only thing I can think of is it might be the groups. in your Dial plan or you using something like

exten => _xxxxxxx.,1,Dial(Zap/g0/${exten})

is so try changing it to dial(Zap/4/{exten})

I looked and didn’t see anything that resembled that in the extensions config files.

I’m really at a loss since the call reporting tools say that the call was completed sucessfully to the outside #. I’m really starting to lean towards hardware or the possibility that the modules are hosed in some way.

To help troubleshoot I changed the group for my trunk from 0 to 6, just to ensure that something like what Rusty suggested wasn’t hiding somewhere.

I ran the 3 call scenario and captured the debug output, it seem that everything is the same in the construction of both the calls. Nothing indicates that it is trying to route the call to the fxo extension but as the debug shows it rings there.

I am wondering it this could really be a hardware problem, any feedback would be greatly appreciated.

; Autogenerated by /usr/local/sbin/genzaptelconf – do not hand edit
; Zaptel Channels Configurations (zapata.conf)
;
; This is not intended to be a complete zapata.conf. Rather, it is intended
; to be #include-d by /etc/zapata.conf that will include the global settings
;
callerid=asreceived

; Span 1: WCTDM/0 "Wildcard TDM400P REV I Board 1"
signalling=fxo_ks
; Note: this is an extension. Create a ZAP extension in AMP for Channel 1
context=from-internal
group=1
channel => 1

; channel 2, WCTDM, inactive.
; channel 3, WCTDM, inactive.
signalling=fxs_ks
; Note: this is a trunk. Create a ZAP trunk in AMP for Channel 4
context=from-pstn
group=6
channel => 4

###########################################

Extension 202 is the ZAP extension channel 1

Extension 200 is the SIP phone

################### Analog extension to an outside #

asterisk1CLI>
– Starting simple switch on ‘Zap/1-1’
– Executing Macro(“Zap/1-1”, “dialout-trunk|2|5602480|”) in new stack
– Executing GotoIf(“Zap/1-1”, “1?3:2)”) in new stack
– Goto (macro-dialout-trunk,s,3)
– Executing Macro(“Zap/1-1”, “record-enable|202|OUT”) in new stack
– Executing GotoIf(“Zap/1-1”, “0 > 0?2:4”) in new stack
– Goto (macro-record-enable,s,4)
– Executing GotoIf(“Zap/1-1”, “1?5:8”) in new stack
– Goto (macro-record-enable,s,5)
– Executing DBget(“Zap/1-1”, “RecEnable=RECORD-OUT/202”) in new stack
– DBget: varname=RecEnable, family=RECORD-OUT, key=202
– DBget: Value not found in database.
– Executing SetVar(“Zap/1-1”, “CALLFILENAME=OUT202-20050920-082933-1127219366.27”) in new stack
– Executing Goto(“Zap/1-1”, “s|14”) in new stack
– Goto (macro-record-enable,s,14)
– Executing GotoIf(“Zap/1-1”, “0?15:99”) in new stack
– Goto (macro-record-enable,s,99)
– Executing NoOp(“Zap/1-1”, “NO RECORDING NEEDED”) in new stack
– Executing GotoIf(“Zap/1-1”, “1?7”) in new stack
– Goto (macro-dialout-trunk,s,7)
– Executing GotoIf(“Zap/1-1”, “1?9”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing SetGroup(“Zap/1-1”, “OUT_2”) in new stack
– Executing CheckGroup(“Zap/1-1”, “”) in new stack
– Executing SetVar(“Zap/1-1”, “DIAL_NUMBER=5602480”) in new stack
– Executing SetVar(“Zap/1-1”, “DIAL_TRUNK=2”) in new stack
– Executing AGI(“Zap/1-1”, “fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
fixlocalprefix: Could not parse /etc/asterisk/localprefixes.conf
– AGI Script fixlocalprefix completed, returning 0
– Executing SetVar(“Zap/1-1”, “OUTNUM=5602480”) in new stack
– Executing Cut(“Zap/1-1”, “custom=OUT_2|:|1”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?19”) in new stack
– Executing Dial(“Zap/1-1”, “ZAP/g6/5602480”) in new stack
– Called g6/5602480
– Zap/4-1 answered Zap/1-1
– Attempting native bridge of Zap/1-1 and Zap/4-1
– Hungup ‘Zap/4-1’
== Spawn extension (macro-dialout-trunk, s, 17) exited non-zero on ‘Zap/1-1’ in macro ‘dialout-trunk’
== Spawn extension (from-internal, 95602480, 1) exited non-zero on ‘Zap/1-1’
– Executing Macro(“Zap/1-1”, “hangupcall”) in new stack
– Executing ResetCDR(“Zap/1-1”, “w”) in new stack
– Executing NoCDR(“Zap/1-1”, “”) in new stack
– Executing Wait(“Zap/1-1”, “5”) in new stack
== Spawn extension (macro-hangupcall, s, 3) exited non-zero on ‘Zap/1-1’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘Zap/1-1’
– Hungup 'Zap/1-1’
asterisk1
CLI>

################### SIP phone to an outside #, call goes to analog extension

asterisk1CLI>
– Executing Macro(“SIP/200-936b”, “dialout-trunk|2|5602480|”) in new stack
– Executing GotoIf(“SIP/200-936b”, “1?3:2)”) in new stack
– Goto (macro-dialout-trunk,s,3)
– Executing Macro(“SIP/200-936b”, “record-enable|200|OUT”) in new stack
– Executing GotoIf(“SIP/200-936b”, “0 > 0?2:4”) in new stack
– Goto (macro-record-enable,s,4)
– Executing GotoIf(“SIP/200-936b”, “1?5:8”) in new stack
– Goto (macro-record-enable,s,5)
– Executing DBget(“SIP/200-936b”, “RecEnable=RECORD-OUT/200”) in new stack
– DBget: varname=RecEnable, family=RECORD-OUT, key=200
– DBget: Value not found in database.
– Executing SetVar(“SIP/200-936b”, “CALLFILENAME=OUT200-20050920-083101-1127219461.29”) in new stack
– Executing Goto(“SIP/200-936b”, “s|14”) in new stack
– Goto (macro-record-enable,s,14)
– Executing GotoIf(“SIP/200-936b”, “0?15:99”) in new stack
– Goto (macro-record-enable,s,99)
– Executing NoOp(“SIP/200-936b”, “NO RECORDING NEEDED”) in new stack
– Executing GotoIf(“SIP/200-936b”, “1?7”) in new stack
– Goto (macro-dialout-trunk,s,7)
– Executing GotoIf(“SIP/200-936b”, “1?9”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing SetGroup(“SIP/200-936b”, “OUT_2”) in new stack
– Executing CheckGroup(“SIP/200-936b”, “”) in new stack
– Executing SetVar(“SIP/200-936b”, “DIAL_NUMBER=5602480”) in new stack
– Executing SetVar(“SIP/200-936b”, “DIAL_TRUNK=2”) in new stack
– Executing AGI(“SIP/200-936b”, “fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
fixlocalprefix: Could not parse /etc/asterisk/localprefixes.conf
– AGI Script fixlocalprefix completed, returning 0
– Executing SetVar(“SIP/200-936b”, “OUTNUM=5602480”) in new stack
– Executing Cut(“SIP/200-936b”, “custom=OUT_2|:|1”) in new stack
– Executing GotoIf(“SIP/200-936b”, “0?19”) in new stack
– Executing Dial(“SIP/200-936b”, “ZAP/g6/5602480”) in new stack
– Called g6/5602480
– Zap/1-1 is ringing
– Zap/1-1 is ringing
– Zap/1-1 answered SIP/200-936b
– Hungup ‘Zap/1-1’
== Spawn extension (macro-dialout-trunk, s, 17) exited non-zero on ‘SIP/200-936b’ in macro ‘dialout-trunk’
== Spawn extension (from-internal, 95602480, 1) exited non-zero on ‘SIP/200-936b’
– Executing Macro(“SIP/200-936b”, “hangupcall”) in new stack
– Executing ResetCDR(“SIP/200-936b”, “w”) in new stack
– Executing NoCDR(“SIP/200-936b”, “”) in new stack
– Executing Wait(“SIP/200-936b”, “5”) in new stack
== Spawn extension (macro-hangupcall, s, 3) exited non-zero on ‘SIP/200-936b’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/200-936b’
asterisk1
CLI>

################### Analog extension is taken off hook, call is made from SIP phone to outside # and gets connected correctly

asterisk1CLI>
– Starting simple switch on ‘Zap/1-1’
– Executing Macro(“SIP/200-c43e”, “dialout-trunk|2|5602480|”) in new stack
– Executing GotoIf(“SIP/200-c43e”, “1?3:2)”) in new stack
– Goto (macro-dialout-trunk,s,3)
– Executing Macro(“SIP/200-c43e”, “record-enable|200|OUT”) in new stack
– Executing GotoIf(“SIP/200-c43e”, “0 > 0?2:4”) in new stack
– Goto (macro-record-enable,s,4)
– Executing GotoIf(“SIP/200-c43e”, “1?5:8”) in new stack
– Goto (macro-record-enable,s,5)
– Executing DBget(“SIP/200-c43e”, “RecEnable=RECORD-OUT/200”) in new stack
– DBget: varname=RecEnable, family=RECORD-OUT, key=200
– DBget: Value not found in database.
– Executing SetVar(“SIP/200-c43e”, “CALLFILENAME=OUT200-20050920-083235-1127219554.32”) in new stack
– Executing Goto(“SIP/200-c43e”, “s|14”) in new stack
– Goto (macro-record-enable,s,14)
– Executing GotoIf(“SIP/200-c43e”, “0?15:99”) in new stack
– Goto (macro-record-enable,s,99)
– Executing NoOp(“SIP/200-c43e”, “NO RECORDING NEEDED”) in new stack
– Executing GotoIf(“SIP/200-c43e”, “1?7”) in new stack
– Goto (macro-dialout-trunk,s,7)
– Executing GotoIf(“SIP/200-c43e”, “1?9”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing SetGroup(“SIP/200-c43e”, “OUT_2”) in new stack
– Executing CheckGroup(“SIP/200-c43e”, “”) in new stack
– Executing SetVar(“SIP/200-c43e”, “DIAL_NUMBER=5602480”) in new stack
– Executing SetVar(“SIP/200-c43e”, “DIAL_TRUNK=2”) in new stack
– Executing AGI(“SIP/200-c43e”, “fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
fixlocalprefix: Could not parse /etc/asterisk/localprefixes.conf
– AGI Script fixlocalprefix completed, returning 0
– Executing SetVar(“SIP/200-c43e”, “OUTNUM=5602480”) in new stack
– Executing Cut(“SIP/200-c43e”, “custom=OUT_2|:|1”) in new stack
– Executing GotoIf(“SIP/200-c43e”, “0?19”) in new stack
– Executing Dial(“SIP/200-c43e”, “ZAP/g6/5602480”) in new stack
– Called g6/5602480
– Zap/4-1 answered SIP/200-c43e
– Hungup ‘Zap/4-1’
== Spawn extension (macro-dialout-trunk, s, 17) exited non-zero on ‘SIP/200-c43e’ in macro ‘dialout-trunk’
== Spawn extension (from-internal, 95602480, 1) exited non-zero on ‘SIP/200-c43e’
– Executing Macro(“SIP/200-c43e”, “hangupcall”) in new stack
– Executing ResetCDR(“SIP/200-c43e”, “w”) in new stack
– Executing NoCDR(“SIP/200-c43e”, “”) in new stack
– Executing Wait(“SIP/200-c43e”, “5”) in new stack
== Spawn extension (macro-hangupcall, s, 3) exited non-zero on ‘SIP/200-c43e’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/200-c43e’
asterisk1
CLI>

Well If It was me for now I would simplify the dial plan. I dont use @home
but all you would need is a [context] and a and a simple dial command in the extensions.conf
exten => _.,1,Dial(Zap/4/${exten})

put zap channels and sip phones in this context and you wont need the groups either and see if you still get the same results.
If that works then you will know its not hardware and more then likely something in your dial plan