Denis,

You probably need to specify the full address, including the mask, like: 1.1.1.1/32

Regards,
Ilie

On Thu, 11 Jul 2024 at 14:19, Denys Pozniak via sr-users <sr-users@lists.kamailio.org> wrote:
I tested - no changes, plus an error appeared in the syslog:

CRITICAL: <core> [core/ip_addr.c:234]: ip_addr2sbuf(): unknown address family 0
CRITICAL: <core> [core/ip_addr.c:234]: ip_addr2sbuf(): unknown address family 0

modparam("topos", "event_mode", 9)

event_route[topos:msg-outgoing] {
        if ( $sndto(ip) == "1.1.1.1" ) {
                xlog("L_WARN","[msg-outgoing] $rm/$rU/$sndto(ip) \n");
                drop;
        }
}

event_route[topos:msg-receiving] {
  if ( $si == "1.1.1.1" ) {
    xlog("L_WARN","[msg-receiving] $rm/$rU/$si \n");
    drop;
  }
}




чт, 11 июл. 2024 г. в 14:20, Patrick Karton <patrickarton@hotmail.com>:
You have to use topos:receiving instead of topos:incoming.



Le 11 juil. 2024 08:48, Denys Pozniak via sr-users <sr-users@lists.kamailio.org> a écrit :
Hello!
I need to disable topos for one specific SIP trunk (in-out), it looks like it’s enough to use event_route with IP address filtering.
But for some reason, the incoming INVITE from the peer still gets processed by topos and I also don’t see a mention of [msg-incoming] in the logs, only this:

WARNING: <script>: [msg-outgoing] OPTIONS/you/1.1.1.1

Code snippet:

loadmodule "topos.so"
modparam("topos", "db_url", DBURL)
modparam("topos", "contact_mode", 1)
modparam("topos", "header_mode", 1)
modparam("topos", "methods_noinitial", "OPTIONS,SUBSCRIBE,PUBLISH")
modparam("topos", "dialog_expire", 7210)
modparam("topos", "rr_update", 1)
modparam("topos", "event_mode", 5)
/*
1 - execute event_route[topos:msg-outgoing]
2 - execute event_route[topos:msg-sending]
4 - execute event_route[topos:msg-incoming]
8 - execute event_route[topos:msg-receiving]
*/

request_route {
....
  event_route[topos:msg-outgoing] {
    if ( $sndto(ip) == "1.1.1.1" ) {
         xlog("L_WARN","[msg-outgoing] $rm/$rU/$sndto(ip) \n");
        drop;
    }
  }
}

event_route[topos:msg-incoming] {
    if ( $si == "1.1.1.1" ) {
         xlog("L_WARN","[msg-incoming] $rm/$rU/$si \n");
        drop;
    }
}

# kamailio -v
version: kamailio 5.7.1 (x86_64/linux) 1cf389-dirty



--

BR,
Denys Pozniak





--

BR,
Denys Pozniak


__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe: