[Asterisk-code-review] res_pjsip/pjsip_message_filter: set preferred transport in pjsip_mess... (asterisk[16])

Bernd Zobl asteriskteam at digium.com
Wed Mar 31 07:32:34 CDT 2021


Bernd Zobl has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/15630 )

Change subject: res_pjsip/pjsip_message_filter: set preferred transport in pjsip_message_filter
......................................................................


Patch Set 4:

(1 comment)

https://gerrit.asterisk.org/c/asterisk/+/15630/4/res/res_pjsip/pjsip_message_filter.c 
File res/res_pjsip/pjsip_message_filter.c:

https://gerrit.asterisk.org/c/asterisk/+/15630/4/res/res_pjsip/pjsip_message_filter.c@242 
PS4, Line 242: 	if ((tdata->tp_info.transport->key.type != PJSIP_TRANSPORT_UDP) &&
You're right, as far as I could observe, it does. I didn't know whether this was the desired behaviour or not, though.

---

I have a transport configured to bind to TCP 0.0.0.0:9060,
If I call a registered phone (the phone's SIP bindport is 5060), I can see that the TCP packet is targeted to the phone

> Transmission Control Protocol, Src Port: 36611, Dst Port: 5060, Seq: 1, Ack: 1, Len: 1008
>     Source Port: 36611
>     Destination Port: 5060

where 36611 is the ephemeral port.
This port is used in the SIP INVITE's Via and Contact headers:

> Session Initiation Protocol (INVITE)
>     Request-Line: INVITE sip:9099 at 10.193.10.120:5060;transport=tcp SIP/2.0
>     Message Header
>         Via: SIP/2.0/TCP 10.193.0.1:36611;rport;branch=z9hG4bKPj68a09b52-e117-4b95-a172-e65a55d5fb7b;alias
>         From: "Station 9011" <sip:9011 at 192.168.248.80>;tag=a74efce4-3e08-4d6a-9d51-f79b67ea9fbe
>             SIP Display info: "Station 9011"
>             SIP from address: sip:9011 at 192.168.248.80
>             SIP from tag: a74efce4-3e08-4d6a-9d51-f79b67ea9fbe
>         To: <sip:9099 at 10.193.10.120>
>             SIP to address: sip:9099 at 10.193.10.120
>         Contact: <sip:asterisk at 10.193.0.1:36611;transport=TCP>
>             Contact URI: sip:asterisk at 10.193.0.1:36611;transport=TCP
>                 Contact URI User Part: asterisk
>                 Contact URI Host Part: 10.193.0.1
>                 Contact URI Host Port: 36611
>                 Contact URI parameter: transport=TCP

-----

I've now checked the behaviour against that of UDP transports. Those have the transport's bindport in the Via and Contact headers.

I therefore assume that those should contain the bindport. I will try to adapt my patch accordingly. Could you point me in the right direction how to do this? I would have tried to use the `local_name.port`, like it is done for UDP in line 257, but have not looked into it yet.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15630
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I598e60257a7f92b29efce1fb3e9a2fc06f1439b6
Gerrit-Change-Number: 15630
Gerrit-PatchSet: 4
Gerrit-Owner: Florian Floimair <f.floimair at commend.com>
Gerrit-Reviewer: Bernd Zobl <b.zobl at commend.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Comment-Date: Wed, 31 Mar 2021 12:32:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210331/924363d3/attachment-0001.html>


More information about the asterisk-code-review mailing list