Channel A/B, span N got hangup, cause -1

nickstone
Joined: Tue 30 of Jun, 2009

Channel A/B, span N got hangup, cause -1

Posted:Tue 30 of Jun, 2009 (13:25 UTC)
I am trying to get Call Forwarding working. Basically I have set up Call Forwarding through the Asterisk GUI. I have set up one extension to forward to a mobile number. If the extension is phoned internally it works (i.e. I get forwarded to the mobile). However if I dial the extension externally I get an immediate hang-up.

The verbose log from asterisk is here:

    -- Accepting call from '01234567899' to '131234' on channel 1/6, span 1
    -- Executing [131234@DID_span_1:1] Goto("Zap/6-1", "default|1234|1") in new stack
    -- Goto (default,1234,1)
    -- Executing [1234@default:1] Macro("Zap/6-1", "stdexten|1234|SIP/1234") in new stack
    -- Executing [s@macro-stdexten:1] Set("Zap/6-1", "__DYNAMIC_FEATURES=") in new stack
    -- Executing [s@macro-stdexten:2] GotoIf("Zap/6-1", "1?5:3") in new stack
    -- Goto (macro-stdexten,s,5)
    -- Executing [s@macro-stdexten:5] Macro("Zap/6-1", "stdexten-followme|1234|SIP/1234") in new stack
    -- Executing [s@macro-stdexten-followme:1] Answer("Zap/6-1", "") in new stack
    -- Executing [s@macro-stdexten-followme:2] Dial("Zap/6-1", "SIP/1234|20|r") in new stack
[Jul  1 10:04:45] WARNING[8336]: app_dial.c:1272 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Unknown)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [s@macro-stdexten-followme:3] Set("Zap/6-1", "__FMCIDNUM=02071234567") in new stack
    -- Executing [s@macro-stdexten-followme:4] Set("Zap/6-1", "__FMCIDNAME=") in new stack
    -- Executing [s@macro-stdexten-followme:5] FollowMe("Zap/6-1", "1234|") in new stack
    -- <Zap/6-1> Playing 'followme/pls-hold-while-try' (language 'en')
    -- Started music on hold, class 'default', on Zap/6-1
    -- calling 09876543211@DLPN_DialPlan1
    -- Executing [09876543211@DLPN_DialPlan1:1] Macro("Local/09876543211@DLPN_DialPlan1-14e9,2", "trunkdial-failover-0.3|Zap/g1/09876543211||span_1|") in new stack
    -- Executing [s@macro-trunkdial-failover-0.3:1] GotoIf("Local/09876543211@DLPN_DialPlan1-14e9,2", "1?1-fmsetcid|1") in new stack
    -- Goto (macro-trunkdial-failover-0.3,1-fmsetcid,1)
    -- Executing [1-fmsetcid@macro-trunkdial-failover-0.3:1] Set("Local/09876543211@DLPN_DialPlan1-14e9,2", "CALLERID(num)=02071234567") in new stack
    -- Executing [1-fmsetcid@macro-trunkdial-failover-0.3:2] Set("Local/09876543211@DLPN_DialPlan1-14e9,2", "CALLERID(name)=") in new stack
    -- Executing [1-fmsetcid@macro-trunkdial-failover-0.3:3] Goto("Local/09876543211@DLPN_DialPlan1-14e9,2", "1-dial|1") in new stack
    -- Goto (macro-trunkdial-failover-0.3,1-dial,1)
    -- Executing [1-dial@macro-trunkdial-failover-0.3:2] Dial("Local/09876543211@DLPN_DialPlan1-14e9,2", "Zap/g1/09876543211") in new stack
    -- Requested transfer capability: 0x00 - SPEECH
    -- Called g1/09876543211
    -- Channel 1/6, span 1 got hangup, cause -1
    -- Stopped music on hold on Zap/6-1
    -- Hungup 'Zap/2-1'
  == Spawn extension (macro-trunkdial-failover-0.3, 1-dial, 2) exited non-zero on 'Local/09876543211@DLPN_DialPlan1-14e9,2' in macro 'trunkdial-failover-0.3'
  == Spawn extension (DLPN_DialPlan1, 09876543211, 1) exited non-zero on 'Local/09876543211@DLPN_DialPlan1-14e9,2'
    -- Hungup 'Zap/6-1'
    -- Moving call from channel 2 to channel 1
[Jul  1 10:04:49] WARNING[8046]: chan_dahdi.c:8581 pri_fixup_principle: Whoa, there's no owner, and we're having to fix up channel 2 to channel 1


The relevant sections of the dialplan are here:

[general]
static = yes
writeprotect = no
clearglobalvars = no
 
[globals]
CONSOLE = Console/dsp  ; Console interface for demo
IAXINFO = guest
TRUNK = Zap/g1
FAX_RX_LOCATION = /var/local/
TRUNKMSD = 1  FEATURES =
DIALOPTIONS = r
RINGTIME = 20
FOLLOWMEOPTIONS =
span_1 = Zap/g1
GLOBAL_OUTBOUNDCID = 02071234567
GLOBAL_OUTBOUNDCIDNAME =
FOLLOWME_1234 = 1
 
[macro-stdexten]
exten => s,1,Set(__DYNAMIC_FEATURES=${FEATURES})
exten => s,2,GotoIf($["${FOLLOWME_${ARG1}}" = "1"]?5:3)
exten => s,3,Dial(${ARG2},${RINGTIME},${DIALOPTIONS})
exten => s,4,Goto(s-${DIALSTATUS},1)
exten => s,5,Macro(stdexten-followme,${ARG1},${ARG2})
exten => s-NOANSWER,1,Voicemail(${ARG1},u)
exten => s-NOANSWER,2,Goto(default,s,1)
exten => s-BUSY,1,Voicemail(${ARG1},b)
exten => s-BUSY,2,Goto(default,s,1)
exten => _s-.,1,Goto(s-NOANSWER,1)
exten => a,1,VoicemailMain(${ARG1})
 
[macro-stdexten-followme]
exten => s,1,Answer
exten => s,2,Dial(${ARG2},${RINGTIME},${DIALOPTIONS})
;exten => s,3,Set(__FMCIDNUM=${CALLERID(num)})
exten => s,3,Set(__FMCIDNUM=02071234567)
exten => s,4,Set(__FMCIDNAME=${CALLERID(name)})
exten => s,5,Followme(${ARG1},${FOLLOWMEOPTIONS})
exten => s,6,Voicemail(${ARG1},u)
exten => s-NOANSWER,1,Voicemail(${ARG1},u)
exten => s-BUSY,1,Voicemail(${ARG1},b)
exten => s-BUSY,2,Goto(default,s,1)
exten => _s-.,1,Goto(s-NOANSWER,1)
exten => a,1,VoicemailMain(${ARG1})
 
[macro-trunkdial-failover-0.3]
exten => s,1,GotoIf($[${LEN(${FMCIDNUM})} > 6]?1-fmsetcid,1)
exten => s,2,GotoIf($[${LEN(${GLOBAL_OUTBOUNDCIDNAME})} > 1]?1-setgbobname,1)
exten => s,3,Set(CALLERID(num)=${IF($[${LEN(${CID_${CALLERID(num)}})} > 2]?${CID_${CALLERID(num)}}:)})
exten => s,n,GotoIf($[${LEN(${CALLERID(num)})} > 6]?1-dial,1)
exten => s,n,Set(CALLERID(all)=${IF($[${LEN(${CID_${ARG3}})} > 6]?${CID_${ARG3}}:${GLOBAL_OUTBOUNDCID})})
exten => s,n,Goto(1-dial,1)
exten => 1-setgbobname,1,Set(CALLERID(name)=${GLOBAL_OUTBOUNDCIDNAME})
exten => 1-setgbobname,n,Goto(s,3)
exten => 1-fmsetcid,1,Set(CALLERID(num)=${FMCIDNUM})
exten => 1-fmsetcid,n,Set(CALLERID(name)=${FMCIDNAME})
exten => 1-fmsetcid,n,Goto(1-dial,1)
exten => 1-dial,1,Dial(${ARG1})
exten => 1-dial,n,Gotoif(${LEN(${ARG2})} > 0 ?1-${DIALSTATUS},1:1-out,1)
exten => 1-CHANUNAVAIL,1,Dial(${ARG2})
exten => 1-CHANUNAVAIL,n,Hangup()
exten => 1-CONGESTION,1,Dial(${ARG2})
exten => 1-CONGESTION,n,Hangup()
exten => 1-out,1,Hangup()


If anybody can tell me what is going wrong here that would be great. I have found a few other articles on line that suggest that you have to set the cid to be a valid one for our group (which I have done).

We're using SIP phones internally and we have a channels of a PRI externally. The system is built using Asterisk 1.4.25.1.

Thanks

Nick