No outgoing calls possible

FreePBX newbie here!

Outgoing calls fails with
ERROR[285129]: res_pjsip_header_funcs.c:723 remove_header: No headers had been previously added to this session.

Verbose log shows the following:

root@freepbx:~# asterisk -rvvvv
Asterisk 20.8.1, Copyright (C) 1999 - 2022, Sangoma Technologies Corporation and others.
Created by Mark Spencer <[email protected]>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 20.8.1 currently running on freepbx (pid = 1056)
  == Using SIP RTP Audio TOS bits 184
  == Using SIP RTP Audio CoS mark 5
    -- Executing [+49XXXXXXXXXXXX@from-internal:1] Macro("PJSIP/80-00000085", "user-callerid,LIMIT,EXTERNAL,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("PJSIP/80-00000085", "TOUCH_MONITOR=XXXXXXXXXXXX.145") in new stack
    -- Executing [s@macro-user-callerid:2] Set("PJSIP/80-00000085", "CHANCONTEXT=") in new stack
    -- Executing [s@macro-user-callerid:3] Set("PJSIP/80-00000085", "CHANCONTEXT=") in new stack
    -- Executing [s@macro-user-callerid:4] Set("PJSIP/80-00000085", "CHANEXTENCONTEXT=80-00000085") in new stack
    -- Executing [s@macro-user-callerid:5] Set("PJSIP/80-00000085", "CHANEXTEN=80-00000085") in new stack
    -- Executing [s@macro-user-callerid:6] Set("PJSIP/80-00000085", "CALLERID(number)=80") in new stack
    -- Executing [s@macro-user-callerid:7] Set("PJSIP/80-00000085", "AMPUSER=80") in new stack
    -- Executing [s@macro-user-callerid:8] Set("PJSIP/80-00000085", "HOTDESCKCHAN=80-00000085") in new stack
    -- Executing [s@macro-user-callerid:9] Set("PJSIP/80-00000085", "HOTDESKEXTEN=80") in new stack
    -- Executing [s@macro-user-callerid:10] Set("PJSIP/80-00000085", "HOTDESKCALL=0") in new stack
    -- Executing [s@macro-user-callerid:11] ExecIf("PJSIP/80-00000085", "0?Set(HOTDESKCALL=1)") in new stack
    -- Executing [s@macro-user-callerid:12] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [s@macro-user-callerid:13] GotoIf("PJSIP/80-00000085", "0?report") in new stack
    -- Executing [s@macro-user-callerid:14] ExecIf("PJSIP/80-00000085", "1?Set(REALCALLERIDNUM=80)") in new stack
    -- Executing [s@macro-user-callerid:15] Set("PJSIP/80-00000085", "AMPUSER=80") in new stack
    -- Executing [s@macro-user-callerid:16] GotoIf("PJSIP/80-00000085", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:17] Set("PJSIP/80-00000085", "AMPUSERCIDNAME=Name Test") in new stack
    -- Executing [s@macro-user-callerid:18] ExecIf("PJSIP/80-00000085", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
    -- Executing [s@macro-user-callerid:19] GotoIf("PJSIP/80-00000085", "0?report") in new stack
    -- Executing [s@macro-user-callerid:20] Set("PJSIP/80-00000085", "AMPUSERCID=80") in new stack
    -- Executing [s@macro-user-callerid:21] Set("PJSIP/80-00000085", "__DIAL_OPTIONS=") in new stack
    -- Executing [s@macro-user-callerid:22] Set("PJSIP/80-00000085", "CALLERID(all)="Name Test" <80>") in new stack
    -- Executing [s@macro-user-callerid:23] ExecIf("PJSIP/80-00000085", "0?Set(CUSDIAL=)") in new stack
    -- Executing [s@macro-user-callerid:24] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(all)="Name Test" <80>)") in new stack
    -- Executing [s@macro-user-callerid:25] GotoIf("PJSIP/80-00000085", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:26] ExecIf("PJSIP/80-00000085", "1?Set(GROUP(concurrency_limit)=80)") in new stack
    -- Executing [s@macro-user-callerid:27] NoOp("PJSIP/80-00000085", "Macro Depth is 1") in new stack
    -- Executing [s@macro-user-callerid:28] GotoIf("PJSIP/80-00000085", "1?report2:macroerror") in new stack
    -- Goto (macro-user-callerid,s,29)
    -- Executing [s@macro-user-callerid:29] GotoIf("PJSIP/80-00000085", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,47)
    -- Executing [s@macro-user-callerid:47] Set("PJSIP/80-00000085", "CALLERID(number)=80") in new stack
    -- Executing [s@macro-user-callerid:48] Set("PJSIP/80-00000085", "CALLERID(name)=Name Test") in new stack
    -- Executing [s@macro-user-callerid:49] GotoIf("PJSIP/80-00000085", "0?cnum") in new stack
    -- Executing [s@macro-user-callerid:50] Set("PJSIP/80-00000085", "CDR(cnam)=Name Test") in new stack
    -- Executing [s@macro-user-callerid:51] Set("PJSIP/80-00000085", "CDR(cnum)=80") in new stack
    -- Executing [s@macro-user-callerid:52] Set("PJSIP/80-00000085", "CHANNEL(language)=de_DE") in new stack
    -- Executing [+49XXXXXXXXXXXX@from-internal:2] Gosub("PJSIP/80-00000085", "sub-record-check,s,1(out,+49XXXXXXXXXXXX,dontcare)") in new stack
    -- Executing [s@sub-record-check:1] GotoIf("PJSIP/80-00000085", "0?initialized") in new stack
    -- Executing [s@sub-record-check:2] Set("PJSIP/80-00000085", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [s@sub-record-check:3] Set("PJSIP/80-00000085", "NOW=XXXXXXXXXXXX") in new stack
    -- Executing [s@sub-record-check:4] Set("PJSIP/80-00000085", "__DAY=10") in new stack
    -- Executing [s@sub-record-check:5] Set("PJSIP/80-00000085", "__MONTH=06") in new stack
    -- Executing [s@sub-record-check:6] Set("PJSIP/80-00000085", "__YEAR=2024") in new stack
    -- Executing [s@sub-record-check:7] Set("PJSIP/80-00000085", "__TIMESTR=20240610-151900") in new stack
    -- Executing [s@sub-record-check:8] Set("PJSIP/80-00000085", "__FROMEXTEN=80") in new stack
    -- Executing [s@sub-record-check:9] Set("PJSIP/80-00000085", "__MON_FMT=wav") in new stack
    -- Executing [s@sub-record-check:10] NoOp("PJSIP/80-00000085", "Recordings initialized") in new stack
    -- Executing [s@sub-record-check:11] ExecIf("PJSIP/80-00000085", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [s@sub-record-check:12] Set("PJSIP/80-00000085", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [s@sub-record-check:13] ExecIf("PJSIP/80-00000085", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [s@sub-record-check:14] GotoIf("PJSIP/80-00000085", "3?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [s@sub-record-check:17] GotoIf("PJSIP/80-00000085", "1?sub-record-check,out,1") in new stack
    -- Goto (sub-record-check,out,1)
    -- Executing [out@sub-record-check:1] NoOp("PJSIP/80-00000085", "Outbound Recording Check from 80 to +49XXXXXXXXXXXX") in new stack
    -- Executing [out@sub-record-check:2] Set("PJSIP/80-00000085", "RECMODE=dontcare") in new stack
    -- Executing [out@sub-record-check:3] ExecIf("PJSIP/80-00000085", "1?Goto(routewins)") in new stack
    -- Goto (sub-record-check,out,7)
    -- Executing [out@sub-record-check:7] Gosub("PJSIP/80-00000085", "recordcheck,1(dontcare,out,+49XXXXXXXXXXXX)") in new stack
    -- Executing [recordcheck@sub-record-check:1] NoOp("PJSIP/80-00000085", "Starting recording check against dontcare") in new stack
    -- Executing [recordcheck@sub-record-check:2] Goto("PJSIP/80-00000085", "dontcare") in new stack
    -- Goto (sub-record-check,recordcheck,3)
    -- Executing [recordcheck@sub-record-check:3] Return("PJSIP/80-00000085", "") in new stack
    -- Executing [out@sub-record-check:8] Return("PJSIP/80-00000085", "") in new stack
    -- Executing [+49XXXXXXXXXXXX@from-internal:3] Set("PJSIP/80-00000085", "_ROUTEID=1") in new stack
    -- Executing [+49XXXXXXXXXXXX@from-internal:4] Set("PJSIP/80-00000085", "_ROUTENAME=External") in new stack
    -- Executing [+49XXXXXXXXXXXX@from-internal:5] Set("PJSIP/80-00000085", "MOHCLASS=default") in new stack
    -- Executing [+49XXXXXXXXXXXX@from-internal:6] Set("PJSIP/80-00000085", "_CALLERIDNAMEINTERNAL=Name Test") in new stack
    -- Executing [+49XXXXXXXXXXXX@from-internal:7] Set("PJSIP/80-00000085", "_CALLERIDNUMINTERNAL=80") in new stack
    -- Executing [+49XXXXXXXXXXXX@from-internal:8] Set("PJSIP/80-00000085", "_EMAILNOTIFICATION=FALSE") in new stack
    -- Executing [+49XXXXXXXXXXXX@from-internal:9] Set("PJSIP/80-00000085", "_NODEST=") in new stack
    -- Executing [+49XXXXXXXXXXXX@from-internal:10] Macro("PJSIP/80-00000085", "dialout-trunk,2,+49XXXXXXXXXXXX,,off") in new stack
    -- Executing [s@macro-dialout-trunk:1] Set("PJSIP/80-00000085", "DIAL_TRUNK=2") in new stack
    -- Executing [s@macro-dialout-trunk:2] ExecIf("PJSIP/80-00000085", "0?Set(DIAL_OPTIONS=)") in new stack
    -- Executing [s@macro-dialout-trunk:3] GosubIf("PJSIP/80-00000085", "0?sub-pincheck,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:4] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(num)=80)") in new stack
    -- Executing [s@macro-dialout-trunk:5] GotoIf("PJSIP/80-00000085", "0?disabletrunk,1") in new stack
    -- Executing [s@macro-dialout-trunk:6] Set("PJSIP/80-00000085", "DIAL_NUMBER=+49XXXXXXXXXXXX") in new stack
    -- Executing [s@macro-dialout-trunk:7] Set("PJSIP/80-00000085", "DIAL_TRUNK_OPTIONS=") in new stack
    -- Executing [s@macro-dialout-trunk:8] Set("PJSIP/80-00000085", "OUTBOUND_GROUP=OUT_2") in new stack
    -- Executing [s@macro-dialout-trunk:9] Set("PJSIP/80-00000085", "DIAL_TRUNK_OPTIONS=Ttr") in new stack
    -- Executing [s@macro-dialout-trunk:10] GotoIf("PJSIP/80-00000085", "0?nomax") in new stack
    -- Executing [s@macro-dialout-trunk:11] GotoIf("PJSIP/80-00000085", "0?chanfull") in new stack
    -- Executing [s@macro-dialout-trunk:12] GotoIf("PJSIP/80-00000085", "0?skipoutcid") in new stack
    -- Executing [s@macro-dialout-trunk:13] Macro("PJSIP/80-00000085", "outbound-callerid,2") in new stack
    -- Executing [s@macro-outbound-callerid:1] NoOp("PJSIP/80-00000085", "80") in new stack
    -- Executing [s@macro-outbound-callerid:2] NoOp("PJSIP/80-00000085", "") in new stack
    -- Executing [s@macro-outbound-callerid:3] NoOp("PJSIP/80-00000085", "off") in new stack
    -- Executing [s@macro-outbound-callerid:4] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(name-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:5] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(num-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:6] Set("PJSIP/80-00000085", "HOTDESCKCHAN=80-00000085") in new stack
    -- Executing [s@macro-outbound-callerid:7] Set("PJSIP/80-00000085", "HOTDESKEXTEN=80") in new stack
    -- Executing [s@macro-outbound-callerid:8] Set("PJSIP/80-00000085", "HOTDESKCALL=0") in new stack
    -- Executing [s@macro-outbound-callerid:9] ExecIf("PJSIP/80-00000085", "0?Set(HOTDESKCALL=1)") in new stack
    -- Executing [s@macro-outbound-callerid:10] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [s@macro-outbound-callerid:11] Set("PJSIP/80-00000085", "ALLOWTHISROUTE=NO") in new stack
    -- Executing [s@macro-outbound-callerid:12] ExecIf("PJSIP/80-00000085", "0?Set(ALLOWTHISROUTE=YES)") in new stack
    -- Executing [s@macro-outbound-callerid:13] ExecIf("PJSIP/80-00000085", "0?Hangup()") in new stack
    -- Executing [s@macro-outbound-callerid:14] ExecIf("PJSIP/80-00000085", "0?Set(REALCALLERIDNUM=80)") in new stack
    -- Executing [s@macro-outbound-callerid:15] ExecIf("PJSIP/80-00000085", "0?Set(AMPUSER=80)") in new stack
    -- Executing [s@macro-outbound-callerid:16] GotoIf("PJSIP/80-00000085", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,20)
    -- Executing [s@macro-outbound-callerid:20] Set("PJSIP/80-00000085", "USEROUTCID=") in new stack
    -- Executing [s@macro-outbound-callerid:21] Set("PJSIP/80-00000085", "EMERGENCYCID=") in new stack
    -- Executing [s@macro-outbound-callerid:22] ExecIf("PJSIP/80-00000085", "0?Set(EMERGENCYCID=)") in new stack
    -- Executing [s@macro-outbound-callerid:23] Set("PJSIP/80-00000085", "TRUNKOUTCID=<+49XXXXXXXXXXXX>") in new stack
    -- Executing [s@macro-outbound-callerid:24] GotoIf("PJSIP/80-00000085", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,30)
    -- Executing [s@macro-outbound-callerid:30] ExecIf("PJSIP/80-00000085", "1?Set(CALLERID(all)=<+49XXXXXXXXXXXX>)") in new stack
    -- Executing [s@macro-outbound-callerid:31] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:32] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:33] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(all)=80)") in new stack
    -- Executing [s@macro-outbound-callerid:34] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(all)=80)") in new stack
    -- Executing [s@macro-outbound-callerid:35] Set("PJSIP/80-00000085", "TIOHIDE=no") in new stack
    -- Executing [s@macro-outbound-callerid:36] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:37] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:38] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:39] ExecIf("PJSIP/80-00000085", "0?Set(CALLERID(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:40] Set("PJSIP/80-00000085", "CDR(outbound_cnum)=+49XXXXXXXXXXXX") in new stack
    -- Executing [s@macro-outbound-callerid:41] Set("PJSIP/80-00000085", "CDR(outbound_cnam)=") in new stack
    -- Executing [s@macro-dialout-trunk:14] GosubIf("PJSIP/80-00000085", "0?sub-flp-2,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:15] Set("PJSIP/80-00000085", "OUTNUM=+49XXXXXXXXXXXX") in new stack
    -- Executing [s@macro-dialout-trunk:16] Set("PJSIP/80-00000085", "custom=PJSIP") in new stack
    -- Executing [s@macro-dialout-trunk:17] ExecIf("PJSIP/80-00000085", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)Ttr)") in new stack
    -- Executing [s@macro-dialout-trunk:18] ExecIf("PJSIP/80-00000085", "0?Set(DIAL_TRUNK_OPTIONS=TtrM(confirm))") in new stack
    -- Executing [s@macro-dialout-trunk:19] Macro("PJSIP/80-00000085", "dialout-trunk-predial-hook,") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("PJSIP/80-00000085", "") in new stack
    -- Executing [s@macro-dialout-trunk:20] GotoIf("PJSIP/80-00000085", "0?bypass,1") in new stack
    -- Executing [s@macro-dialout-trunk:21] ExecIf("PJSIP/80-00000085", "1?Set(CONNECTEDLINE(num,i)=+49XXXXXXXXXXXX)") in new stack
    -- Executing [s@macro-dialout-trunk:22] ExecIf("PJSIP/80-00000085", "1?Set(CONNECTEDLINE(name,i)=CID:+49XXXXXXXXXXXX)") in new stack
    -- Executing [s@macro-dialout-trunk:23] ExecIf("PJSIP/80-00000085", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)+49XXXXXXXXXXXX)") in new stack
    -- Executing [s@macro-dialout-trunk:24] GotoIf("PJSIP/80-00000085", "0?customtrunk") in new stack
    -- Executing [s@macro-dialout-trunk:25] ExecIf("PJSIP/80-00000085", "0?Set(DIAL_TRUNK_OPTIONS=tr)") in new stack
    -- Executing [s@macro-dialout-trunk:26] Set("PJSIP/80-00000085", "HASH(__SIPHEADERS,Alert-Info)=unset") in new stack
    -- Executing [s@macro-dialout-trunk:27] Dial("PJSIP/80-00000085", "PJSIP/+49XXXXXXXXXXXX@Vodafone_Anschluss_1,300,Ttrb(func-apply-sipheaders^s^1,(2))U(sub-send-obroute-email^+49XXXXXXXXXXXX^+49XXXXXXXXXXXX^2^XXXXXXXXXXXX^^+49XXXXXXXXXXXX)") in new stack
    -- PJSIP/Vodafone_Anschluss_1-00000086 Internal Gosub(func-apply-sipheaders,s,1(2)) start
    -- Executing [s@func-apply-sipheaders:1] NoOp("PJSIP/Vodafone_Anschluss_1-00000086", "Applying SIP Headers to channel PJSIP/Vodafone_Anschluss_1-00000086") in new stack
    -- Executing [s@func-apply-sipheaders:2] Set("PJSIP/Vodafone_Anschluss_1-00000086", "TECH=PJSIP") in new stack
    -- Executing [s@func-apply-sipheaders:3] Set("PJSIP/Vodafone_Anschluss_1-00000086", "SIPHEADERKEYS=Alert-Info") in new stack
    -- Executing [s@func-apply-sipheaders:4] While("PJSIP/Vodafone_Anschluss_1-00000086", "1") in new stack
    -- Executing [s@func-apply-sipheaders:5] Set("PJSIP/Vodafone_Anschluss_1-00000086", "sipheader=unset") in new stack
    -- Executing [s@func-apply-sipheaders:6] ExecIf("PJSIP/Vodafone_Anschluss_1-00000086", "1?Set(PJSIP_HEADER(remove,Alert-Info)=)") in new stack
[Jun 10 15:19:00] ERROR[285129]: res_pjsip_header_funcs.c:723 remove_header: No headers had been previously added to this session.
    -- Executing [s@func-apply-sipheaders:7] ExecIf("PJSIP/Vodafone_Anschluss_1-00000086", "0?Set(sipheader=<http://127.0.0.1>;info=unset)") in new stack
    -- Executing [s@func-apply-sipheaders:8] ExecIf("PJSIP/Vodafone_Anschluss_1-00000086", "0?Set(sipheader=<http://127.0.0.1>unset)") in new stack
    -- Executing [s@func-apply-sipheaders:9] ExecIf("PJSIP/Vodafone_Anschluss_1-00000086", "0?Set(PJSIP_HEADER(add,Alert-Info)=unset)") in new stack
    -- Executing [s@func-apply-sipheaders:10] EndWhile("PJSIP/Vodafone_Anschluss_1-00000086", "") in new stack
    -- Executing [s@func-apply-sipheaders:4] While("PJSIP/Vodafone_Anschluss_1-00000086", "0") in new stack
    -- Executing [s@func-apply-sipheaders:11] Return("PJSIP/Vodafone_Anschluss_1-00000086", "") in new stack
  == Spawn extension (from-pstn, +49XXXXXXXXXXXX, 1) exited non-zero on 'PJSIP/Vodafone_Anschluss_1-00000086'
    -- PJSIP/Vodafone_Anschluss_1-00000086 Internal Gosub(func-apply-sipheaders,s,1(2)) complete GOSUB_RETVAL=
    -- Called PJSIP/+49XXXXXXXXXXXX@Vodafone_Anschluss_1
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [s@macro-dialout-trunk:28] NoOp("PJSIP/80-00000085", "Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 47") in new stack
    -- Executing [s@macro-dialout-trunk:29] GotoIf("PJSIP/80-00000085", "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/80-00000085", "RC=47") in new stack
    -- Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto("PJSIP/80-00000085", "47,1") in new stack
    -- Goto (macro-dialout-trunk,47,1)
    -- Executing [47@macro-dialout-trunk:1] Goto("PJSIP/80-00000085", "continue,1") in new stack
    -- Goto (macro-dialout-trunk,continue,1)
    -- Executing [continue@macro-dialout-trunk:1] NoOp("PJSIP/80-00000085", "TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 47 - failing through to other trunks") in new stack
    -- Executing [continue@macro-dialout-trunk:2] ExecIf("PJSIP/80-00000085", "1?Set(CALLERID(number)=80)") in new stack
    -- Executing [+49XXXXXXXXXXXX@from-internal:11] Macro("PJSIP/80-00000085", "outisbusy,") in new stack
    -- Executing [s@macro-outisbusy:1] Progress("PJSIP/80-00000085", "") in new stack
    -- Executing [s@macro-outisbusy:2] GotoIf("PJSIP/80-00000085", "0?emergency,1") in new stack
    -- Executing [s@macro-outisbusy:3] GotoIf("PJSIP/80-00000085", "0?intracompany,1") in new stack
    -- Executing [s@macro-outisbusy:4] Playback("PJSIP/80-00000085", "all-circuits-busy-now&please-try-call-later, noanswer") in new stack
       > 0x55783d2470 -- Strict RTP learning after remote address set to: 192.168.178.30:34490
    -- <PJSIP/80-00000085> Playing 'all-circuits-busy-now.g722' (language 'de_DE')
       > 0x55783d2470 -- Strict RTP switching to RTP target address 192.168.178.30:34490 as source
  == Spawn extension (macro-outisbusy, s, 4) exited non-zero on 'PJSIP/80-00000085' in macro 'outisbusy'
  == Spawn extension (from-internal, +49XXXXXXXXXXXX, 11) exited non-zero on 'PJSIP/80-00000085'
    -- Executing [h@from-internal:1] Macro("PJSIP/80-00000085", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("PJSIP/80-00000085", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [s@macro-hangupcall:3] ExecIf("PJSIP/80-00000085", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [s@macro-hangupcall:4] Hangup("PJSIP/80-00000085", "") in new stack
  == Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'PJSIP/80-00000085' in macro 'hangupcall'
  == Spawn extension (from-internal, h, 1) exited non-zero on 'PJSIP/80-00000085'

Inbound mails are working fine, but outbound calls get the message “all-circuits-busy-now&please-try-call-later”.
Any ideas how to find out on how to configure that outbound route correctly?

The error message doesn’t represent a real error.

You’ve got an unavailable status with an ISDN cause code of 47, which means “Resources unavailable, unspecified”. I’m not sure if Asterisk generates this code internally, or whether it means a call was attempted, and was rejected. In the former case it would be because you’d required them to register and they hadn’t, or because a connectivity test had failed. In the latter case you would need ot look at what was actually exchanged with provider and possibly ask their help, but typical causes might be an invalidly formatted caller ID or destination number.

To check the first one, you need to use the CLI to query the endpoint. I think that is “pjsip show endpoint Vodafone_Anschluss_1”.

In the latter case, you need to run the CLI command “pjsip set logger on”, before attempting the call, to get the actual SIP messages exchanged.

Thanks for your answer!
With the callerID, you might be correct!
With the command given by you, the callerID is set to .
I already tinkered around trying to catch the correct format, but this doesn’t changed anything.
I already contacted my sip provider, but they just told me they “don’t do support for third-party devices”…

This is for the latter case what I found in the logging:

<--- Received SIP request (1078 bytes) from UDP:192.168.178.30:59387 --->
INVITE sip:[email protected];transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.178.30:59387;branch=z9hG4bK-524287-1---ac913868f882bc83;rport
Max-Forwards: 70
Contact: <sip:[email protected]:59387;transport=UDP>
To: <sip:[email protected]>
From: <sip:[email protected];transport=UDP>;tag=573fa465
Call-ID: Pc2H4L1UCUXl_6NKXJ0H5w..
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
Supported: replaces, norefersub, extended-refer, timer, sec-agree, outbound, path, X-cisco-serviceuri
User-Agent: Z 5.6.4 v2.10.20.4_1
Allow-Events: presence, kpml, talk, as-feature-event
Content-Length: 376

v=0
o=Z 0 198306560 IN IP4 192.168.178.30
s=Z
c=IN IP4 192.168.178.30
t=0 0
m=audio 36417 RTP/AVP 9 8 102 106 101 98 0 3
a=rtpmap:102 G726-32/8000
a=rtpmap:106 opus/48000/2
a=fmtp:106 sprop-maxcapturerate=16000; minptime=20; useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:98 telephone-event/48000
a=fmtp:98 0-16
a=sendrecv
a=rtcp-mux

<--- Transmitting SIP response (520 bytes) to UDP:192.168.178.30:59387 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.178.30:59387;rport=59387;received=192.168.178.30;branch=z9hG4bK-524287-1---ac913868f882bc83
Call-ID: Pc2H4L1UCUXl_6NKXJ0H5w..
From: <sip:[email protected]>;tag=573fa465
To: <sip:[email protected]>;tag=z9hG4bK-524287-1---ac913868f882bc83
CSeq: 1 INVITE
WWW-Authenticate: Digest realm="asterisk",nonce="1718050591/0f860b8eb65b14b506e527a855162e88",opaque="2fcef5764bfa3e9c",algorithm=MD5,qop="auth"
Server: FPBX-16.0.40.7(20.8.1)
Content-Length:  0


<--- Received SIP request (375 bytes) from UDP:192.168.178.30:59387 --->
ACK sip:[email protected];transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.178.30:59387;branch=z9hG4bK-524287-1---ac913868f882bc83;rport
Max-Forwards: 70
To: <sip:[email protected]>;tag=z9hG4bK-524287-1---ac913868f882bc83
From: <sip:[email protected];transport=UDP>;tag=573fa465
Call-ID: Pc2H4L1UCUXl_6NKXJ0H5w..
CSeq: 1 ACK
Content-Length: 0


<--- Received SIP request (1385 bytes) from UDP:192.168.178.30:59387 --->
INVITE sip:[email protected];transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.178.30:59387;branch=z9hG4bK-524287-1---0a1292bc73055409;rport
Max-Forwards: 70
Contact: <sip:[email protected]:59387;transport=UDP>
To: <sip:[email protected]>
From: <sip:[email protected];transport=UDP>;tag=573fa465
Call-ID: Pc2H4L1UCUXl_6NKXJ0H5w..
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
Supported: replaces, norefersub, extended-refer, timer, sec-agree, outbound, path, X-cisco-serviceuri
User-Agent: Z 5.6.4 v2.10.20.4_1
Authorization: Digest username="80",realm="asterisk",nonce="1718050591/0f860b8eb65b14b506e527a855162e88",uri="sip:[email protected];transport=UDP",response="1f8b639bb117991cc46a2f61cfe11b18",cnonce="c9a90ba3193dea6ae108ec0ca7a835ee",nc=00000001,qop=auth,algorithm=MD5,opaque="2fcef5764bfa3e9c"
Allow-Events: presence, kpml, talk, as-feature-event
Content-Length: 376

v=0
o=Z 0 198306560 IN IP4 192.168.178.30
s=Z
c=IN IP4 192.168.178.30
t=0 0
m=audio 36417 RTP/AVP 9 8 102 106 101 98 0 3
a=rtpmap:102 G726-32/8000
a=rtpmap:106 opus/48000/2
a=fmtp:106 sprop-maxcapturerate=16000; minptime=20; useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:98 telephone-event/48000
a=fmtp:98 0-16
a=sendrecv
a=rtcp-mux

<--- Transmitting SIP response (328 bytes) to UDP:192.168.178.30:59387 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.178.30:59387;rport=59387;received=192.168.178.30;branch=z9hG4bK-524287-1---0a1292bc73055409
Call-ID: Pc2H4L1UCUXl_6NKXJ0H5w..
From: <sip:[email protected]>;tag=573fa465
To: <sip:[email protected]>
CSeq: 2 INVITE
Server: FPBX-16.0.40.7(20.8.1)
Content-Length:  0


[Jun 10 22:16:31] ERROR[285129]: res_pjsip_header_funcs.c:723 remove_header: No headers had been previously added to this session.
<--- Transmitting SIP response (523 bytes) to UDP:192.168.178.30:59387 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.178.30:59387;rport=59387;received=192.168.178.30;branch=z9hG4bK-524287-1---0a1292bc73055409
Call-ID: Pc2H4L1UCUXl_6NKXJ0H5w..
From: <sip:[email protected]>;tag=573fa465
To: <sip:[email protected]>;tag=24d78fd9-dbcf-495d-a4dc-d3a68f74413a
CSeq: 2 INVITE
Server: FPBX-16.0.40.7(20.8.1)
Contact: <sip:192.168.178.66:5060>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER, INFO, MESSAGE
Content-Length:  0


<--- Transmitting SIP request (1124 bytes) to UDP:178.13.17.134:5060 --->
INVITE sip:sip.kabelfon.vodafone.de:5060 SIP/2.0
Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;rport;branch=z9hG4bKPjc975ecb7-1d86-46ed-9d6a-577307587dfb
From: <sip:[email protected]>;tag=45e80f2f-a578-4da8-bb5a-6042288b69df
To: <sip:[email protected]>
Contact: <sip:[email protected]:5060>
Call-ID: c43c9025-33c6-4c9a-9fde-644e420592ce
CSeq: 24324 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER, INFO, MESSAGE
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Route: <sip:[email protected]:5060>
Max-Forwards: 70
User-Agent: FPBX-16.0.40.7(20.8.1)
Content-Type: application/sdp
Content-Length:   339

v=0
o=- 2102915972 2102915972 IN IP4 XXX.XXX.XXX.XXX
s=Asterisk
c=IN IP4 XXX.XXX.XXX.XXX
t=0 0
m=audio 16870 RTP/AVP 9 111 18 4 101
a=rtpmap:9 G722/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:4 G723/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:140
a=sendrecv

<--- Received SIP response (399 bytes) from UDP:178.13.17.134:5060 --->
SIP/2.0 100 Trying
Call-ID: c43c9025-33c6-4c9a-9fde-644e420592ce
Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;received=XXX.XXX.XXX.XXX;branch=z9hG4bKPjc975ecb7-1d86-46ed-9d6a-577307587dfb;rport=61005
To: <sip:[email protected]>
From: <sip:[email protected]>;tag=45e80f2f-a578-4da8-bb5a-6042288b69df
CSeq: 24324 INVITE
Date: Mon, 10 Jun 2024 20:16:31 GMT
Content-Length: 0


<--- Received SIP response (516 bytes) from UDP:178.13.17.134:5060 --->
SIP/2.0 500 Server Internal Error
Content-Length: 0
From: <sip:[email protected]>;tag=45e80f2f-a578-4da8-bb5a-6042288b69df
To: <sip:[email protected]>;tag=65d5cfe0-66675f1f1ad9f4b6-gm-po-lucentPCSF-140555
Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;received=XXX.XXX.XXX.XXX;branch=z9hG4bKPjc975ecb7-1d86-46ed-9d6a-577307587dfb;rport=61005
Call-ID: c43c9025-33c6-4c9a-9fde-644e420592ce
CSeq: 24324 INVITE
Reason: X.int;reasoncode=0x00000509;add-info=068C.0018.0001
Reason: Q.850;cause=47


<--- Transmitting SIP request (540 bytes) to UDP:178.13.17.134:5060 --->
ACK sip:sip.kabelfon.vodafone.de:5060 SIP/2.0
Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;rport;branch=z9hG4bKPjc975ecb7-1d86-46ed-9d6a-577307587dfb
From: <sip:[email protected]>;tag=45e80f2f-a578-4da8-bb5a-6042288b69df
To: <sip:[email protected]>;tag=65d5cfe0-66675f1f1ad9f4b6-gm-po-lucentPCSF-140555
Call-ID: c43c9025-33c6-4c9a-9fde-644e420592ce
CSeq: 24324 ACK
Route: <sip:[email protected]:5060>
Max-Forwards: 70
User-Agent: FPBX-16.0.40.7(20.8.1)
Content-Length:  0


<--- Transmitting SIP response (828 bytes) to UDP:192.168.178.30:59387 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 192.168.178.30:59387;rport=59387;received=192.168.178.30;branch=z9hG4bK-524287-1---0a1292bc73055409
Call-ID: Pc2H4L1UCUXl_6NKXJ0H5w..
From: <sip:[email protected]>;tag=573fa465
To: <sip:[email protected]>;tag=24d78fd9-dbcf-495d-a4dc-d3a68f74413a
CSeq: 2 INVITE
Server: FPBX-16.0.40.7(20.8.1)
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER, INFO, MESSAGE
Contact: <sip:192.168.178.66:5060>
Content-Type: application/sdp
Content-Length:   262

v=0
o=- 0 198306562 IN IP4 192.168.178.66
s=Asterisk
c=IN IP4 192.168.178.66
t=0 0
m=audio 15710 RTP/AVP 9 102 101
a=rtpmap:9 G722/8000
a=rtpmap:102 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:140
a=sendrecv

<--- Received SIP request (682 bytes) from UDP:192.168.178.30:59387 --->
CANCEL sip:[email protected];transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.178.30:59387;branch=z9hG4bK-524287-1---0a1292bc73055409;rport
Max-Forwards: 70
To: <sip:[email protected]>
From: <sip:[email protected];transport=UDP>;tag=573fa465
Call-ID: Pc2H4L1UCUXl_6NKXJ0H5w..
CSeq: 2 CANCEL
User-Agent: Z 5.6.4 v2.10.20.4_1
Authorization: Digest username="80",realm="asterisk",nonce="1718050591/0f860b8eb65b14b506e527a855162e88",uri="sip:[email protected];transport=UDP",response="3a460b11c880f19138618393f8c11b66",cnonce="c616489ee0b6930da085b46e073d7c9c",nc=00000002,qop=auth,algorithm=MD5,opaque="2fcef5764bfa3e9c"
Content-Length: 0


<--- Transmitting SIP response (365 bytes) to UDP:192.168.178.30:59387 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.178.30:59387;rport=59387;received=192.168.178.30;branch=z9hG4bK-524287-1---0a1292bc73055409
Call-ID: Pc2H4L1UCUXl_6NKXJ0H5w..
From: <sip:[email protected]>;tag=573fa465
To: <sip:[email protected]>;tag=24d78fd9-dbcf-495d-a4dc-d3a68f74413a
CSeq: 2 CANCEL
Server: FPBX-16.0.40.7(20.8.1)
Content-Length:  0


<--- Transmitting SIP response (498 bytes) to UDP:192.168.178.30:59387 --->
SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 192.168.178.30:59387;rport=59387;received=192.168.178.30;branch=z9hG4bK-524287-1---0a1292bc73055409
Call-ID: Pc2H4L1UCUXl_6NKXJ0H5w..
From: <sip:[email protected]>;tag=573fa465
To: <sip:[email protected]>;tag=24d78fd9-dbcf-495d-a4dc-d3a68f74413a
CSeq: 2 INVITE
Server: FPBX-16.0.40.7(20.8.1)
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER, INFO, MESSAGE
Content-Length:  0


<--- Received SIP request (376 bytes) from UDP:192.168.178.30:59387 --->
ACK sip:[email protected];transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.178.30:59387;branch=z9hG4bK-524287-1---0a1292bc73055409;rport
Max-Forwards: 70
To: <sip:[email protected]>;tag=24d78fd9-dbcf-495d-a4dc-d3a68f74413a
From: <sip:[email protected];transport=UDP>;tag=573fa465
Call-ID: Pc2H4L1UCUXl_6NKXJ0H5w..
CSeq: 2 ACK
Content-Length: 0


<--- Received SIP request (995 bytes) from UDP:192.168.178.30:59387 --->
REGISTER sip:192.168.178.66;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.178.30:59387;branch=z9hG4bK-524287-1---ce52e08fa1ab4962;rport
Max-Forwards: 70
Contact: <sip:[email protected]:59387;rinstance=a264f85b74d5e606;transport=UDP>
To: <sip:[email protected];transport=UDP>
From: <sip:[email protected];transport=UDP>;tag=218f7e0b
Call-ID: 9YKR1px23UcSi2AAqYQVwA..
CSeq: 2091 REGISTER
Expires: 60
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Supported: replaces, norefersub, extended-refer, timer, sec-agree, outbound, path, X-cisco-serviceuri
User-Agent: Z 5.6.4 v2.10.20.4_1
Authorization: Digest username="80",realm="asterisk",nonce="1718050554/8b4cf7be9d5538829d47059cd74df50b",uri="sip:192.168.178.66;transport=UDP",response="4cc8aae365cbce835c8a20f79907bcae",cnonce="5604e8ff4bdebc1571b463a3ddae5673",nc=00000002,qop=auth,algorithm=MD5,opaque="161e8b722af9ffec"
Allow-Events: presence, kpml, talk, as-feature-event
Content-Length: 0


<--- Transmitting SIP response (524 bytes) to UDP:192.168.178.30:59387 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.178.30:59387;rport=59387;received=192.168.178.30;branch=z9hG4bK-524287-1---ce52e08fa1ab4962
Call-ID: 9YKR1px23UcSi2AAqYQVwA..
From: <sip:[email protected]>;tag=218f7e0b
To: <sip:[email protected]>;tag=z9hG4bK-524287-1---ce52e08fa1ab4962
CSeq: 2091 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1718050607/59f8e7a3aad04cac0b1b0b54ca2109ba",opaque="44ef18205f53de39",stale=true,algorithm=MD5,qop="auth"
Server: FPBX-16.0.40.7(20.8.1)
Content-Length:  0


<--- Received SIP request (995 bytes) from UDP:192.168.178.30:59387 --->
REGISTER sip:192.168.178.66;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.178.30:59387;branch=z9hG4bK-524287-1---2283ad78095bdb94;rport
Max-Forwards: 70
Contact: <sip:[email protected]:59387;rinstance=a264f85b74d5e606;transport=UDP>
To: <sip:[email protected];transport=UDP>
From: <sip:[email protected];transport=UDP>;tag=218f7e0b
Call-ID: 9YKR1px23UcSi2AAqYQVwA..
CSeq: 2092 REGISTER
Expires: 60
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Supported: replaces, norefersub, extended-refer, timer, sec-agree, outbound, path, X-cisco-serviceuri
User-Agent: Z 5.6.4 v2.10.20.4_1
Authorization: Digest username="80",realm="asterisk",nonce="1718050607/59f8e7a3aad04cac0b1b0b54ca2109ba",uri="sip:192.168.178.66;transport=UDP",response="5860dc0692fe58faf02aab3a5aaa31a6",cnonce="67131f14ce028f737900448cf5d273cd",nc=00000001,qop=auth,algorithm=MD5,opaque="44ef18205f53de39"
Allow-Events: presence, kpml, talk, as-feature-event
Content-Length: 0


<--- Transmitting SIP response (485 bytes) to UDP:192.168.178.30:59387 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.178.30:59387;rport=59387;received=192.168.178.30;branch=z9hG4bK-524287-1---2283ad78095bdb94
Call-ID: 9YKR1px23UcSi2AAqYQVwA..
From: <sip:[email protected]>;tag=218f7e0b
To: <sip:[email protected]>;tag=z9hG4bK-524287-1---2283ad78095bdb94
CSeq: 2092 REGISTER
Date: Mon, 10 Jun 2024 20:16:47 GMT
Contact: <sip:[email protected]:59387;rinstance=a264f85b74d5e606>;expires=59
Expires: 60
Server: FPBX-16.0.40.7(20.8.1)
Content-Length:  0


<--- Transmitting SIP request (691 bytes) to UDP:192.168.178.30:59387 --->
NOTIFY sip:[email protected]:59387;rinstance=a264f85b74d5e606 SIP/2.0
Via: SIP/2.0/UDP 192.168.178.66:5060;rport;branch=z9hG4bKPjc7831529-43d8-4a77-b25a-2eb56dcca41f
From: <sip:[email protected]>;tag=79d8100e-bd54-4ffe-9a98-24431743b87b
To: <sip:[email protected];rinstance=a264f85b74d5e606>
Contact: <sip:[email protected]:5060>
Call-ID: a9303c14-c582-4888-a597-deb1b44eed42
CSeq: 34450 NOTIFY
Subscription-State: terminated
Event: message-summary
Allow-Events: message-summary, presence, dialog, refer
Max-Forwards: 70
User-Agent: FPBX-16.0.40.7(20.8.1)
Content-Type: application/simple-message-summary
Content-Length:    48

Messages-Waiting: no
Voice-Message: 0/0 (0/0)

<--- Received SIP response (418 bytes) from UDP:192.168.178.30:59387 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.178.66:5060;rport=5060;branch=z9hG4bKPjc7831529-43d8-4a77-b25a-2eb56dcca41f
Contact: <sip:192.168.178.30:59387>
To: <sip:[email protected];rinstance=a264f85b74d5e606>;tag=2d2e6a79
From: <sip:[email protected]>;tag=79d8100e-bd54-4ffe-9a98-24431743b87b
Call-ID: a9303c14-c582-4888-a597-deb1b44eed42
CSeq: 34450 NOTIFY
User-Agent: Z 5.6.4 v2.10.20.4_1
Content-Length: 0

I see a few anomalies that might explain why the call was rejected.

  1. Codecs. For the trunk, you apparently have g722, g726, g729 and g723 enabled. Please try with only alaw and ulaw enabled. For calls to mobiles that are VoLTE capable, it’s possible that Vodafone will transcode to g722, but (if they support wideband at all), they likely require your equipment to handle the native AMR-WB. In any case, calls to a landline will go alaw.

  2. The Route header. I assume that you have something like
    Outbound Proxy: sip:178.13.17.134\;lr
    Try changing it to
    Outbound Proxy: sip:178.13.17.134\;lr\;hide

  3. The Via header on the 500 reply shows rport=61005, which means that your router/firewall rewrote the source port number. If possible, try eliminating this by forwarding UDP port 5060 to the PBX, or by some option like “disable source port rewriting” (the exact name varies by firewall make).

  4. Number formats. Look at the INVITE they send for an incoming call and try to match the formats for the From and To headers. They might require an account number or username in the From header, rather than a phone number, especially if you are using registration. Also, look at their documentation to see whether other headers such as Diversion or P-Asserted-Identity are required.

In each of these changes, even if they don’t fix the problem, check whether you get a different, possibly more meaningful error message, which could be a clue as to what further change is required.

Sorry, I just realized that 192.168.178.x means you are likely using a FRITZ!Box, which I know nothing about, other than you may have to use it as a proxy, rather than sending to the provider directly.

Thanks again for your answer!

For 1 (Codecs):
I found the following in the SIP documentation (https://www.vodafone.de/media/downloads/pdf/IP-Anlagen-Anschluss-R5-Interface-Description.pdf, hope it is the correct one for my contract):
image
Thus, I added the codecs available from FreePBX to 2 places within FreePBX: The ‘Asterisk SIP Settings’ within the ‘settings’ menu and to the PJSIP settings in the endpoint.
Also, I set them within my sip client (softphone, zoiper):

Route header: Where do I specify that?
I only added the domain ‘sip.kabelfon.vodafone.de’ as sip server to the endpoint. Do I have to specify that anywhere else too?

Now to the rport thing:
My Firewall (OpnSense) is set to forward port 5060 directly to the FreePBX server (and as in your later answer, no, there’s no FritzBox in the network - there was, but is replaced by OpnSense. I was too lazy to change the network addresses lol). Static port mapping for outbound ports is activated, but seems like it still don’t work…

For the number format:
I just called from my smartphone to the endpoint.
The following headers are set for the INVITE:
From: sip:[email protected];user=phone;tag=65d5cfe0-66687313158bc89d-gm-pt-lucentPCSF-098607
To: sip:[email protected];user=phone
Where do I have to ensure to put those formats? In the dial patterns of the outbound route?

Wow, that document is 34 pages but yet it’s pretty vague. I suspect that they don’t support HD (wideband) audio to/from VoLTE mobiles, because G.722, the only wideband codec, is way down on the list. In the PJSIP settings for the trunk, please enable only alaw, ulaw and g722, in that order.

Regarding the source port rewrite, the Via header from Vodafone:
Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;received=XXX.XXX.XXX.XXX;branch=z9hG4bKPjc975ecb7-1d86-46ed-9d6a-577307587dfb;rport=61005
means that whatever is responding to your INVITE received it from the IP address in the received= tag, on the port in the rport= tag. While it’s conceivable that this is false or occurred elsewhere, OPNsense does rewrite source ports by default so that’s what I suspect happened. You can confirm this by capturing traffic on the firewall’s WAN interface. In any case, I believe that the hybrid outbound NAT recommended in
Configuring NAT for a VoIP PBX | pfSense Documentation will eliminate the rewrite.

OK, but that domain resolves to 88.134.209.241 from here in Paris. I suppose it’s possible that your DNS resolves it differenty, but based on

and other search results, I thought that you have an Outbound Proxy setting for your trunk to 178.13.17.134 . If not, how do you believe that address is found? If you do have Outbound Proxy, try adding the \;hide to eliminate the route header.

Regarding formats, they seem to allow both national and E.164, so that’s unlikely the problem.

If you still have trouble, post a compete incoming INVITE (including SDP) and we’ll try to match Outgoing. Or, if you have something else that is successfully making outbound calls via your account (other PBX, softphone, etc.) post the settings you are using there.

Hi and thanks for waiting!
You were right, the port was rewritten.
Now, I reconfigured the firewall and I got the same symptoms on my sip client, but other messages in the log!
Here you go:

<--- Received SIP request (1076 bytes) from UDP:192.168.178.30:52759 --->
INVITE sip:[email protected];transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.178.30:52759;branch=z9hG4bK-524287-1---b5cf639baf0780c1;rport
Max-Forwards: 70
Contact: <sip:[email protected]:52759;transport=UDP>
To: <sip:[email protected]>
From: <sip:[email protected];transport=UDP>;tag=b76c1317
Call-ID: FzsYBZHD5CsBRYH1gcp0Ag..
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
Supported: replaces, norefersub, extended-refer, timer, sec-agree, outbound, path, X-cisco-serviceuri
User-Agent: Z 5.6.4 v2.10.20.4_1
Allow-Events: presence, kpml, talk, as-feature-event
Content-Length: 374

v=0
o=Z 0 9722160 IN IP4 192.168.178.30
s=Z
c=IN IP4 192.168.178.30
t=0 0
m=audio 37297 RTP/AVP 9 8 102 106 101 98 0 3
a=rtpmap:102 G726-32/8000
a=rtpmap:106 opus/48000/2
a=fmtp:106 sprop-maxcapturerate=16000; minptime=20; useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:98 telephone-event/48000
a=fmtp:98 0-16
a=sendrecv
a=rtcp-mux

<--- Transmitting SIP response (520 bytes) to UDP:192.168.178.30:52759 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.178.30:52759;rport=52759;received=192.168.178.30;branch=z9hG4bK-524287-1---b5cf639baf0780c1
Call-ID: FzsYBZHD5CsBRYH1gcp0Ag..
From: <sip:[email protected]>;tag=b76c1317
To: <sip:[email protected]>;tag=z9hG4bK-524287-1---b5cf639baf0780c1
CSeq: 1 INVITE
WWW-Authenticate: Digest realm="asterisk",nonce="1718650756/285fdf0b394473adc423cdb0b6285e26",opaque="3945113717de4b01",algorithm=MD5,qop="auth"
Server: FPBX-16.0.40.7(20.8.1)
Content-Length:  0


<--- Received SIP request (375 bytes) from UDP:192.168.178.30:52759 --->
ACK sip:[email protected];transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.178.30:52759;branch=z9hG4bK-524287-1---b5cf639baf0780c1;rport
Max-Forwards: 70
To: <sip:[email protected]>;tag=z9hG4bK-524287-1---b5cf639baf0780c1
From: <sip:[email protected];transport=UDP>;tag=b76c1317
Call-ID: FzsYBZHD5CsBRYH1gcp0Ag..
CSeq: 1 ACK
Content-Length: 0


<--- Received SIP request (1383 bytes) from UDP:192.168.178.30:52759 --->
INVITE sip:[email protected];transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.178.30:52759;branch=z9hG4bK-524287-1---d7822a2c6414a39c;rport
Max-Forwards: 70
Contact: <sip:[email protected]:52759;transport=UDP>
To: <sip:[email protected]>
From: <sip:[email protected];transport=UDP>;tag=b76c1317
Call-ID: FzsYBZHD5CsBRYH1gcp0Ag..
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
Supported: replaces, norefersub, extended-refer, timer, sec-agree, outbound, path, X-cisco-serviceuri
User-Agent: Z 5.6.4 v2.10.20.4_1
Authorization: Digest username="80",realm="asterisk",nonce="1718650756/285fdf0b394473adc423cdb0b6285e26",uri="sip:[email protected];transport=UDP",response="9ba8922e8ffbf5a21d41004c64d66206",cnonce="a688fdc8c3fd1768d706adf4e71d2910",nc=00000001,qop=auth,algorithm=MD5,opaque="3945113717de4b01"
Allow-Events: presence, kpml, talk, as-feature-event
Content-Length: 374

v=0
o=Z 0 9722160 IN IP4 192.168.178.30
s=Z
c=IN IP4 192.168.178.30
t=0 0
m=audio 37297 RTP/AVP 9 8 102 106 101 98 0 3
a=rtpmap:102 G726-32/8000
a=rtpmap:106 opus/48000/2
a=fmtp:106 sprop-maxcapturerate=16000; minptime=20; useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:98 telephone-event/48000
a=fmtp:98 0-16
a=sendrecv
a=rtcp-mux

<--- Transmitting SIP response (328 bytes) to UDP:192.168.178.30:52759 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.178.30:52759;rport=52759;received=192.168.178.30;branch=z9hG4bK-524287-1---d7822a2c6414a39c
Call-ID: FzsYBZHD5CsBRYH1gcp0Ag..
From: <sip:[email protected]>;tag=b76c1317
To: <sip:[email protected]>
CSeq: 2 INVITE
Server: FPBX-16.0.40.7(20.8.1)
Content-Length:  0


[Jun 17 20:59:16] ERROR[285129]: res_pjsip_header_funcs.c:723 remove_header: No headers had been previously added to this session.
<--- Transmitting SIP response (523 bytes) to UDP:192.168.178.30:52759 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.178.30:52759;rport=52759;received=192.168.178.30;branch=z9hG4bK-524287-1---d7822a2c6414a39c
Call-ID: FzsYBZHD5CsBRYH1gcp0Ag..
From: <sip:[email protected]>;tag=b76c1317
To: <sip:[email protected]>;tag=0750a262-83ec-4692-87fa-6d073653b287
CSeq: 2 INVITE
Server: FPBX-16.0.40.7(20.8.1)
Contact: <sip:192.168.178.66:5060>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER, INFO, MESSAGE
Content-Length:  0


<--- Transmitting SIP request (1079 bytes) to UDP:178.13.17.134:5060 --->
INVITE sip:sip.kabelfon.vodafone.de:5060 SIP/2.0
Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;rport;branch=z9hG4bKPj35e05536-0207-4fd7-a8b7-d80557cf8895
From: <sip:[email protected]>;tag=4ce83467-aa36-4de9-b0fd-036135357b3d
To: <sip:[email protected]>
Contact: <sip:[email protected]:5060>
Call-ID: d20ec945-6df0-4cba-88ec-641713cc6296
CSeq: 9216 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER, INFO, MESSAGE
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Route: <sip:[email protected]:5060>
Max-Forwards: 70
User-Agent: FPBX-16.0.40.7(20.8.1)
Content-Type: application/sdp
Content-Length:   289

v=0
o=- 624591781 624591781 IN IP4 XXX.XXX.XXX.XXX
s=Asterisk
c=IN IP4 XXX.XXX.XXX.XXX
t=0 0
m=audio 12244 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:140
a=sendrecv

<--- Received SIP response (403 bytes) from UDP:178.13.17.134:5060 --->
SIP/2.0 100 Trying
Call-ID: d20ec945-6df0-4cba-88ec-641713cc6296
Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;received=XXX.XXX.XXX.XXX;branch=z9hG4bKPj35e05536-0207-4fd7-a8b7-d80557cf8895;rport=5060
To: <sip:[email protected]>
From: <sip:[email protected]>;tag=4ce83467-aa36-4de9-b0fd-036135357b3d
CSeq: 9216 INVITE
Date: Mon, 17 Jun 2024 18:59:16 GMT
Content-Length: 0


<--- Received SIP response (539 bytes) from UDP:178.13.17.134:5060 --->
SIP/2.0 407 Proxy Authentication Required
Call-ID: d20ec945-6df0-4cba-88ec-641713cc6296
Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;received=XXX.XXX.XXX.XXX;branch=z9hG4bKPj35e05536-0207-4fd7-a8b7-d80557cf8895;rport=5060
To: <sip:[email protected]>;tag=65d5cfac-667087842d74b137
From: <sip:[email protected]>;tag=4ce83467-aa36-4de9-b0fd-036135357b3d
CSeq: 9216 INVITE
Date: Mon, 17 Jun 2024 18:59:16 GMT
Warning: 399 sbc.fixed.vodafone.de "IP association no match, user not registered"
Content-Length: 0


<--- Transmitting SIP request (518 bytes) to UDP:178.13.17.134:5060 --->
ACK sip:sip.kabelfon.vodafone.de:5060 SIP/2.0
Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;rport;branch=z9hG4bKPj35e05536-0207-4fd7-a8b7-d80557cf8895
From: <sip:[email protected]>;tag=4ce83467-aa36-4de9-b0fd-036135357b3d
To: <sip:[email protected]>;tag=65d5cfac-667087842d74b137
Call-ID: d20ec945-6df0-4cba-88ec-641713cc6296
CSeq: 9216 ACK
Route: <sip:[email protected]:5060>
Max-Forwards: 70
User-Agent: FPBX-16.0.40.7(20.8.1)
Content-Length:  0


[Jun 17 20:59:16] WARNING[285129]: res_pjsip_outbound_authenticator_digest.c:507 digest_create_request_with_auth: Endpoint: 'Vodafone_Anschluss_1': No auth objects matching realm(s) '' from challenge found.
<--- Transmitting SIP response (826 bytes) to UDP:192.168.178.30:52759 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 192.168.178.30:52759;rport=52759;received=192.168.178.30;branch=z9hG4bK-524287-1---d7822a2c6414a39c
Call-ID: FzsYBZHD5CsBRYH1gcp0Ag..
From: <sip:[email protected]>;tag=b76c1317
To: <sip:[email protected]>;tag=0750a262-83ec-4692-87fa-6d073653b287
CSeq: 2 INVITE
Server: FPBX-16.0.40.7(20.8.1)
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER, INFO, MESSAGE
Contact: <sip:192.168.178.66:5060>
Content-Type: application/sdp
Content-Length:   260

v=0
o=- 0 9722162 IN IP4 192.168.178.66
s=Asterisk
c=IN IP4 192.168.178.66
t=0 0
m=audio 15510 RTP/AVP 9 102 101
a=rtpmap:9 G722/8000
a=rtpmap:102 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:140
a=sendrecv

Can you read anything interesting outta there?
Thanks in advance!

You received a malformed 407 response. I’d guess it saying I don’t know who you are. Possibly it is because of the, apparently redundant Route header, which will be the result of specifying an unneeded outbound proxy. It also looks like you specified the proxy in legacy mode, as the user part of the request URI is missing.

You shouldn’t need an outbound proxy if the domain name is the same as that in the request URI, and these days most require loose routing (\;lr), and many require the Route header suppressing (\;hide)

Great, fully removing the outbound proxy works well!
Thank all of you very much!

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