[sr-dev] [kamailio/kamailio] m_dump doesnt use usrloc to deliver message (Issue #3185)

admin-toneca notifications at github.com
Tue Jul 12 22:53:45 CEST 2022


### Description

When client register, m_dump sent message to host from header "TO" in stored message, instead to send to AOR.

### Troubleshooting

modparam("msilo", "db_url", DBURL)
modparam("msilo", "from_address", "sip:registrar at kamailio.org")
modparam("msilo", "content_type_hdr", "Content-Type: text/plain\r\n")
modparam("msilo", "offline_message", "*** User $rU is offline!")


route[REGISTRAR] {
        xlog("(REGISTRAR) =============================================================================\n");
        if (!is_method("REGISTER")) return;

        if(isflagset(FLT_NATS)) {
                setbflag(FLB_NATB);
#!ifdef WITH_NATSIPPING
                # do SIP NAT pinging
                setbflag(FLB_NATSIPPING);
#!endif
        }
        if (!save("location")) {
                sl_reply_error();
        }

        xlog("L_NOTICE", "REGISTER received -> dumping messages with MSILO\n");

        # MSILO - dumping user's offline messages
        if (m_dump()) {
                xlog("L_NOTICE", "MSILO: offline messages dumped - if they were\n");
        }
        else {
                xlog("L_NOTICE", "MSILO: no offline messages dumped\n");
        };

        exit;
}


#### Log Messages

Message which kamailio tried to sent:

INSERT INTO `silo` (`id`, `src_addr`, `dst_addr`, `username`, `domain`, `inc_time`, `exp_time`, `snd_time`, `ctype`, `body`, `extra_hdrs`, `callid`, `status`) VALUES
(4, 'sip:1867 at sbc.test.org', 'sip:1404 at sbc.test.org', '1404', 'sbc.test.org', 1657654135, 1657913335, 0, 'text/html', 0x3c5350414e205354594c453d22464f4e542d46414d494c593a417269616c3b20464f4e542d53495a453a3130707420223e7171717171717171717171713c2f5350414e3e0d0a, '', '', 0);

```
[kamailio.log](https://github.com/kamailio/kamailio/files/9096693/kamailio.log)

```

#### SIP Traffic

3.127.6.184 is public IP of EC2
172.31.3.158 is private IP of same instance
So you can see that kamailio tried to sent SIP MESSAGE to self

```
19:59:52.341870 IP 17.74.26.179.50038 > 172.31.3.158.5060: SIP: REGISTER sip:sbc.test.org SIP/2.0
19:59:52.381456 IP 172.31.3.158.5060 > 17.74.26.179.50038: SIP: SIP/2.0 200 OK
19:59:52.538450 IP 17.74.26.179.50038 > 172.31.3.158.5060: SIP: SUBSCRIBE sip:1404 at sbc.test.org SIP/2.0
19:59:52.577632 IP 172.31.3.158.5060 > 17.74.26.179.50038: SIP: SIP/2.0 407 Proxy Authentication Required
19:59:52.724509 IP 172.31.3.158.5060 > 3.127.6.184.5060: SIP: MESSAGE sip:1404 at sbc.test.org SIP/2.0
19:59:52.724597 IP 3.127.6.184.5060 > 172.31.3.158.5060: SIP: MESSAGE sip:1404 at sbc.test.org SIP/2.0
19:59:52.754379 IP 17.74.26.179.50038 > 172.31.3.158.5060: SIP: SUBSCRIBE sip:1404 at sbc.test.org SIP/2.0
19:59:52.813768 IP 172.31.3.158.5060 > 3.127.6.184.5060: SIP: SIP/2.0 407 Proxy Authentication Required
19:59:52.813865 IP 3.127.6.184.5060 > 172.31.3.158.5060: SIP: SIP/2.0 407 Proxy Authentication Required
```



### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.7.0-dev0 (x86_64/linux) 0d9380
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, 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_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 0d9380
compiled on 14:06:32 May 26 2022 with gcc 11.2.0

```

* **Operating System**:

<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `lsb_release -a` and `uname -a`)
-->

```
Linux ip-172-31-3-158 5.15.0-1013-aws #17-Ubuntu SMP Fri Jun 10 10:40:12 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3185
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/3185 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220712/0891df41/attachment.htm>


More information about the sr-dev mailing list