[SR-Users] RES: event_route and acc_db_request().

Alexandre Abreu alexandre.abreu at redt.com.br
Thu Mar 24 14:55:31 CET 2011


Hi Daniel,

Using 'xmlrpc' and 'mi' it works. When I finish this project, I will write a
small text explaining the steps I did to make this work. Maybe this will
benefit more people from the community. 

Thank you.
Alexandre

-----Mensagem original-----
De: Daniel-Constantin Mierla [mailto:miconda at gmail.com] 
Enviada em: quinta-feira, 24 de março de 2011 03:51
Para: Alexandre Abreu
Cc: 'SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users
Mailing List'
Assunto: Re: RES: RES: [SR-Users] event_route and acc_db_request().

Hello,

the method name is 'mi' then the first parameter is dlg_terminate_dlg and
the next parameters are the ones required by the dlg_terminate_dlg.

The XMLRPC command 'mi' is to execute commands from the old control
interface that we named MI:

http://kamailio.org/docs/modules/stable/modules/mi_rpc.html#id2945832

Cheers,
Daniel

On 3/23/11 4:30 PM, Alexandre Abreu wrote:
> Hi Daniel,
>
> Look the request/reply.
>
> <...>
> <?xml version="1.0" encoding="UTF-8"?>.
> <methodCall>.
> <methodName>mi dlg_terminate_dlg</methodName>.
> <params>.
> <param><value><string>065fa668d8485f33</string></value></param>.
> </params>.
> </methodCall>.
>
> <...>
> <?xml version="1.0"?>
> <methodResponse>
> <fault>
> <value>
> <struct>
> <member>
> <name>faultCode</name>
> <value><int>500</int></value>
> </member>
> <member>
> <name>faultString</name>
> <value><string>Method Not Found</string></value> </member> </struct> 
> </value> </fault> </methodResponse>
>
> This is module xmlrpc handling the POST at route[XMLRPC]. I am not 
> sure if I understand correctly how you suggested the use of 'mi
dlg_terminate_dlg'
> command.
>
> Thanks,
> Alexandre
>
> -----Mensagem original-----
> De: Daniel-Constantin Mierla [mailto:miconda at gmail.com] Enviada em: 
> quarta-feira, 23 de março de 2011 11:10
> Para: Alexandre Abreu
> Cc: 'SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - 
> Users Mailing List'
> Assunto: Re: RES: [SR-Users] event_route and acc_db_request().
>
> Hello,
>
> On 3/23/11 2:36 PM, Alexandre Abreu wrote:
>> Hello Daniel.
>>
>> The module being used is 'mi_xmlrpc.so'
> ok, this one creates a new process for handling xmlrpc requests. It is 
> pretty much clear that is very likely what I suspected first time.
>
> If you have time, try load instead xmlrpc module and use the command 
> 'mi dlg_terminate_dlg ...".
>
> Cheers,
> Daniel
>
>>    I am using the Carsten's rtpproxy
>> patch. RTPPROXY detects the media timeout and send a notification 
>> through XMLRPC lib with 'dlg_terminate_dlg callid' to Kamailio. After 
>> that, I configured the event_route to catch the local generated 
>> requests for accounting these BYEs.
>>
>> Thanks,
>> Alexandre
>>
>> -----Mensagem original-----
>> De: Daniel-Constantin Mierla [mailto:miconda at gmail.com] Enviada em:
>> quarta-feira, 23 de março de 2011 10:17
>> Para: Alexandre Abreu
>> Cc: 'SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - 
>> Users Mailing List'
>> Assunto: Re: RES: [SR-Users] event_route and acc_db_request().
>>
>> Hello,
>>
>> On 3/23/11 1:44 PM, Alexandre Abreu wrote:
>>> Hello Daniel.
>>>
>>> The BYE is generated by kamctl/xmlrpc (dlg_terminate_dlg).
>> is xmlrpc via mi_xmlrpc or via xmlrpc module?
>>
>> I have to double check, but looks very likely to be the fact that acc 
>> db connection was not initialized for MI/RPC children processes.
>>
>> Thanks,
>> Daniel
>>
>>> Alexandre
>>>
>>> De: Daniel-Constantin Mierla [mailto:miconda at gmail.com] Enviada em:
>>> quarta-feira, 23 de março de 2011 04:55
>>> Para: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - 
>>> Users Mailing List
>>> Cc: Alexandre Abreu
>>> Assunto: Re: [SR-Users] event_route and acc_db_request().
>>>
>>> Hello,
>>>
>>> On 3/17/11 5:45 PM, Alexandre Abreu wrote:
>>> Hello.
>>>
>>> Why acc_db_request() doesn’t work on event_route?
>>>
>>> I will take a look.
>>>
>>> Is the BYE generated by dialog timeout or you trigger it by
> kamctl/xmlrpc?
>>> Cheers,
>>> Daniel
>>>
>>>
>>>
>>> Mar 17 13:15:44 devel kamailio[25209]: INFO:<script>: Routing 
>>> locally generated BYE to<sip:2000000 at 192.168.200.114:9297>
>>> Mar 17 13:15:44 devel kamailio[25209]: ERROR:<core>    [db.c:421]:
>>> invalid parameter value Mar 17 13:15:44 devel kamailio[25209]: ERROR:
>>> acc [acc.c:391]: error in use_table Mar 17 13:15:44 devel
>>> kamailio[25209]: INFO:<script>: Routing locally generated BYE 
>>> to<sip:2000001 at 192.168.200.149:7335>
>>> Mar 17 13:15:44 devel kamailio[25209]: ERROR:<core>    [db.c:421]:
>>> invalid parameter value Mar 17 13:15:44 devel kamailio[25209]: ERROR:
>>> acc [acc.c:391]: error in use_table
>>>
>>> event_route[tm:local-request] {
>>>
>>>            xlog("L_INFO", "Routing locally generated $rm 
>>> to<$ru>\n");
>>>
>>>            if (is_method("BYE"))
>>>                    acc_db_request("rtp-timeout", “acc”); }
>>>
>>> If I change acc_db_request() to acc_log_request() everything works 
>>> fine, but this BYE should go to database for accounting purposes.
>>>
>>> I am using GIT version from Kamailio branch 3.1.
>>>
>>>    From 2008 there is a thread that also demonstrate this problem:
>>>
>>> http://www.mail-archive.com/users@lists.kamailio.org/msg01411.html
>>>
>>> Unfortunately, in the archives, there’s no solution for that.
>>>
>>> Regards,
>>> Alexandre
>>>
>>>
>>> _______________________________________________
>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
>>> list sr-users at lists.sip-router.org 
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>> --
>> Daniel-Constantin Mierla
>> http://www.asipto.com
>>
> --
> Daniel-Constantin Mierla
> http://www.asipto.com
>

--
Daniel-Constantin Mierla
http://www.asipto.com





More information about the sr-users mailing list