Anveo Direct with CHAN_PJSIP trunk. Asterisk 16.6.2 from SNG7-FPBX-64bit-2002-2.iso

Hi there,

I’m moving from SipXecs. I have my Cisco 7960 on CHAN_PJSIP and connected that’s all good.
But I’m trying to configure Anveodirect as a PJSIP trunk and my Trunk always seem to want to go through a Sangoma SBC with IP = 104.145.12.182

I’ve followed the post 68522: community.freepbx.org anveo-direct-setup/68522 a few times already.

My public IP = 174.93.175.241
In Menu -> Settings -> Asterisk Sip Settings -> External Address = 174.93.175.241
in ssh:

grep 174.93.175.241 /etc/asterisk/*
pjsip.transports.conf:external_media_address=174.93.175.241
pjsip.transports.conf:external_signaling_address=174.93.175.241
sip_general_additional.conf:externip=174.93.175.241

But the trunk uses tells Anveo to reach me at 104.145.12.182
and it uses a 172.27.0.10 which is on my private network.
I would think that these 2 IPs should be my public address of 174.93.175.241

Do you know what I’ve forgotten to configure ?
Kind Regards,
Martin Politick Jan. 2021

Here are my SIP trace from Anveo CDR:

/*<<<|174.93.175.241:5060 @ 2021-01-22 07:19:01 */
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 104.145.12.182:5060;rport;branch=z9hG4bKPja4eb9fd7-9cae-4592-9c9b-6edf98a74d3e
From: sip:[email protected]**172.27.0.10**;tag=374d2ca2-4b5e-4a3e-a2d4-fccf2870fda2
To: sip:[email protected]
Contact: sip:[email protected]:5060**104.145.12.182**
Call-ID: 5e246593-2e85-43d2-8eff-a88d95843378
CSeq: 30646 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: FPBX-15.0.16.42(16.6.2)
Content-Type: application/sdp
Content-Length: 341

v=0
o=- 697861980 697861980 IN IP4 104.145.12.182
s=Asterisk
c=IN IP4 104.145.12.182
t=0 0
m=audio 13476 RTP/AVP 0 8 3 111 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/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

/*>>>|174.93.175.241:5060 @ 2021-01-22 07:19:01 */
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 104.145.12.182:5060;received=174.93.175.241;rport=5060;branch=z9hG4bKPja4eb9fd7-9cae-4592-9c9b-6edf98a74d3e
From: sip:[email protected];tag=374d2ca2-4b5e-4a3e-a2d4-fccf2870fda2
To: sip:[email protected]
Call-ID: 5e246593-2e85-43d2-8eff-a88d95843378
CSeq: 30646 INVITE
Server: Anveo Callcontrol
Content-Length: 0

/*>>>|174.93.175.241:5060 @ 2021-01-22 07:19:01 */
SIP/2.0 503 Service Unavailable
Server: Anveo Callcontrol
Via: SIP/2.0/UDP 104.145.12.182:5060;received=174.93.175.241;branch=z9hG4bKPja4eb9fd7-9cae-4592-9c9b-6edf98a74d3e;rport=5060
From: sip:[email protected];tag=374d2ca2-4b5e-4a3e-a2d4-fccf2870fda2
To: sip:[email protected];tag=3b15a6585e026902eff9531553f11965
Call-ID: 5e246593-2e85-43d2-8eff-a88d95843378
CSeq: 30646 INVITE
Server: Anveo Callcontrol
Reason: SIP; cause=503; text=“Service Unavailable”
Content-Length: 0

/*<<<|174.93.175.241:5060 @ 2021-01-22 07:19:01 */
ACK sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 104.145.12.182:5060;rport;branch=z9hG4bKPja4eb9fd7-9cae-4592-9c9b-6edf98a74d3e
From: sip:[email protected];tag=374d2ca2-4b5e-4a3e-a2d4-fccf2870fda2
To: sip:[email protected];tag=3b15a6585e026902eff9531553f11965
Call-ID: 5e246593-2e85-43d2-8eff-a88d95843378
CSeq: 30646 ACK
Max-Forwards: 70
User-Agent: FPBX-15.0.16.42(16.6.2)
Content-Length: 0

You must restart (not just reload) Asterisk after changing these settings.

You are right, that fixed the 104.145.12.182 Sangoma IP problem.
My mistake, I thought I rebooted the VM, but obviously I did not.

But my outboud call still fails with Anveo Direct with a:

SIP/2.0 503 Service Unavailable

I know very little in SIP signaling, but does it matter if the

From: sip:[email protected]
has a private IP address in it ? Or is it like the “from” in an email and it does not need to match the actual email address?

Or do you know why or what causes a “SIP/2.0 503 Service Unavailable” ?

Kind Regards,
Martin Politick.

FULL ANVEO TRACE

/*<<<|174.93.175.241:5060 @ 2021-01-23 05:30:47 */
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 174.93.175.241:5060;rport;branch=z9hG4bKPj2fde4a1e-fb59-49a9-a886-f88a56f00920
From: sip:[email protected];tag=8caf6b8b-480d-46e6-8462-1d37b7311b04
To: sip:[email protected]
Contact: sip:[email protected]:5060
Call-ID: 223e8dfe-f2a8-4826-a308-ccc832fafd36
CSeq: 16329 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: FPBX-15.0.16.42(16.6.2)
Content-Type: application/sdp
Content-Length: 343

v=0
o=- 1171049796 1171049796 IN IP4 174.93.175.241
s=Asterisk
c=IN IP4 174.93.175.241
t=0 0
m=audio 18766 RTP/AVP 0 8 3 111 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/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

/*>>>|174.93.175.241:5060 @ 2021-01-23 05:30:47 */
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 174.93.175.241:5060;rport=5060;branch=z9hG4bKPj2fde4a1e-fb59-49a9-a886-f88a56f00920
From: sip:[email protected];tag=8caf6b8b-480d-46e6-8462-1d37b7311b04
To: sip:[email protected]
Call-ID: 223e8dfe-f2a8-4826-a308-ccc832fafd36
CSeq: 16329 INVITE
Server: Anveo Callcontrol
Content-Length: 0

/*>>>|174.93.175.241:5060 @ 2021-01-23 05:30:47 */
SIP/2.0 503 Service Unavailable
Server: Anveo Callcontrol
Via: SIP/2.0/UDP 174.93.175.241:5060;branch=z9hG4bKPj2fde4a1e-fb59-49a9-a886-f88a56f00920;rport=5060
From: sip:[email protected];tag=8caf6b8b-480d-46e6-8462-1d37b7311b04
To: sip:[email protected];tag=315f68fe8becb9b8fa872e3305232146
Call-ID: 223e8dfe-f2a8-4826-a308-ccc832fafd36
CSeq: 16329 INVITE
Server: Anveo Callcontrol
Reason: SIP; cause=503; text=“Service Unavailable”
Content-Length: 0

/*<<<|174.93.175.241:5060 @ 2021-01-23 05:30:47 */
ACK sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 174.93.175.241:5060;rport;branch=z9hG4bKPj2fde4a1e-fb59-49a9-a886-f88a56f00920
From: sip:[email protected];tag=8caf6b8b-480d-46e6-8462-1d37b7311b04
To: sip:[email protected];tag=315f68fe8becb9b8fa872e3305232146
Call-ID: 223e8dfe-f2a8-4826-a308-ccc832fafd36
CSeq: 16329 ACK
Max-Forwards: 70
User-Agent: FPBX-15.0.16.42(16.6.2)
Content-Length: 0

Full ASTERISK trace:

<— Received SIP request (955 bytes) from UDP:192.168.10.94:51408 —>
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.10.94:5060;branch=z9hG4bK5976d8ce
From: “Martin” sip:[email protected];tag=000f24c6a21a0a5c5de0c4e9-1ef5654c
To: sip:[email protected]
Call-ID: [email protected]
Max-Forwards: 70
Date: Sat, 23 Jan 2021 04:19:55 GMT
CSeq: 101 INVITE
User-Agent: Cisco-CP7960G/8.0
Contact: sip:[email protected]:5060;transport=udp
Expires: 180
Accept: application/sdp
Allow: ACK,BYE,CANCEL,INVITE,NOTIFY,OPTIONS,REFER,REGISTER,UPDATE
Supported: replaces,join,norefersub
Content-Length: 278
Content-Type: application/sdp
Content-Disposition: session;handling=optional

v=0
o=Cisco-SIPUA 19268 0 IN IP4 192.168.10.94
s=SIP Call
t=0 0
m=audio 17286 RTP/AVP 0 8 18 101
c=IN IP4 192.168.10.94
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv

<— Transmitting SIP response (519 bytes) to UDP:192.168.10.94:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.10.94:5060;received=192.168.10.94;branch=z9hG4bK5976d8ce
Call-ID: [email protected]
From: “Martin” sip:[email protected];tag=000f24c6a21a0a5c5de0c4e9-1ef5654c
To: sip:[email protected];tag=z9hG4bK5976d8ce
CSeq: 101 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1611375591/545476cb75062cda728b5bdabea28fb6”,opaque=“627ea8784af17a39”,algorithm=md5,qop=“auth”
Server: FPBX-15.0.16.42(16.6.2)
Content-Length: 0

<— Received SIP request (365 bytes) from UDP:192.168.10.94:51409 —>
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.10.94:5060;branch=z9hG4bK5976d8ce
From: “Martin” sip:[email protected];tag=000f24c6a21a0a5c5de0c4e9-1ef5654c
To: sip:[email protected];tag=z9hG4bK5976d8ce
Call-ID: [email protected]
Date: Sat, 23 Jan 2021 04:19:55 GMT
CSeq: 101 ACK
Content-Length: 0

<— Received SIP request (1219 bytes) from UDP:192.168.10.94:51410 —>
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.10.94:5060;branch=z9hG4bK59fddba9
From: “Martin” sip:[email protected];tag=000f24c6a21a0a5c5de0c4e9-1ef5654c
To: sip:[email protected]
Call-ID: [email protected]
Max-Forwards: 70
Date: Sat, 23 Jan 2021 04:19:55 GMT
CSeq: 102 INVITE
User-Agent: Cisco-CP7960G/8.0
Contact: sip:[email protected]:5060;transport=udp
Authorization: Digest username=“222”,realm=“asterisk”,uri="sip:[email protected]",response=“ff77d55393ba626694fc75d6cb190eed”,nonce=“1611375591/545476cb75062cda728b5bdabea28fb6”,opaque=“627ea8784af17a39”,cnonce=“1d2250af”,qop=auth,nc=00000001,algorithm=md5
Expires: 180
Accept: application/sdp
Allow: ACK,BYE,CANCEL,INVITE,NOTIFY,OPTIONS,REFER,REGISTER,UPDATE
Supported: replaces,join,norefersub
Content-Length: 278
Content-Type: application/sdp
Content-Disposition: session;handling=optional

v=0
o=Cisco-SIPUA 19268 0 IN IP4 192.168.10.94
s=SIP Call
t=0 0
m=audio 17286 RTP/AVP 0 8 18 101
c=IN IP4 192.168.10.94
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv

== Setting global variable ‘SIPDOMAIN’ to ‘172.27.0.10’
<— Transmitting SIP response (347 bytes) to UDP:192.168.10.94:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.10.94:5060;received=192.168.10.94;branch=z9hG4bK59fddba9
Call-ID: [email protected]
From: “Martin” sip:[email protected];tag=000f24c6a21a0a5c5de0c4e9-1ef5654c
To: sip:[email protected]
CSeq: 102 INVITE
Server: FPBX-15.0.16.42(16.6.2)
Content-Length: 0

== Using SIP RTP Audio TOS bits 184
== Using SIP RTP Audio TOS bits 184 in TCLASS field.
== Using SIP RTP Audio CoS mark 5
– Executing [[email protected]:1] Macro(“PJSIP/222-00000002”, “user-callerid,LIMIT,EXTERNAL,”) in new stack
– Executing [[email protected]:1] Set(“PJSIP/222-00000002”, “TOUCH_MONITOR=1611375591.2”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/222-00000002”, “AMPUSER=222”) in new stack
– Executing [[email protected]:3] GotoIf(“PJSIP/222-00000002”, “0?report”) in new stack
– Executing [[email protected]:4] ExecIf(“PJSIP/222-00000002”, “1?Set(REALCALLERIDNUM=222)”) in new stack
– Executing [[email protected]:5] Set(“PJSIP/222-00000002”, “AMPUSER=222”) in new stack
– Executing [[email protected]:6] GotoIf(“PJSIP/222-00000002”, “0?limit”) in new stack
– Executing [[email protected]:7] Set(“PJSIP/222-00000002”, “AMPUSERCIDNAME=Martin Politick”) in new stack
– Executing [[email protected]:8] ExecIf(“PJSIP/222-00000002”, “0?Set(__CIDMASQUERADING=TRUE)”) in new stack
– Executing [[email protected]:9] GotoIf(“PJSIP/222-00000002”, “0?report”) in new stack
– Executing [[email protected]:10] Set(“PJSIP/222-00000002”, “AMPUSERCID=222”) in new stack
– Executing [[email protected]:11] Set(“PJSIP/222-00000002”, “__DIAL_OPTIONS=HhTtr”) in new stack
– Executing [[email protected]:12] Set(“PJSIP/222-00000002”, “CALLERID(all)=“Martin Politick” <222>”) in new stack
– Executing [[email protected]:13] ExecIf(“PJSIP/222-00000002”, “0?Set(CALLERID(all)=EXTERNAL)”) in new stack
– Executing [[email protected]:14] GotoIf(“PJSIP/222-00000002”, “0?limit”) in new stack
– Executing [[email protected]:15] ExecIf(“PJSIP/222-00000002”, “1?Set(GROUP(concurrency_limit)=222)”) in new stack
– Executing [[email protected]:16] ExecIf(“PJSIP/222-00000002”, “0?Set(CHANNEL(language)=)”) in new stack
– Executing [[email protected]:17] NoOp(“PJSIP/222-00000002”, “Macro Depth is 1”) in new stack
– Executing [[email protected]:18] GotoIf(“PJSIP/222-00000002”, “1?report2:macroerror”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [[email protected]:19] GotoIf(“PJSIP/222-00000002”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,38)
– Executing [[email protected]:38] Set(“PJSIP/222-00000002”, “CALLERID(number)=222”) in new stack
– Executing [[email protected]:39] Set(“PJSIP/222-00000002”, “CALLERID(name)=Martin Politick”) in new stack
– Executing [[email protected]:40] GotoIf(“PJSIP/222-00000002”, “0?cnum”) in new stack
– Executing [[email protected]:41] Set(“PJSIP/222-00000002”, “CDR(cnam)=Martin Politick”) in new stack
– Executing [[email protected]:42] Set(“PJSIP/222-00000002”, “CDR(cnum)=222”) in new stack
– Executing [[email protected]:43] Set(“PJSIP/222-00000002”, “CHANNEL(language)=en”) in new stack
– Executing [[email protected]:2] Gosub(“PJSIP/222-00000002”, “sub-record-check,s,1(out,16047616555,dontcare)”) in new stack
– Executing [[email protected]:1] GotoIf(“PJSIP/222-00000002”, “0?initialized”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/222-00000002”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [[email protected]:3] Set(“PJSIP/222-00000002”, “NOW=1611375591”) in new stack
– Executing [[email protected]:4] Set(“PJSIP/222-00000002”, “__DAY=22”) in new stack
– Executing [[email protected]:5] Set(“PJSIP/222-00000002”, “__MONTH=01”) in new stack
– Executing [[email protected]:6] Set(“PJSIP/222-00000002”, “__YEAR=2021”) in new stack
– Executing [[email protected]:7] Set(“PJSIP/222-00000002”, “__TIMESTR=20210122-201951”) in new stack
– Executing [[email protected]:8] Set(“PJSIP/222-00000002”, “__FROMEXTEN=222”) in new stack
– Executing [[email protected]:9] Set(“PJSIP/222-00000002”, “__MON_FMT=wav”) in new stack
– Executing [[email protected]:10] NoOp(“PJSIP/222-00000002”, “Recordings initialized”) in new stack
– Executing [[email protected]:11] ExecIf(“PJSIP/222-00000002”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [[email protected]:12] Set(“PJSIP/222-00000002”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [[email protected]:13] ExecIf(“PJSIP/222-00000002”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [[email protected]:14] GotoIf(“PJSIP/222-00000002”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [[email protected]:17] GotoIf(“PJSIP/222-00000002”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [[email protected]:1] NoOp(“PJSIP/222-00000002”, “Outbound Recording Check from 222 to 16047616555”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/222-00000002”, “RECMODE=dontcare”) in new stack
– Executing [[email protected]:3] ExecIf(“PJSIP/222-00000002”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [[email protected]:7] Gosub(“PJSIP/222-00000002”, “recordcheck,1(dontcare,out,16047616555)”) in new stack
– Executing [[email protected]:1] NoOp(“PJSIP/222-00000002”, “Starting recording check against dontcare”) in new stack
– Executing [[email protected]:2] Goto(“PJSIP/222-00000002”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [[email protected]:3] Return(“PJSIP/222-00000002”, “”) in new stack
– Executing [[email protected]:8] Return(“PJSIP/222-00000002”, “”) in new stack
– Executing [[email protected]:3] ExecIf(“PJSIP/222-00000002”, “0 ?Set(CDR(accountcode)=)”) in new stack
– Executing [[email protected]:4] Set(“PJSIP/222-00000002”, “MOHCLASS=default”) in new stack
– Executing [[email protected]:5] Set(“PJSIP/222-00000002”, “_NODEST=”) in new stack
– Executing [[email protected]:6] Macro(“PJSIP/222-00000002”, “dialout-trunk,1,16047616555,off”) in new stack
– Executing [[email protected]:1] Set(“PJSIP/222-00000002”, “DIAL_TRUNK=1”) in new stack
– Executing [[email protected]:2] ExecIf(“PJSIP/222-00000002”, “0?Set(DIAL_OPTIONS=Hhtr)”) in new stack
– Executing [[email protected]:3] GosubIf(“PJSIP/222-00000002”, “0?sub-pincheck,s,1()”) in new stack
– Executing [[email protected]:4] ExecIf(“PJSIP/222-00000002”, “0?Set(CALLERID(num)=222)”) in new stack
– Executing [[email protected]:5] GotoIf(“PJSIP/222-00000002”, “0?disabletrunk,1”) in new stack
– Executing [[email protected]:6] Set(“PJSIP/222-00000002”, “DIAL_NUMBER=16047616555”) in new stack
– Executing [[email protected]:7] Set(“PJSIP/222-00000002”, “DIAL_TRUNK_OPTIONS=HhTtr”) in new stack
– Executing [[email protected]:8] Set(“PJSIP/222-00000002”, “OUTBOUND_GROUP=OUT_1”) in new stack
– Executing [[email protected]:9] Set(“PJSIP/222-00000002”, “DIAL_TRUNK_OPTIONS=T”) in new stack
– Executing [[email protected]:10] GotoIf(“PJSIP/222-00000002”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,12)
– Executing [[email protected]:12] GotoIf(“PJSIP/222-00000002”, “0?skipoutcid”) in new stack
– Executing [[email protected]:13] Macro(“PJSIP/222-00000002”, “outbound-callerid,1”) in new stack
– Executing [[email protected]:1] NoOp(“PJSIP/222-00000002”, “222”) in new stack
– Executing [[email protected]:2] NoOp(“PJSIP/222-00000002”, “”) in new stack
– Executing [[email protected]:3] NoOp(“PJSIP/222-00000002”, “off”) in new stack
– Executing [[email protected]:4] ExecIf(“PJSIP/222-00000002”, “0?Set(CALLERPRES(name-pres)=)”) in new stack
– Executing [[email protected]:5] ExecIf(“PJSIP/222-00000002”, “0?Set(CALLERPRES(num-pres)=)”) in new stack
– Executing [[email protected]:6] ExecIf(“PJSIP/222-00000002”, “0?Set(REALCALLERIDNUM=222)”) in new stack
– Executing [[email protected]:7] ExecIf(“PJSIP/222-00000002”, “0?Set(AMPUSER=222)”) in new stack
– Executing [[email protected]:8] GotoIf(“PJSIP/222-00000002”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [[email protected]:12] Set(“PJSIP/222-00000002”, “USEROUTCID=”) in new stack
– Executing [[email protected]:13] Set(“PJSIP/222-00000002”, “EMERGENCYCID=”) in new stack
– Executing [[email protected]:14] Set(“PJSIP/222-00000002”, “TRUNKOUTCID=15816818189”) in new stack
– Executing [[email protected]:15] GotoIf(“PJSIP/222-00000002”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,21)
– Executing [[email protected]:21] ExecIf(“PJSIP/222-00000002”, “1?Set(CALLERID(all)=15816818189)”) in new stack
– Executing [[email protected]:22] ExecIf(“PJSIP/222-00000002”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [[email protected]:23] ExecIf(“PJSIP/222-00000002”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [[email protected]:24] ExecIf(“PJSIP/222-00000002”, “0?Set(CALLERID(all)=222)”) in new stack
– Executing [[email protected]:25] Set(“PJSIP/222-00000002”, “TIOHIDE=no”) in new stack
– Executing [[email protected]:26] ExecIf(“PJSIP/222-00000002”, “0?Set(CALLERPRES(name-pres)=prohib_passed_screen)”) in new stack
– Executing [[email protected]:27] ExecIf(“PJSIP/222-00000002”, “0?Set(CALLERPRES(num-pres)=prohib_passed_screen)”) in new stack
– Executing [[email protected]-callerid:28] ExecIf(“PJSIP/222-00000002”, “0?Set(CALLERPRES(name-pres)=prohib_passed_screen)”) in new stack
– Executing [[email protected]:29] ExecIf(“PJSIP/222-00000002”, “0?Set(CALLERPRES(num-pres)=prohib_passed_screen)”) in new stack
– Executing [[email protected]:30] Set(“PJSIP/222-00000002”, “CDR(outbound_cnum)=15816818189”) in new stack
– Executing [[email protected]:31] Set(“PJSIP/222-00000002”, “CDR(outbound_cnam)=”) in new stack
– Executing [[email protected]:14] GosubIf(“PJSIP/222-00000002”, “0?sub-flp-1,s,1()”) in new stack
– Executing [[email protected]:15] Set(“PJSIP/222-00000002”, “OUTNUM=16047616555”) in new stack
– Executing [[email protected]:16] Set(“PJSIP/222-00000002”, “custom=PJSIP”) in new stack
– Executing [[email protected]:17] ExecIf(“PJSIP/222-00000002”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)”) in new stack
– Executing [[email protected]:18] ExecIf(“PJSIP/222-00000002”, “0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))”) in new stack
– Executing [[email protected]:19] Macro(“PJSIP/222-00000002”, “dialout-trunk-predial-hook,”) in new stack
– Executing [[email protected]:1] MacroExit(“PJSIP/222-00000002”, “”) in new stack
– Executing [[email protected]:20] GotoIf(“PJSIP/222-00000002”, “0?skipcrm”) in new stack
– Executing [[email protected]:21] Set(“PJSIP/222-00000002”, “__CRM_DIRECTION=OUTBOUND”) in new stack
– Executing [[email protected]:22] Set(“PJSIP/222-00000002”, “__CRM_DESTINATION=16047616555”) in new stack
– Executing [[email protected]:23] Set(“PJSIP/222-00000002”, “__CRM_SOURCE=222”) in new stack
– Executing [[email protected]:24] AGI(“PJSIP/222-00000002”, “agi://127.0.0.1/sangomacrm.agi”) in new stack
– <PJSIP/222-00000002>AGI Script agi://127.0.0.1/sangomacrm.agi completed, returning 0
– Executing [[email protected]:25] Set(“PJSIP/222-00000002”, “CHANNEL(hangup_handler_push)=crm-hangup,s,1”) in new stack
– Executing [[email protected]:26] NoOp(“PJSIP/222-00000002”, “CRM Finished”) in new stack
– Executing [[email protected]:27] GotoIf(“PJSIP/222-00000002”, “0?bypass,1”) in new stack
– Executing [[email protected]:28] ExecIf(“PJSIP/222-00000002”, “1?Set(CONNECTEDLINE(num,i)=16047616555)”) in new stack
– Executing [[email protected]:29] ExecIf(“PJSIP/222-00000002”, “1?Set(CONNECTEDLINE(name,i)=CID:15816818189)”) in new stack
– Executing [[email protected]:30] ExecIf(“PJSIP/222-00000002”, “0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)15816818189)”) in new stack
– Executing [[email protected]:31] GotoIf(“PJSIP/222-00000002”, “0?customtrunk”) in new stack
– Executing [[email protected]:32] ExecIf(“PJSIP/222-00000002”, “0?Set(DIAL_TRUNK_OPTIONS=)”) in new stack
– Executing [[email protected]:33] Dial(“PJSIP/222-00000002”, “PJSIP/[email protected]_Direct,300,Tb(func-apply-sipheaders^s^1,(1))”) in new stack
– PJSIP/Anveo_Direct-00000003 Internal Gosub(func-apply-sipheaders,s,1(1)) start
– Executing [[email protected]:1] ExecIf(“PJSIP/Anveo_Direct-00000003”, “0?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1)”) in new stack
– Executing [[email protected]:2] NoOp(“PJSIP/Anveo_Direct-00000003”, “Applying SIP Headers to channel PJSIP/Anveo_Direct-00000003”) in new stack
– Executing [[email protected]:3] Set(“PJSIP/Anveo_Direct-00000003”, “TECH=PJSIP”) in new stack
– Executing [[email protected]:4] Set(“PJSIP/Anveo_Direct-00000003”, “SIPHEADERKEYS=”) in new stack
– Executing [[email protected]:5] While(“PJSIP/Anveo_Direct-00000003”, “0”) in new stack
– Jumping to priority 13
– Executing [[email protected]:14] Return(“PJSIP/Anveo_Direct-00000003”, “”) in new stack
== Spawn extension (from-pstn, 16047616555, 1) exited non-zero on ‘PJSIP/Anveo_Direct-00000003’
– PJSIP/Anveo_Direct-00000003 Internal Gosub(func-apply-sipheaders,s,1(1)) complete GOSUB_RETVAL=
– Called PJSIP/[email protected]_Direct
<— Transmitting SIP request (1023 bytes) to UDP:169.48.232.158:5060 —>
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 174.93.175.241:5060;rport;branch=z9hG4bKPj4adf83af-e7f9-4da0-9157-2caa639b5aa7
From: sip:[email protected];tag=83b7c6a5-f946-4317-8178-43bc0d8e1501
To: sip:[email protected]
Contact: sip:[email protected]:5060
Call-ID: 22cd9017-ee8e-4a79-ba06-c3ce564f4ae5
CSeq: 25031 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: FPBX-15.0.16.42(16.6.2)
Content-Type: application/sdp
Content-Length: 343

v=0
o=- 1755389975 1755389975 IN IP4 174.93.175.241
s=Asterisk
c=IN IP4 174.93.175.241
t=0 0
m=audio 16172 RTP/AVP 0 8 3 111 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/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

<— Received SIP response (352 bytes) from UDP:169.48.232.158:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 174.93.175.241:5060;rport=5060;branch=z9hG4bKPj4adf83af-e7f9-4da0-9157-2caa639b5aa7
From: sip:[email protected];tag=83b7c6a5-f946-4317-8178-43bc0d8e1501
To: sip:[email protected]
Call-ID: 22cd9017-ee8e-4a79-ba06-c3ce564f4ae5
CSeq: 25031 INVITE
Server: Anveo Callcontrol
Content-Length: 0

<— Received SIP response (481 bytes) from UDP:169.48.232.158:5060 —>
SIP/2.0 503 Service Unavailable
Server: Anveo Callcontrol
Via: SIP/2.0/UDP 174.93.175.241:5060;branch=z9hG4bKPj4adf83af-e7f9-4da0-9157-2caa639b5aa7;rport=5060
From: sip:[email protected];tag=83b7c6a5-f946-4317-8178-43bc0d8e1501
To: sip:[email protected];tag=f888121cc310cdc49ab576d89c23494d
Call-ID: 22cd9017-ee8e-4a79-ba06-c3ce564f4ae5
CSeq: 25031 INVITE
Server: Anveo Callcontrol
Reason: SIP; cause=503; text=“Service Unavailable”
Content-Length: 0

<— Transmitting SIP request (438 bytes) to UDP:169.48.232.158:5060 —>
ACK sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 174.93.175.241:5060;rport;branch=z9hG4bKPj4adf83af-e7f9-4da0-9157-2caa639b5aa7
From: sip:[email protected];tag=83b7c6a5-f946-4317-8178-43bc0d8e1501
To: sip:[email protected];tag=f888121cc310cdc49ab576d89c23494d
Call-ID: 22cd9017-ee8e-4a79-ba06-c3ce564f4ae5
CSeq: 25031 ACK
Max-Forwards: 70
User-Agent: FPBX-15.0.16.42(16.6.2)
Content-Length: 0

== Everyone is busy/congested at this time (1:0/1/0)
– Executing [[email protected]:34] NoOp(“PJSIP/222-00000002”, “Dial failed for some reason with DIALSTATUS = CONGESTION and HANGUPCAUSE = 34”) in new stack
– Executing [[email protected]:35] GotoIf(“PJSIP/222-00000002”, “0?continue,1:s-CONGESTION,1”) in new stack
– Goto (macro-dialout-trunk,s-CONGESTION,1)
– Executing [[email protected]:1] Set(“PJSIP/222-00000002”, “RC=34”) in new stack
– Executing [[email protected]:2] Goto(“PJSIP/222-00000002”, “34,1”) in new stack
– Goto (macro-dialout-trunk,34,1)
– Executing [[email protected]:1] Goto(“PJSIP/222-00000002”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [[email protected]:1] NoOp(“PJSIP/222-00000002”, “TRUNK Dial failed due to CONGESTION HANGUPCAUSE: 34 - failing through to other trunks”) in new stack
– Executing [[email protected]:2] ExecIf(“PJSIP/222-00000002”, “1?Set(CALLERID(number)=222)”) in new stack
– Executing [[email protected]:7] Macro(“PJSIP/222-00000002”, “dialout-trunk,2,16047616555,off”) in new stack
– Executing [[email protected]:1] Set(“PJSIP/222-00000002”, “DIAL_TRUNK=2”) in new stack
– Executing [[email protected]:2] ExecIf(“PJSIP/222-00000002”, “0?Set(DIAL_OPTIONS=Hhtr)”) in new stack
– Executing [[email protected]:3] GosubIf(“PJSIP/222-00000002”, “0?sub-pincheck,s,1()”) in new stack
– Executing [[email protected]:4] ExecIf(“PJSIP/222-00000002”, “0?Set(CALLERID(num)=222)”) in new stack
– Executing [[email protected]:5] GotoIf(“PJSIP/222-00000002”, “1?disabletrunk,1”) in new stack
– Goto (macro-dialout-trunk,disabletrunk,1)
– Executing [[email protected]:1] NoOp(“PJSIP/222-00000002”, “TRUNK: SIP/Anveo_Out_CHAN-SIP DISABLED - falling through to next trunk”) in new stack
– Executing [[email protected]:8] Macro(“PJSIP/222-00000002”, “outisbusy,”) in new stack
– Executing [[email protected]:1] Progress(“PJSIP/222-00000002”, “”) in new stack
– Executing [[email protected]:2] GotoIf(“PJSIP/222-00000002”, “0?emergency,1”) in new stack
– Executing [[email protected]:3] GotoIf(“PJSIP/222-00000002”, “0?intracompany,1”) in new stack
– Executing [[email protected]:4] Playback(“PJSIP/222-00000002”, “all-circuits-busy-now&please-try-call-later, noanswer”) in new stack
> 0x7f6584326470 – Strict RTP learning after remote address set to: 192.168.10.94:17286
<— Transmitting SIP response (891 bytes) to UDP:192.168.10.94:5060 —>
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 192.168.10.94:5060;received=192.168.10.94;branch=z9hG4bK59fddba9
Call-ID: [email protected]
From: “Martin” sip:[email protected];tag=000f24c6a21a0a5c5de0c4e9-1ef5654c
To: sip:[email protected];tag=8270fdba-e9fb-4410-8d68-fc9b953206ab
CSeq: 102 INVITE
Server: FPBX-15.0.16.42(16.6.2)
Contact: sip:172.27.0.10:5060
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
P-Asserted-Identity: “CID:15816818189” sip:[email protected]
Content-Type: application/sdp
Content-Length: 245

v=0
o=- 19268 2 IN IP4 172.27.0.10
s=Asterisk
c=IN IP4 172.27.0.10
t=0 0
m=audio 19074 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

-- <PJSIP/222-00000002> Playing 'all-circuits-busy-now.ulaw' (language 'en')
   > 0x7f6584326470 -- Strict RTP switching to RTP target address 192.168.10.94:17286 as source
-- <PJSIP/222-00000002> Playing 'please-try-call-later.ulaw' (language 'en')

<— Received SIP request (664 bytes) from UDP:192.168.10.94:51411 —>
CANCEL sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.10.94:5060;branch=z9hG4bK59fddba9
From: “Martin” sip:[email protected];tag=000f24c6a21a0a5c5de0c4e9-1ef5654c
To: sip:[email protected]
Call-ID: [email protected]
Max-Forwards: 70
Date: Sat, 23 Jan 2021 04:19:58 GMT
CSeq: 102 CANCEL
User-Agent: Cisco-CP7960G/8.0
Content-Length: 0
Authorization: Digest username=“222”,realm=“asterisk”,uri="sip:[email protected]",response=“d7fe06fa999d23e152ba6f660eb607fe”,nonce=“1611375591/545476cb75062cda728b5bdabea28fb6”,opaque=“627ea8784af17a39”,cnonce=“3987bd13”,qop=auth,nc=00000002,algorithm=md5

<— Transmitting SIP response (384 bytes) to UDP:192.168.10.94:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.10.94:5060;received=192.168.10.94;branch=z9hG4bK59fddba9
Call-ID: [email protected]
From: “Martin” sip:[email protected];tag=000f24c6a21a0a5c5de0c4e9-1ef5654c
To: sip:[email protected];tag=8270fdba-e9fb-4410-8d68-fc9b953206ab
CSeq: 102 CANCEL
Server: FPBX-15.0.16.42(16.6.2)
Content-Length: 0

<— Transmitting SIP response (581 bytes) to UDP:192.168.10.94:5060 —>
SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 192.168.10.94:5060;received=192.168.10.94;branch=z9hG4bK59fddba9
Call-ID: [email protected]
From: “Martin” sip:[email protected];tag=000f24c6a21a0a5c5de0c4e9-1ef5654c
To: sip:[email protected];tag=8270fdba-e9fb-4410-8d68-fc9b953206ab
CSeq: 102 INVITE
Server: FPBX-15.0.16.42(16.6.2)
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
P-Asserted-Identity: “CID:15816818189” sip:[email protected]
Content-Length: 0

-- Executing [[email protected]:1] Macro("PJSIP/222-00000002", "hangupcall") in new stack
-- Executing [[email protected]:1] GotoIf("PJSIP/222-00000002", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [[email protected]:3] ExecIf("PJSIP/222-00000002", "0?Set(CDR(recordingfile)=)") in new stack
-- Executing [[email protected]:4] NoOp("PJSIP/222-00000002", " montior file= ") in new stack
-- Executing [[email protected]:5] GotoIf("PJSIP/222-00000002", "1?skipagi") in new stack
-- Goto (macro-hangupcall,s,7)
-- Executing [[email protected]:7] Hangup("PJSIP/222-00000002", "") in new stack

== Spawn extension (macro-hangupcall, s, 7) exited non-zero on ‘PJSIP/222-00000002’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘PJSIP/222-00000002’
– PJSIP/222-00000002 Internal Gosub(crm-hangup,s,1) start
– Executing [[email protected]:1] NoOp(“PJSIP/222-00000002”, “Sending Hangup to CRM”) in new stack
– Executing [[email protected]:2] NoOp(“PJSIP/222-00000002”, “HANGUP CAUSE: 34”) in new stack
– Executing [[email protected]:3] ExecIf(“PJSIP/222-00000002”, “0?Set(__CRM_VOICEMAIL=)”) in new stack
– Executing [[email protected]:4] NoOp(“PJSIP/222-00000002”, “MASTER CHANNEL: 1611375591.2 = 1611375591.2”) in new stack
– Executing [[email protected]:5] GotoIf(“PJSIP/222-00000002”, “0?return”) in new stack
– Executing [[email protected]:6] Set(“PJSIP/222-00000002”, “__CRM_HANGUP=1”) in new stack
– Executing [[email protected]:7] AGI(“PJSIP/222-00000002”, “agi://127.0.0.1/sangomacrm.agi”) in new stack
– <PJSIP/222-00000002>AGI Script agi://127.0.0.1/sangomacrm.agi completed, returning 0
– Executing [[email protected]:8] Return(“PJSIP/222-00000002”, “”) in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on ‘PJSIP/222-00000002’
– PJSIP/222-00000002 Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=
<— Received SIP request (386 bytes) from UDP:192.168.10.94:51412 —>
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.10.94:5060;branch=z9hG4bK59fddba9
From: “Martin” sip:[email protected];tag=000f24c6a21a0a5c5de0c4e9-1ef5654c
To: sip:[email protected];tag=8270fdba-e9fb-4410-8d68-fc9b953206ab
Call-ID: [email protected]
Date: Sat, 23 Jan 2021 04:19:58 GMT
CSeq: 102 ACK
Content-Length: 0

<— Transmitting SIP request (435 bytes) to UDP:169.48.232.158:5060 —>
OPTIONS sip:sbc.anveo.com:5060 SIP/2.0
Via: SIP/2.0/UDP 174.93.175.241:5060;rport;branch=z9hGa4
From: sip:[email protected];tag=f58a5a
To: sip:sbc.anveo.com
Contact: sip:[email protected]:5060
Call-ID: 7063f918-257b-4b73-8ab2-4854c571193b
CSeq: 28091 OPTIONS
Max-Forwards: 70
User-Agent: FPBX-15.0.16.42(16.6.2)
Content-Length: 0

<— Received SIP response (375 bytes) from UDP:169.48.232.158:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 174.93.175.241:5060;rport=5060;branch=z9hG4bKPj08e919ea-49b2-4568-b11a-36231b2d7ba4
From: sip:[email protected];tag=f58a
To: sip:sbc.anveo.com;tag=17865
Call-ID: 7063f918-257
CSeq: 28091 OPTIONS
Server: Anveo Callcontrol
Content-Length: 0

The SIP sent to Anveo looks fine, unless perhaps you configured a Dialing Prefix for the trunk at Anveo, in which case you must set a matching Outbound Dial Prefix in the FreePBX Trunk settings.

Otherwise, the problem is likely with your Anveo settings. Confirm that your public IP address is in the Authorized IP Addresses list. Use their Call Simulator to confirm that you don’t have a problem with the carrier list, rate cap, etc. Check the Account Limits section and confirm that you have a positive balance.

Thank you @Stewart1, I’ve verified all of that. I think I’ll have to use of the 4 free tech. tickets.
I’ve completely removed the Dial prefix (to remove one thing out of the equation. Yes my IP is in the authorized list. From my tests, when it’s not, I don’t even get a Call Record and no SIP trace (which is logical).

I’ve used the simulator and no, I had removed the cap and I didn’t exclude any carrier (Is that what you meant by the carrier list ?). I have more than 50$ in the account.

Kind Regards,
Martin Politick, Jan 2021

Try setting your failover depth to 8 and retest. I don’t have much faith in some of the international carriers, even those Anveo calls Prime.

2021-01-24

1015 is Airtel, 1001 is Lanck, 24 is Alcazar; I’m not snowed by any of them (for Canada).
25 is Bandwidth (good) and 27 is Iristel (they’re a Canadian carrier and that’s their business.)

If you still have trouble, post another SIP trace from the Anveo end.

YES!!!
Thx @Stewart1.

That was it, a strange behavior for Anveo to allow no fail-over then …


Thank you, now I will hardened the outbound and add the prefix & cap.

Thank you again @Stewart1, for fixing a Anveo setting in the end.

Kind Regards,
Martin Politick. Jan 2021

That’s there so you can do the failover by specifying additional trunks in your Outbound Route, which could be a more reliable (and more expensive) provider, or another Anveo trunk with more conservative carrier selection.

Unfortunately, Anveo does not distinguish failover due to timeout from failover where the carrier rejected the call. FreePBX also lacks a built-in way to make this distinction. I’ve learned from experience that if there are two or more timeouts, the end user will likely assume the line is dead and hang up, even though the call would eventually succeed.

So, my system gives Anveo only one shot (from a conservatively selected list of carriers) and fails over to a high end provider. I typically see about 2% of calls failing at Anveo. For example, if I’m paying Anveo $0.002 and Flowroute $0.01, that’s an average cost of $0.00216. In my application that’s enough of a saving to justify the administrative hassle of an additional vendor.

There are also a few calls, perhaps 0.05%, where Anveo doesn’t fail over but the result is problematic (poor quality, dropped call, DTMF doesn’t pass, etc.), where Flowroute might have had a better result. However, this is virtually impossible to troubleshoot or even measure, because phones are generally unreliable these days. Even before Covid, we had businesses running VoIP on overloaded networks, users on crappy car Bluetooth in areas with poor cellular coverage, etc. Now, we have millions of people working from home using softphones with laptop mic and speaker, connected over flaky Wi-Fi, while their internet connections are saturated by the kids taking classes by Zoom. Even if your system were perfect, a few percent of calls will be bad. If you improve the result by 0.05%, there is no way to even tell.

1 Like

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