SIPTRAce module

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SIPTRAce module

Francjos
Hello,
I,ve conigured two opensips servers and i would like each one to send sipsak to another and see if it is still working.
I've installed sipsak on both Opensips.
In order to see the request and reply messages, i've used the siptrace module.
I've loaded it on both Opensips and set the parameters as follows:

 loadmodule “siptrace.so”

modparam(“siptrace”, “db_url“, “mysql://opensips:opensipsrw@localhost/opensips”)
modparam(“siptrace”, “trace_flag“, “22”)    # Here the trace_flag will 22.
modparam(“siptrace”, “traced_user_avp“, “$avp(traced_user)”)
modparam(“siptrace”, “trace_on”, 1)

I also load the avpops module :

loadmodule “avpops.so”
modparam(“avpops”,”db_url”,“mysql://opensips:opensipsrw@localhost/opensips”)
modparam(“avpops”, “avp_table”, “New_usr_preferences”)

After that, i've  added the avp in the usr_preferences table using this command:

opensipsctl avp add –T usr_preferences opensips@myripaddress trace 1 1

I also add this routing logic at the beginning of the main routing logic:

if(avp_db_load(“$fu”,”$avp(trace)”)) {
$avp(traced_user)=$fu;
setflag(22);
 sip_trace();
 xlog(“L_INFO”,”User $fu being traced”);
}

I restarted Opensips and tracing:

opensipsctl restart
opensipsctl fifo sip_trace on

When i send a ping using the sipsak tool like this:

sipsak -s sip:opensips@myotheripaddress, i hope i can visualize,  the tracing in the sip_trace table, but when i visualise its content, the table is empty.

Am i simming something in order to get corrects results?

Thanky you
Reply | Threaded
Open this post in threaded view
|

Re: SIPTRAce module

Bogdan-Andrei Iancu-2
Hi,

Use debug=4 in your config and check the logs to see if the script
execution really gets to the siptrace part and if so, why it is not
done. If you do not manage to "read" the logs, post them somewhere (post
only logs related to the REGISTER execution - the REGISTER you want to
trace) and send here the link.

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 27.04.2016 10:24, Francjos wrote:

> Hello,
> I,ve conigured two opensips servers and i would like each one to send sipsak
> to another and see if it is still working.
> I've installed sipsak on both Opensips.
> In order to see the request and reply messages, i've used the siptrace
> module.
> I've loaded it on both Opensips and set the parameters as follows:
>
>   loadmodule “siptrace.so”
>
> modparam(“siptrace”, “db_url“,
> “mysql://opensips:opensipsrw@localhost/opensips”)
> modparam(“siptrace”, “trace_flag“, “22”)    # Here the trace_flag will 22.
> modparam(“siptrace”, “traced_user_avp“, “$avp(traced_user)”)
> modparam(“siptrace”, “trace_on”, 1)
>
> I also load the avpops module :
>
> loadmodule “avpops.so”
> modparam(“avpops”,”db_url”,“mysql://opensips:opensipsrw@localhost/opensips”)
> modparam(“avpops”, “avp_table”, “New_usr_preferences”)
>
> After that, i've  added the avp in the usr_preferences table using this
> command:
>
> opensipsctl avp add –T usr_preferences opensips@myripaddress trace 1 1
>
> I also add this routing logic at the beginning of the main routing logic:
>
> if(avp_db_load(“$fu”,”$avp(trace)”)) {
> $avp(traced_user)=$fu;
> setflag(22);
>   sip_trace();
>   xlog(“L_INFO”,”User $fu being traced”);
> }
>
> I restarted Opensips and tracing:
>
> opensipsctl restart
> opensipsctl fifo sip_trace on
>
> When i send a ping using the sipsak tool like this:
>
> sipsak -s sip:opensips@myotheripaddress, i hope i can visualize,  the
> tracing in the sip_trace table, but when i visualise its content, the table
> is empty.
>
> Am i simming something in order to get corrects results?
>
> Thanky you
>
>
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/SIPTRAce-module-tp7602727.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: SIPTRAce module

Bogdan-Andrei Iancu-2
Hi,

You can use the script_trace() function :
    http://www.opensips.org/Documentation/Script-CoreFunctions-2-1#toc43
to trace the executions through your script.

Place this function first thing in your script and check the its output for your OPTIONS.

Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 10.05.2016 17:26, Nduwayezu, Joselyne wrote:
hello Bogdan,

How can i do to  check the logs to see if the script execution really gets to the siptrace part ?All what i've done, i use ngrep to capture packets when i send sipsak and this is what i get on both servers:

Server 10.0.0.5 gives:
.

U 2016/05/10 13:57:12.402720 10.0.0.5:47413 -> 10.0.0.4:5060
OPTIONS [hidden email] SIP/2.0.
Via: SIP/2.0/UDP 10.0.0.5:47413;branch=z9hG4bK.3fc50b66;rport;alias.
From: [hidden email].
To: [hidden email].
Call-ID: [hidden email].
CSeq: 1 OPTIONS.
Contact: sip:sipsak@10.0.0.5:47413.
Content-Length: 0.
Max-Forwards: 70.
User-Agent: sipsak 0.9.6.
Accept: text/plain.
.

U 2016/05/10 13:57:12.405823 10.0.0.4:5060 -> 10.0.0.5:47413
SIP/2.0 500 Service full.
Via: SIP/2.0/UDP 10.0.0.5:47413;received=10.0.0.5;branch=z9hG4bK.3fc50b66;rport=47413;alias.
From: [hidden email].
To: [hidden email];tag=61890dad1e908c702027bf054a266115.c3bd.
Call-ID: [hidden email].
CSeq: 1 OPTIONS.
Server: OpenSIPS (2.1.2 (x86_64/linux)).
Content-Length: 0.
.

Server 10.0.0.4 gives:


root@front-1:/etc/opensips# ngrep -d eth0 -t -W byline "$1" port 5060 -q
interface: eth0 (10.0.0.0/255.255.255.0)
filter: (ip or ip6) and ( port 5060 )
U 2016/05/10 13:57:12.406208 10.0.0.5:47413 -> 10.0.0.4:5060
OPTIONS [hidden email] SIP/2.0.
Via: SIP/2.0/UDP 10.0.0.5:47413;branch=z9hG4bK.3fc50b66;rport;alias.
From: [hidden email].
To: [hidden email].
Call-ID: [hidden email].
CSeq: 1 OPTIONS.
Contact: sip:sipsak@10.0.0.5:47413.
Content-Length: 0.
Max-Forwards: 70.
User-Agent: sipsak 0.9.6.
Accept: text/plain.
.

U 2016/05/10 13:57:12.406735 10.0.0.4:5060 -> 10.0.0.5:47413
SIP/2.0 500 Service full.
Via: SIP/2.0/UDP 10.0.0.5:47413;received=10.0.0.5;branch=z9hG4bK.3fc50b66;rport=47413;alias.
From: [hidden email].
To: [hidden email];tag=61890dad1e908c702027bf054a266115.c3bd.
Call-ID: [hidden email].
CSeq: 1 OPTIONS.
Server: OpenSIPS (2.1.2 (x86_64/linux)).
Content-Length: 0.

I guess the error "500 Service full" is related to a bloc in the script where i define the routing logic for the load balancing:


## Freeswitch
route[2] {
        xlog("L_NOTICE","[$pr:$fU@$si:$sp]: This is Media-Server Route Use Load-balancer NOW!!\n");
         if (!load_balance("1","calls")) {
                 sl_send_reply("500","Service full");
                exit;
        }
        xlog("L_NOTICE","[$pr:$fU@$si:$sp]: Selected destination Media-Server : $du\n");
}
                                                                                                                                                             
.
In need more explanation how i can fix that.

NDUWAYEZU Joselyne

2016-04-30 12:20 GMT+02:00 Bogdan-Andrei Iancu <[hidden email]>:
Hi,

Use debug=4 in your config and check the logs to see if the script execution really gets to the siptrace part and if so, why it is not done. If you do not manage to "read" the logs, post them somewhere (post only logs related to the REGISTER execution - the REGISTER you want to trace) and send here the link.

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On <a moz-do-not-send="true" href="tel:27.04.2016%2010" target="_blank" value="+12704201610">27.04.2016 10:24, Francjos wrote:
Hello,
I,ve conigured two opensips servers and i would like each one to send sipsak
to another and see if it is still working.
I've installed sipsak on both Opensips.
In order to see the request and reply messages, i've used the siptrace
module.
I've loaded it on both Opensips and set the parameters as follows:

  loadmodule “siptrace.so”

modparam(“siptrace”, “db_url“,
“mysql://opensips:opensipsrw@localhost/opensips”)
modparam(“siptrace”, “trace_flag“, “22”)    # Here the trace_flag will 22.
modparam(“siptrace”, “traced_user_avp“, “$avp(traced_user)”)
modparam(“siptrace”, “trace_on”, 1)

I also load the avpops module :

loadmodule “avpops.so”
modparam(“avpops”,”db_url”,“mysql://opensips:opensipsrw@localhost/opensips”)
modparam(“avpops”, “avp_table”, “New_usr_preferences”)

After that, i've  added the avp in the usr_preferences table using this
command:

opensipsctl avp add –T usr_preferences opensips@myripaddress trace 1 1

I also add this routing logic at the beginning of the main routing logic:

if(avp_db_load(“$fu”,”$avp(trace)”)) {
$avp(traced_user)=$fu;
setflag(22);
  sip_trace();
  xlog(“L_INFO”,”User $fu being traced”);
}

I restarted Opensips and tracing:

opensipsctl restart
opensipsctl fifo sip_trace on

When i send a ping using the sipsak tool like this:

sipsak -s sip:opensips@myotheripaddress, i hope i can visualize,  the
tracing in the sip_trace table, but when i visualise its content, the table
is empty.

Am i simming something in order to get corrects results?

Thanky you



--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/SIPTRAce-module-tp7602727.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



Haute École de Bruxelles


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users