No audio using remote PJSIP behind NAT, CHANSIP works fine

If you are using Anveo retail, you are already connecting to them on port 5010 and the port number at your end can be anything, because it’s using registration.

With AnveoDirect, you connect to them on port 5060, but the port number on your end can be different, you just need to specify it correctly on their portal “Configure Destination Trunks”.

Using a random port gives me one way audio. On my endpoint, I am unable to hear anything but audio goes out.

Using Anveo retail

That’s progress. Try changing the local port of your phone to other than 5060. It you still have trouble (and have turned off any SIP related settings in your router), post a new log with SIP trace.

BTW, I assume that 38.26.23.34 is a redacted value. If you are really in Canada, please explain your ISP setup, as it is very unusual.

Using random ports can conflict with low end routers forwarding policies. Ensure ensuing inbound sdp connections are forwarded correctly, no matter the originating port

I had to create a second account because the forum gives new users a message limit.

I am in Toronto, my office is in NY. My ISP in Canada is a fiber provider named Rally, used to be called frontline. It’s home internet, 1GBPS, not sure what questions I can answer about that topic. Also, I’ve used a softphone here on and off for months.

I meant to say I randomly assigned a port. Specifically 61111.

Then the 61111 port is what your extensions need to register against, your trunks are a different kettle of fish. if registering, then no prob, it should work , but If using IP auth then you will need to pinhole forward your vsp:5060 (or prefentially anything other than 5060 if supported) to localhost/61111 on your outside firewall

I am in Toronto, my office is in NY.

Awesome, both Toronto and Brooklyn have great Chinese food :slight_smile:

In Toronto, router make/model? Does it get the public IP on its WAN interface? If not, please explain (your modem/ONT is configured as a gateway, the ISP is doing NAT, etc.)

In the phone, try changing SIP Local Port to another value.
Enable RPORT should be set.

If you still have trouble, post a new log with SIP trace.

Stewart, Toronto’s food game is on point. When I started coming here I thought I would be disappointed because we have so many good food options available in NYC. I was mistaken, there are so many good restaurants in Toronto as well.

OK, just to clarify. I changed the listening port for chan pjsip in Freepbx settings to 61111. After doing that, I forwarded port 61111 on my office router to my Freepbx server. Then I changed the SIP local port on my phone to 61111. That is what I thought Stewart1 said to do. After doing that, I got outbound audio from my endpoint at home.

Now I went to Asterisk Sip Settings → Chan SIP Settings and I changed the bind pot from 5160 to 61122. I logged into Anveo and it says “Registration from: xx.xx.xx.xx:61122” (the xx’s are my office’s IP.)

I made a test call but that didn’t change anything.

In the Trunk’s sip settings I have not changed anything. inbound and outbound are still using port 5010.

In Toronto I have a Huawei HG8245H. It does get a public IP on the WAN.

I had played around earlier with a lot of the phone settings (many of which are outside of my limited understanding). I’m fairly certain that I had set everything back, but just in case I reset to factory defaults and changed only the following settings, then placed a test call. The results were the same

SIP Proxy and Registrar
Use SIP Proxy: I set this to Enable
Proxy IP Address or Host Name: added my hostname
Proxy Port: 61111
Use SIP Registrar: Set it to Enable

Line Settings
Line 1 Display Name:Test1
Line 1 User ID:120
Line 1 Authentication User Name:120
Line 1 Authentication Password:PasswordOnFreePBX

Settings in the Quick Setup page I didn’t change.

SIP Proxy and Registrar
Use SIP Registrar: Set to disabled, I didn’t touch it.

LAN Setup: All defaults as they are. It’s set to get an IP address from my router and that isn’t related so I haven’t touched it.

If I go over to the Voice Over IP section on my phone, then click on Signaling protocols I have the following options (left at default)

SIP General
SIP Transport Protocol:
SIP Local Port:
Gateway Name:
PRACK Mode:
Enable RPORT:
Include PTIME in SDP:
Enable Keep Alive using OPTIONS:
Connect Media on 180 Response:
Block Caller ID on Outgoing Calls:
Incoming Anonymous Call Blocking:
SIP Proxy and Registrar
Use SIP Proxy:
Proxy IP Address or Host Name:
ourhostname.net
Proxy Port:
61111
Enable Registrar Keep Alive:
Maximum Number of Authentication Retries:
4
Use SIP Proxy IP and Port for Registration:
Use SIP Registrar:
Registration Expires:
3600
Seconds
Registration Failed Expires:
300
Seconds
Use SIP Outbound Proxy:
Redundant Proxy Mode:

SIP Timers
Retransmission Timer T1:
500
Retransmission Timer T2:
4000
Retransmission Timer T4:
5000
INVITE Timer:
32000
Session-Expires:
1800
Min-SE:
90

Quality of Service Parameters
Type of Service (ToS):
0xa0
Hex

Here, I changed SIP Local Port to 61505. I didn’t forward any ports or do anything else. Still the same one way audio.
Also, Enable RPORT: is set to Enable

How do I get a log with SIP trace?

Sorry for all the stupid questions, I want to clarify that this is outside of my realm and many of the suggestions you guys have given me I’ve had to google. =)

I took a look at both manuals. The phone manual does not contain the words NAT or STUN anywhere, so I suspect that the (malfunctioning) NAT traversal is happening in the router. Confirm that in Network Application -> ALG Configuration, Enable SIP ALG is not checked.

If no luck, possibly forwarding (Forward Rules -> Port Mapping ) UDP port 61505 (the port the phone is listening on) to 192.168.1.21 will help.

If still no luck, please post a log including the SIP traffic (same as in your earlier post) with the current configuration.

This router has two built-in VoIP interfaces. Is your ISP using either of them?

Somewhat off topic: Based on what I know so far about your application, I would not choose to have two devices on the same extension, so pjsip may not be required. I’m concerned that when you are at the office, if your wife or kids may be at home at the time, they would be needlessly disturbed by the ringing phone. And when you are working from home, unless your office in New York is a private room with the door closed, your associates may be needlessly disturbed. I would use a Call Flow Control or Time Condition to route calls to your current location. To cover the case where it was accidentally set wrong, I’d use Follow Me to ring the other extension, if the selected one goes unanswered for e.g. 15 seconds. If you forward some calls to your mobile, this would also help if you use different SIMs for US and CA.

SIP ALG was enabled but disabling seems to make no difference.

I forwarded 61505 to 192.168.1.21, no change. I did notice this, not sure if it is relevant however:
On this page, you can configure port mapping parameters to set up virtual servers on the LAN network and allow these servers to be accessed from the Ethernet.
Note: The well-known ports for voice services cannot be in the range of the mapping ports.

I tried DMZ again for the phone, same results.

I will reconsider using PJSIP and go with your other solutions. I’d love to use Tasker’s location tool to change which phone rings, but it will be a project for a different day. I spent way too many hours reading and trying to get this to work this weekend, but I did learn a lot.

Below is the log file, let me know if I have to go back further

[2019-02-04 08:03:27] VERBOSE[15454][C-0000000e] netsock2.c: Using SIP RTP TOS bits 184
[2019-02-04 08:03:27] VERBOSE[15454][C-0000000e] netsock2.c: Using SIP RTP CoS mark 5
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:1] Set(“SIP/Anveo_Trunk-0000000e”, “__DIRECTION=INBOUND”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:2] Gosub(“SIP/Anveo_Trunk-0000000e”, “sub-record-check,s,1(in,s,dontcare)”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:1] GotoIf(“SIP/Anveo_Trunk-0000000e”, “0?initialized”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:2] Set(“SIP/Anveo_Trunk-0000000e”, “__REC_STATUS=INITIALIZED”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:3] Set(“SIP/Anveo_Trunk-0000000e”, “NOW=1549267407”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:4] Set(“SIP/Anveo_Trunk-0000000e”, “__DAY=04”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:5] Set(“SIP/Anveo_Trunk-0000000e”, “__MONTH=02”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:6] Set(“SIP/Anveo_Trunk-0000000e”, “__YEAR=2019”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:7] Set(“SIP/Anveo_Trunk-0000000e”, “__TIMESTR=20190204-080327”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:8] Set(“SIP/Anveo_Trunk-0000000e”, “__FROMEXTEN=unknown”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:9] Set(“SIP/Anveo_Trunk-0000000e”, “__MON_FMT=wav”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:10] NoOp(“SIP/Anveo_Trunk-0000000e”, “Recordings initialized”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:11] ExecIf(“SIP/Anveo_Trunk-0000000e”, “0?Set(ARG3=dontcare)”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:12] Set(“SIP/Anveo_Trunk-0000000e”, “REC_POLICY_MODE_SAVE=”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:13] ExecIf(“SIP/Anveo_Trunk-0000000e”, “0?Set(REC_STATUS=NO)”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:14] GotoIf(“SIP/Anveo_Trunk-0000000e”, “2?checkaction”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx_builtins.c: Goto (sub-record-check,s,17)
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@sub-record-check:17] GotoIf(“SIP/Anveo_Trunk-0000000e”, “1?sub-record-check,in,1”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx_builtins.c: Goto (sub-record-check,in,1)
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [in@sub-record-check:1] NoOp(“SIP/Anveo_Trunk-0000000e”, “Inbound Recording Check to s”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [in@sub-record-check:2] Set(“SIP/Anveo_Trunk-0000000e”, “FROMEXTEN=unknown”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [in@sub-record-check:3] ExecIf(“SIP/Anveo_Trunk-0000000e”, “10?Set(FROMEXTEN=7183076648)”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [in@sub-record-check:4] Gosub(“SIP/Anveo_Trunk-0000000e”, “recordcheck,1(dontcare,in,s)”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [recordcheck@sub-record-check:1] NoOp(“SIP/Anveo_Trunk-0000000e”, “Starting recording check against dontcare”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [recordcheck@sub-record-check:2] Goto(“SIP/Anveo_Trunk-0000000e”, “dontcare”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx_builtins.c: Goto (sub-record-check,recordcheck,3)
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [recordcheck@sub-record-check:3] Return(“SIP/Anveo_Trunk-0000000e”, “”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [in@sub-record-check:5] Return(“SIP/Anveo_Trunk-0000000e”, “”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:3] Set(“SIP/Anveo_Trunk-0000000e”, “CHANNEL(tonezone)=us”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:4] ExecIf(“SIP/Anveo_Trunk-0000000e”, “1?Set(__FROM_DID=s)”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:5] Set(“SIP/Anveo_Trunk-0000000e”, “returnhere=1”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:6] Gosub(“SIP/Anveo_Trunk-0000000e”, “app-blacklist-check,s,1()”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@app-blacklist-check:1] GotoIf(“SIP/Anveo_Trunk-0000000e”, “0?blacklisted”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@app-blacklist-check:2] Set(“SIP/Anveo_Trunk-0000000e”, “CALLED_BLACKLIST=1”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@app-blacklist-check:3] Return(“SIP/Anveo_Trunk-0000000e”, “”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:7] Set(“SIP/Anveo_Trunk-0000000e”, “CDR(did)=s”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:8] GotoIf(“SIP/Anveo_Trunk-0000000e”, “0?”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:9] ExecIf(“SIP/Anveo_Trunk-0000000e”, “0 ?Set(CALLERID(name)=7183076648)”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:10] Set(“SIP/Anveo_Trunk-0000000e”, “__MOHCLASS=”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:11] Set(“SIP/Anveo_Trunk-0000000e”, “__REVERSAL_REJECT=FALSE”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:12] GotoIf(“SIP/Anveo_Trunk-0000000e”, “1?post-reverse-charge”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx_builtins.c: Goto (from-trunk,s,14)
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:14] NoOp(“SIP/Anveo_Trunk-0000000e”, “”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:15] Set(“SIP/Anveo_Trunk-0000000e”, “__CALLINGNAMEPRES_SV=allowed_not_screened”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:16] Set(“SIP/Anveo_Trunk-0000000e”, “__CALLINGNUMPRES_SV=allowed_not_screened”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:17] Set(“SIP/Anveo_Trunk-0000000e”, “CALLERID(name-pres)=allowed_not_screened”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:18] Set(“SIP/Anveo_Trunk-0000000e”, “CALLERID(num-pres)=allowed_not_screened”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:19] NoOp(“SIP/Anveo_Trunk-0000000e”, “CallerID Entry Point”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:20] Set(“SIP/Anveo_Trunk-0000000e”, “__CRM_DIRECTION=INBOUND”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:21] Set(“SIP/Anveo_Trunk-0000000e”, “__CRM_SOURCE=7183076648”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:22] Set(“SIP/Anveo_Trunk-0000000e”, “__CRM_LINKEDID=1549267407.27”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:23] ExecIf(“SIP/Anveo_Trunk-0000000e”, “1?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1)”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@from-trunk:24] Goto(“SIP/Anveo_Trunk-0000000e”, “ivr-1,s,1”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx_builtins.c: Goto (ivr-1,s,1)
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@ivr-1:1] Set(“SIP/Anveo_Trunk-0000000e”, “TIMEOUT_LOOPCOUNT=0”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@ivr-1:2] Set(“SIP/Anveo_Trunk-0000000e”, “INVALID_LOOPCOUNT=0”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@ivr-1:3] Set(“SIP/Anveo_Trunk-0000000e”, “_IVR_CONTEXT_ivr-1=”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@ivr-1:4] Set(“SIP/Anveo_Trunk-0000000e”, “_IVR_CONTEXT=ivr-1”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@ivr-1:5] Set(“SIP/Anveo_Trunk-0000000e”, “__IVR_RETVM=”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@ivr-1:6] GotoIf(“SIP/Anveo_Trunk-0000000e”, “0?skip”) in new stack
[2019-02-04 08:03:27] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@ivr-1:7] Answer(“SIP/Anveo_Trunk-0000000e”, “”) in new stack
[2019-02-04 08:03:27] VERBOSE[32176][C-0000000d] app_dial.c: SIP/Anveo_Trunk-0000000d answered PJSIP/120-0000000c
[2019-02-04 08:03:27] VERBOSE[26847] res_pjsip_logger.c: <— Transmitting SIP response (1452 bytes) to UDP:38.26.23.34:61505 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.21:61505;rport=61505;received=38.26.23.34;branch=z9hG4bK-237-8a73e-5566337d
Call-ID: 85ebf8-1501a8c0-f041-55013-236-743a827b-236
From: “Argentek” <sip:120@ hostname>;tag=84d9b0-1501a8c0-f041-55013-236-9b57cc9-236
To: <sip:17183076648@ hostname>;tag=4c944219-bf8d-4eba-8378-ad335b80ba5d
CSeq: 2 INVITE
Server: FPBX-14.0.5.25(13.19.1)
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Contact: <sip:ip.xx.xx. xx:61111>
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800;refresher=uac
Require: timer
P-Asserted-Identity: “CID:7183076648” <sip:17183076648@ hostname>
Content-Type: application/sdp
Content-Length: 675

v=0
o=- 1549267906 1549267908 IN IP4 ip.xx.xx.xx
s=Asterisk
c=IN IP4 ip.xx.xx.xx
t=0 0
m=audio 13130 RTP/AVP 0 8 9 101
a=ice-ufrag:26da7aee230c2175365b1aa50d104de5
a=ice-pwd:2b509b2f66521c6b5839eabe5a48c7dc
a=candidate:H689058d2 1 UDP 2130706431 fe80::a00:27ff:fe22:f86c 13130 typ host
a=candidate:Hc0a801fc 1 UDP 2130706431 192.168.1.252 13130 typ host
a=candidate:H689058d2 2 UDP 2130706430 fe80::a00:27ff:fe22:f86c 13131 typ host
a=candidate:Hc0a801fc 2 UDP 2130706430 192.168.1.252 13131 typ host
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/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

[2019-02-04 08:03:27] VERBOSE[32194][C-0000000d] bridge_channel.c: Channel SIP/Anveo_Trunk-0000000d joined ‘simple_bridge’ basic-bridge <695585da-fdca-482c-a9fa-a472b3844fe4>
[2019-02-04 08:03:27] VERBOSE[32176][C-0000000d] bridge_channel.c: Channel PJSIP/120-0000000c joined ‘simple_bridge’ basic-bridge <695585da-fdca-482c-a9fa-a472b3844fe4>
[2019-02-04 08:03:27] VERBOSE[15413] res_pjsip_logger.c: <— Received SIP request (882 bytes) from UDP:38.26.23.34:61505 —>
ACK sip:ip.xx.xx.xx:61111 SIP/2.0
From: “Argentek”<sip:120@ hostname>;tag=84d9b0-1501a8c0-f041-55013-236-9b57cc9-236
To: <sip:17183076648@ hostname>;tag=4c944219-bf8d-4eba-8378-ad335b80ba5d
Call-ID: 85ebf8-1501a8c0-f041-55013-236-743a827b-236
CSeq: 2 ACK
Via: SIP/2.0/UDP 192.168.1.21:61505;rport;branch=z9hG4bK-239-8afd1-51a868c2
Max-Forwards: 70
Allow: REGISTER, INVITE, ACK, BYE, REFER, NOTIFY, CANCEL, INFO, OPTIONS, PRACK, SUBSCRIBE, UPDATE, PUBLISH
User-Agent: AUDC-IPPhone/2.2.16.142.12 (440HDG-Rev1; 00908F61344B)
Contact: <sip:120@192 .168.1.21:61505>
Authorization: Digest username=“120”,realm=“asterisk”,nonce=“1549267405/c70a5e8335f6c6a37f49dcc405d42e35”,uri=“sip:17183076648@hostname:61111”,response=“eb11256c2ac4861b52744b0d9ac513a0”,algorithm=MD5,cnonce=“8a73f”,opaque=“3ef054e81cc5a5cd”,qop=auth,nc=00000001
Content-Length: 0

[2019-02-04 08:03:28] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@ivr-1:8] Wait(“SIP/Anveo_Trunk-0000000e”, “1”) in new stack
[2019-02-04 08:03:29] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@ivr-1:9] Set(“SIP/Anveo_Trunk-0000000e”, “IVR_MSG=custom/argentek_firstprompt”) in new stack
[2019-02-04 08:03:29] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@ivr-1:10] Set(“SIP/Anveo_Trunk-0000000e”, “TIMEOUT(digit)=3”) in new stack
[2019-02-04 08:03:29] VERBOSE[32189][C-0000000e] func_timeout.c: Digit timeout set to 3.000
[2019-02-04 08:03:29] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@ivr-1:11] ExecIf(“SIP/Anveo_Trunk-0000000e”, “1?Background(custom/argentek_firstprompt)”) in new stack
[2019-02-04 08:03:29] VERBOSE[32189][C-0000000e] file.c: <SIP/Anveo_Trunk-0000000e> Playing ‘custom/argentek_firstprompt.slin’ (language ‘en’)
[2019-02-04 08:03:41] VERBOSE[15413] res_pjsip_logger.c: <— Received SIP request (871 bytes) from UDP:38.26.23.34:61505 —>
BYE sip:ip.xx.xx.xx:61111 SIP/2.0
From: “Argentek”<sip:120@ hostname>;tag=84d9b0-1501a8c0-f041-55013-236-9b57cc9-236
To: <sip:17183076648@ hostname>;tag=4c944219-bf8d-4eba-8378-ad335b80ba5d
Call-ID: 85ebf8-1501a8c0-f041-55013-236-743a827b-236
CSeq: 3 BYE
Via: SIP/2.0/UDP 192.168.1.21:61505;rport;branch=z9hG4bK-246-8e550-2ae90080
Max-Forwards: 70
Supported: replaces,100rel,eventlist,timer
Allow: REGISTER, INVITE, ACK, BYE, REFER, NOTIFY, CANCEL, INFO, OPTIONS, PRACK, SUBSCRIBE, UPDATE, PUBLISH
User-Agent: AUDC-IPPhone/2.2.16.142.12 (440HDG-Rev1; 00908F61344B)
Authorization: Digest username=“120”,realm=“asterisk”,nonce=“1549267405/c70a5e8335f6c6a37f49dcc405d42e35”,uri=“sip:ip.xx.xx.xx:61111”,response=“ac4dacdcc84cb8c3a69114fe8ac95db1”,algorithm=MD5,cnonce=“8e551”,opaque=“3ef054e81cc5a5cd”,qop=auth,nc=00000002
Content-Length: 0

[2019-02-04 08:03:41] VERBOSE[26847] res_pjsip_logger.c: <— Transmitting SIP response (417 bytes) to UDP:38.26.23.34:61505 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.21:61505;rport=61505;received=38.26.23.34;branch=z9hG4bK-246-8e550-2ae90080
Call-ID: 85ebf8-1501a8c0-f041-55013-236-743a827b-236
From: “Argentek” <sip:120@ hostname>;tag=84d9b0-1501a8c0-f041-55013-236-9b57cc9-236
To: <sip:17183076648@ hostname>;tag=4c944219-bf8d-4eba-8378-ad335b80ba5d
CSeq: 3 BYE
Server: FPBX-14.0.5.25(13.19.1)
Content-Length: 0

[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] bridge_channel.c: Channel PJSIP/120-0000000c left ‘simple_bridge’ basic-bridge <695585da-fdca-482c-a9fa-a472b3844fe4>
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] app_macro.c: Spawn extension (macro-dialout-trunk, s, 32) exited non-zero on ‘PJSIP/120-0000000c’ in macro ‘dialout-trunk’
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Spawn extension (from-internal, 17183076648, 7) exited non-zero on ‘PJSIP/120-0000000c’
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Executing [h@from-internal:1] Macro(“PJSIP/120-0000000c”, “hangupcall”) in new stack
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Executing [s@macro-hangupcall:1] GotoIf(“PJSIP/120-0000000c”, “1?theend”) in new stack
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx_builtins.c: Goto (macro-hangupcall,s,3)
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Executing [s@macro-hangupcall:3] ExecIf(“PJSIP/120-0000000c”, “0?Set(CDR(recordingfile)=)”) in new stack
[2019-02-04 08:03:41] VERBOSE[32194][C-0000000d] bridge_channel.c: Channel SIP/Anveo_Trunk-0000000d left ‘simple_bridge’ basic-bridge <695585da-fdca-482c-a9fa-a472b3844fe4>
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Executing [s@macro-hangupcall:4] NoOp(“PJSIP/120-0000000c”, "SIP/Anveo_Trunk-0000000d monior file= ") in new stack
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Executing [s@macro-hangupcall:5] AGI(“PJSIP/120-0000000c”, “attendedtransfer-rec-restart.php,SIP/Anveo_Trunk-0000000d,”) in new stack
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] res_agi.c: Launched AGI Script /var/lib/asterisk/agi-bin/attendedtransfer-rec-restart.php
[2019-02-04 08:03:41] VERBOSE[32189][C-0000000e] pbx.c: Spawn extension (ivr-1, s, 11) exited non-zero on ‘SIP/Anveo_Trunk-0000000e’
[2019-02-04 08:03:41] VERBOSE[32189][C-0000000e] pbx.c: Executing [h@ivr-1:1] Hangup(“SIP/Anveo_Trunk-0000000e”, “”) in new stack
[2019-02-04 08:03:41] VERBOSE[32189][C-0000000e] pbx.c: Spawn extension (ivr-1, h, 1) exited non-zero on ‘SIP/Anveo_Trunk-0000000e’
[2019-02-04 08:03:41] VERBOSE[32189][C-0000000e] app_stack.c: SIP/Anveo_Trunk-0000000e Internal Gosub(crm-hangup,s,1) start
[2019-02-04 08:03:41] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@crm-hangup:1] NoOp(“SIP/Anveo_Trunk-0000000e”, “Sending Hangup to CRM”) in new stack
[2019-02-04 08:03:41] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@crm-hangup:2] NoOp(“SIP/Anveo_Trunk-0000000e”, “HANGUP CAUSE: 16”) in new stack
[2019-02-04 08:03:41] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@crm-hangup:3] ExecIf(“SIP/Anveo_Trunk-0000000e”, “0?Set(__CRM_VOICEMAIL=)”) in new stack
[2019-02-04 08:03:41] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@crm-hangup:4] NoOp(“SIP/Anveo_Trunk-0000000e”, “MASTER CHANNEL: 1549267407.27 = 1549267407.27”) in new stack
[2019-02-04 08:03:41] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@crm-hangup:5] GotoIf(“SIP/Anveo_Trunk-0000000e”, “0?return”) in new stack
[2019-02-04 08:03:41] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@crm-hangup:6] Set(“SIP/Anveo_Trunk-0000000e”, “__CRM_HANGUP=1”) in new stack
[2019-02-04 08:03:41] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@crm-hangup:7] AGI(“SIP/Anveo_Trunk-0000000e”, “sangomacrm.agi”) in new stack
[2019-02-04 08:03:41] VERBOSE[32189][C-0000000e] res_agi.c: Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] res_agi.c: <PJSIP/120-0000000c>AGI Script attendedtransfer-rec-restart.php completed, returning 0
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Executing [s@macro-hangupcall:6] Hangup(“PJSIP/120-0000000c”, “”) in new stack
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] app_macro.c: Spawn extension (macro-hangupcall, s, 6) exited non-zero on ‘PJSIP/120-0000000c’ in macro ‘hangupcall’
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Spawn extension (from-internal, h, 1) exited non-zero on ‘PJSIP/120-0000000c’
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] app_stack.c: PJSIP/120-0000000c Internal Gosub(crm-hangup,s,1) start
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Executing [s@crm-hangup:1] NoOp(“PJSIP/120-0000000c”, “Sending Hangup to CRM”) in new stack
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Executing [s@crm-hangup:2] NoOp(“PJSIP/120-0000000c”, “HANGUP CAUSE: 16”) in new stack
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Executing [s@crm-hangup:3] ExecIf(“PJSIP/120-0000000c”, “0?Set(__CRM_VOICEMAIL=)”) in new stack
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Executing [s@crm-hangup:4] NoOp(“PJSIP/120-0000000c”, “MASTER CHANNEL: 1549267405.25 = 1549267405.25”) in new stack
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Executing [s@crm-hangup:5] GotoIf(“PJSIP/120-0000000c”, “0?return”) in new stack
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Executing [s@crm-hangup:6] Set(“PJSIP/120-0000000c”, “__CRM_HANGUP=1”) in new stack
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] pbx.c: Executing [s@crm-hangup:7] AGI(“PJSIP/120-0000000c”, “sangomacrm.agi”) in new stack
[2019-02-04 08:03:41] VERBOSE[32176][C-0000000d] res_agi.c: Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
[2019-02-04 08:03:42] VERBOSE[32189][C-0000000e] res_agi.c: <SIP/Anveo_Trunk-0000000e>AGI Script sangomacrm.agi completed, returning 0
[2019-02-04 08:03:42] VERBOSE[32189][C-0000000e] pbx.c: Executing [s@crm-hangup:8] Return(“SIP/Anveo_Trunk-0000000e”, “”) in new stack
[2019-02-04 08:03:42] VERBOSE[32189][C-0000000e] app_stack.c: Spawn extension (ivr-1, h, 1) exited non-zero on ‘SIP/Anveo_Trunk-0000000e’
[2019-02-04 08:03:42] VERBOSE[32189][C-0000000e] app_stack.c: SIP/Anveo_Trunk-0000000e Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=
[2019-02-04 08:03:42] VERBOSE[32176][C-0000000d] res_agi.c: <PJSIP/120-0000000c>AGI Script sangomacrm.agi completed, returning 0
[2019-02-04 08:03:42] VERBOSE[32176][C-0000000d] pbx.c: Executing [s@crm-hangup:8] Return(“PJSIP/120-0000000c”, “”) in new stack
[2019-02-04 08:03:42] VERBOSE[32176][C-0000000d] app_stack.c: Spawn extension (from-internal, h, 1) exited non-zero on ‘PJSIP/120-0000000c’
[2019-02-04 08:03:42] VERBOSE[32176][C-0000000d] app_stack.c: PJSIP/120-0000000c Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=

OK so let’s try this and now I’m going to be asking things from before this storm of changes started happening.

On this 440HD we’ve seen outgoing calls from it to the PBX which I pointed out had that NAT issue and you’re getting one way audio. So what happened when you made an inbound call to the phone. In other words, called the PBX from the PSTN, routed that call to the extension for this phone and did you have two-way audio?

I believe that the SIP and SDP are clean now (you didn’t post the INVITE from the phone to Asterisk, but the SIP you did post was free of public IP address substitutions). So from here, it should be pretty easy.

Turn off Enable ICE Support and turn on RTP Symmetric (unlikely to be causing trouble but it makes debugging harder) and confirm that DMZ has been turned off. Next, we’ll start with the simplest calls. Try dialing *65, which speaks your extension number and hangs up after ~10 seconds. Once that’s working, try *43 (echo test). When that also works, try calling out.

The phone has a Port Mirroring feature that should help find RTP problems. See https://www.audiocodes.com/media/9630/ltrt-11950-400hd-series-ip-phone-administrators-manual-ver-228.pdf p. 267. Connect your computer to the PC port and capture a failing call with Wireshark. If there is RTP coming in, we can see what’s wrong with it (incorrect port, codec issue, content is silent, etc.) If not, we can capture at the PBX end and see whether RTP was properly sent out.

OK, just an update, and it’s a disappointing one (because I couldn’t learn from it).

Tom, this morning I tried an inbound call. I had the same results.
Stewart1, this morning before 10 am (our work day starts at 10am) I downloaded Wireshark, installed it, enabled port mirroring and made the test calls you mentioned. The test calls had no audio and thousands of lines filled up the Wireshark log. Since it was too much info to put into the forum, I pointed my phone number back to work with the anveo IVR and disabled the trunk in FreePBX with every intention of trying it after work hours.

Now, I point the phone number back to work with my freepbx and enable the trunk. I fire up Wireshark and make the *65 call, and for some reason unknown to me IT WORKS! I haven’t had a chance to change any of the settings since this morning so I don’t know what happened or why it isn’t happening any more.

Of course part of me is happy that it works, the other part of me is very confused as to what was happening to begin with.

Thank you to everyone who has added to this thread!

Even though Tom Ray, BlazeStudios, fired back at one poster about not reading the OP and obviously being a NAT issue, (and NAT is a common problem), I am still wondering if you ever did a reboot or a fwconsole restart.

I, like Phil parker, had a very similar issue as yours and ultimately a “randomly restarting Asterisk” WAS an answer and solved my problem.

Just wondering… if you did such towards the end when things started working.

The problem with problems going away by themselves is the usually come back by themselves.

Historically, when something like this starts working, it’s because something has gotten out of the way of the NAT problem you are seeing.

In your average phone conversation, there are at least four NAT legs you need to look into:

  1. Phone to PBX.
  2. PBX to phone.
  3. PBX to ITSP.
  4. ITSP to PBX.

The thing is that Asterisk is a back to back user agent, so each leg is independent of the others. Inbound and outbound are actually unrelated data streams, so assuming that outbound calls work, therefore inbound should is simply an incorrect assumption.

To make matters even more messy, where the call initiates can have an effect on how the call performs. This is because of the way the routers process the traffic. When a call originate from inside the network, the router sets up everything that you need and maintains it as long as nothing changes. If anything changes (ports or addresses) and the router isn’t aware of the change, the call will drop. Remember, incoming traffic and outgoing traffic are largely unrelated, and each inbound and outbound call is going to have two of each of those.

It’s a lot of balls to keep in the air, and finding out specifically which one piece of one leg is not set up right can be frustrating and challenging.

Hi everyone, I was traveling yesterday so I didn’t have a chance to respond.

Yes, I had tried fwconsole restart before philparker made a suggestion. After seeing his message, I also powered down the VM and booted it back up. There was no change. Phil, I still appreciate your input because often at times a restart does fix things.

Yes, I agree. Even though I did learn a lot from this thread I also feel that resolving the issue would have been good.

Yes, I spent at least 8 hours researching, trying different things, following directions on this thread and others, etc. If you factor how little we will save each month on our phone expense then this is an awful use of time. For me it’s a hobby with practical value in the end.

Actually, it was about how if the OP uses a softphone and not this problem phone in question over PJSIP there were ZERO issues and therefore the issue is related to how this problem phone is dealing with crap. Not that the PBX or other things need to be messed with because clearly the PBX is fine if other devices can work but one can’t.

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