PJSIP Outbound calls not working via Sipgate trunk

I managed to get it working… once I found some extra configuration information on the sipgate.de website (thank you google translate!)

FYI for people looking in the future:

pjsip Settings
in the General tab for the trunk:
Username : sipgate user name
Secret : Sipgate passowrd
Authentication : Outbound
Registration : Send
Lang code : English
Sip Server : sipgate.co.uk
SIP Server Port : 5060
Context : from-pstn
Transport : 0.0.0.0-udp

In the advanced tab:
Contact User : sipgate username
From domain : sipgate.co.uk
From User : sipgate username
Client uri : sip:[email protected]:5060
Server URI : sip:sipgate.co.uk:5060
AOR Contact : sip:[email protected]

I think everything is left at default.

Hello FreePBX community.

I have recently installed FreePBX and connected to Sipgatecouk BASIC account. After a lot of digging and learning I have successfully managed to make and receive calls from Sipgate using SIP_CHAN. Having read that PJSIP is the new way to do things I have been attempting to configure the sip trunk to work with PJSIP.

I can receive incoming calls fine, just as with CHAN_SIP but I can’t make out going calls. I have setup all settings the same (which can be the same) for both trunks. I think it has something to do with the connection string being sent to the trunk.

CHAN_SIP (Working)
– Called SIP/sipgatecouk/447700770077

PJSIP (Not working)
– Called PJSIP/[email protected]_Trunk_PJSIP
I am assuming if I can get this string to read Called PJSIP/sipgatecouk/447700770077 it would work.

It seems to be ignoring my Dial Pattern with the only one I have at the moment is in the outbound route and is ()9|[./]

Any help would be much appreciated. Full log for PJSIP failed call below.

 to Asterisk 13.18.4 currently running on pbx (pid = 1905)
  == Setting global variable 'SIPDOMAIN' to 'pbxmydomaincom'
    -- Executing [[email protected]:1] Macro("PJSIP/101-00000009", "user-callerid,LIMIT,EXTERNAL,") in new stack
    -- Executing [[email protected]:1] Set("PJSIP/101-00000009", "TOUCH_MONITOR=1514829635.14") in new stack
    -- Executing [[email protected]:2] Set("PJSIP/101-00000009", "AMPUSER=101") in new stack
    -- Executing [[email protected]:3] GotoIf("PJSIP/101-00000009", "0?report") in new stack
    -- Executing [[email protected]:4] ExecIf("PJSIP/101-00000009", "1?Set(REALCALLERIDNUM=101)") in new stack
    -- Executing [[email protected]:5] Set("PJSIP/101-00000009", "AMPUSER=101") in new stack
    -- Executing [[email protected]:6] GotoIf("PJSIP/101-00000009", "0?limit") in new stack
    -- Executing [[email protected]:7] Set("PJSIP/101-00000009", "AMPUSERCIDNAME=Office") in new stack
    -- Executing [[email protected]:8] ExecIf("PJSIP/101-00000009", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
    -- Executing [[email protected]:9] GotoIf("PJSIP/101-00000009", "0?report") in new stack
    -- Executing [[email protected]:10] Set("PJSIP/101-00000009", "AMPUSERCID=101") in new stack
    -- Executing [[email protected]:11] Set("PJSIP/101-00000009", "__DIAL_OPTIONS=HhTtr") in new stack
    -- Executing [[email protected]:12] Set("PJSIP/101-00000009", "CALLERID(all)="Office" <101>") in new stack
[2018-01-01 18:00:35] WARNING[14983][C-00000007]: ast_expr2.fl:470 ast_yyerror: ast_yyerror():  syntax error: syntax error, unexpected '>', expecting '-' or '!' or '(' or '<token>'; Input:
"LIMIT"="LIMIT" & 3 & 1 & >0 & 0>=
                          ^
[2018-01-01 18:00:35] WARNING[14983][C-00000007]: ast_expr2.fl:474 ast_yyerror: If you have questions, please refer to https://wiki.asterisk.org/wiki/display/AST/Channel+Variables
    -- Executing [[email protected]:13] GotoIf("PJSIP/101-00000009", "0?limit") in new stack
    -- Executing [[email protected]:14] ExecIf("PJSIP/101-00000009", "1?Set(GROUP(concurrency_limit)=101)") in new stack
    -- Executing [[email protected]:15] ExecIf("PJSIP/101-00000009", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [[email protected]:16] NoOp("PJSIP/101-00000009", "Macro Depth is 1") in new stack
    -- Executing [[email protected]er-callerid:17] GotoIf("PJSIP/101-00000009", "1?report2:macroerror") in new stack
    -- Goto (macro-user-callerid,s,19)
    -- Executing [[email protected]:19] GotoIf("PJSIP/101-00000009", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,37)
    -- Executing [[email protected]:37] Set("PJSIP/101-00000009", "CALLERID(number)=101") in new stack
    -- Executing [[email protected]:38] Set("PJSIP/101-00000009", "CALLERID(name)=Office") in new stack
    -- Executing [[email protected]:39] GotoIf("PJSIP/101-00000009", "0?cnum") in new stack
    -- Executing [[email protected]:40] Set("PJSIP/101-00000009", "CDR(cnam)=Office") in new stack
    -- Executing [[email protected]:41] Set("PJSIP/101-00000009", "CDR(cnum)=101") in new stack
    -- Executing [[email protected]:42] Set("PJSIP/101-00000009", "CHANNEL(language)=en_GB") in new stack
    -- Executing [[email protected]:2] Gosub("PJSIP/101-00000009", "sub-record-check,s,1(out,907700770077,dontcare)") in new stack
    -- Executing [[email protected]:1] GotoIf("PJSIP/101-00000009", "0?initialized") in new stack
    -- Executing [[email protected]:2] Set("PJSIP/101-00000009", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [[email protected]:3] Set("PJSIP/101-00000009", "NOW=1514829635") in new stack
    -- Executing [[email protected]:4] Set("PJSIP/101-00000009", "__DAY=01") in new stack
    -- Executing [[email protected]:5] Set("PJSIP/101-00000009", "__MONTH=01") in new stack
    -- Executing [[email protected]:6] Set("PJSIP/101-00000009", "__YEAR=2018") in new stack
    -- Executing [[email protected]:7] Set("PJSIP/101-00000009", "__TIMESTR=20180101-180035") in new stack
    -- Executing [[email protected]:8] Set("PJSIP/101-00000009", "__FROMEXTEN=101") in new stack
    -- Executing [[email protected]:9] Set("PJSIP/101-00000009", "__MON_FMT=wav") in new stack
    -- Executing [[email protected]:10] NoOp("PJSIP/101-00000009", "Recordings initialized") in new stack
    -- Executing [[email protected]:11] ExecIf("PJSIP/101-00000009", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [[email protected]:12] Set("PJSIP/101-00000009", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [[email protected]:13] ExecIf("PJSIP/101-00000009", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [[email protected]:14] GotoIf("PJSIP/101-00000009", "3?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [[email protected]:17] GotoIf("PJSIP/101-00000009", "1?sub-record-check,out,1") in new stack
    -- Goto (sub-record-check,out,1)
    -- Executing [[email protected]:1] NoOp("PJSIP/101-00000009", "Outbound Recording Check from 101 to 907700770077") in new stack
    -- Executing [[email protected]:2] Set("PJSIP/101-00000009", "RECMODE=dontcare") in new stack
    -- Executing [[email protected]:3] ExecIf("PJSIP/101-00000009", "1?Goto(routewins)") in new stack
    -- Goto (sub-record-check,out,7)
    -- Executing [[email protected]:7] Gosub("PJSIP/101-00000009", "recordcheck,1(dontcare,out,907700770077)") in new stack
    -- Executing [[email protected]:1] NoOp("PJSIP/101-00000009", "Starting recording check against dontcare") in new stack
    -- Executing [[email protected]:2] Goto("PJSIP/101-00000009", "dontcare") in new stack
    -- Goto (sub-record-check,recordcheck,3)
    -- Executing [[email protected]:3] Return("PJSIP/101-00000009", "") in new stack
    -- Executing [[email protected]:8] Return("PJSIP/101-00000009", "") in new stack
    -- Executing [[email protected]:3] ExecIf("PJSIP/101-00000009", "0 ?Set(CDR(accountcode)=)") in new stack
    -- Executing [[email protected]:4] Set("PJSIP/101-00000009", "EMERGENCYROUTE=YES") in new stack
    -- Executing [[email protected]:5] Set("PJSIP/101-00000009", "MOHCLASS=default") in new stack
    -- Executing [[email protected]:6] ExecIf("PJSIP/101-00000009", "1?Set(TRUNKCIDOVERRIDE=01234567890)") in new stack
    -- Executing [[email protected]:7] Set("PJSIP/101-00000009", "_NODEST=") in new stack
    -- Executing [[email protected]:8] Macro("PJSIP/101-00000009", "dialout-trunk,1,907700770077,,on") in new stack
    -- Executing [[email protected]:1] Set("PJSIP/101-00000009", "DIAL_TRUNK=1") in new stack
    -- Executing [[email protected]:2] GosubIf("PJSIP/101-00000009", "0?sub-pincheck,s,1()") in new stack
    -- Executing [[email protected]:3] ExecIf("PJSIP/101-00000009", "0?Set(CALLERID(num)=101)") in new stack
    -- Executing [[email protected]:4] GotoIf("PJSIP/101-00000009", "0?disabletrunk,1") in new stack
    -- Executing [[email protected]:5] Set("PJSIP/101-00000009", "DIAL_NUMBER=907700770077") in new stack
    -- Executing [[email protected]:6] Set("PJSIP/101-00000009", "DIAL_TRUNK_OPTIONS=HhTtr") in new stack
    -- Executing [[email protected]:7] Set("PJSIP/101-00000009", "OUTBOUND_GROUP=OUT_1") in new stack
    -- Executing [[email protected]:8] Set("PJSIP/101-00000009", "DIAL_TRUNK_OPTIONS=T") in new stack
    -- Executing [[email protected]:9] GotoIf("PJSIP/101-00000009", "1?nomax") in new stack
    -- Goto (macro-dialout-trunk,s,11)
    -- Executing [[email protected]:11] GotoIf("PJSIP/101-00000009", "0?skipoutcid") in new stack
    -- Executing [[email protected]:12] Macro("PJSIP/101-00000009", "outbound-callerid,1") in new stack
    -- Executing [[email protected]:1] NoOp("PJSIP/101-00000009", "101") in new stack
    -- Executing [[email protected]:2] NoOp("PJSIP/101-00000009", "") in new stack
    -- Executing [[email protected]:3] NoOp("PJSIP/101-00000009", "off") in new stack
    -- Executing [[email protected]:4] ExecIf("PJSIP/101-00000009", "0?Set(CALLERPRES(name-pres)=)") in new stack
    -- Executing [[email protected]:5] ExecIf("PJSIP/101-00000009", "0?Set(CALLERPRES(num-pres)=)") in new stack
    -- Executing [[email protected]:6] ExecIf("PJSIP/101-00000009", "0?Set(REALCALLERIDNUM=101)") in new stack
    -- Executing [[email protected]:7] GotoIf("PJSIP/101-00000009", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,11)
    -- Executing [[email protected]:11] Set("PJSIP/101-00000009", "USEROUTCID=") in new stack
    -- Executing [[email protected]:12] Set("PJSIP/101-00000009", "EMERGENCYCID=") in new stack
    -- Executing [[email protected]:13] Set("PJSIP/101-00000009", "TRUNKOUTCID=01234567890") in new stack
    -- Executing [[email protected]:14] GotoIf("PJSIP/101-00000009", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,19)
    -- Executing [[email protected]:19] ExecIf("PJSIP/101-00000009", "1?Set(CALLERID(all)=01234567890)") in new stack
    -- Executing [[email protected]:20] ExecIf("PJSIP/101-00000009", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [[email protected]:21] ExecIf("PJSIP/101-00000009", "1?Set(CALLERID(all)=01234567890)") in new stack
    -- Executing [[email protected]:22] ExecIf("PJSIP/101-00000009", "0?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [[email protected]:23] ExecIf("PJSIP/101-00000009", "0?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [[email protected]:24] Set("PJSIP/101-00000009", "CDR(outbound_cnum)=01234567890") in new stack
    -- Executing [[email protected]:25] Set("PJSIP/101-00000009", "CDR(outbound_cnam)=") in new stack
    -- 
-- Executing [[email protected]:1] ExecIf("PJSIP/101-00000009", "0?Set(TARGET_FLP_1=07700770077)") in new stack
    -- Executing [[email protected]:2] GotoIf("PJSIP/101-00000009", "0?match") in new stack
    -- Executing [[email protected]:3] ExecIf("PJSIP/101-00000009", "0?Set(TARGET_FLP_1=07700770077)") in new stack
    -- Executing [[email protected]:4] GotoIf("PJSIP/101-00000009", "0?match") in new stack
    -- Executing [[email protected]:5] ExecIf("PJSIP/101-00000009", "0?Set(TARGET_FLP_1=07700770077)") in new stack
    -- Executing [[email protected]:6] GotoIf("PJSIP/101-00000009", "0?match") in new stack
    -- Executing [[email protected]:7] ExecIf("PJSIP/101-00000009", "0?Set(TARGET_FLP_1=07700770077)") in new stack
    -- Executing [[email protected]:8] GotoIf("PJSIP/101-00000009", "0?match") in new stack
    -- Executing [[email protected]:9] ExecIf("PJSIP/101-00000009", "0?Set(TARGET_FLP_1=07700770077)") in new stack
    -- Executing [[email protected]:10] GotoIf("PJSIP/101-00000009", "0?match") in new stack
    -- Executing [[email protected]:11] ExecIf("PJSIP/101-00000009", "0?Set(TARGET_FLP_1=07700770077)") in new stack
    -- Executing [[email protected]:12] GotoIf("PJSIP/101-00000009", "0?match") in new stack
    -- Executing [[email protected]:13] ExecIf("PJSIP/101-00000009", "0?Set(TARGET_FLP_1=4407700770077)") in new stack
    -- Executing [[email protected]:14] GotoIf("PJSIP/101-00000009", "0?match") in new stack
    -- Executing [[email protected]:15] ExecIf("PJSIP/101-00000009", "0?Set(TARGET_FLP_1=4407700770077)") in new stack
    -- Executing [[email protected]:16] GotoIf("PJSIP/101-00000009", "0?match") in new stack
    -- Executing [[email protected]:17] ExecIf("PJSIP/101-00000009", "0?Set(TARGET_FLP_1=747608470)") in new stack
    -- Executing [[email protected]:18] GotoIf("PJSIP/101-00000009", "0?match") in new stack
    -- Executing [[email protected]:19] ExecIf("PJSIP/101-00000009", "0?Set(TARGET_FLP_1=07700770077)") in new stack
    -- Executing [[email protected]:20] GotoIf("PJSIP/101-00000009", "0?match") in new stack
    -- Executing [[email protected]:21] Return("PJSIP/101-00000009", "") in new stack
    -- Executing [[email protected]:14] Set("PJSIP/101-00000009", "OUTNUM=907700770077") in new stack
    -- Executing [[email protected]:15] Set("PJSIP/101-00000009", "custom=PJSIP") in new stack
    -- Executing [[email protected]:16] ExecIf("PJSIP/101-00000009", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)") in new stack
    -- Executing [[email protected]:17] ExecIf("PJSIP/101-00000009", "0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))") in new stack
    -- Executing [[email protected]:18] Macro("PJSIP/101-00000009", "dialout-trunk-predial-hook,") in new stack
    -- Executing [[email protected]:1] MacroExit("PJSIP/101-00000009", "") in new stack
    -- Executing [[email protected]:19] GotoIf("PJSIP/101-00000009", "0?skipcrm") in new stack
    -- Executing [[email protected]:20] Set("PJSIP/101-00000009", "__CRM_DIRECTION=OUTBOUND") in new stack
    -- Executing [[email protected]:21] Set("PJSIP/101-00000009", "__CRM_DESTINATION=907700770077") in new stack
    -- Executing [[email protected]:22] Set("PJSIP/101-00000009", "__CRM_SOURCE=101") in new stack
    -- Executing [[email protected]:23] AGI("PJSIP/101-00000009", "sangomacrm.agi") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
    -- <PJSIP/101-00000009>AGI Script sangomacrm.agi completed, returning 0
    -- Executing [[email protected]:24] Set("PJSIP/101-00000009", "CHANNEL(hangup_handler_push)=crm-hangup,s,1") in new stack
    -- Executing [[email protected]:25] NoOp("PJSIP/101-00000009", "CRM Finished") in new stack
    -- Executing [[email protected]:26] GotoIf("PJSIP/101-00000009", "0?bypass,1") in new stack
    -- Executing [[email protected]:27] ExecIf("PJSIP/101-00000009", "1?Set(CONNECTEDLINE(num,i)=907700770077)") in new stack
    -- Executing [[email protected]:28] ExecIf("PJSIP/101-00000009", "1?Set(CONNECTEDLINE(name,i)=CID:01234567890)") in new stack
    -- Executing [[email protected]:29] ExecIf("PJSIP/101-00000009", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)01234567890)") in new stack
    -- Executing [[email protected]:30] GotoIf("PJSIP/101-00000009", "0?customtrunk") in new stack
    -- Executing [[email protected]:31] Dial("PJSIP/101-00000009", "PJSIP/[email protected]_Trunk_PJSIP,300,T") in new stack
    -- Called PJSIP/[email protected]_Trunk_PJSIP
 == Everyone is busy/congested at this time (1:0/0/1)
-- Executing [[email protected]:32] NoOp("PJSIP/101-0000000a", "Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 21") in new stack
-- Executing [[email protected]:33] GotoIf("PJSIP/101-0000000a", "1?continue,1:s-CHANUNAVAIL,1") in new stack

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.