Pre-Submission Checklist

Type Of Change

Checklist:

Description

This PR adds 2 new flags to the mode parameter of the ds_is_from_list function.

Some times the dispatcher configuration can look like this (route attribute is just for exampe, sockname is important here):

70 sip:192.168.1.1:5060;transport=udp 0 1 route=route1;sockname=udp_5060
71 sip:192.168.1.1:5060;transport=udp 0 1 route=route2;sockname=udp_5061
72 sip:192.168.1.1:5060;transport=udp 0 1 route=route3;sockname=udp_5062
73 sip:192.168.1.1:5060;transport=udp 0 1 route=route4;sockname=udp_5063

Here we have one host/port/protocol on the remote side and different ports that we are listening on,
In stock dispatcher version ds_is_from_list(-1,0) will always match first available - 70, but this is not right
for dst ports 5061-5063 (sockets in realality, because we can have different local ip on same port also).
The new mode flag DS_MATCH_SOCKET (8) allow match for dispatcher socket also.

Second flag is DS_MATCH_STRICTEST (16), it allow to match more strictness target in "address/protocol/port/socket" key,
for example:

70 sip:192.168.1.1;transport=udp 0 1 route=route1
71 sip:192.168.1.1:5061;transport=udp 0 1 route=route2
72 sip:192.168.1.1:5062;transport=udp 0 1 route=route3
73 sip:192.168.1.1;transport=udp 0 1 route=route4;socket=udp:192.168.10.10:5063

if packet come from from any port of sip:192.168.1.1;transport=udp except 5061-5062 ds_is_from list will return 70,
if received port also is 5063 the result will be 73, packets from ports 5061-5062 will be matched at 71-72 respectively.
In stock version of ds_is_from_list the result will always be 70.

Note, the DS_MATCH_STRICTEST method can be more compute intensive, because we can potentially traverse all the dispatcher tree.

The behavior of existing flags are not changed.


You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/3699

Commit Summary

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/pull/3699@github.com>