Incoming calls fail

Hi!

I’ve been banging my head with this issue for quite a while and realize I’m not Einstein and won’t be a candidate for the Nobel prize next year either…:wink:

I’m a SIP novice, so please excuse my ignorance.

The setup:

  • An IP-phone account with a phone number (DID?) with Phonzo as provider
  • My LAN is behind a gateway/router, no ports forwarded.
  • FreePBX running on a RaspberryPi

What works:

  • Registering the Phonzo SIP-trunk account in Csipsimple on my Android, sitting within my LAN, outgoing and incoming calls works
  • Registering the Phonzo SIP-trunk account in X-Lite on my Windows laptop, sitting within my LAN, outgoing and incoming calls works
  • Registering Android units (Csipsimple) to my local FreePBX extensions, local calls between them works
  • Registering Android units (Csipsimple) to my local FreePBX extensions, outgoing calls using SIP-trunk via provider Phonzo works

However, when my FreePBX is registered to the SIP-trunk, incoming calls fail. Dialing the SIP-trunk results in a few seconds of silence, and the call is ended.

What I’ve tried:

  • Follow multiple configuration guides on the net
  • Search several forums, and applying tips found there
  • Use an alternate port, even port forwarding that port
  • Initial analyis of Asterisk logs. Registration seems to succeed, but I cannot find call related activity when the trunk is dialed.
  1. Why does both incoming and outgoing calls work when I configure Csipsimple and X-lite to use the SIP-trunk directly, and not when going via FreePBX?
  2. Would really appreciate if someone could bump me in the right direction. What should I look for? Where should I look?

Best regards

It would be easier to help you if you posted you trunk config and some logs of failed calls.

Thanks Alan!

Below are hopefully the requested config, and a log started when sip was reloaded and a call was placed. No sign of INVITE…?

Thanks again!

****** CONFIG **********

sip_general_additional.conf:

vmexten=*97
context=from-sip-external
callerid=Unknown
notifyringing=yes
notifyhold=yes
tos_sip=cs3
tos_audio=ef
tos_video=af41
alwaysauthreject=yes
useragent=FPBX-2.11.0(11.6.0)
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=g729
callevents=no
bindport=50701
jbenable=no
minexpiry=60
maxcallbitrate=384
maxexpiry=3600
notifyhold=yes
notifyringing=yes
registerattempts=0
registertimeout=20
rtpholdtimeout=300
rtpkeepalive=0
rtptimeout=30
srvlookup=yes
allowguest=yes
checkmwi=10
defaultexpiry=120
videosupport=no
canreinvite=no
g726nonstandard=no
nat=yes
externhost=mydomain.dyndns.com
externrefresh=120
localnet=192.168.1.0/255.255.255.0

sip_additional.conf:

[1000]
deny=0.0.0.0/0.0.0.0
secret=******
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
nat=no
port=5060
qualify=yes
qualifyfreq=60
transport=udp
encryption=no
callgroup=
pickupgroup=
dial=SIP/1000
mailbox=1000@device
permit=0.0.0.0/0.0.0.0
callerid=Pia <1000>
callcounter=yes
faxdetect=no

[1001]
deny=0.0.0.0/0.0.0.0
secret=******
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
nat=no
port=5060
qualify=yes
qualifyfreq=60
transport=udp
encryption=no
callgroup=
pickupgroup=
dial=SIP/1001
mailbox=1001@device
permit=0.0.0.0/0.0.0.0
callerid=Sven <1001>
callcounter=yes
faxdetect=no

[1002]
deny=0.0.0.0/0.0.0.0
secret=******
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
nat=no
port=5060
qualify=yes
qualifyfreq=60
transport=udp
encryption=no
callgroup=
pickupgroup=
dial=SIP/1002
mailbox=1002@device
permit=0.0.0.0/0.0.0.0
callerid=Plattan <1002>
callcounter=yes
faxdetect=no

[1003]
deny=0.0.0.0/0.0.0.0
secret=******
dtmfmode=rfc2833
canreinvite=no
context=from-internal
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
nat=no
port=5060
qualify=yes
qualifyfreq=60
transport=udp
encryption=no
callgroup=
pickupgroup=
dial=SIP/1003
mailbox=1003@device
permit=0.0.0.0/0.0.0.0
callerid=Laptop <1003>
callcounter=yes
faxdetect=no

[PhonzoTrunk]
username=46105XXXXXX
type=peer
secret=*******
qualify=yes
insecure=port,invite
host=sip.phonzo.com
fromdomain=sip.phonzo.com
canreinvite=no
canredirect=no
authuser=46105XXXXXX
context=from-trunk-sip-PhonzoTrunk

sip_registrations.conf:

register=105XXXXXX:PASSWORD:[email protected]:5060/105XXXXXX

****** LOG **********

root@raspbx:~# asterisk -vvvvvvvvvvr
Asterisk 11.6.0, Copyright © 1999 - 2013 Digium, Inc. and others.
Created by Mark Spencer [email protected]
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 11.6.0 currently running on raspbx (pid = 2774)
raspbxCLI> sip set debug on
SIP Debugging enabled
raspbx
CLI> sip reload
Reloading SIP
== Parsing ‘/etc/asterisk/sip.conf’: Found
== Parsing ‘/etc/asterisk/sip_general_additional.conf’: Found
== Parsing ‘/etc/asterisk/sip_general_custom.conf’: Found
== Parsing ‘/etc/asterisk/sip_nat.conf’: Found
== Parsing ‘/etc/asterisk/sip_registrations_custom.conf’: Found
== Parsing ‘/etc/asterisk/sip_registrations.conf’: Found
== Parsing ‘/etc/asterisk/sip_custom.conf’: Found
== Parsing ‘/etc/asterisk/sip_additional.conf’: Found
== Parsing ‘/etc/asterisk/sip_custom_post.conf’: Found
== Parsing ‘/etc/asterisk/users.conf’: Found
[2014-01-05 22:45:00] WARNING[2832]: sip/config_parser.c:812 sip_parse_nat_option: nat=yes is deprecated, use nat=force_rport,comedia instead
== Using SIP TOS bits 96
== Using SIP CoS mark 4
Reliably Transmitting (no NAT) to 192.168.1.78:48582:
NOTIFY sip:[email protected]:48582;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.1.90:5060;branch=z9hG4bK1b017078;rport
Max-Forwards: 70
Route: sip:[email protected]:48582;ob
From: “Unknown” sip:[email protected];tag=as65916f64
To: sip:[email protected]:48582;ob;tag=ta7Umg8mSI0ST0hFKR7BLJa6LbojhSdw
Contact: sip:[email protected]:5060
Call-ID: Nfzjpna8axWLewJl7EEpety5WYMLCf1K
CSeq: 105 NOTIFY
User-Agent: FPBX-2.11.0(11.6.0)
Event: message-summary
Content-Type: application/simple-message-summary
Subscription-State: active
Content-Length: 87

Messages-Waiting: no
Message-Account: sip:*[email protected]
Voice-Message: 0/0 (0/0)


== Parsing ‘/etc/asterisk/sip_notify.conf’: Found
== Parsing ‘/etc/asterisk/sip_notify_custom.conf’: Found
== Parsing ‘/etc/asterisk/sip_notify_additional.conf’: Found
Retransmitting #1 (no NAT) to 192.168.1.78:48582:
NOTIFY sip:[email protected]:48582;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.1.90:5060;branch=z9hG4bK1b017078;rport
Max-Forwards: 70
Route: sip:[email protected]:48582;ob
From: “Unknown” sip:[email protected];tag=as65916f64
To: sip:[email protected]:48582;ob;tag=ta7Umg8mSI0ST0hFKR7BLJa6LbojhSdw
Contact: sip:[email protected]:5060
Call-ID: Nfzjpna8axWLewJl7EEpety5WYMLCf1K
CSeq: 105 NOTIFY
User-Agent: FPBX-2.11.0(11.6.0)
Event: message-summary
Content-Type: application/simple-message-summary
Subscription-State: active
Content-Length: 87

Messages-Waiting: no
Message-Account: sip:*[email protected]
Voice-Message: 0/0 (0/0)


Reliably Transmitting (no NAT) to 192.168.1.78:48582:
OPTIONS sip:[email protected]:48582;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.1.90:5060;branch=z9hG4bK0fdb3e81
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as39fa0f6c
To: sip:[email protected]:48582;ob
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.11.0(11.6.0)
Date: Sun, 05 Jan 2014 22:45:01 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


Reliably Transmitting (NAT) to 80.232.37.178:5060:
OPTIONS sip:sip.phonzo.com SIP/2.0
Via: SIP/2.0/UDP 78.XX.XXX.XXX:5060;branch=z9hG4bK2b7fd386;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as6d88a35e
To: sip:sip.phonzo.com
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.11.0(11.6.0)
Date: Sun, 05 Jan 2014 22:45:01 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


[2014-01-05 22:45:01] NOTICE[2832]: chan_sip.c:14995 sip_reregister: – Re-registration for [email protected]
REGISTER 10 headers, 0 lines
Reliably Transmitting (NAT) to 80.232.37.178:5060:
REGISTER sip:sip.phonzo.com SIP/2.0
Via: SIP/2.0/UDP 78.XX.XXX.XXX:5060;branch=z9hG4bK6399dcaf;rport
Max-Forwards: 70
From: sip:[email protected];tag=as0dcc4274
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 102 REGISTER
User-Agent: FPBX-2.11.0(11.6.0)
Expires: 120
Contact: sip:[email protected]:5060
Content-Length: 0


<— SIP read from UDP:80.232.37.178:5060 —>
SIP/2.0 501 Unsupported Method
Via: SIP/2.0/UDP 78.XX.XXX.XXX:5060;branch=z9hG4bK2b7fd386;rport=53286
To: sip:sip.phonzo.com;tag=7c68881b
From: “Unknown” sip:[email protected];tag=as6d88a35e
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
Content-Length: 0

<------------->
— (7 headers 0 lines) —
Really destroying SIP dialog ‘[email protected]:5060’ Method: OPTIONS

<— SIP read from UDP:80.232.37.178:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 78.XX.XXX.XXX:5060;branch=z9hG4bK6399dcaf;rport=53286
To: sip:[email protected];tag=6bbca963
From: sip:[email protected];tag=as0dcc4274
Call-ID: [email protected]
CSeq: 102 REGISTER
WWW-Authenticate: Digest nonce=“1388961901:471e1d9c66f31243fb0bfa48db29d999”,algorithm=MD5,realm="sip.phonzo.com"
Content-Length: 0

<------------->
— (8 headers 0 lines) —
Responding to challenge, registration to domain/host name sip.phonzo.com
REGISTER 11 headers, 0 lines
Reliably Transmitting (NAT) to 80.232.37.178:5060:
REGISTER sip:sip.phonzo.com SIP/2.0
Via: SIP/2.0/UDP 78.XX.XXX.XXX:5060;branch=z9hG4bK0f33a1ae;rport
Max-Forwards: 70
From: sip:[email protected];tag=as7cad6ad4
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 103 REGISTER
User-Agent: FPBX-2.11.0(11.6.0)
Authorization: Digest username=“46105XXXXXX”, realm=“sip.phonzo.com”, algorithm=MD5, uri=“sip:sip.phonzo.com”, nonce=“1388961901:471e1d9c66f31243fb0bfa48db29d999”, response="25f3dbac01309ac46d59977b1f08c759"
Expires: 120
Contact: sip:[email protected]:5060
Content-Length: 0


<— SIP read from UDP:80.232.37.178:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 78.XX.XXX.XXX:5060;branch=z9hG4bK0f33a1ae;rport=53286
Contact: sip:[email protected]:5060;expires=300
To: sip:[email protected];tag=fca32d28
From: sip:[email protected];tag=as7cad6ad4
Call-ID: [email protected]
CSeq: 103 REGISTER
Date: Sun, 05 Jan 2014 22:45:01 GMT
PortaBilling: available-funds:94.07 currency:SEK
Content-Length: 0

<------------->
— (10 headers 0 lines) —
Scheduling destruction of SIP dialog ‘[email protected]’ in 32000 ms (Method: REGISTER)
[2014-01-05 22:45:01] NOTICE[2832]: chan_sip.c:23425 handle_response_register: Outbound Registration: Expiry for sip.phonzo.com is 300 sec (Scheduling reregistration in 285 s)
Retransmitting #2 (no NAT) to 192.168.1.78:48582:
NOTIFY sip:[email protected]:48582;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.1.90:5060;branch=z9hG4bK1b017078;rport
Max-Forwards: 70
Route: sip:[email protected]:48582;ob
From: “Unknown” sip:[email protected];tag=as65916f64
To: sip:[email protected]:48582;ob;tag=ta7Umg8mSI0ST0hFKR7BLJa6LbojhSdw
Contact: sip:[email protected]:5060
Call-ID: Nfzjpna8axWLewJl7EEpety5WYMLCf1K
CSeq: 105 NOTIFY
User-Agent: FPBX-2.11.0(11.6.0)
Event: message-summary
Content-Type: application/simple-message-summary
Subscription-State: active
Content-Length: 87

Messages-Waiting: no
Message-Account: sip:*[email protected]
Voice-Message: 0/0 (0/0)


Retransmitting #3 (no NAT) to 192.168.1.78:48582:
NOTIFY sip:[email protected]:48582;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.1.90:5060;branch=z9hG4bK1b017078;rport
Max-Forwards: 70
Route: sip:[email protected]:48582;ob
From: “Unknown” sip:[email protected];tag=as65916f64
To: sip:[email protected]:48582;ob;tag=ta7Umg8mSI0ST0hFKR7BLJa6LbojhSdw
Contact: sip:[email protected]:5060
Call-ID: Nfzjpna8axWLewJl7EEpety5WYMLCf1K
CSeq: 105 NOTIFY
User-Agent: FPBX-2.11.0(11.6.0)
Event: message-summary
Content-Type: application/simple-message-summary
Subscription-State: active
Content-Length: 87

Messages-Waiting: no
Message-Account: sip:*[email protected]
Voice-Message: 0/0 (0/0)


Retransmitting #1 (no NAT) to 192.168.1.78:48582:
OPTIONS sip:[email protected]:48582;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.1.90:5060;branch=z9hG4bK0fdb3e81
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as39fa0f6c
To: sip:[email protected]:48582;ob
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.11.0(11.6.0)
Date: Sun, 05 Jan 2014 22:45:01 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<— SIP read from UDP:192.168.1.78:48582 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.90:5060;rport=5060;received=192.168.1.90;branch=z9hG4bK1b017078
Call-ID: Nfzjpna8axWLewJl7EEpety5WYMLCf1K
From: “Unknown” sip:[email protected];tag=as65916f64
To: sip:[email protected];ob;tag=ta7Umg8mSI0ST0hFKR7BLJa6LbojhSdw
CSeq: 105 NOTIFY
Contact: sip:[email protected]:48582;ob
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Content-Length: 0

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

<— SIP read from UDP:192.168.1.78:48582 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.90:5060;rport=5060;received=192.168.1.90;branch=z9hG4bK1b017078
Call-ID: Nfzjpna8axWLewJl7EEpety5WYMLCf1K
From: “Unknown” sip:[email protected];tag=as65916f64
To: sip:[email protected];ob;tag=ta7Umg8mSI0ST0hFKR7BLJa6LbojhSdw
CSeq: 105 NOTIFY
Contact: sip:[email protected]:48582;ob
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Content-Length: 0

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

<— SIP read from UDP:192.168.1.78:48582 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.90:5060;received=192.168.1.90;branch=z9hG4bK0fdb3e81
Call-ID: [email protected]:5060
From: “Unknown” sip:[email protected];tag=as39fa0f6c
To: sip:[email protected];ob;tag=z9hG4bK0fdb3e81
CSeq: 102 OPTIONS
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Accept: application/sdp, application/pidf+xml, application/xpidf+xml, application/simple-message-summary, message/sipfrag;version=2.0, application/im-iscomposing+xml, text/plain
Supported: replaces, 100rel, timer, norefersub
Allow-Events: presence, message-summary, refer
User-Agent: CSipSimple_santos10wifi-17/r2330
Content-Type: application/sdp
Content-Length: 308

v=0
o=- 3597950736 3597950736 IN IP4 192.168.1.78
s=pjmedia
t=0 0
m=audio 4000 RTP/AVP 9 99 0 8 101
c=IN IP4 192.168.1.78
a=sendrecv
a=rtpmap:9 G722/8000
a=rtpmap:99 SILK/24000
a=fmtp:99 useinbandfec=0
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
<------------->
— (13 headers 14 lines) —
Really destroying SIP dialog ‘[email protected]:5060’ Method: OPTIONS

<— SIP read from UDP:192.168.1.78:48582 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.90:5060;rport=5060;received=192.168.1.90;branch=z9hG4bK1b017078
Call-ID: Nfzjpna8axWLewJl7EEpety5WYMLCf1K
From: “Unknown” sip:[email protected];tag=as65916f64
To: sip:[email protected];ob;tag=ta7Umg8mSI0ST0hFKR7BLJa6LbojhSdw
CSeq: 105 NOTIFY
Contact: sip:[email protected]:48582;ob
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Content-Length: 0

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

<— SIP read from UDP:192.168.1.78:48582 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.90:5060;rport=5060;received=192.168.1.90;branch=z9hG4bK1b017078
Call-ID: Nfzjpna8axWLewJl7EEpety5WYMLCf1K
From: “Unknown” sip:[email protected];tag=as65916f64
To: sip:[email protected];ob;tag=ta7Umg8mSI0ST0hFKR7BLJa6LbojhSdw
CSeq: 105 NOTIFY
Contact: sip:[email protected]:48582;ob
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Content-Length: 0

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

<— SIP read from UDP:192.168.1.78:48582 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.90:5060;received=192.168.1.90;branch=z9hG4bK0fdb3e81
Call-ID: [email protected]:5060
From: “Unknown” sip:[email protected];tag=as39fa0f6c
To: sip:[email protected];ob;tag=z9hG4bK0fdb3e81
CSeq: 102 OPTIONS
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Accept: application/sdp, application/pidf+xml, application/xpidf+xml, application/simple-message-summary, message/sipfrag;version=2.0, application/im-iscomposing+xml, text/plain
Supported: replaces, 100rel, timer, norefersub
Allow-Events: presence, message-summary, refer
User-Agent: CSipSimple_santos10wifi-17/r2330
Content-Type: application/sdp
Content-Length: 308

v=0
o=- 3597950736 3597950736 IN IP4 192.168.1.78
s=pjmedia
t=0 0
m=audio 4000 RTP/AVP 9 99 0 8 101
c=IN IP4 192.168.1.78
a=sendrecv
a=rtpmap:9 G722/8000
a=rtpmap:99 SILK/24000
a=fmtp:99 useinbandfec=0
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
<------------->
— (13 headers 14 lines) —
Really destroying SIP dialog ‘natpingOThjODgwNjE1YzIyZjUxMmNmOWJmMDFjZDg4ZTk1ZmI.’ Method: OPTIONS
Really destroying SIP dialog ‘[email protected]’ Method: REGISTER

<— SIP read from UDP:192.168.1.78:48582 —>

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

<— SIP read from UDP:80.232.37.178:5060 —>
OPTIONS sip:sip.phonzo.com SIP/2.0
Via: SIP/2.0/UDP 80.232.37.178:5060;branch=z9hG4bK-d8754z-43144009eaab140d-1—d8754z-;rport
Max-Forwards: 1
To: sip:sip.phonzo.com
From: sip:80.232.37.178:5060;tag=d8886847
Call-ID: natpingMmU2OTM2MTA3YTBhMmNlYjc0MTBiMzdiMjU5YjAxOGQ.
CSeq: 1 OPTIONS
Accept: application/sdp
Content-Length: 0

<------------->
— (9 headers 0 lines) —
Sending to 80.232.37.178:5060 (NAT)
Looking for s in from-sip-external (domain sip.phonzo.com)

<— Transmitting (NAT) to 80.232.37.178:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 80.232.37.178:5060;branch=z9hG4bK-d8754z-43144009eaab140d-1—d8754z-;received=80.232.37.178;rport=5060
From: sip:80.232.37.178:5060;tag=d8886847
To: sip:sip.phonzo.com;tag=as2429a5a5
Call-ID: natpingMmU2OTM2MTA3YTBhMmNlYjc0MTBiMzdiMjU5YjAxOGQ.
CSeq: 1 OPTIONS
Server: FPBX-2.11.0(11.6.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:78.XX.XXX.XXX:5060
Accept: application/sdp
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘natpingMmU2OTM2MTA3YTBhMmNlYjc0MTBiMzdiMjU5YjAxOGQ.’ in 32000 ms (Method: OPTIONS)
Reliably Transmitting (NAT) to 80.232.37.178:5060:
OPTIONS sip:sip.phonzo.com SIP/2.0
Via: SIP/2.0/UDP 78.XX.XXX.XXX:5060;branch=z9hG4bK62652304;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as5b93c8c3
To: sip:sip.phonzo.com
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.11.0(11.6.0)
Date: Sun, 05 Jan 2014 22:46:01 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<— SIP read from UDP:80.232.37.178:5060 —>
SIP/2.0 501 Unsupported Method
Via: SIP/2.0/UDP 78.XX.XXX.XXX:5060;branch=z9hG4bK62652304;rport=53286
To: sip:sip.phonzo.com;tag=36c61d4b
From: “Unknown” sip:[email protected];tag=as5b93c8c3
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
Content-Length: 0

<------------->
— (7 headers 0 lines) —
Really destroying SIP dialog ‘[email protected]:5060’ Method: OPTIONS
Reliably Transmitting (no NAT) to 192.168.1.78:48582:
OPTIONS sip:[email protected]:48582;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.1.90:5060;branch=z9hG4bK07eb8656
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as45bbe850
To: sip:[email protected]:48582;ob
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.11.0(11.6.0)
Date: Sun, 05 Jan 2014 22:46:02 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<— SIP read from UDP:192.168.1.78:48582 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.90:5060;received=192.168.1.90;branch=z9hG4bK07eb8656
Call-ID: [email protected]:5060
From: “Unknown” sip:[email protected];tag=as45bbe850
To: sip:[email protected];ob;tag=z9hG4bK07eb8656
CSeq: 102 OPTIONS
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Accept: application/sdp, application/pidf+xml, application/xpidf+xml, application/simple-message-summary, message/sipfrag;version=2.0, application/im-iscomposing+xml, text/plain
Supported: replaces, 100rel, timer, norefersub
Allow-Events: presence, message-summary, refer
User-Agent: CSipSimple_santos10wifi-17/r2330
Content-Type: application/sdp
Content-Length: 308

v=0
o=- 3597950797 3597950797 IN IP4 192.168.1.78
s=pjmedia
t=0 0
m=audio 4000 RTP/AVP 9 99 0 8 101
c=IN IP4 192.168.1.78
a=sendrecv
a=rtpmap:9 G722/8000
a=rtpmap:99 SILK/24000
a=fmtp:99 useinbandfec=0
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
<------------->
— (13 headers 14 lines) —
Really destroying SIP dialog ‘[email protected]:5060’ Method: OPTIONS
raspbxCLI> sip set debug off
SIP Debugging Disabled
raspbx
CLI> sip show registry
Host dnsmgr Username Refresh State Reg.Time
sip.phonzo.com:5060 N 105XXXXXX 285 Registered Sun, 05 Jan 2014 22:45:01
1 SIP registrations.
raspbxCLI> sip show peers
Name/username Host Dyn Forcerport ACL Port Status Description
1000 (Unspecified) D A 0 UNKNOWN
1001 (Unspecified) D A 0 UNKNOWN
1002/1002 192.168.1.78 D A 48582 OK (591 ms)
1003 (Unspecified) D A 0 UNKNOWN
PhonzoTrunk/46105XXXXXX 80.232.37.178 N 5060 OK (14 ms)
5 sip peers [Monitored: 2 online, 3 offline Unmonitored: 0 online, 0 offline]
raspbx
CLI> exit
Asterisk cleanly ending (0).
Executing last minute cleanups

You have authentication in the trunk then you set it as insecure, that ignores authentication. That is generally only done on trunks with static IP that use the IP for authentication.

I don’t see externip or externhost specified anywhere, is it set in sip settings?

Did you add the context to your trunk? The context should just be from-trunk

Also why does a phone on your LAN have a 1/2 second latency?

I have removed “insecure” from trunk definition. Still no incoming calls.

In my previous post there is a dump of sip_general_additional.conf, which has a definition for “externhost=mydomain.dyndns.com”. The address is of course something else. Is it misplaced or wrong?

I’ve set the trunk context to “context=from-trunk”. Still no incoming calls.

The LAN phone with large latency is an Android unit running Csipsimple, using basic configuration template to register on my FreePBX.

Should I see INVITE from the SIP provider in the log when there is an incoming call?

The updated trunk config:

[PhonzoTrunk]
username=46105XXXXXX
type=peer
secret=******
qualify=yes
host=sip.phonzo.com
fromdomain=sip.phonzo.com
canreinvite=no
canredirect=no
authuser=46105XXXXXX
context=from-trunk

One would think you would see the invite. I would forward port 5060 from your firewall (UDP) just to be sure.

Asterisk is a B2BUA, not a SIP client. It is more difficult than just getting a peer to work. But, you still should see an invite with global SIP debug on.

My NAT has locked port forwarding to something called ALG for port 5060. Cannot disable ALG and thereby forwarding of port 5060 is not possible. Have tried binding FreePBX to another port and forwarding that port instead, without success…

With Wireshark, I’ve been capturing communication between X-Lite on a laptop (which can receive incoming calls) and the SIP-trunk. All communication is made with the laptop’s local LAN IP and the provider’s external address. External IP and address substitution and routing is handled by my NAT?

Inspecting the logs from my FreePBX unit (e.g in my previous comment), I see that the external IP is used already from the PBX? The externhost/externip defined in general-conf section? What is the FreePBX exernip used for?

Again. I’m totally out of bounds here, in terms of knowledge. But would really like to solve this issue.

Best regards

Always disable ALG/Helper functions on your router the are rarely helpful.

Thanks dicko.

ALG cannot be disabled in the router.

Did some wild testing. If I replace the actual external IP with the FreePBX box IP (i.e local IP) and disable NAT (nat=no), I can make and receive calls.

What does this mean? Will I have stability issues or such?

If I use VPN or TLS, will I be able to bypass the “helper” ALG in the router.

Thanks!