[asterisk-bugs] [JIRA] (ASTERISK-28993) PJSIP picks wrong media IP address for listening RTP

Marin Odrljin (JIRA) noreply at issues.asterisk.org
Thu Jul 16 07:13:25 CDT 2020


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=251438#comment-251438 ] 

Marin Odrljin edited comment on ASTERISK-28993 at 7/16/20 7:13 AM:
-------------------------------------------------------------------

Yes, then it works. Thank you!
I've added to each endpoint the same IP address as it is defined in its transport (.42 - .72):
{code}
media_address=10.5.20.42
bind_rtp_to_media_address=yes
{code}

Asterisk listens on the same IP as stated in SDP and it does it correctly on each different IP as defined for each individual trunk.
So you think this is a quite common to define those parameters in such scenario when there are multiple local IP addresses? Transport binding is not enough?

However, I saw another interesting thing - SIP messages are always sent from the same IP 10.5.20.42 for all trunks binded to .42 - .72, at least that is written in Via header:
{code}
<--- History Entry 0 Sent to 138.187.57.135:5060 at 1594897914 --->
OPTIONS sip:X.X.X.135 SIP/2.0
Via: SIP/2.0/UDP 10.5.20.42:5060;rport;branch=z9hG4bKPje47537b7-c33d-4ea7-ab3f-21b7efdb8b62
From: <sip:pjsip-swisscom-5 at 10.5.20.62>;tag=02ac0423-f5d0-4832-abcc-5421b07e8607
To: <sip:X.X.X.135>
Contact: <sip:pjsip-swisscom-5 at 10.5.20.42:5060>
Call-ID: d8f916a2-a6ce-460f-ad8d-57be052aecac
CSeq: 39466 OPTIONS
Max-Forwards: 70
User-Agent: Asterisk PBX 16.11.0
Content-Length:  0
{code}

You can see that in header From it is correct IP .62 while Via and Contact have .42. The same behaviour is with INVITE message. I have tried to add local_net into transport but it doesn't help.


was (Author: modrljin):
Yes, then it works. Thank you!
I've added to each endpoint the same IP address as it is defined in its transport (.42 - .72):
{code}
media_address=10.5.20.42
bind_rtp_to_media_address=yes
{code}

Asterisk listens on the same IP as stated in SDP and it does it correctly on each different IP as defined for each individual trunk.
So you think this is a quite common to define those parameters in such scenario when there are multiple local IP addresses? Transport binding is not enough?

However, I saw another interesting thing - SIP messages are always sent from the same IP 10.5.20.42 for all trunks binded to .42 - .72, at least that is written in Via header:
{code}
<--- History Entry 0 Sent to 138.187.57.135:5060 at 1594897914 --->
OPTIONS sip:138.187.57.135 SIP/2.0
Via: SIP/2.0/UDP 10.5.20.42:5060;rport;branch=z9hG4bKPje47537b7-c33d-4ea7-ab3f-21b7efdb8b62
From: <sip:pjsip-swisscom-5 at 10.5.20.62>;tag=02ac0423-f5d0-4832-abcc-5421b07e8607
To: <sip:138.187.57.135>
Contact: <sip:pjsip-swisscom-5 at 10.5.20.42:5060>
Call-ID: d8f916a2-a6ce-460f-ad8d-57be052aecac
CSeq: 39466 OPTIONS
Max-Forwards: 70
User-Agent: Asterisk PBX 16.11.0
Content-Length:  0
{code}

You can see that in header From it is correct IP .62 while Via and Contact have .42. The same behaviour is with INVITE message. I have tried to add local_net into transport but it doesn't help.

> PJSIP picks wrong media IP address for listening RTP
> ----------------------------------------------------
>
>                 Key: ASTERISK-28993
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28993
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_pjsip, Resources/res_pjsip_sdp_rtp
>    Affects Versions: 16.11.0
>         Environment: Debian GNU/Linux 9
>            Reporter: Marin Odrljin
>            Assignee: Unassigned
>            Severity: Minor
>         Attachments: http.conf, pjsip.conf, rtp.conf
>
>
> We are having multiple local IP addresses 10.5.20.42 ,.52, ,.62, ,.72 for multiple PJSIP trunks toward 2 different provider IP addresses. SIP INVITE sends SDP as following:
> {code}
> c=IN IP4 10.5.20.42
> m=audio 12442 RTP/AVP 8 3 101
> {code}
> but UDP listening address is the last one .72:
> {code}
> ss -na
> udp    UNCONN     0      0      10.5.20.72:12442                 *:*
> {code}
> So the result is no incoming RTP packets are comming into Asterisk - no IN audio.
> Intersting thing is that in Asterisk 13 we have had the same configuration and it worked because Asterisk was listening on all IPs 0.0.0.0



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list