[OpenSIPS-Users] opensips control panel

Nandini madhu sermj2012 at gmail.com
Wed Aug 7 09:23:13 CEST 2013


Hi Flavio,
Greetings.

Hi Bodgan.
Greetings.

I have seen some INVITES and BYES in my acc table. I have enabled CDR_FLAG
in my script and loaded the module too.

But i am unable to get the data in cdrviewer.

Please help me

My script is as below:

# main request routing logic

route{
    if (!mf_process_maxfwd_header("10")) {
        sl_send_reply("483","Too Many Hops");
        exit;
    }

    if (has_totag()) {
        # sequential requests within a dialog should
        # take the path determined by record-routing
        if (loose_route()) {
            if (is_method("BYE")) {
                *setflag(CDR_FLAG); # ... even if the transaction fails
                create_dialog();
                setflag(TRACE_FLAG);
                setflag(DB_FLAG); # do accounting ...*
            } else if (is_method("INVITE")) {
                # even if in most of the cases is useless, do RR for
                # re-INVITEs alos, as some buggy clients do change route set
                # during the dialog.
                record_route();
            }

            # route it out to whatever destination was set by loose_route()
            # in $du (destination URI).
            route(relay);
        } else {
            if ( is_method("ACK") ) {
                if ( t_check_trans() ) {
                    # non loose-route, but stateful ACK; must be an ACK
after
                    # a 487 or e.g. 404 from upstream server
                    t_relay();
                    exit;
                } else {
                    # ACK without matching transaction ->
                    # ignore and discard
                    exit;
                }
            }
            sl_send_reply("404","Not here");
        }
        exit;
    }

    # CANCEL processing
    if (is_method("CANCEL"))
    {
        if (t_check_trans())
            t_relay();
        exit;
    }

    t_check_trans();

    if ( !(is_method("REGISTER")  ) ) {
        if (from_uri==myself)
        {
        } else {
            # if caller is not local, then called number must be local
            if (!uri==myself) {
                send_reply("403","Rely forbidden");
                exit;
            }
        }
    }

    # preloaded route checking
    if (loose_route()) {
        xlog("L_ERR",
        "Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");
        if (!is_method("ACK"))
            sl_send_reply("403","Preload Route denied");
        exit;
    }

    # record routing
    if (!is_method("REGISTER|MESSAGE"))
        record_route();

    # account only INVITEs
    if (is_method("INVITE")) {
                        *setflag(CDR_FLAG);
                        create_dialog();
                        setflag(TRACE_FLAG);
                        setflag(DB_FLAG); # do accounting ...
                *
    }


    if (!uri==myself) {
        append_hf("P-hint: outbound\r\n");
        route(relay);
    }

    # requests for my domain
    if (is_method("PUBLISH|SUBSCRIBE"))
    {
        sl_send_reply("503", "Service Unavailable");
        exit;
    }

    if (is_method("REGISTER"))
    {
        if (   0 ) setflag(TCP_PERSISTENT);

        if (!save("location"))
            sl_reply_error();

        exit;
    }

    if ($rU==NULL) {
        # request with no Username in RURI
        sl_send_reply("484","Address Incomplete");
        exit;
    }

    # do lookup with method filtering
    if (!lookup("location","m")) {
        t_newtran();

        t_reply("404", "Not Found");
        exit;
    }

    # when routing via usrloc, log the missed calls also
    setflag(ACC_MISSED);
    route(relay);
}


route[relay] {
    # for INVITEs enable some additional helper routes
    if (is_method("INVITE")) {
        t_on_branch("per_branch_ops");
        t_on_reply("handle_nat");
        t_on_failure("missed_call");
    }

    if (!t_relay()) {
        send_reply("500","Internal Error");
    };
    exit;
}


branch_route[per_branch_ops] {
    xlog("new branch at $ru\n");
}


onreply_route[handle_nat] {

    xlog("incoming reply\n");
}


failure_route[missed_call] {
    if (t_was_cancelled()) {
        exit;
    }

    # uncomment the following lines if you want to block client
    # redirect based on 3xx replies.
    ##if (t_check_status("3[0-9][0-9]")) {
    ##t_reply("404","Not found");
    ##    exit;
    ##}

}
Regards

sermj


On Fri, Jun 28, 2013 at 4:59 PM, Flavio Goncalves <flavio at voffice.com.br>wrote:

> Hi Nandini,
>
> Try the following steps:
>
> 1. Make sure you have data in the ACC tables (select * from acc;). If you
> don't have data in your acc table you have problems in your opensips script.
>
> 2. Try to run the proc manually in the database.  SQL>call
> opensips_cdrs_1_6();
> This proc should be run each 3 minutes from cron daemon.
>
> 3. Check now if you have data in cdrs (select * from cdrs).
>
> If you still don't have any data in cdrs, please check the opensips logs
> for errors inserting data in the database.
>
> Best regards,
>
> Flavio E. Goncalves
>
>
>
> 2013/6/28 Nandini madhu <sermj2012 at gmail.com>
>
>> Dear Flavio E. Goncalves,
>>
>> I have loaded opensips_cdrs.mysql and cdrs.mysql into mysql database.
>> And i rechecked the installation instructions as per opensips control
>> panel documentation.
>> Please have a glance on the list available in opensips database:
>>
>> mysql> show tables; (in opensips database)
>> +----------------------+
>> | Tables_in_opensips   |
>> +----------------------+
>> | acc                  |
>> | active_watchers      |
>> | address              |
>> | aliases              |
>> | carrierfailureroute  |
>> | carrierroute         |
>> | cdrs                 |
>> | cpl                  |
>> | dbaliases            |
>> | dialog               |
>> | dialplan             |
>> | dispatcher           |
>> | domain               |
>> | domainpolicy         |
>> | dr_carriers          |
>> | dr_gateways          |
>> | dr_groups            |
>> | dr_rules             |
>> | globalblacklist      |
>> | grp                  |
>> | imc_members          |
>> | imc_rooms            |
>> | load_balancer        |
>> | location             |
>> | missed_calls         |
>> | monitored_stats      |
>> | monitoring_stats     |
>> | ocp_admin_privileges |
>> | pdt                  |
>> | presentity           |
>> | pua                  |
>> | re_grp               |
>> | registrant           |
>> | rls_presentity       |
>> | rls_watchers         |
>> | route_tree           |
>> | rtpproxy_sockets     |
>> | silo                 |
>> | sip_trace            |
>> | speed_dial           |
>> | subscriber           |
>> | uri                  |
>> | userblacklist        |
>> | usr_preferences      |
>> | version              |
>> | watchers             |
>> | xcap                 |
>> +----------------------+
>> 47 rows in set (0.00 sec)
>>
>> Tables from cdrs table from opensips database;
>>
>> mysql> show columns from cdrs;
>>
>> +-----------------+------------------+------+-----+---------------------+----------------+
>> | Field           | Type             | Null | Key | Default             |
>> Extra          |
>>
>> +-----------------+------------------+------+-----+---------------------+----------------+
>> | cdr_id          | bigint(20)       | NO   | PRI | NULL                |
>> auto_increment |
>> | call_start_time | datetime         | NO   |     | 0000-00-00 00:00:00
>> |                |
>> | duration        | int(10) unsigned | NO   |     | 0
>> |                |
>> | sip_call_id     | varchar(128)     | NO   |     |
>> |                |
>> | sip_from_tag    | varchar(128)     | NO   |     |
>> |                |
>> | sip_to_tag      | varchar(128)     | NO   |     |
>> |                |
>> | created         | datetime         | NO   |     | 0000-00-00 00:00:00
>> |                |
>>
>> +-----------------+------------------+------+-----+---------------------+----------------+
>> 7 rows in set (0.00 sec)
>>
>> Kindly please help me.
>>
>>
>> On Thu, Jun 27, 2013 at 3:53 PM, Flavio Goncalves <flavio at voffice.com.br>wrote:
>>
>>> Hi Nandini,
>>>
>>> There is a mysql stored procedure call to calculate the duration of the
>>> calls. There are some files at the tool subdirectory.
>>> /var/www/opensips=cp/config/tools/system/cdr (if I'm remembering
>>> correctly). There is a sql file with a procedure to import to mysql (or
>>> postgresql) and a shell script to call the procedure from cron. Please,
>>> check again the installation instructions.
>>>
>>> Flavio E. Goncalves
>>>
>>>
>>>
>>> 2013/6/27 Nandini madhu <sermj2012 at gmail.com>
>>>
>>>>  Dear all.
>>>>
>>>>   i have installed opensips server and open-sips control panel on my pc
>>>> successfully.
>>>>   In user management ,i can see the clients listed,but when the clients
>>>> are registered,when we click on line users,its showing no data found.
>>>> In CDRviewer also its showing no data.
>>>>
>>>> please help me,
>>>> Thanks in advance
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at lists.opensips.org
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130807/6fe71148/attachment-0001.htm>


More information about the Users mailing list