<div dir="ltr"><div>Hi,</div><div><br></div><div>The source IP:Port of the SIP packet you've provided is <a href="http://192.168.1.50:5061">192.168.1.50:5061</a> so according with the config both if($si=="192.168.1.10") and ds_is_from_list() should return 'false'. <br></div><div><br></div><div>ds_is_from_list()<br></div><div>"when no parameter is given or only groupid is given, the matching is done only for IP address and port (protocol is ignored)."</div><div><a href="http://kamailio.org/docs/modules/5.0.x/modules/dispatcher.html#dispatcher.f.ds_is_from_list">http://kamailio.org/docs/modules/5.0.x/modules/dispatcher.html#dispatcher.f.ds_is_from_list</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 16, 2017 at 2:42 PM, Ilie Soltanici <span dir="ltr"><<a href="mailto:iliusha.md@gmail.com" target="_blank">iliusha.md@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">Hello,</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">"ds_is_from_list" function from Dispatcher module give false result - when actually it should be true.</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">modparam("dispatcher", "db_url",DBURL)<br style="box-sizing:border-box">modparam("dispatcher", "table_name", "dispatcher")<br style="box-sizing:border-box">modparam("dispatcher", "setid_col", "setid")<br style="box-sizing:border-box">modparam("dispatcher", "destination_col", "destination")<br style="box-sizing:border-box">modparam("dispatcher", "flags", 2)<br style="box-sizing:border-box">modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")<br style="box-sizing:border-box">modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")<br style="box-sizing:border-box">modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")<br style="box-sizing:border-box">modparam("dispatcher", "sock_avp", "$avp(AVP_SOCK)")</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">request_route {</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">xlog("L_INFO","[=Start Routing=]")</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">if(ds_is_from_list()) {<br style="box-sizing:border-box">xlog("L_INFO","[=FROM ASTERISK=]");<br style="box-sizing:border-box">} else {<br style="box-sizing:border-box">xlog("L_INFO","[=TO ASTERISK=]");<br style="box-sizing:border-box">}</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">if($si=="192.168.1.10") {<br style="box-sizing:border-box">xlog("L_INFO","[=FROM ASTERISK BY IP=]");<br style="box-sizing:border-box">} else {<br style="box-sizing:border-box">xlog("L_INFO","[=TO ASTERISK BY IP=]");<br style="box-sizing:border-box">}</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">root@kamailio:/var/log# kamctl dispatcher show<br style="box-sizing:border-box">dispatcher gateways<br style="box-sizing:border-box">+----+-------+----------------<wbr>-----+-------+----------+-----<wbr>--+-----------------+<br style="box-sizing:border-box">| id | setid | destination | flags | priority | attrs | description |<br style="box-sizing:border-box">+----+-------+----------------<wbr>-----+-------+----------+-----<wbr>--+-----------------+<br style="box-sizing:border-box">| 1 | 1 | sip:<a href="http://192.168.1.10:5060" target="_blank">192.168.1.10:5060</a> | 0 | 3 | | Main Asterisk |<br style="box-sizing:border-box">| 2 | 2 | sip:<a href="http://192.168.1.11:5060" target="_blank">192.168.1.11:5060</a> | 0 | 2 | | Backup Asterisk |<br style="box-sizing:border-box">| 3 | 3 | sip:<a href="http://192.168.1.12:5060" target="_blank">192.168.1.12:5060</a> | 0 | 1 | | Test Asterisk |<br style="box-sizing:border-box">+----+-------+----------------<wbr>-----+-------+----------+-----<wbr>--+-----------------+<br style="box-sizing:border-box">root@kamailio:/var/log#</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">cat /var/log/kamailio.log<br style="box-sizing:border-box">[=Start Routing=]<br style="box-sizing:border-box"><span style="box-sizing:border-box;font-weight:600">[=TO ASTERISK=]</span><br style="box-sizing:border-box"><span style="box-sizing:border-box;font-weight:600">[=FROM ASTERISK BY IP=]</span></p><h3 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:1.25em;line-height:1.25;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">Additional Information</h3><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px"><li style="box-sizing:border-box;margin-left:0px"><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px"><span style="box-sizing:border-box;font-weight:600">SIP Packet</span><br style="box-sizing:border-box">2017/09/15 19:21:57.589451 <a href="http://192.168.1.50:5061" target="_blank">192.168.1.50:5061</a> -> <a href="http://192.168.1.1:5060" target="_blank">192.168.1.1:5060</a><br style="box-sizing:border-box">REGISTER sip:192.168.1.1 SIP/2.0<br style="box-sizing:border-box">Via: SIP/2.0/UDP 192.168.1.50:5061;branch=<wbr>z9hG4bK-5219-1-0<br style="box-sizing:border-box">From: <a href="mailto:sip%3A10@192.168.1.50" target="_blank">sip:10@192.168.1.50</a>;tag=1<br style="box-sizing:border-box">To: <a href="mailto:sip%3A10@192.168.1.50" target="_blank">sip:10@192.168.1.50</a><br style="box-sizing:border-box">Call-ID: <a href="mailto:1-5219@192.168.1.50" target="_blank">1-5219@192.168.1.50</a><br style="box-sizing:border-box">CSeq: 1 REGISTER<br style="box-sizing:border-box">Contact: <a href="http://sip:10@192.168.1.50:5061" target="_blank">sip:10@192.168.1.50:5061</a><br style="box-sizing:border-box">Max-Forwards: 10<br style="box-sizing:border-box">Expires: 120<br style="box-sizing:border-box">User-Agent: SIPp/Win32<br style="box-sizing:border-box">Content-Length: 0</p></li><li style="box-sizing:border-box;margin-top:0.25em;margin-left:0px"><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px"><span style="box-sizing:border-box;font-weight:600">Kamailio Version</span> - output of <code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0.2em 0px;margin:0px;background-color:rgba(27,31,35,0.05);border-radius:3px">kamailio -v</code></p></li></ul><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;margin-top:0px;margin-bottom:16px;word-wrap:normal;padding:16px;overflow:auto;line-height:1.45;background-color:rgb(246,248,250);border-radius:3px;color:rgb(36,41,46)"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0px;margin:0px;background:transparent;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">root@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@kamailio:/var/log#
</code></pre><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px"><li style="box-sizing:border-box;margin-left:0px"><span style="box-sizing:border-box;font-weight:600">Operating System</span>:</li></ul><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;margin-top:0px;word-wrap:normal;padding:16px;overflow:auto;line-height:1.45;background-color:rgb(246,248,250);border-radius:3px;color:rgb(36,41,46);margin-bottom:0px"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0px;margin:0px;background:transparent;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">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</code></pre><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;margin-top:0px;word-wrap:normal;padding:16px;overflow:auto;line-height:1.45;background-color:rgb(246,248,250);border-radius:3px;color:rgb(36,41,46);margin-bottom:0px"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0px;margin:0px;background:transparent;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">Is this a bug or something wrong with configuration?</code></pre><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;margin-top:0px;word-wrap:normal;padding:16px;overflow:auto;line-height:1.45;background-color:rgb(246,248,250);border-radius:3px;color:rgb(36,41,46);margin-bottom:0px"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0px;margin:0px;background:transparent;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">Thank you</code></pre></div>
<br>______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:12.8px">Regards,</span><br></div><div><br></div><div>Arsen Semionov</div><div>Eurolan.info</div><div>cell: +442035198881</div></div></div>
</div></div>