Re: [OpenSIPS-Users] OpenSIPS 3.2.7 tracer module for sip dialogs leads to an endless loop

2022-10-12 Thread Pavel Ekshin
 Hi Bogdan!

Thanks for the answer! I tried this one:

 TRACE module
loadmodule "tracer.so"
modparam("tracer", "trace_on", 1)
modparam("tracer", "trace_id","[tid]uri=mysql://X:XXX@localhost
/opensips;table=sip_trace;")
modparam("tracer", "trace_id","[tid]uri=sip:172.16.34.91:5060")
modparam("tracer", "trace_local_ip", "172.16.34.91")

I use the constant string "tid" inside the trace(), no specific variable.

route{
script_trace( 1, "$rm from $si, ruri=$ru, contact=$ct",
"script_trace");
#trace("tid", "d", "sip");
#xlog("here_trace");

#if (!has_totag()) {
#   if(is_method("INVITE") ) {
#   # We need to use the dialog module to have the outgoing ACK
traced
#   # trace("tid", "d", "sip");
#}
#}
#else {
#   match_dialog();
#}

#if (!is_method("INVITE,ACK,BYE,PRACK")) {
# Requests that are not part of an established dialog will be
transaction base traced
#   trace("tid", "t", "sip");
#   xlog("Message not in dialog - $rm\n");
#}
#trace("tid", "t", "sip");
..

BR, Pavel

вт, 11 окт. 2022 г. в 14:58, Bogdan-Andrei Iancu :

> Hi PAvel,
>
> How do you define the tid you use for tracing ?
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
> OpenSIPS Summit 27-30 Sept 2022, Athens
>   https://www.opensips.org/events/Summit-2022Athens/
>
> On 9/21/22 7:45 PM, Pavel Ekshin wrote:
>
> Hi Bogdan,
>
> Thanks for the answer.
> I tried this module, but nothing weird was found. On reply ACK messages in
> sngrep capture I see the correct "To/Contact'' header, but in log the "To"
> header looks different, but it's not lead to any loop.
>
> Sep 20 16:51:55 openSIPS /usr/sbin/opensips[15619]: [Script
> Trace][/etc/opensips/opensips_residential.cfg:430][script_trace][core if]
> -> (INVITE from 172.18.53.131, ruri=sip:4002@172.16.34.173:5060, contact=<
> sip:opensips@172.18.53.131:5060>)
> Sep 20 16:51:55 openSIPS /usr/sbin/opensips[15619]: [Script
> Trace][/etc/opensips/opensips_residential.cfg:427][script_trace][module
> t_relay] -> (INVITE from 172.18.53.131, ruri=sip:4002@172.16.34.173:5060,
> contact=)
> Sep 20 16:51:55 openSIPS /usr/sbin/opensips[15619]: [Script
> Trace][/etc/opensips/opensips_residential.cfg:430][script_trace][core exit]
> -> (INVITE from 172.18.53.131, ruri=sip:4002@172.16.34.173:5060, contact=<
> sip:opensips@172.18.53.131:5060>)
> Sep 20 16:51:55 openSIPS /usr/sbin/opensips[15619]: [Script
> Trace][/etc/opensips/opensips_residential.cfg:221][script_trace][core if]
> -> (ACK from 172.18.53.131, ruri=sip:172.16.34.173:5060;transport=udp,
> contact=)
> Sep 20 16:51:55 openSIPS /usr/sbin/opensips[15619]: [Script
> Trace][/etc/opensips/opensips_residential.cfg:214][script_trace][module
> mf_process_maxfwd_header] -> (ACK from 172.18.53.131, ruri=
> sip:172.16.34.173:5060;transport=udp, contact=<
> sip:opensips@172.18.53.131:5060>)
> Sep 20 16:51:55 openSIPS /usr/sbin/opensips[15619]: [Script
> Trace][/etc/opensips/opensips_residential.cfg:258][script_trace][core if]
> -> (ACK from 172.18.53.131, ruri=sip:172.16.34.173:5060;transport=udp,
> contact=)
> Sep 20 16:51:55 openSIPS /usr/sbin/opensips[15619]: [Script
> Trace][/etc/opensips/opensips_residential.cfg:221][script_trace][module
> has_totag] -> (ACK from 172.18.53.131, ruri=
> sip:172.16.34.173:5060;transport=udp, contact=<
> sip:opensips@172.18.53.131:5060>)
>
>
> 
> 172.18.53.131:5060___172.16.34.91:5060
> __172.16.34.173:5060___172.16.34.173:64087
>
> __qqwq__qqwq__qqwq__qqwqx
>
> __16:06:48.772459___xINVITE_(SDP)_x_x_x_
>
> +0.001900___x_qq>_x_x_x_
>
> __16:06:48.774359___x__407_Proxy_Authentication_R_x_x_x_
>
> +0.014197___x_
> __16:06:48.788556___x_ACK_x

Re: [OpenSIPS-Users] OpenSIPS 3.2.7 tracer module for sip dialogs leads to an endless loop

2022-09-21 Thread Pavel Ekshin
m 172.18.53.131,
ruri=sip:172.16.34.173:5060;transport=udp,
contact=)
Sep 20 16:51:58 openSIPS /usr/sbin/opensips[15617]: [Script
Trace][/etc/opensips/opensips_residential.cfg:430][script_trace][core if]
-> (BYE from 172.18.53.131, ruri=sip:172.16.34.173:5060;transport=udp,
contact=)
Sep 20 16:51:58 openSIPS /usr/sbin/opensips[15617]: [Script
Trace][/etc/opensips/opensips_residential.cfg:427][script_trace][module
t_relay] -> (BYE from 172.18.53.131, ruri=sip:172.16.34.173:5060;transport=udp,
contact=)
Sep 20 16:51:58 openSIPS /usr/sbin/opensips[15617]: [Script
Trace][/etc/opensips/opensips_residential.cfg:430][script_trace][core exit]
-> (BYE from 172.18.53.131, ruri=sip:172.16.34.173:5060;transport=udp,
contact=)

If I disable trace("tid", "d/t/m", "sip") module at route level, I never
faced with loop.I also found that trace("tid", "m", "sip") is worked for
specific messages, f.e INVITE, and not looped too.
If I have something wrong with the route, it should also be looped without
enabled trace(), but it's not happen. I think it's around the rules of
trace() module and rules there this module may be enabled. Maybe you have
an example for enabling the trace() module globally?

BR, Pavel

вт, 6 сент. 2022 г. в 11:53, Bogdan-Andrei Iancu :

> Hi Pavel,
>
> The tracing part has nothing to do with the routing on the SIP side. And
> usually you end up with SIP loops if, without changing the RURI, you
> send the SIP request out, making OpenSIPS to send the request back to
> itself (as the destination in RURI still points to OpenSIPS).
>
> I advice you to try to understand the execution flow via your script by
> using the script_trace[1] function and logging the RURI (as $ru)
>
> [1]
>
> https://www.opensips.org/Documentation/Script-CoreFunctions-3-2#script_trace
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>https://www.opensips-solutions.com
> OpenSIPS Summit 27-30 Sept 2022, Athens
>https://www.opensips.org/events/Summit-2022Athens/
>
> On 8/30/22 9:31 PM, Pavel Ekshin wrote:
> > Hi there,
> > I try very basic scenario with tracing sip dialogs in OpenSIPS 3.2.7,
> > and this scenario leads in an endless loop inside Opensips for SIP
> > messages.
> > Maybe someone is similarly affected or can point to the error on the
> > route scenario? I use out of box residential configuration. I read the
> > tracer module doc (https://opensips.org/docs/modules/devel/tracer.html
> > <https://opensips.org/docs/modules/devel/tracer.html>), but dialog
> > examples from doc also lead to loops.
> > I also tried with transactions, but they are looped too. Trace for
> > messages works fine.  I think I miss some points.
> >
> > MariaDB [opensips]> select method,COUNT(*) from sip_trace group by
> method;
> > ++--+
> > | method | COUNT(*) |
> > ++--+
> > | ACK| 2625 |
> > | BYE| 2270 |
> > | INVITE |  219 |
> > ++--+
> >
> > Below my config:
> [...]
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] OpenSIPS 3.2.7 tracer module for sip dialogs leads to an endless loop

2022-09-21 Thread Pavel Ekshin
>https://www.opensips-solutions.com
> OpenSIPS Summit 27-30 Sept 2022, Athens
>https://www.opensips.org/events/Summit-2022Athens/
>
> On 8/30/22 9:31 PM, Pavel Ekshin wrote:
> > Hi there,
> > I try very basic scenario with tracing sip dialogs in OpenSIPS 3.2.7,
> > and this scenario leads in an endless loop inside Opensips for SIP
> > messages.
> > Maybe someone is similarly affected or can point to the error on the
> > route scenario? I use out of box residential configuration. I read the
> > tracer module doc (https://opensips.org/docs/modules/devel/tracer.html
> > <https://opensips.org/docs/modules/devel/tracer.html>), but dialog
> > examples from doc also lead to loops.
> > I also tried with transactions, but they are looped too. Trace for
> > messages works fine.  I think I miss some points.
> >
> > MariaDB [opensips]> select method,COUNT(*) from sip_trace group by
> method;
> > ++--+
> > | method | COUNT(*) |
> > ++--+
> > | ACK| 2625 |
> > | BYE| 2270 |
> > | INVITE |  219 |
> > ++--+
> >
> > Below my config:
> [...]
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] OpenSIPS 3.2.7 tracer module for sip dialogs leads to an endless loop

2022-08-30 Thread Pavel Ekshin
Hi there,
I try very basic scenario with tracing sip dialogs in OpenSIPS 3.2.7, and
this scenario leads in an endless loop inside Opensips for SIP messages.
Maybe someone is similarly affected or can point to the error on the route
scenario? I use out of box residential configuration. I read the tracer
module doc (https://opensips.org/docs/modules/devel/tracer.html), but
dialog examples from doc also lead to loops.
I also tried with transactions, but they are looped too. Trace for messages
works fine.  I think I miss some points.

MariaDB [opensips]> select method,COUNT(*) from sip_trace group by method;
++--+
| method | COUNT(*) |
++--+
| ACK| 2625 |
| BYE| 2270 |
| INVITE |  219 |
++--+

Below my config:

# This script was generated via "make menuconfig", from
#   the "Residential" scenario.


### Global Parameters #

/* uncomment the following lines to enable debugging */
#debug_mode=yes

log_level=4
xlog_level=4
log_stderror=no
log_facility=LOG_LOCAL0

udp_workers=4

/* uncomment the next line to enable the auto temporary blacklisting of
   not available destinations (default disabled) */
#disable_dns_blacklist=no

/* uncomment the next line to enable IPv6 lookup after IPv4 dns
   lookup failures (default disabled) */
#dns_try_ipv6=yes


socket=udp:172.16.34.91:5060   # CUSTOMIZE ME
socket=tcp:172.16.34.91:5060   # CUSTOMIZE ME


### Modules Section 

#set module path
mpath="/usr/lib64/opensips/modules"

 AVPOPS module
loadmodule "avpops.so"
modparam("avpops", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
# CUSTOMIZE ME

 HTTPD module
loadmodule "httpd.so"
modparam("httpd", "port", )
modparam("httpd", "ip", "127.0.0.1")

  MI_HTTP module
loadmodule "mi_http.so"
modparam("mi_http", "root", "mi")

 JSON module
loadmodule "json.so"

 SIGNALING module
loadmodule "signaling.so"

 StateLess module
loadmodule "sl.so"

 Transaction Module
loadmodule "tm.so"
modparam("tm", "fr_timeout", 5)
modparam("tm", "fr_inv_timeout", 30)
modparam("tm", "restart_fr_on_each_reply", 0)
modparam("tm", "onreply_avp_mode", 1)

 Record Route Module
loadmodule "rr.so"
/* do not append from tag to the RR (no need for this script) */
modparam("rr", "append_fromtag", 0)
#modparam("rr", "append_fromtag", 1) # DL

 MAX ForWarD module
loadmodule "maxfwd.so"

 SIP MSG OPerationS module
loadmodule "sipmsgops.so"

 FIFO Management Interface
loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
modparam("mi_fifo", "fifo_mode", 0666)

 MYSQL module
loadmodule "db_mysql.so"

 PERMISSIONS module
loadmodule "permissions.so"
modparam("permissions", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips")
# CUSTOMIZE ME

 USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "working_mode_preset", "single-instance-sql-write-back")
modparam("usrloc", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME

 REGISTRAR module
loadmodule "registrar.so"
modparam("registrar", "tcp_persistent_flag", "TCP_PERSISTENT")
/* uncomment the next line not to allow more than 10 contacts per AOR */
#modparam("registrar", "max_contacts", 10)

 ACCounting module
loadmodule "acc.so"
/* what special events should be accounted ? */
modparam("acc", "early_media", 0)
modparam("acc", "report_cancels", 0)
/* by default we do not adjust the direct of the sequential requests.
   if you enable this parameter, be sure to enable "append_fromtag"
   in "rr" module */
modparam("acc", "detect_direction", 0)
modparam("acc", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME

 AUTHentication modules
loadmodule "auth.so"
loadmodule "auth_db.so"
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME
modparam("auth_db", "load_credentials", "")

 ALIAS module
loadmodule "alias_db.so"
modparam("alias_db", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME

 DOMAIN module
loadmodule "domain.so"
modparam("domain", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME
modparam("domain", "db_mode", 1)   # Use caching
modparam("auth_db|usrloc", "use_domain", 1)

 DIALOG module
loadmodule "dialog.so"
modparam("dialog", "dlg_match_mode", 1)
modparam("dialog", "default_timeout", 21600)  # 6 hours timeout
modparam("dialog", "db_mode", 2)
modparam("dialog", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME

  DIALPLAN module
loadmodule "dialplan.so"
modparam("dialplan", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME

  DYNAMMIC ROUTING module
loadmodule "drouting.so"
modparam("drouting", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE