[SR-Users] Dispatcher Module with ds_is_from_list function

Arsen arsen.semionov at gmail.com
Sun Sep 17 10:47:30 CEST 2017


Hi,

The source IP:Port of the SIP packet you've provided is 192.168.1.50:5061
so according with the config both if($si=="192.168.1.10") and
ds_is_from_list() should return 'false'.

ds_is_from_list()
"when no parameter is given or only groupid is given, the matching is done
only for IP address and port (protocol is ignored)."
http://kamailio.org/docs/modules/5.0.x/modules/dispatcher.html#dispatcher.f.ds_is_from_list

On Sat, Sep 16, 2017 at 2:42 PM, Ilie Soltanici <iliusha.md at gmail.com>
wrote:

> Hello,
>
> "ds_is_from_list" function from Dispatcher module give false result - when
> actually it should be true.
>
> modparam("dispatcher", "db_url",DBURL)
> modparam("dispatcher", "table_name", "dispatcher")
> modparam("dispatcher", "setid_col", "setid")
> modparam("dispatcher", "destination_col", "destination")
> modparam("dispatcher", "flags", 2)
> modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
> modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
> modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
> modparam("dispatcher", "sock_avp", "$avp(AVP_SOCK)")
>
> request_route {
>
> xlog("L_INFO","[=Start Routing=]")
>
> if(ds_is_from_list()) {
> xlog("L_INFO","[=FROM ASTERISK=]");
> } else {
> xlog("L_INFO","[=TO ASTERISK=]");
> }
>
> if($si=="192.168.1.10") {
> xlog("L_INFO","[=FROM ASTERISK BY IP=]");
> } else {
> xlog("L_INFO","[=TO ASTERISK BY IP=]");
> }
>
> root at kamailio:/var/log# kamctl dispatcher show
> dispatcher gateways
> +----+-------+---------------------+-------+----------+-----
> --+-----------------+
> | id | setid | destination | flags | priority | attrs | description |
> +----+-------+---------------------+-------+----------+-----
> --+-----------------+
> | 1 | 1 | sip:192.168.1.10:5060 | 0 | 3 | | Main Asterisk |
> | 2 | 2 | sip:192.168.1.11:5060 | 0 | 2 | | Backup Asterisk |
> | 3 | 3 | sip:192.168.1.12:5060 | 0 | 1 | | Test Asterisk |
> +----+-------+---------------------+-------+----------+-----
> --+-----------------+
> root at kamailio:/var/log#
>
> cat /var/log/kamailio.log
> [=Start Routing=]
> [=TO ASTERISK=]
> [=FROM ASTERISK BY IP=]
> Additional Information
>
>    -
>
>    SIP Packet
>    2017/09/15 19:21:57.589451 192.168.1.50:5061 -> 192.168.1.1:5060
>    REGISTER sip:192.168.1.1 SIP/2.0
>    Via: SIP/2.0/UDP 192.168.1.50:5061;branch=z9hG4bK-5219-1-0
>    From: sip:10 at 192.168.1.50;tag=1
>    To: sip:10 at 192.168.1.50
>    Call-ID: 1-5219 at 192.168.1.50
>    CSeq: 1 REGISTER
>    Contact: sip:10 at 192.168.1.50:5061
>    Max-Forwards: 10
>    Expires: 120
>    User-Agent: SIPp/Win32
>    Content-Length: 0
>    -
>
>    Kamailio Version - output of kamailio -v
>
> root at kamailio:/var/log# kamailio -v
> version: kamailio 5.0.3 (x86_64/linux)
> flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> id: unknown
> compiled on 12:12:14 Sep  7 2017 with gcc 6.3.0
> root at kamailio:/var/log#
>
>
>    - Operating System:
>
> Debian 9.1/ Linux kamailio1 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u3 (2017-08-06) x86_64 GNU/Linux
>
> Is this a bug or something wrong with configuration?
>
> Thank you
>
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>


-- 
Regards,

Arsen Semionov
Eurolan.info
cell: +442035198881
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20170917/a63b61c6/attachment.html>


More information about the sr-users mailing list