[Kamailio-Devel] Any solution for pua_usrloc when Kamailio is restarted?
Daniel-Constantin Mierla
miconda at gmail.com
Thu Mar 26 15:14:52 CET 2009
On 03/26/2009 04:13 PM, Iñaki Baz Castillo wrote:
> 2009/3/26 Iñaki Baz Castillo <ibc at aliax.net>:
>
>> 2009/3/26 Daniel-Constantin Mierla <miconda at gmail.com>:
>>
>>> Your solution is good anyhow, for those enabling pua_usrloc for first time
>>> -- there will be usrloc updates. If you get a patch, I can review.
>>>
>> Please let me know if my current idea could be valid:
>>
>> 'pua/send_publish.c' contains in function 'send_publish()':
>> ------------------
>> if(publ->body== NULL)
>> {
>> LM_ERR("New PUBLISH and no body found- invalid
>> request\n");
>> return -1;
>> }
>> ------------------
>>
>> and 'pua_usrloc/ul_publish.c' contains in funcion 'ul_publish()':
>> ------------------
>> if(pua_send_publish(publ)< 0)
>> {
>> LM_ERR("while sending publish\n");
>> }
>> ------------------
>>
>>
>> The idea is:
>>
>> 'pua/send_publish.c' - 'send_publish()':
>> ------------------
>> if(publ->body== NULL)
>> {
>> LM_ERR("New PUBLISH and no body found- invalid
>> request\n");
>> return -10; // NOTE THIS UNIQUE VALUE (could
>> be a #define)
>> }
>> ------------------
>>
>> 'pua_usrloc/ul_publish.c' - 'ul_publish()':
>> ------------------
>> if((error=pua_send_publish(publ))< 0)
>> {
>> LM_ERR("while sending publish\n");
>> if (error == -10) {
>> # act as if an INSERT callback occurred (generate
>> the body) and re-send.
>> }
>> }
>> ------------------
>>
>
>
> Hi, it works :)
> I will commit it later.
>
please standardize the return codes with some defines. Would be easier
to track it. I will check latter as well.
Thanks,
Daniel
--
Daniel-Constantin Mierla
SIP Router Masterclass - Kamailio (OpenSER) Training
http://www.asipto.com/index.php/sip-router-masterclass/
More information about the Devel
mailing list