My phone is located behind a NAT, 172.16.0.0/21. Asterisk 16 is on a public IP. PJSIP has the config below: force_rport=yes direct_media=yes disable_direct_media_on_nat = yes direct_media_method=invite But when I send a call I see the RTP being sent to my private address, vs the public IP. This only happens when Asterisk has dialed the call to another carrier. If instead of Dial I choose Answer() and MusicOnHold, then the RTP gets shipped to the right address. This is a sample of the erroneous behavior: Got RTP packet from XX.XX.XX.XX:17510 (type 00, seq 024786, ts 017440, len 000160) Sent RTP packet to 172.16.7.254:50798 (type 00, seq 010736, ts 017440, len 000160) 172.16.7.254 is my private address. What am I missing? Should I open a bug? Asterisk should never, ever send RTP to a private address when Asterisk itself is on a public IP. Before you ask, the dialplan is 3 lines, '_X.' => 1. NoOP() 2. Dial(PJSIP/${EXTEN}@carrier) 3. Hangup() -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20200517/08af14f4/attachment.html>
About this case: the old SIP channel behaves correctly. On Sun, May 17, 2020 at 2:44 AM Saint Michael <venefax at gmail.com> wrote:> My phone is located behind a NAT, 172.16.0.0/21. > Asterisk 16 is on a public IP. > PJSIP has the config below: > force_rport=yes > direct_media=yes > disable_direct_media_on_nat = yes > direct_media_method=invite > > But when I send a call I see the RTP being sent to my private address, vs > the public IP. This only happens when Asterisk has dialed the call to > another carrier. If instead of Dial I choose Answer() and MusicOnHold, then > the RTP gets shipped to the right address. > This is a sample of the erroneous behavior: > Got RTP packet from XX.XX.XX.XX:17510 (type 00, seq 024786, ts 017440, > len 000160) > Sent RTP packet to 172.16.7.254:50798 (type 00, seq 010736, ts > 017440, len 000160) > > 172.16.7.254 is my private address. > What am I missing? Should I open a bug? > Asterisk should never, ever send RTP to a private address when Asterisk > itself is on a public IP. > Before you ask, the dialplan is 3 lines, > '_X.' => 1. NoOP() > 2. Dial(PJSIP/${EXTEN}@carrier) > 3. Hangup() > > > > > > > > > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20200517/6e75dd4d/attachment.html>
Reasonably Related Threads
- CALLERID on pjsip doesn't work?
- asterisk 13.16 / pjsip / t.38: res_pjsip_t38.c:207 t38_automatic_reject: Automatically rejecting T.38 request on channel 'PJSIP/91-00000007'
- CALLERID on pjsip doesn't work?
- Ast 13 beta 3 - Segfault when calling on pjsip trunk with directmedia=yes
- SIP DTMF problem with SNOM