Dial Pattern Challenges

Hi,

Thank you, I had just disabled Chan_SIP trunk, because I was really stuck with it as compared with PJSIP. I have enabled Chan_SIP. And I get, “Circuits are busy” I am not sure if the Chan_SIP trunk is coming up. This is what I have now on the settings

username=***********
type=peer
qualify=yes
secret=***********
nat=yes
insecure=invite,port
host=..co.za
fromuser=*********
fromdomain=
.****.co.za
dtmfmode=rfc2833
context=from-trunk
disallow=all
allow=g729
allow=alaw
allow=ulaw
canreinvite=no

On the report screen this is what I see. Shows as if it is up

When I dial this is the log. My handsets are configured as PJSIP could that affect

=========================================================================
Connected to Asterisk 13.12.1 currently running on localhost (pid = 2101)
– Executing [0812641154@from-internal:1] Macro(“PJSIP/2004-00000004”, “user-callerid,LIMIT,EXTERNAL,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“PJSIP/2004-00000004”, “TOUCH_MONITOR=1489499121.5”) in new stack
– Executing [s@macro-user-callerid:2] Set(“PJSIP/2004-00000004”, “AMPUSER=2004”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“PJSIP/2004-00000004”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“PJSIP/2004-00000004”, “1?Set(REALCALLERIDNUM=2004)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“PJSIP/2004-00000004”, “AMPUSER=2004”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“PJSIP/2004-00000004”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:7] Set(“PJSIP/2004-00000004”, “AMPUSERCIDNAME=Thokozani”) in new stack
– Executing [s@macro-user-callerid:8] GotoIf(“PJSIP/2004-00000004”, “0?report”) in new stack
– Executing [s@macro-user-callerid:9] Set(“PJSIP/2004-00000004”, “AMPUSERCID=2004”) in new stack
– Executing [s@macro-user-callerid:10] Set(“PJSIP/2004-00000004”, “__DIAL_OPTIONS=Ttr”) in new stack
– Executing [s@macro-user-callerid:11] Set(“PJSIP/2004-00000004”, “CALLERID(all)=“Thokozani” <2004>”) in new stack
– Executing [s@macro-user-callerid:12] GotoIf(“PJSIP/2004-00000004”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:13] ExecIf(“PJSIP/2004-00000004”, “1?Set(GROUP(concurrency_limit)=2004)”) in new stack
– Executing [s@macro-user-callerid:14] ExecIf(“PJSIP/2004-00000004”, “0?Set(CHANNEL(language)=)”) in new stack
– Executing [s@macro-user-callerid:15] GotoIf(“PJSIP/2004-00000004”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,29)
– Executing [s@macro-user-callerid:29] Set(“PJSIP/2004-00000004”, “CALLERID(number)=2004”) in new stack
– Executing [s@macro-user-callerid:30] Set(“PJSIP/2004-00000004”, “CALLERID(name)=Thokozani”) in new stack
– Executing [s@macro-user-callerid:31] GotoIf(“PJSIP/2004-00000004”, “0?cnum”) in new stack
– Executing [s@macro-user-callerid:32] Set(“PJSIP/2004-00000004”, “CDR(cnam)=Thokozani”) in new stack
– Executing [s@macro-user-callerid:33] Set(“PJSIP/2004-00000004”, “CDR(cnum)=2004”) in new stack
– Executing [s@macro-user-callerid:34] Set(“PJSIP/2004-00000004”, “CHANNEL(language)=en_GB”) in new stack
– Executing [0812641154@from-internal:2] Gosub(“PJSIP/2004-00000004”, “sub-record-check,s,1(out,0812641154,dontcare)”) in new stack
– Executing [s@sub-record-check:1] GotoIf(“PJSIP/2004-00000004”, “0?initialized”) in new stack
– Executing [s@sub-record-check:2] Set(“PJSIP/2004-00000004”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:3] Set(“PJSIP/2004-00000004”, “NOW=1489499122”) in new stack
– Executing [s@sub-record-check:4] Set(“PJSIP/2004-00000004”, “__DAY=14”) in new stack
– Executing [s@sub-record-check:5] Set(“PJSIP/2004-00000004”, “__MONTH=03”) in new stack
– Executing [s@sub-record-check:6] Set(“PJSIP/2004-00000004”, “__YEAR=2017”) in new stack
– Executing [s@sub-record-check:7] Set(“PJSIP/2004-00000004”, “__TIMESTR=20170314-154522”) in new stack
– Executing [s@sub-record-check:8] Set(“PJSIP/2004-00000004”, “__FROMEXTEN=2004”) in new stack
– Executing [s@sub-record-check:9] Set(“PJSIP/2004-00000004”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:10] NoOp(“PJSIP/2004-00000004”, “Recordings initialized”) in new stack
– Executing [s@sub-record-check:11] ExecIf(“PJSIP/2004-00000004”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [s@sub-record-check:12] Set(“PJSIP/2004-00000004”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [s@sub-record-check:13] ExecIf(“PJSIP/2004-00000004”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [s@sub-record-check:14] GotoIf(“PJSIP/2004-00000004”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [s@sub-record-check:17] GotoIf(“PJSIP/2004-00000004”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] NoOp(“PJSIP/2004-00000004”, “Outbound Recording Check from 2004 to 0812641154”) in new stack
– Executing [out@sub-record-check:2] Set(“PJSIP/2004-00000004”, “RECMODE=dontcare”) in new stack
– Executing [out@sub-record-check:3] ExecIf(“PJSIP/2004-00000004”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [out@sub-record-check:7] Gosub(“PJSIP/2004-00000004”, “recordcheck,1(dontcare,out,0812641154)”) in new stack
– Executing [recordcheck@sub-record-check:1] NoOp(“PJSIP/2004-00000004”, “Starting recording check against dontcare”) in new stack
– Executing [recordcheck@sub-record-check:2] Goto(“PJSIP/2004-00000004”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [recordcheck@sub-record-check:3] Return(“PJSIP/2004-00000004”, “”) in new stack
– Executing [out@sub-record-check:8] Return(“PJSIP/2004-00000004”, “”) in new stack
– Executing [0812641154@from-internal:3] ExecIf(“PJSIP/2004-00000004”, “0 ?Set(CDR(accountcode)=)”) in new stack
– Executing [0812641154@from-internal:4] Set(“PJSIP/2004-00000004”, “MOHCLASS=default”) in new stack
– Executing [0812641154@from-internal:5] ExecIf(“PJSIP/2004-00000004”, “1?Set(TRUNKCIDOVERRIDE=27872884271)”) in new stack
– Executing [0812641154@from-internal:6] Set(“PJSIP/2004-00000004”, “_NODEST=”) in new stack
– Executing [0812641154@from-internal:7] Macro(“PJSIP/2004-00000004”, “dialout-trunk,2,0812641154,off”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“PJSIP/2004-00000004”, “DIAL_TRUNK=2”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“PJSIP/2004-00000004”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“PJSIP/2004-00000004”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“PJSIP/2004-00000004”, “DIAL_NUMBER=0812641154”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“PJSIP/2004-00000004”, “DIAL_TRUNK_OPTIONS=Ttr”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“PJSIP/2004-00000004”, “OUTBOUND_GROUP=OUT_2”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“PJSIP/2004-00000004”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing [s@macro-dialout-trunk:9] GotoIf(“PJSIP/2004-00000004”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“PJSIP/2004-00000004”, “DIAL_TRUNK_OPTIONS=T”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“PJSIP/2004-00000004”, “outbound-callerid,2”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“PJSIP/2004-00000004”, “0?Set(CALLERPRES(name-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“PJSIP/2004-00000004”, “0?Set(CALLERPRES(num-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:3] ExecIf(“PJSIP/2004-00000004”, “0?Set(REALCALLERIDNUM=2004)”) in new stack
– Executing [s@macro-outbound-callerid:4] GotoIf(“PJSIP/2004-00000004”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,7)
– Executing [s@macro-outbound-callerid:7] Set(“PJSIP/2004-00000004”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“PJSIP/2004-00000004”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:9] Set(“PJSIP/2004-00000004”, “TRUNKOUTCID=27872884271”) in new stack
– Executing [s@macro-outbound-callerid:10] GotoIf(“PJSIP/2004-00000004”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,15)
– Executing [s@macro-outbound-callerid:15] ExecIf(“PJSIP/2004-00000004”, “1?Set(CALLERID(all)=0116753130)”) in new stack
– Executing [s@macro-outbound-callerid:16] ExecIf(“PJSIP/2004-00000004”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:17] ExecIf(“PJSIP/2004-00000004”, “1?Set(CALLERID(all)=0116753130)”) in new stack
– Executing [s@macro-outbound-callerid:18] ExecIf(“PJSIP/2004-00000004”, “0?Set(CALLERPRES(name-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:19] ExecIf(“PJSIP/2004-00000004”, “0?Set(CALLERPRES(num-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:20] Set(“PJSIP/2004-00000004”, “CDR(outbound_cnum)=0116753130”) in new stack
– Executing [s@macro-outbound-callerid:21] Set(“PJSIP/2004-00000004”, “CDR(outbound_cnam)=”) in new stack
[2017-03-14 15:45:22] WARNING[2129]: func_cdr.c:383 cdr_write_callback: CDR requires a value (CDR(variable)=value)
– Executing [s@macro-dialout-trunk:12] GosubIf(“PJSIP/2004-00000004”, “0?sub-flp-2,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“PJSIP/2004-00000004”, “OUTNUM=0812641154”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“PJSIP/2004-00000004”, “custom=SIP/Chan”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“PJSIP/2004-00000004”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)”) in new stack
– Executing [s@macro-dialout-trunk:16] ExecIf(“PJSIP/2004-00000004”, “0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))”) in new stack
– Executing [s@macro-dialout-trunk:17] Macro(“PJSIP/2004-00000004”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“PJSIP/2004-00000004”, “”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“PJSIP/2004-00000004”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:19] ExecIf(“PJSIP/2004-00000004”, “1?Set(CONNECTEDLINE(num,i)=0812641154)”) in new stack
– Executing [s@macro-dialout-trunk:20] ExecIf(“PJSIP/2004-00000004”, “1?Set(CONNECTEDLINE(name,i)=CID:0116753130)”) in new stack
– Executing [s@macro-dialout-trunk:21] ExecIf(“PJSIP/2004-00000004”, “0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)0116753130)”) in new stack
– Executing [s@macro-dialout-trunk:22] GotoIf(“PJSIP/2004-00000004”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:23] Dial(“PJSIP/2004-00000004”, “SIP/Chan/0812641154,300,T”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/Chan/0812641154
[2017-03-14 15:45:22] WARNING[2182][C-00000004]: chan_sip.c:23862 handle_response_invite: Received response: “Forbidden” from ‘sip:*************@:5160***.***.***.**;tag=as25462eed’
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [s@macro-dialout-trunk:24] NoOp(“PJSIP/2004-00000004”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 21”) in new stack
– Executing [s@macro-dialout-trunk:25] GotoIf(“PJSIP/2004-00000004”, “0?continue,1:s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set(“PJSIP/2004-00000004”, “RC=21”) in new stack
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto(“PJSIP/2004-00000004”, “21,1”) in new stack
– Goto (macro-dialout-trunk,21,1)
– Executing [21@macro-dialout-trunk:1] Goto(“PJSIP/2004-00000004”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [continue@macro-dialout-trunk:1] NoOp(“PJSIP/2004-00000004”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 21 - failing through to other trunks”) in new stack
– Executing [continue@macro-dialout-trunk:2] ExecIf(“PJSIP/2004-00000004”, “1?Set(CALLERID(number)=2004)”) in new stack
– Executing [0812641154@from-internal:8] Macro(“PJSIP/2004-00000004”, “outisbusy,”) in new stack
– Executing [s@macro-outisbusy:1] Progress(“PJSIP/2004-00000004”, “”) in new stack
– Executing [s@macro-outisbusy:2] GotoIf(“PJSIP/2004-00000004”, “0?emergency,1”) in new stack
– Executing [s@macro-outisbusy:3] GotoIf(“PJSIP/2004-00000004”, “0?intracompany,1”) in new stack
– Executing [s@macro-outisbusy:4] Playback(“PJSIP/2004-00000004”, “all-circuits-busy-now&pls-try-call-later, noanswer”) in new stack
– <PJSIP/2004-00000004> Playing ‘all-circuits-busy-now.ulaw’ (language ‘en_GB’)
> 0x7fb56c03dac0 – Probation passed - setting RTP source address to 192.168.2.204:56308
– <PJSIP/2004-00000004> Playing ‘pls-try-call-later.ulaw’ (language ‘en_GB’)
– Executing [s@macro-outisbusy:5] Congestion(“PJSIP/2004-00000004”, “20”) in new stack
== Spawn extension (macro-outisbusy, s, 5) exited non-zero on ‘PJSIP/2004-00000004’ in macro ‘outisbusy’
== Spawn extension (from-internal, 0812641154, 8) exited non-zero on ‘PJSIP/2004-00000004’
– Executing [h@from-internal:1] Macro(“PJSIP/2004-00000004”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“PJSIP/2004-00000004”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] ExecIf(“PJSIP/2004-00000004”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [s@macro-hangupcall:4] Hangup(“PJSIP/2004-00000004”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘PJSIP/2004-00000004’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on 'PJSIP/2004-00000004’
localhost*CLI>

That looks like a problem to me.

Off hand, I’d guess that your ports are backwards, but there are lots of other places where Chan-SIP and PJ-SIP differ. The first and most obvious is that they MUST use different ports and you have to make sure that the stuff that gets configured in the channel driver gets handled on the right port.

Hi Gregory!

Then it might be preferrable to continue with PJSIP for now… Creating new problems by trying to switch to Chan_SIP might not be a good idea now…

Could you please retry what I mentionned here

?

Good luck and have a nice day!

Nick

Is there any particular reason that you need to use PJSIP? Moving from one to another isn’t that difficult. There’s a button on the extensions page to switch (Follow popup insctructions carefully), then adjust the ports in the SIP Setttings tab for CHAN_SIP and PJSIP. You will probably have to restart asterisk after. You should now have a ‘normal’ CHAN_SIP PBX.

Check that your phone and Trunk are registered. Place a call. As mentioned, the Dialplan looks fine. You could temporarily put . as the dialplan pattern to ensure calls go through, thus leaving only the trunk to look at.

If you are having any Codec issues, you’ll see mention of it when you pickup the phone and it tries to negotiate parameters for the call.

If your phone supports g729a make sure it is activated, and ensure the it is selected in the SIP Settings and it is first in the list. This will ensure that all codecs line up with your trunk.

Have fun…