[OpenSIPS-Users] registration t_replicate()

Bogdan-Andrei Iancu bogdan at opensips.org
Wed Jun 12 15:04:36 CEST 2013


Doing just before the exit, after the save() stuff.

Regards,

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


On 06/12/2013 03:50 PM, Miha wrote:
> Hi Bogdan,
>
> where exactly t_replicate() should be used?
>
> my script:
>
>  if (is_method("REGISTER") && is_from_local())
>         {
>
>                 # make pua_usrloc send PUBLISH for phones which do
>                 # not support presence
>                 # filter after User-Agent header
>                 if(!search("^User-Agent: X-Lite")) pua_set_publish();
>
>                 ## --NAT-- ##
>                 if (isflagset(5)) {
>                         setbflag(6);
>                         setbflag(7);
>                 };
>                 ## --/NAT-- ##
>
>                 # authenticate the REGISTER requests (uncomment to
> enable auth)
>                 if (!www_authorize("", "subscriber"))
>                 {
>                         www_challenge("", "0");
>                         exit;
>                 }
>                 *t_replicate("sip:xxx.xxx.xxx.xxx:5060");*
>                 if (!db_check_to())
>                 {
>                         sl_send_reply("403","Forbidden auth ID");
>                         exit;
>                 }
>                 if (!save("location"))
>                         sl_reply_error();
>
>                 exit;
>         }
>
>
> I am getting this:
>
> Jun 12 14:45:39 localhost /usr/sbin/opensips[12659]:
> ERROR:pua:send_publish_int: New 'presence' PUBLISH and no body found -
> invalid request
> Jun 12 14:45:39 localhost /usr/sbin/opensips[12659]:
> ERROR:tm:_reply_light: failed to generate 200 reply when a final 401
> was sent out
> Jun 12 14:45:39 localhost /usr/sbin/opensips[12659]:
> ERROR:signaling:sig_send_reply_mod: failed to send reply with tm module
> Jun 12 14:45:39 localhost /usr/sbin/opensips[12659]:
> ERROR:registrar:send_reply: failed to send 200 OK
>
> thanks!
>
> miha
>
>
>
>
> Dne 6/12/2013 12:07 PM, pis(e Bogdan-Andrei Iancu:
>> Hello Miha,
>>
>> Yes, t_replicate() is designed to be used after to finished the local
>> processing of the REGISTER (like doing the save(location)).
>>
>> This mechanism is intended to be used between servers in the same
>> platform, so you can use IP-based authentication for the replicated
>> REGISTERs (no need for digest auth). And you should not accept
>> replicated registers from anywhere, but only from servers from your
>> platform.
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>> OpenSIPS Founder and Developer
>> http://www.opensips-solutions.com
>>
>>
>> On 06/11/2013 02:49 PM, Miha wrote:
>>> HI,
>>>
>>> I need a little info how replication of registrations is done. I just
>>> use function t_replicate() in script where I am doing registration stuff?
>>>
>>> What about security must there be any credential or how other proxy
>>> deals with this? Can any proxy post this repication data to my server?
>>>
>>> Thanks!
>>> Miha
>>>
>>>
>>>
>>> _______________________________________________
>>> 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/20130612/b6453530/attachment.htm>


More information about the Users mailing list