Problem with outgoing calls "TO field and the Request-URI are incorrectly"

TO field and the Request-URI are incorrectly
Request-Line: INVITE sip: +77123456789%405.63.114.58@provider_IP SIP / 2.0
To: sip: +77123456789%405.63.114.58@provider_IP
Should be + 77123456789 @provider_IP

Update
It’s an old address. 5.63.114.58, without “% 40”
I think this is a bug
How can correct this?

trunk connectoin:
Freepbx
trunk
Outgoing

type=peer
qualify=60000
host=195.111.11.119
disallow=all
allow=alaw&g729

and i added
useragent=igroup

update

I have two iface eth0 192.168.1.113, eth1 5.36.214.85
route route provider_ip via 5.36.214.86

You need to show a full call debug to see what is happening. On top of that, your SIP trunk has some pretty bare settings.

freepbx*CLI> sip set debug peer 101
SIP Debugging Enabled for IP: 192.168.1.51

<— SIP read from UDP:192.168.1.51:5060 —>
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.51:5060;branch=z9hG4bK004eaf017dbce811873da91cf6d3c9ca;rport
From: “PhonerLite” sip:[email protected];tag=3295294731
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 34 INVITE
Contact: sip:[email protected]:5060;gr=80AA0C04-73BC-E811-871B-A91CF6D3C9CA
Content-Type: application/sdp
Mime-Version: 1.0
Allow: INVITE, ACK, BYE, CANCEL, INFO, MESSAGE, NOTIFY, OPTIONS, REFER, UPDATE, PRACK
Max-Forwards: 70
P-Early-Media: supported
User-Agent: SIPPER for PhonerLite
Session-Expires: 1800
Supported: 100rel, replaces, from-change, gruu, timer
P-Preferred-Identity: sip:[email protected]
Content-Length: 547

v=0
o=- 3212249612 1 IN IP4 192.168.1.51
s=SIPPER for PhonerLite
c=IN IP4 192.168.1.51
t=0 0
m=audio 5062 RTP/AVP 107 8 0 2 3 97 110 111 9 18 11 118 101
a=rtpmap:107 opus/48000/2
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:3 GSM/8000
a=rtpmap:97 iLBC/8000
a=rtpmap:110 speex/8000
a=rtpmap:111 speex/16000
a=rtpmap:9 G722/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=yes
a=rtpmap:11 L16/44100
a=rtpmap:118 L16/16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ssrc:1793720816
a=sendrecv
<------------->
— (17 headers 23 lines) —
Sending to 192.168.1.51:5060 (NAT)
Sending to 192.168.1.51:5060 (NAT)
Using INVITE request as basis request - [email protected]
Found peer ‘101’ for ‘101’ from 192.168.1.51:5060

<— Reliably Transmitting (no NAT) to 192.168.1.51:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.51:5060;branch=z9hG4bK004eaf017dbce811873da91cf6d3c9ca;received=192.168.1.51;rport=5060
From: “PhonerLite” sip:[email protected];tag=3295294731
To: sip:[email protected];tag=as7e4945d3
Call-ID: [email protected]
CSeq: 34 INVITE
Server: DibaGroup
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce=“5b19d08c”
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘[email protected]’ in 6400 ms (Method: INVITE)

<— SIP read from UDP:192.168.1.51:5060 —>
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.51:5060;branch=z9hG4bK004eaf017dbce811873da91cf6d3c9ca;rport
From: “PhonerLite” sip:[email protected];tag=3295294731
To: sip:[email protected];tag=as7e4945d3
Call-ID: [email protected]
CSeq: 34 ACK
Content-Length: 0

<------------->
— (7 headers 0 lines) —

<— SIP read from UDP:192.168.1.51:5060 —>
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.51:5060;branch=z9hG4bK004eaf017dbce811873ea91cf6d3c9ca;rport
From: “PhonerLite” sip:[email protected];tag=3295294731
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 35 INVITE
Contact: sip:[email protected]:5060;gr=80AA0C04-73BC-E811-871B-A91CF6D3C9CA
Authorization: Digest username=“101”, realm=“asterisk”, nonce=“5b19d08c”, uri="sip:[email protected]", response=“cd58ee3f1d6a6681f01be06025b8cd70”, algorithm=MD5
Content-Type: application/sdp
Mime-Version: 1.0
Allow: INVITE, ACK, BYE, CANCEL, INFO, MESSAGE, NOTIFY, OPTIONS, REFER, UPDATE, PRACK
Max-Forwards: 70
P-Early-Media: supported
User-Agent: SIPPER for PhonerLite
Session-Expires: 1800
Supported: 100rel, replaces, from-change, gruu, timer
P-Preferred-Identity: sip:[email protected]
Content-Length: 547

v=0
o=- 3212249612 1 IN IP4 192.168.1.51
s=SIPPER for PhonerLite
c=IN IP4 192.168.1.51
t=0 0
m=audio 5062 RTP/AVP 107 8 0 2 3 97 110 111 9 18 11 118 101
a=rtpmap:107 opus/48000/2
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:3 GSM/8000
a=rtpmap:97 iLBC/8000
a=rtpmap:110 speex/8000
a=rtpmap:111 speex/16000
a=rtpmap:9 G722/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=yes
a=rtpmap:11 L16/44100
a=rtpmap:118 L16/16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ssrc:1793720816
a=sendrecv
<------------->
— (18 headers 23 lines) —
Sending to 192.168.1.51:5060 (no NAT)
Using INVITE request as basis request - [email protected]
Found peer ‘101’ for ‘101’ from 192.168.1.51:5060
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Found RTP audio format 107
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 2
Found RTP audio format 3
Found RTP audio format 97
Found RTP audio format 110
Found RTP audio format 111
Found RTP audio format 9
Found RTP audio format 18
Found RTP audio format 11
Found RTP audio format 118
Found RTP audio format 101
Found audio description format opus for ID 107
Found audio description format PCMA for ID 8
Found audio description format PCMU for ID 0
Found audio description format G726-32 for ID 2
Found audio description format GSM for ID 3
Found audio description format iLBC for ID 97
Found audio description format speex for ID 110
Found audio description format speex for ID 111
Found audio description format G722 for ID 9
Found audio description format G729 for ID 18
Found unknown media description format L16 for ID 11
Found audio description format L16 for ID 118
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw|gsm|g726|g722), peer - audio=(ulaw|gsm|alaw|g722|g729|ilbc|opus|speex|speex16|slin16)/video=(nothing)/text=(nothing), combined - (ulaw|alaw|gsm|g722)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
> 0x7fe43c082710 – Strict RTP learning after remote address set to: 192.168.1.51:5062
Peer audio RTP is at port 192.168.1.51:5062
Looking for +77123456789 in from-internal (domain 192.168.1.113)
sip_route_dump: route/path hop: sip:[email protected]:5060;gr=80AA0C04-73BC-E811-871B-A91CF6D3C9CA

<— Transmitting (no NAT) to 192.168.1.51:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.51:5060;branch=z9hG4bK004eaf017dbce811873ea91cf6d3c9ca;received=192.168.1.51;rport=5060
From: “PhonerLite” sip:[email protected];tag=3295294731
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 35 INVITE
Server: DibaGroup
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: sip:[email protected]:5060
Content-Length: 0

<------------>
– Executing [+77123456789@from-internal:1] Macro(“SIP/101-000006ad”, “user-callerid,LIMIT,EXTERNAL,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/101-000006ad”, “TOUCH_MONITOR=1537583368.4787”) in new stack
– Executing [s@macro-user-callerid:2] Set(“SIP/101-000006ad”, “AMPUSER=101”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“SIP/101-000006ad”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“SIP/101-000006ad”, “1?Set(REALCALLERIDNUM=101)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/101-000006ad”, “AMPUSER=101”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“SIP/101-000006ad”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:7] Set(“SIP/101-000006ad”, “AMPUSERCIDNAME=101”) in new stack
– Executing [s@macro-user-callerid:8] ExecIf(“SIP/101-000006ad”, “0?Set(__CIDMASQUERADING=TRUE)”) in new stack
– Executing [s@macro-user-callerid:9] GotoIf(“SIP/101-000006ad”, “0?report”) in new stack
– Executing [s@macro-user-callerid:10] Set(“SIP/101-000006ad”, “AMPUSERCID=101”) in new stack
– Executing [s@macro-user-callerid:11] Set(“SIP/101-000006ad”, “__DIAL_OPTIONS=HhTtr”) in new stack
– Executing [s@macro-user-callerid:12] Set(“SIP/101-000006ad”, “CALLERID(all)=“101” <101>”) in new stack
– Executing [s@macro-user-callerid:13] GotoIf(“SIP/101-000006ad”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:14] ExecIf(“SIP/101-000006ad”, “1?Set(GROUP(concurrency_limit)=101)”) in new stack
– Executing [s@macro-user-callerid:15] ExecIf(“SIP/101-000006ad”, “0?Set(CHANNEL(language)=)”) in new stack
– Executing [s@macro-user-callerid:16] NoOp(“SIP/101-000006ad”, “Macro Depth is 1”) in new stack
– Executing [s@macro-user-callerid:17] GotoIf(“SIP/101-000006ad”, “1?report2:macroerror”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [s@macro-user-callerid:19] GotoIf(“SIP/101-000006ad”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,37)
– Executing [s@macro-user-callerid:37] Set(“SIP/101-000006ad”, “CALLERID(number)=101”) in new stack
– Executing [s@macro-user-callerid:38] Set(“SIP/101-000006ad”, “CALLERID(name)=101”) in new stack
– Executing [s@macro-user-callerid:39] GotoIf(“SIP/101-000006ad”, “0?cnum”) in new stack
– Executing [s@macro-user-callerid:40] Set(“SIP/101-000006ad”, “CDR(cnam)=101”) in new stack
– Executing [s@macro-user-callerid:41] Set(“SIP/101-000006ad”, “CDR(cnum)=101”) in new stack
– Executing [s@macro-user-callerid:42] Set(“SIP/101-000006ad”, “CHANNEL(language)=ru”) in new stack
– Executing [+77123456789@from-internal:2] Gosub(“SIP/101-000006ad”, “sub-record-check,s,1(out,+77123456789,dontcare)”) in new stack
– Executing [s@sub-record-check:1] GotoIf(“SIP/101-000006ad”, “0?initialized”) in new stack
– Executing [s@sub-record-check:2] Set(“SIP/101-000006ad”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:3] Set(“SIP/101-000006ad”, “NOW=1537583368”) in new stack
– Executing [s@sub-record-check:4] Set(“SIP/101-000006ad”, “__DAY=22”) in new stack
– Executing [s@sub-record-check:5] Set(“SIP/101-000006ad”, “__MONTH=09”) in new stack
– Executing [s@sub-record-check:6] Set(“SIP/101-000006ad”, “__YEAR=2018”) in new stack
– Executing [s@sub-record-check:7] Set(“SIP/101-000006ad”, “__TIMESTR=20180922-022928”) in new stack
– Executing [s@sub-record-check:8] Set(“SIP/101-000006ad”, “__FROMEXTEN=101”) in new stack
– Executing [s@sub-record-check:9] Set(“SIP/101-000006ad”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:10] NoOp(“SIP/101-000006ad”, “Recordings initialized”) in new stack
– Executing [s@sub-record-check:11] ExecIf(“SIP/101-000006ad”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [s@sub-record-check:12] Set(“SIP/101-000006ad”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [s@sub-record-check:13] ExecIf(“SIP/101-000006ad”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [s@sub-record-check:14] GotoIf(“SIP/101-000006ad”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [s@sub-record-check:17] GotoIf(“SIP/101-000006ad”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] NoOp(“SIP/101-000006ad”, “Outbound Recording Check from 101 to +77123456789”) in new stack
– Executing [out@sub-record-check:2] Set(“SIP/101-000006ad”, “RECMODE=dontcare”) in new stack
– Executing [out@sub-record-check:3] ExecIf(“SIP/101-000006ad”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [out@sub-record-check:7] Gosub(“SIP/101-000006ad”, “recordcheck,1(dontcare,out,+77123456789)”) in new stack
– Executing [recordcheck@sub-record-check:1] NoOp(“SIP/101-000006ad”, “Starting recording check against dontcare”) in new stack
– Executing [recordcheck@sub-record-check:2] Goto(“SIP/101-000006ad”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [recordcheck@sub-record-check:3] Return(“SIP/101-000006ad”, “”) in new stack
– Executing [out@sub-record-check:8] Return(“SIP/101-000006ad”, “”) in new stack
– Executing [+77123456789@from-internal:3] ExecIf(“SIP/101-000006ad”, “0 ?Set(CDR(accountcode)=)”) in new stack
– Executing [+77123456789@from-internal:4] Set(“SIP/101-000006ad”, “MOHCLASS=default”) in new stack
– Executing [+77123456789@from-internal:5] Set(“SIP/101-000006ad”, “_NODEST=”) in new stack
– Executing [+77123456789@from-internal:6] Macro(“SIP/101-000006ad”, “dialout-trunk,1,+77123456789,off”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“SIP/101-000006ad”, “DIAL_TRUNK=1”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/101-000006ad”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:3] ExecIf(“SIP/101-000006ad”, “0?Set(CALLERID(num)=101)”) in new stack
– Executing [s@macro-dialout-trunk:4] GotoIf(“SIP/101-000006ad”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“SIP/101-000006ad”, “DIAL_NUMBER=+77123456789”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“SIP/101-000006ad”, “DIAL_TRUNK_OPTIONS=HhTtr”) in new stack
– Executing [s@macro-dialout-trunk:7] Set(“SIP/101-000006ad”, “OUTBOUND_GROUP=OUT_1”) in new stack
– Executing [s@macro-dialout-trunk:8] Set(“SIP/101-000006ad”, “DIAL_TRUNK_OPTIONS=T”) in new stack
– Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/101-000006ad”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,11)
– Executing [s@macro-dialout-trunk:11] GotoIf(“SIP/101-000006ad”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:12] Macro(“SIP/101-000006ad”, “outbound-callerid,1”) in new stack
– Executing [s@macro-outbound-callerid:1] NoOp(“SIP/101-000006ad”, “101”) in new stack
– Executing [s@macro-outbound-callerid:2] NoOp(“SIP/101-000006ad”, “”) in new stack
– Executing [s@macro-outbound-callerid:3] NoOp(“SIP/101-000006ad”, “on”) in new stack
– Executing [s@macro-outbound-callerid:4] ExecIf(“SIP/101-000006ad”, “0?Set(CALLERPRES(name-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:5] ExecIf(“SIP/101-000006ad”, “0?Set(CALLERPRES(num-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:6] ExecIf(“SIP/101-000006ad”, “0?Set(REALCALLERIDNUM=101)”) in new stack
– Executing [s@macro-outbound-callerid:7] GotoIf(“SIP/101-000006ad”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,11)
– Executing [s@macro-outbound-callerid:11] Set(“SIP/101-000006ad”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:12] Set(“SIP/101-000006ad”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:13] Set(“SIP/101-000006ad”, “TRUNKOUTCID=+77780468886”) in new stack
– Executing [s@macro-outbound-callerid:14] GotoIf(“SIP/101-000006ad”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,19)
– Executing [s@macro-outbound-callerid:19] ExecIf(“SIP/101-000006ad”, “1?Set(CALLERID(all)=+77780468886)”) in new stack
– Executing [s@macro-outbound-callerid:20] ExecIf(“SIP/101-000006ad”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:21] ExecIf(“SIP/101-000006ad”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:22] ExecIf(“SIP/101-000006ad”, “0?Set(CALLERPRES(name-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:23] ExecIf(“SIP/101-000006ad”, “0?Set(CALLERPRES(num-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:24] Set(“SIP/101-000006ad”, “CDR(outbound_cnum)=+77780468886”) in new stack
– Executing [s@macro-outbound-callerid:25] Set(“SIP/101-000006ad”, “CDR(outbound_cnam)=”) in new stack
– Executing [s@macro-dialout-trunk:13] GosubIf(“SIP/101-000006ad”, “0?sub-flp-1,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“SIP/101-000006ad”, “OUTNUM=+77123456789”) in new stack
– Executing [s@macro-dialout-trunk:15] Set(“SIP/101-000006ad”, “custom=SIP/out”) in new stack
– Executing [s@macro-dialout-trunk:16] ExecIf(“SIP/101-000006ad”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)”) in new stack
– Executing [s@macro-dialout-trunk:17] ExecIf(“SIP/101-000006ad”, “0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))”) in new stack
– Executing [s@macro-dialout-trunk:18] Macro(“SIP/101-000006ad”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/101-000006ad”, “”) in new stack
– Executing [s@macro-dialout-trunk:19] GotoIf(“SIP/101-000006ad”, “0?skipcrm”) in new stack
– Executing [s@macro-dialout-trunk:20] Set(“SIP/101-000006ad”, “__CRM_DIRECTION=OUTBOUND”) in new stack
– Executing [s@macro-dialout-trunk:21] Set(“SIP/101-000006ad”, “__CRM_DESTINATION=+77123456789”) in new stack
– Executing [s@macro-dialout-trunk:22] Set(“SIP/101-000006ad”, “__CRM_SOURCE=101”) in new stack
– Executing [s@macro-dialout-trunk:23] AGI(“SIP/101-000006ad”, “sangomacrm.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
– <SIP/101-000006ad>AGI Script sangomacrm.agi completed, returning 0
– Executing [s@macro-dialout-trunk:24] Set(“SIP/101-000006ad”, “CHANNEL(hangup_handler_push)=crm-hangup,s,1”) in new stack
– Executing [s@macro-dialout-trunk:25] NoOp(“SIP/101-000006ad”, “CRM Finished”) in new stack
– Executing [s@macro-dialout-trunk:26] GotoIf(“SIP/101-000006ad”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:27] ExecIf(“SIP/101-000006ad”, “1?Set(CONNECTEDLINE(num,i)=+77123456789)”) in new stack
– Executing [s@macro-dialout-trunk:28] ExecIf(“SIP/101-000006ad”, “1?Set(CONNECTEDLINE(name,i)=CID:+77780468886)”) in new stack
– Executing [s@macro-dialout-trunk:29] ExecIf(“SIP/101-000006ad”, “0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)+77780468886)”) in new stack
– Executing [s@macro-dialout-trunk:30] GotoIf(“SIP/101-000006ad”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:31] Dial(“SIP/101-000006ad”, “SIP/out/[email protected],300,T”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/out/[email protected]
[2018-09-22 02:29:29] WARNING[11388][C-00000191]: chan_sip.c:24071 handle_response_invite: Received response: “Forbidden” from ‘sip:[email protected];tag=as44586efc’
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [s@macro-dialout-trunk:32] NoOp(“SIP/101-000006ad”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 21”) in new stack
– Executing [s@macro-dialout-trunk:33] GotoIf(“SIP/101-000006ad”, “0?continue,1:s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set(“SIP/101-000006ad”, “RC=21”) in new stack
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto(“SIP/101-000006ad”, “21,1”) in new stack
– Goto (macro-dialout-trunk,21,1)
– Executing [21@macro-dialout-trunk:1] Goto(“SIP/101-000006ad”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [continue@macro-dialout-trunk:1] NoOp(“SIP/101-000006ad”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 21 - failing through to other trunks”) in new stack
– Executing [continue@macro-dialout-trunk:2] ExecIf(“SIP/101-000006ad”, “1?Set(CALLERID(number)=101)”) in new stack
– Executing [+77123456789@from-internal:7] Macro(“SIP/101-000006ad”, “outisbusy,”) in new stack
– Executing [s@macro-outisbusy:1] Progress(“SIP/101-000006ad”, “”) in new stack
Audio is at 13556
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding codec g722 to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<— Transmitting (no NAT) to 192.168.1.51:5060 —>
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 192.168.1.51:5060;branch=z9hG4bK004eaf017dbce811873ea91cf6d3c9ca;received=192.168.1.51;rport=5060
From: “PhonerLite” sip:[email protected];tag=3295294731
To: sip:[email protected];tag=as549bde35
Call-ID: [email protected]
CSeq: 35 INVITE
Server: DibaGroup
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: sip:[email protected]:5060
Content-Type: application/sdp
Require: timer
Content-Length: 322

v=0
o=root 734336070 734336070 IN IP4 192.168.1.113
s=Asterisk PBX 14.7.4
c=IN IP4 192.168.1.113
t=0 0
m=audio 13556 RTP/AVP 0 8 3 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<------------>
– Executing [s@macro-outisbusy:2] GotoIf(“SIP/101-000006ad”, “0?emergency,1”) in new stack
– Executing [s@macro-outisbusy:3] GotoIf(“SIP/101-000006ad”, “0?intracompany,1”) in new stack
– Executing [s@macro-outisbusy:4] Playback(“SIP/101-000006ad”, “all-circuits-busy-now&please-try-call-later, noanswer”) in new stack
– <SIP/101-000006ad> Playing ‘all-circuits-busy-now.ulaw’ (language ‘ru’)
> 0x7fe43c082710 – Strict RTP switching to RTP target address 192.168.1.51:5062 as source
> 0x7fe43c082710 – Strict RTP learning complete - Locking on source address 192.168.1.51:5062
– <SIP/101-000006ad> Playing ‘please-try-call-later.ulaw’ (language ‘ru’)
– Executing [s@macro-outisbusy:5] Congestion(“SIP/101-000006ad”, “20”) in new stack

<— Reliably Transmitting (no NAT) to 192.168.1.51:5060 —>
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP 192.168.1.51:5060;branch=z9hG4bK004eaf017dbce811873ea91cf6d3c9ca;received=192.168.1.51;rport=5060
From: “PhonerLite” sip:[email protected];tag=3295294731
To: sip:[email protected];tag=as549bde35
Call-ID: [email protected]
CSeq: 35 INVITE
Server: DibaGroup
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
X-Asterisk-HangupCause: Call Rejected
X-Asterisk-HangupCauseCode: 21
Content-Length: 0

<------------>
[2018-09-22 02:29:33] WARNING[23041][C-00000191]: channel.c:5005 ast_prod: Prodding channel ‘SIP/101-000006ad’ failed
== Spawn extension (macro-outisbusy, s, 5) exited non-zero on ‘SIP/101-000006ad’ in macro ‘outisbusy’
== Spawn extension (from-internal, +77123456789, 7) exited non-zero on ‘SIP/101-000006ad’
– Executing [h@from-internal:1] Macro(“SIP/101-000006ad”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/101-000006ad”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] ExecIf(“SIP/101-000006ad”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [s@macro-hangupcall:4] NoOp(“SIP/101-000006ad”, " monior file= ") in new stack
– Executing [s@macro-hangupcall:5] AGI(“SIP/101-000006ad”, “attendedtransfer-rec-restart.php,”) in new stack

<— SIP read from UDP:192.168.1.51:5060 —>
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.51:5060;branch=z9hG4bK004eaf017dbce811873ea91cf6d3c9ca;rport
From: “PhonerLite” sip:[email protected];tag=3295294731
To: sip:[email protected];tag=as549bde35
Call-ID: [email protected]
CSeq: 35 ACK
Authorization: Digest username=“101”, realm=“asterisk”, nonce=“5b19d08c”, uri="sip:[email protected]", response=“cd58ee3f1d6a6681f01be06025b8cd70”, algorithm=MD5
Content-Length: 0

<------------->
— (8 headers 0 lines) —
– Launched AGI Script /var/lib/asterisk/agi-bin/attendedtransfer-rec-restart.php
– <SIP/101-000006ad>AGI Script attendedtransfer-rec-restart.php completed, returning 0
– Executing [s@macro-hangupcall:6] Hangup(“SIP/101-000006ad”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 6) exited non-zero on ‘SIP/101-000006ad’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/101-000006ad’
– SIP/101-000006ad Internal Gosub(crm-hangup,s,1) start
– Executing [s@crm-hangup:1] NoOp(“SIP/101-000006ad”, “Sending Hangup to CRM”) in new stack
– Executing [s@crm-hangup:2] NoOp(“SIP/101-000006ad”, “HANGUP CAUSE: 34”) in new stack
– Executing [s@crm-hangup:3] ExecIf(“SIP/101-000006ad”, “0?Set(__CRM_VOICEMAIL=)”) in new stack
– Executing [s@crm-hangup:4] NoOp(“SIP/101-000006ad”, “MASTER CHANNEL: 1537583368.4787 = 1537583368.4787”) in new stack
– Executing [s@crm-hangup:5] GotoIf(“SIP/101-000006ad”, “0?return”) in new stack
– Executing [s@crm-hangup:6] Set(“SIP/101-000006ad”, “__CRM_HANGUP=1”) in new stack
– Executing [s@crm-hangup:7] AGI(“SIP/101-000006ad”, “sangomacrm.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
– <SIP/101-000006ad>AGI Script sangomacrm.agi completed, returning 0
– Executing [s@crm-hangup:8] Return(“SIP/101-000006ad”, “”) in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/101-000006ad’
– SIP/101-000006ad Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=
Really destroying SIP dialog ‘[email protected]’ Method: ACK
Really destroying SIP dialog ‘[email protected]’ Method: REGISTER

@yelaman: You need to actually include the provider side of of the call there. You have your SIP debug set to only watch the phone side of the call. So there is nothing here showing the INVITE to the provider that has this bad header setup.

Tcpdump
No. Time Source Destination Protocol Length Info
2 0.826563 5.36.214.85 195.11.111.119 SIP/SDP 944 Request: INVITE sip:+77123456789%[email protected] |

Frame 2: 944 bytes on wire (7552 bits), 944 bytes captured (7552 bits)
Ethernet II, Src: AsustekC_70:13:99 (2c:fd:a1:70:13:99), Dst: Cisco_ee:12:c0 (00:1b:0d:ee:12:c0)
Internet Protocol Version 4, Src: 5.36.214.85, Dst: 195.11.111.119
User Datagram Protocol, Src Port: 5060, Dst Port: 5060
Session Initiation Protocol (INVITE)

No. Time Source Destination Protocol Length Info
3 0.852646 195.11.111.119 5.36.214.85 SIP 338 Status: 100 Trying |

Frame 3: 338 bytes on wire (2704 bits), 338 bytes captured (2704 bits)
Ethernet II, Src: Cisco_ee:12:c0 (00:1b:0d:ee:12:c0), Dst: AsustekC_70:13:99 (2c:fd:a1:70:13:99)
Internet Protocol Version 4, Src: 195.11.111.119, Dst: 5.36.214.85
User Datagram Protocol, Src Port: 5060, Dst Port: 5060
Session Initiation Protocol (100)

No. Time Source Destination Protocol Length Info
4 0.872481 195.11.111.119 5.36.214.85 SIP 414 Status: 403 Forbidden |

Frame 4: 414 bytes on wire (3312 bits), 414 bytes captured (3312 bits)
Ethernet II, Src: Cisco_ee:12:c0 (00:1b:0d:ee:12:c0), Dst: AsustekC_70:13:99 (2c:fd:a1:70:13:99)
Internet Protocol Version 4, Src: 195.11.111.119, Dst: 5.36.214.85
User Datagram Protocol, Src Port: 5060, Dst Port: 5060
Session Initiation Protocol (403)

No. Time Source Destination Protocol Length Info
5 0.872535 5.36.214.85 195.11.111.119 SIP 483 Request: ACK sip:+77123456789%[email protected] |

Frame 5: 483 bytes on wire (3864 bits), 483 bytes captured (3864 bits)
Ethernet II, Src: AsustekC_70:13:99 (2c:fd:a1:70:13:99), Dst: Cisco_ee:12:c0 (00:1b:0d:ee:12:c0)
Internet Protocol Version 4, Src: 5.36.214.85, Dst: 195.11.111.119
User Datagram Protocol, Src Port: 5060, Dst Port: 5060
Session Initiation Protocol (ACK)

No. Time Source Destination Protocol Length Info
6 2.969933 178.90.90.57 5.36.214.85 SIP 611 Request: REGISTER sip:5.36.214.85;transport=UDP (1 binding) |

Frame 6: 611 bytes on wire (4888 bits), 611 bytes captured (4888 bits)
Ethernet II, Src: Cisco_ee:12:c0 (00:1b:0d:ee:12:c0), Dst: AsustekC_70:13:99 (2c:fd:a1:70:13:99)
Internet Protocol Version 4, Src: 178.90.90.57, Dst: 5.36.214.85
User Datagram Protocol, Src Port: 40445, Dst Port: 5060
Session Initiation Protocol (REGISTER)

No. Time Source Destination Protocol Length Info
7 3.463803 178.90.90.57 5.36.214.85 SIP 611 Request: REGISTER sip:5.36.214.85;transport=UDP (1 binding) |

Frame 7: 611 bytes on wire (4888 bits), 611 bytes captured (4888 bits)
Ethernet II, Src: Cisco_ee:12:c0 (00:1b:0d:ee:12:c0), Dst: AsustekC_70:13:99 (2c:fd:a1:70:13:99)
Internet Protocol Version 4, Src: 178.90.90.57, Dst: 5.36.214.85
User Datagram Protocol, Src Port: 40445, Dst Port: 5060
Session Initiation Protocol (REGISTER)

No. Time Source Destination Protocol Length Info
8 4.464693 178.90.90.57 5.36.214.85 SIP 611 Request: REGISTER sip:5.36.214.85;transport=UDP (1 binding) |

Frame 8: 611 bytes on wire (4888 bits), 611 bytes captured (4888 bits)
Ethernet II, Src: Cisco_ee:12:c0 (00:1b:0d:ee:12:c0), Dst: AsustekC_70:13:99 (2c:fd:a1:70:13:99)
Internet Protocol Version 4, Src: 178.90.90.57, Dst: 5.36.214.85
User Datagram Protocol, Src Port: 40445, Dst Port: 5060
Session Initiation Protocol (REGISTER)

No. Time Source Destination Protocol Length Info
9 6.465734 178.90.90.57 5.36.214.85 SIP 611 Request: REGISTER sip:5.36.214.85;transport=UDP (1 binding) |

Frame 9: 611 bytes on wire (4888 bits), 611 bytes captured (4888 bits)
Ethernet II, Src: Cisco_ee:12:c0 (00:1b:0d:ee:12:c0), Dst: AsustekC_70:13:99 (2c:fd:a1:70:13:99)
Internet Protocol Version 4, Src: 178.90.90.57, Dst: 5.36.214.85
User Datagram Protocol, Src Port: 40445, Dst Port: 5060
Session Initiation Protocol (REGISTER)

No. Time Source Destination Protocol Length Info
10 10.466195 178.90.90.57 5.36.214.85 SIP 611 Request: REGISTER sip:5.36.214.85;transport=UDP (1 binding) |

Frame 10: 611 bytes on wire (4888 bits), 611 bytes captured (4888 bits)
Ethernet II, Src: Cisco_ee:12:c0 (00:1b:0d:ee:12:c0), Dst: AsustekC_70:13:99 (2c:fd:a1:70:13:99)
Internet Protocol Version 4, Src: 178.90.90.57, Dst: 5.36.214.85
User Datagram Protocol, Src Port: 40445, Dst Port: 5060
Session Initiation Protocol (REGISTER)

@yelaman That is not what I asked for, at all. There’s not a single SIP packet in there that can be read.

However, this time post your trunk config you have because the first debug showed the call being setup properly in the dialplan so this must be happening when it passes through the trunk.

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