Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatcher ds_is_from_list #1235

Closed
iliesh opened this issue Sep 15, 2017 · 1 comment
Closed

Dispatcher ds_is_from_list #1235

iliesh opened this issue Sep 15, 2017 · 1 comment

Comments

@iliesh
Copy link

iliesh commented Sep 15, 2017

Description

"ds_is_from_list" function from Dispatcher module give false result - when actually it should be true.

Troubleshooting

Reproduction

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@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@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@192.168.1.50>;tag=1
To: <sip:10@192.168.1.50>
Call-ID: 1-5219@192.168.1.50
CSeq: 1 REGISTER
Contact: sip:10@192.168.1.50:5061
Max-Forwards: 10
Expires: 120
User-Agent: SIPp/Win32
Content-Length: 0
  • Kamailio Version - output of kamailio -v
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#
  • 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
@miconda
Copy link
Member

miconda commented Sep 17, 2017

The source port for the SIP request is 5061, in the dispatcher records all addresses have the port 5060.

@miconda miconda closed this as completed Sep 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants