"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("1")) {
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=]
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#
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
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.