Using pjsip - No RTP (sending local address instead of “external_signaling_address”)

Hi
I am using Asterisk 13.1-cert1;
Until now I used SIP for my trunks .
I want set my asterisk behind NAT and for two different IP’s.
If I understand right, In SIP I can specify only one extenip (I need two externip).
So I am trying to use PJSIP.
For inbound calls it works OK, for outbound calls there is no RTP.
my server (with pjsip) is listening on 5065
my remote server (using sip) is listening on 5060
Following is my pjsip file config

[0.0.0.0-udp]
type=transport
protocol=udp
bind=0.0.0.0:5065
external_media_address=
external_signaling_address=
local_net=

[mytrunk]
transport=0.0.0.0-udp
type=endpoint
context=echo1
disallow=all
allow=alaw,ulaw
dtmf_mode=rfc4733
auth=mytrunk
aors=mytrunk
outbound_auth=mytrunk

[mytrunk]
type=auth
auth_type=userpass
password=mypassword
username=mytrunk

[mytrunk]
type=aor
contact=sip::5060
max_contacts=20
qualify_frequency=10

[mytrunk]
type=identify
endpoint=mytrunk
match=

[mytrunk]
type=registration
outbound_auth=mytrunk
server_uri=sip:mytrunk@:5065
client_uri=sip:mytrunk@:5065

on the invite my server sends it’s LAN IP instead of the “external_signaling_address”

Make sure you fill the these 3 setting with the correct information, according to your network

local_net=192.0.2.0/24
external_media_address=203.0.113.1
external_signaling_address=203.0.113.1

also on the endpoint section enable the following
rtp_symmetric and force_rport options to help the far-end NAT/firewall

I added under type=endpoint
rtp_symmetric=yes
force_rport =yes
still it is the same.
See my Sngrep below:

                                                                                        xINVITE sip:123@222.10.155.111:5060 SIP/2.0
           203.0.113.1:5065            222.10.155.111:5060               192.0.2.1   xVia: SIP/2.0/UDP 203.0.113.1:5065;rport;branch=.......
          qqqqqqqqqqwqqqqqqqqq          qqqqqqqqqqwqqqqqqqqq          qqqqqqqqqqwqqqqqqqqqxFrom: "CallerID_name" <sip:0512345678@192.0.2.1>;tag=....
                    x        INVITE (SDP)         x                             x         xTo: <sip:123@222.10.155.111>
  10:04:28.575726   x qqqqqqqqqqqqqqqqqqqqqqqqqq> x                             x         xContact: <sip:c11606b3-eb4d-45a6-acb0-91564564c887@203.0.113.1:5065>
        +0.000424   x      401 Unauthorized       x                             x         xCall-ID: d15663d6-a996-4e12-bb7c-540551835652
  10:04:28.576150   x <qqqqqqqqqqqqqqqqqqqqqqqqqq x                             x         xCSeq: 19771 INVITE
        +0.000787   x             ACK             x                             x         xAllow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, .......
  10:04:28.576937   x qqqqqqqqqqqqqqqqqqqqqqqqqq> x                             x         xSupported: 100rel, timer, replaces, norefersub
        +0.000292   x        INVITE (SDP)         x                             x         xSession-Expires: 1800
  10:04:28.577229   x qqqqqqqqqqqqqqqqqqqqqqqqqq> x                             x         xMin-SE: 90
        +0.001209   x         100 Trying          x                             x         xContent-Type: application/sdp
  10:04:28.578438   x <qqqqqqqqqqqqqqqqqqqqqqqqqq x                             x         xContent-Length:   264
        +0.001365   x        200 OK (SDP)         x                             x         x
  10:04:28.579803   x <qqqqqqqqqqqqqqqqqqqqqqqqqq x                             x         xv=0
        +0.001008   x             ACK             x                             x         xo=- 1212567274 1212567274 IN IP4 192.0.2.1
  10:04:28.580811   x qqqqqqqqqqqqqqqqqqqqqqqqqq> x                             x         xs=Asterisk
                    x                             x      RTP (g711a) 1756       x         xc=IN IP4 203.0.113.1
  10:04:28.806832   x                             x13476 <qqqqqqqqqqqqqqqq 10224x         xt=0 0
       +35.977833   x             BYE             x                             x         xm=audio 10224 RTP/AVP 8 0 101
  10:05:04.558644   x qqqqqqqqqqqqqqqqqqqqqqqqqq> x                             x         xa=rtpmap:8 PCMA/8000
        +0.000678   x           200 OK            x                             x         xa=rtpmap:0 PCMU/8000
  10:05:04.559322   x <qqqqqqqqqqqqqqqqqqqqqqqqqq x                             x         xa=rtpmap:101 telephone-event/8000
                    x                             x                             x         xa=fmtp:101 0-16
                    x                             x                             x         xa=ptime:20
                    x                             x                             x         xa=maxptime:150
                    x                             x                             x         xa=sendrecv

The version of Asterisk you are using is quite old and may have bugs. Chasing down things that may already be fixed is never fun, so upgrading is wise. I do vaguely remember some NAT bugs then too.

Did you also ensure the transport options were actually set as @ambiorixg12 mentioned?

Yes I added the two options and it did not make any difference.
I will upgrade later on and will update.
Thanks

Five options were given above and it is the first three that are the most important.

The first three are set, I replace my ip addresses and somehow they didn’t copy to my post.

I upgraded to “Asterisk certified/13.21-cert3”
I have some progress, but now I get “403 Forbidden” on registration.
Following is my registration section in my pjsip.conf:
[mytrunk]
type=registration
outbound_auth=mytrunk
server_uri=sip:mytrunk@222.10.155.111:5060
client_uri=sip:mytrunk@203.0.113.1:5065

what is missing now ?
Thanks

Back to square 1.
RTP is sent to LAN (same as before upgrade).

Resolved!!!
the problem was on firewall it did not translate the nat for RTP.
Thanks

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