No inbound call on sip trunk


(Dandumit) #1

HEllo,
I have installed FreePBX last version . followed wiki and basically outbound calls from pbx to outside over sip trunk it’s working.

Unfortunately inbound calls from are not working.

I have set debug info to on on CLI but I cannot see the attempt to receive the call.

I have taken a tcpdump and I see result below
it seems that freepbx keep answering with
“SIP/2.0 401 Unauthorized”

Any ideea how to investigate further it’s greatly appreciated.
Daniel

INVITE sip:314335388@192.168.32.110:5060 SIP/2.0

Record-Route: <sip:82.76.7.26;lr=on;ftag=gtej7Xy2mHyUS;vst=AAAAAAQBBAMDBQAJDHNAXEMWSiNLH1xTRQBFQQgDCgMANjA->

Via: SIP/2.0/UDP 82.76.7.26;branch=z9hG4bK8222.2a54adb391e4d20adce3b15b0b01975d.0

Via: SIP/2.0/UDP 82.76.7.26:5090;rport=5090;branch=z9hG4bKKZtgyHa8XjBmm

Max-Forwards: 13

From: "0722461594" <sip:0722461594@10.188.36.36>;tag=gtej7Xy2mHyUS

To: <sip:314335388@sip.rcs-rds.ro:5060>

Call-ID: 35c9f0da-3269-1239-d28f-a45d36c5665c

CSeq: 22039868 INVITE

Contact: <sip:0722461594@82.76.7.26:5090>

User-Agent: MediaServer

Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE

Supported: timer, path, replaces

Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer

Content-Type: application/sdp

Content-Disposition: session

Content-Length: 296

v=0

o=MediaServer 3314728881 3314728882 IN IP4 82.76.7.26

s=MediaServer

c=IN IP4 82.76.7.26

t=0 0

m=audio 29064 RTP/AVP 8 121 101

c=IN IP4 82.76.7.26

a=rtpmap:8 PCMA/8000

a=rtpmap:121 frf-dialed-digit/8000

a=fmtp:121 0-15

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=ptime:20

SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP 82.76.7.26;rport=5060;received=82.76.7.26;branch=z9hG4bK8222.2a54adb391e4d20adce3b15b0b01975d.0

Via: SIP/2.0/UDP 82.76.7.26:5090;rport=5090;branch=z9hG4bKKZtgyHa8XjBmm

Record-Route: <sip:82.76.7.26;lr;ftag=gtej7Xy2mHyUS;vst=AAAAAAQBBAMDBQAJDHNAXEMWSiNLH1xTRQBFQQgDCgMANjA->

Call-ID: 35c9f0da-3269-1239-d28f-a45d36c5665c

From: "0722461594" <sip:0722461594@10.188.36.36>;tag=gtej7Xy2mHyUS

To: <sip:314335388@sip.rcs-rds.ro>;tag=z9hG4bK8222.2a54adb391e4d20adce3b15b0b01975d.0

CSeq: 22039868 INVITE

WWW-Authenticate: Digest realm="asterisk",nonce="1593187320/b3a999ed4398abf8ce94eac62f1ca7a9",opaque="0cce967016a2bc64",algorithm=md5,qop="auth"

Server: FPBX-15.0.16.56(16.6.2)

Content-Length: 0

ACK sip:314335388@192.168.32.110:5060 SIP/2.0

Via: SIP/2.0/UDP 82.76.7.26;branch=z9hG4bK8222.2a54adb391e4d20adce3b15b0b01975d.0

Max-Forwards: 13

From: "0722461594" <sip:0722461594@10.188.36.36>;tag=gtej7Xy2mHyUS

To: <sip:314335388@sip.rcs-rds.ro>;tag=z9hG4bK8222.2a54adb391e4d20adce3b15b0b01975d.0

Call-ID: 35c9f0da-3269-1239-d28f-a45d36c5665c

CSeq: 22039868 ACK

Content-Length: 0

INVITE sip:314335388@192.168.32.110:5060 SIP/2.0

Record-Route: <sip:82.76.7.26;lr=on;ftag=KNtvcFHDcc1Kc;vst=AAAAAAQBBAMDBQAJDHNAXEMWSiNLH1xTRQBFQQgDCgMANjA->

Via: SIP/2.0/UDP 82.76.7.26;branch=z9hG4bK5fe3.ce1bf5c605541a9bff323acbb48012f6.0

Via: SIP/2.0/UDP 82.76.7.26:5090;rport=5090;branch=z9hG4bKpt6t32vjNDecQ

Max-Forwards: 13

From: "0722461594" <sip:0722461594@10.188.36.36>;tag=KNtvcFHDcc1Kc

To: <sip:314335388@sip.rcs-rds.ro:5060>

Call-ID: 35d7c792-3269-1239-d28f-a45d36c5665c

CSeq: 22039868 INVITE

Contact: <sip:0722461594@82.76.7.26:5090>

User-Agent: MediaServer

Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE

Supported: timer, path, replaces

Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer

Content-Type: application/sdp

Content-Disposition: session

Content-Length: 296

v=0

o=MediaServer 3314728881 3314728882 IN IP4 82.76.7.26

s=MediaServer

c=IN IP4 82.76.7.26

t=0 0

m=audio 21088 RTP/AVP 8 121 101

c=IN IP4 82.76.7.26

a=rtpmap:8 PCMA/8000

a=rtpmap:121 frf-dialed-digit/8000

a=fmtp:121 0-15

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

a=ptime:20

SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP 82.76.7.26;rport=5060;received=82.76.7.26;branch=z9hG4bK5fe3.ce1bf5c605541a9bff323acbb48012f6.0

Via: SIP/2.0/UDP 82.76.7.26:5090;rport=5090;branch=z9hG4bKpt6t32vjNDecQ

Record-Route: <sip:82.76.7.26;lr;ftag=KNtvcFHDcc1Kc;vst=AAAAAAQBBAMDBQAJDHNAXEMWSiNLH1xTRQBFQQgDCgMANjA->

Call-ID: 35d7c792-3269-1239-d28f-a45d36c5665c

From: "0722461594" <sip:0722461594@10.188.36.36>;tag=KNtvcFHDcc1Kc

To: <sip:314335388@sip.rcs-rds.ro>;tag=z9hG4bK5fe3.ce1bf5c605541a9bff323acbb48012f6.0

CSeq: 22039868 INVITE

WWW-Authenticate: Digest realm="asterisk",nonce="1593187320/b3a999ed4398abf8ce94eac62f1ca7a9",opaque="5d69baec12e7bf26",algorithm=md5,qop="auth"

Server: FPBX-15.0.16.56(16.6.2)

Content-Length: 0

ACK sip:314335388@192.168.32.110:5060 SIP/2.0

Via: SIP/2.0/UDP 82.76.7.26;branch=z9hG4bK5fe3.ce1bf5c605541a9bff323acbb48012f6.0

Max-Forwards: 13

From: "0722461594" <sip:0722461594@10.188.36.36>;tag=KNtvcFHDcc1Kc

To: <sip:314335388@sip.rcs-rds.ro>;tag=z9hG4bK5fe3.ce1bf5c605541a9bff323acbb48012f6.0

Call-ID: 35d7c792-3269-1239-d28f-a45d36c5665c

CSeq: 22039868 ACK

Content-Length: 0


#2

Yes this is basic SIP trunk configuration. It says “Unauthorized” because it does not recognize the incoming call as being related to your trunk. How you associate incoming calls with your trunk is different depending on whether you are using pjsip or chan_sip.


(Lorne Gaetz) #3

Also depends on if you’re using registration or IP authentication.


(Dandumit) #4

Thank you both for your answers !

Trunk it’s defined as chan_sip .
I guess that I am using registration . I guess that credentials and config string it’s completed well since outgoing ok.

I was guessing / suspecting / digging around NAT configuration . My little NTW setup looks like

Internet (pbx agents) -> pfsense ->192.168.1._ ETH1 ->FreePBX

SIpTrunkPRovider-> ONT box -> 192.168.32._ ETH0->FreePBX

I have declared 2 static routes toward my SIP trunk provider. all ntw setup it’s detected like in picture below in settings>asterisk sip settings.

Thank you for any suggestion.


(Dandumit) #5

@billsimon @Igaetz - if you know how to investigate further please tell me

This is my connection string (but again to place calls from freepbx to outside it’s working )

defaultuser=user
secret=pass
host=sip.rcs-rds.ro
fromdomain=sip.rcs-rds.ro
fromuser=user
type=peer
qualify=yes
insecure=port,invite
disallow=all
context=from-trunk
canreinvite=no
allow=alaw&ulaw
nat=yes

and for outgoing

user:pass@sip.rcs-rds.ro/pass

I have even tried to put “Allow Anonymous Inbound SIP Calls” - to yes. but still does not accept incoming calls from trunk.