Incoming calls from VoIP not being passed to the incoming route

Hi,

I have a problem with receiving incoming calls from VoIP provider. I bought a landline phone number and in the past it worked quite fine, but lately it doesn’t. I configured trunk as suggested by provider, so:

PEER Details:
type=peer host=sip.easycall.pl port=5060 nat=yes context=from-trunk canreinvite=no insecure=no dtmfmode=rfc2833 disallow=all allow=alaw&g729&g722 username={SIP USERNAME} fromuser={SIP USERNAME} secret={SIP PASSWORD}

Register String:
{SIP USERNAME}:{SIP PASSWORD}@sip.easycall.pl/{MY NUMBER}

It registers correctly:
Host dnsmgr Username Refresh State Reg.Time sip.easycall.pl:5060 N {SIP USERNAME} 105 Registered Wed, 18 Jan 2017 13:20:02 1 SIP registrations.

But when I’m calling this number (I’ve set incoming routes both for this number and all other calls - they should put the caller on hold, so I’ll hear music if it’ll work) the call… it gets to the PBX, that’s true. But Asterisk doesn’t even show any debug log about it. I can only see it with sip show channels:
185.140.24.34 {CID, my cellphone number} 3205a6bd1f751b2 0x0 (nothing) No Rx: ACK
and sip show channel 3205a6bd1f751b2 says:
* SIP Call Curr. trans. direction: Incoming Call-ID: [email protected]:5060 Owner channel ID: <none> Our Codec Capability: 8 Non-Codec Capability (DTMF): 1 Their Codec Capability: 0 Joint Codec Capability: 0 Format: 0x0 (nothing) T.38 support No Video support No MaxCallBR: 384 kbps Theoretical Address: 185.140.24.34:5060 Received Address: 185.140.24.34:5060 SIP Transfer mode: open NAT Support: Always Audio IP: {My external IP} (local) Our Tag: as2c9a978b Their Tag: as4d17213b SIP User agent: easyCALL VoIP server Caller-ID: {CID, my cellphone number} Need Destroy: No Last Message: Rx: ACK Promiscuous Redir: No Route: N/A DTMF Mode: rfc2833 SIP Options: replaces replace timer Session-Timer: Uninitiallized

Do you have any idea what causes this problem? I’m configuring it on a FreePBX 2.9.0.12 with Asterisk 1.6.2.10, but I tried it on FreePBX 13 with Asterisk 13 too and the outcome was the same.

Hello,

Please send the sip debug log (sip set debug ip 185.140.24.34).

Thank you,

Daniel Friedman
Trixton LTD.

<--- SIP read from UDP:185.140.24.34:5060 --->
INVITE sip:{MY LANDLINE NUMBER}@192.168.1.125:5060 SIP/2.0
Record-Route: <sip:185.140.24.34;lr=on;ftag=as4dafcbfd>
Via: SIP/2.0/UDP 185.140.24.34;branch=z9hG4bK3511.1edc2ab5.0
Via: SIP/2.0/UDP 185.140.24.49:5060;branch=z9hG4bK1d3bb89a;rport=5060
Max-Forwards: 69
From: <sip:{MY CELLPHONE}@185.140.24.49>;tag=as4dafcbfd
To: <sip:{SIP USERNAME}@sip.easycall.pl>
Contact: <sip:{MY CELLPHONE}@185.140.24.49:5060>
Call-ID: [email protected]:5060
CSeq: 102 INVITE
User-Agent: easyCALL VoIP server
Date: Wed, 18 Jan 2017 13:04:02 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 495

v=0
o=root 2129626386 2129626386 IN IP4 185.140.24.34
s=Asterisk PBX 11.22.0
c=IN IP4 185.140.24.34
t=0 0
m=audio 62454 RTP/AVP 8 18 4 97 3 111 9 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:97 iLBC/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=direction:active
a=nortpproxy:yes

<------------->
--- (16 headers 22 lines) ---
Sending to 185.140.24.34 : 5060 (NAT)
Using INVITE request as basis request - [email protected]:5060
Found peer 'easyCALL_EneDir' for '{MY CELLPHONE}' from 185.140.24.34:5060

<--- Reliably Transmitting (NAT) to 185.140.24.34:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 185.140.24.34;branch=z9hG4bK3511.1edc2ab5.0;received=185.140.24.34
Via: SIP/2.0/UDP 185.140.24.49:5060;branch=z9hG4bK1d3bb89a;rport=5060
From: <sip:{MY CELLPHONE}@185.140.24.49>;tag=as4dafcbfd
To: <sip:{SIP USERNAME}@sip.easycall.pl>;tag=as15abfdc6
Call-ID: [email protected]:5060
CSeq: 102 INVITE
Server: FPBX-2.9.0(1.6.2.10)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="50367d02"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '[email protected]:5060' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:185.140.24.34:5060 --->
ACK sip:{MY LANDLINE NUMBER}@192.168.1.125:5060 SIP/2.0
Via: SIP/2.0/UDP 185.140.24.34;branch=z9hG4bK3511.1edc2ab5.0
From: <sip:{MY CELLPHONE}@185.140.24.49>;tag=as4dafcbfd
Call-ID: [email protected]:5060
To: <sip:{SIP USERNAME}@sip.easycall.pl>;tag=as15abfdc6
CSeq: 102 ACK
Content-Length: 0


<------------->
--- (7 headers 0 lines) ---
Really destroying SIP dialog '[email protected]:5060' Method: ACK

<--- SIP read from UDP:185.140.24.34:5060 --->

<------------->
Really destroying SIP dialog '[email protected]:5060' Method: ACK

You know what’s strange there besides the Unauthorized reply? This:
Found peer 'easyCALL_EneDir' for '{MY CELLPHONE}' from 185.140.24.34:5060
easyCALL_EneDir is another trunk connected to the same VoIP provider, but as another account, that we use only to make outbound calls.

Hello,

Change your sip trunk setting insecure=no to insecure=port,invite and report back.

Thank you,

Daniel Friedman
Trixton LTD.

PEER Details:

type=peer
host=sip.easycall.pl
port=5060
nat=yes
context=from-trunk
canreinvite=no
insecure=port,invite
dtmfmode=rfc2833
disallow=all
allow=alaw&g729&g722
username={SIP USERNAME}
fromuser={SIP USERNAME}
secret={SIP PASSWORD}

And the result:

<--- SIP read from UDP:185.140.24.34:5060 --->
INVITE sip:{LANDLINE NUMBER}@192.168.1.125:5060 SIP/2.0
Record-Route: <sip:185.140.24.34;lr=on;ftag=as083239ef>
Via: SIP/2.0/UDP 185.140.24.34;branch=z9hG4bK9f55.5e898d5.0
Via: SIP/2.0/UDP 185.140.24.49:5060;branch=z9hG4bK5514fbec;rport=5060
Max-Forwards: 69
From: <sip:{MY CELLPHONE}@185.140.24.49>;tag=as083239ef
To: <sip:{SIP USERNAME}@sip.easycall.pl>
Contact: <sip:{MY CELLPHONE}@185.140.24.49:5060>
Call-ID: [email protected]:5060
CSeq: 102 INVITE
User-Agent: easyCALL VoIP server
Date: Wed, 18 Jan 2017 14:40:00 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 493

v=0
o=root 931597333 931597333 IN IP4 185.140.24.34
s=Asterisk PBX 11.22.0
c=IN IP4 185.140.24.34
t=0 0
m=audio 63748 RTP/AVP 8 18 4 97 3 111 9 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:97 iLBC/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=direction:active
a=nortpproxy:yes

<------------->
--- (16 headers 22 lines) ---
Sending to 185.140.24.34 : 5060 (NAT)
Using INVITE request as basis request - [email protected]:5060
Found peer 'easyCALL_EneDir' for '{MY CELLPHONE}' from 185.140.24.34:5060

<--- Reliably Transmitting (NAT) to 185.140.24.34:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 185.140.24.34;branch=z9hG4bK9f55.5e898d5.0;received=185.140.24.34
Via: SIP/2.0/UDP 185.140.24.49:5060;branch=z9hG4bK5514fbec;rport=5060
From: <sip:{MY CELLPHONE}@185.140.24.49>;tag=as083239ef
To: <sip:{SIP USERNAME}@sip.easycall.pl>;tag=as11956b6e
Call-ID: [email protected]:5060
CSeq: 102 INVITE
Server: FPBX-2.9.0(1.6.2.10)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="09a59a5b"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '[email protected]:5060' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:185.140.24.34:5060 --->
ACK sip:{LANDLINE NUMBER}@192.168.1.125:5060 SIP/2.0
Via: SIP/2.0/UDP 185.140.24.34;branch=z9hG4bK9f55.5e898d5.0
From: <sip:{MY CELLPHONE}@185.140.24.49>;tag=as083239ef
Call-ID: [email protected]:5060
To: <sip:{SIP USERNAME}@sip.easycall.pl>;tag=as11956b6e
CSeq: 102 ACK
Content-Length: 0


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

<--- SIP read from UDP:185.140.24.34:5060 --->

<------------->

Ok,

Now send me the sip show registry output. You have a nat issue that causes the server to send your invite to the other trunk. It also seems that you are receiving request from 2 ip’s:

<--- SIP read from UDP:185.140.24.34:5060 --->
INVITE sip:{LANDLINE NUMBER}@192.168.1.125:5060 SIP/2.0
Record-Route: <sip:185.140.24.34;lr=on;ftag=as083239ef>
** Via: SIP/2.0/UDP 185.140.24.34;branch=z9hG4bK9f55.5e898d5.0 **
** Via: SIP/2.0/UDP 185.140.24.49:5060;branch=z9hG4bK5514fbec;rport=5060 **

Change your trunk setting type=peer to type=friend

Thank you,

Daniel Friedman
trixton LTD.

Host                           dnsmgr Username       Refresh State                Reg.Time
sip.easycall.pl:5060           N      {SIP USERNAME}             105 Registered           Wed, 18 Jan 2017 16:10:46
1 SIP registrations.

I use registration only for the account with the landline number, the one that we’re trying to get up and running for incoming calls.

Hello,

What about my other requests?

Thank you,

Daniel Friedman
Trixton LTD.

Sorry, I didn’t see it the first time. I changed it, but still:

<--- SIP read from UDP:185.140.24.34:5060 --->
INVITE sip:{LANDLINE NUMBER}@192.168.1.125:5060 SIP/2.0
Record-Route: <sip:185.140.24.34;lr=on;ftag=as4d729acd>
Via: SIP/2.0/UDP 185.140.24.34;branch=z9hG4bK42ff.7b279294.0
Via: SIP/2.0/UDP 185.140.24.49:5060;branch=z9hG4bK394661c2;rport=5060
Max-Forwards: 69
From: <sip:{MY CELLPHONE}@185.140.24.49>;tag=as4d729acd
To: <sip:{SIP USERNAME}@sip.easycall.pl>
Contact: <sip:{MY CELLPHONE}@185.140.24.49:5060>
Call-ID: [email protected]:5060
CSeq: 102 INVITE
User-Agent: easyCALL VoIP server
Date: Wed, 18 Jan 2017 15:18:32 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 495

v=0
o=root 1273564735 1273564735 IN IP4 185.140.24.34
s=Asterisk PBX 11.22.0
c=IN IP4 185.140.24.34
t=0 0
m=audio 64228 RTP/AVP 8 18 4 97 3 111 9 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:97 iLBC/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=direction:active
a=nortpproxy:yes

<------------->
--- (16 headers 22 lines) ---
Sending to 185.140.24.34 : 5060 (NAT)
Using INVITE request as basis request - [email protected]:5060
Found peer 'easyCALL_EneDir' for '{MY CELLPHONE}' from 185.140.24.34:5060

<--- Reliably Transmitting (NAT) to 185.140.24.34:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 185.140.24.34;branch=z9hG4bK42ff.7b279294.0;received=185.140.24.34
Via: SIP/2.0/UDP 185.140.24.49:5060;branch=z9hG4bK394661c2;rport=5060
From: <sip:{MY CELLPHONE}@185.140.24.49>;tag=as4d729acd
To: <sip:{SIP USERNAME}@sip.easycall.pl>;tag=as12e3bf50
Call-ID: [email protected]:5060
CSeq: 102 INVITE
Server: FPBX-2.9.0(1.6.2.10)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="49418ce9"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '[email protected]:5060' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:185.140.24.34:5060 --->
ACK sip:{LANDLINE NUMBER}@192.168.1.125:5060 SIP/2.0
Via: SIP/2.0/UDP 185.140.24.34;branch=z9hG4bK42ff.7b279294.0
From: <sip:{MY CELLPHONE}@185.140.24.49>;tag=as4d729acd
Call-ID: [email protected]:5060
To: <sip:{SIP USERNAME}@sip.easycall.pl>;tag=as12e3bf50
CSeq: 102 ACK
Content-Length: 0


<------------->
--- (7 headers 0 lines) ---
Really destroying SIP dialog '[email protected]' Method: REGISTER

<--- SIP read from UDP:185.140.24.34:5060 --->

<------------->

Yes, because you are getting a request from 2 ip’s. Send me the trunk settings (all the trunks from this provider)

Thank you,

Daniel Friedman
Trixton LTD.