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 <http://10.0.0.5:47413> -> 10.0.0.4:5060 <http://10.0.0.4:5060>
OPTIONS sip:opensips@10.0.0.4 <mailto:sip%3Aopensips@10.0.0.4> SIP/2.0.
Via: SIP/2.0/UDP 10.0.0.5:47413;branch=z9hG4bK.3fc50b66;rport;alias.
From: sip:sipsak@10.0.0.5:47413;tag=4c5c78b9.
To: sip:opensips@10.0.0.4 <mailto:sip%3Aopensips@10.0.0.4>.
Call-ID: 1281128633@10.0.0.5 <mailto:1281128633@10.0.0.5>.
CSeq: 1 OPTIONS.
Contact: sip:sipsak@10.0.0.5:47413 <http://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 <http://10.0.0.4:5060> -> 10.0.0.5:47413 <http://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: sip:sipsak@10.0.0.5:47413;tag=4c5c78b9.
To: sip:opensips@10.0.0.4 <mailto:sip%3Aopensips@10.0.0.4>;tag=61890dad1e908c702027bf054a266115.c3bd.
Call-ID: 1281128633@10.0.0.5 <mailto:1281128633@10.0.0.5>.
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 <http://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 <http://10.0.0.5:47413> -> 10.0.0.4:5060 <http://10.0.0.4:5060>
OPTIONS sip:opensips@10.0.0.4 <mailto:sip%3Aopensips@10.0.0.4> SIP/2.0.
Via: SIP/2.0/UDP 10.0.0.5:47413;branch=z9hG4bK.3fc50b66;rport;alias.
From: sip:sipsak@10.0.0.5:47413;tag=4c5c78b9.
To: sip:opensips@10.0.0.4 <mailto:sip%3Aopensips@10.0.0.4>.
Call-ID: 1281128633@10.0.0.5 <mailto:1281128633@10.0.0.5>.
CSeq: 1 OPTIONS.
Contact: sip:sipsak@10.0.0.5:47413 <http://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 <http://10.0.0.4:5060> -> 10.0.0.5:47413 <http://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: sip:sipsak@10.0.0.5:47413;tag=4c5c78b9.
To: sip:opensips@10.0.0.4 <mailto:sip%3Aopensips@10.0.0.4>;tag=61890dad1e908c702027bf054a266115.c3bd.
Call-ID: 1281128633@10.0.0.5 <mailto:1281128633@10.0.0.5>.
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 <bog...@opensips.org <mailto:bog...@opensips.org>>:

    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 <tel:27.04.2016%2010>: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
        Users@lists.opensips.org <mailto:Users@lists.opensips.org>
        http://lists.opensips.org/cgi-bin/mailman/listinfo/users




Haute École de Bruxelles

_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to