[OpenSIPS-Users] Location info when using OpenSIPS as outbound proxy
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Tue Aug 3 00:13:42 CEST 2010
Hi Nauman,
Nauman Sulaiman wrote:
> Hi Bogan
>
> Thanks for the replies, we are basically registering with a third party provider and the save location on the Opensips isn't really to keep track of registration state, its just to keep track of the location of the UAC irrespective of whether its registered or not.
>
In this case, you use the trick from Andrew, like:
route{
if (method=="REGISTER")
{
t_on_reply("3");
if (!t_relay()) {
sl_reply_error();
}
exit;
}
}
onreply_route[3] {
# Here we handle REGISTER replies
xlog("L_INFO", "[$mi] [$rs $rr]\n");
if (status=~"200") {
route(3);
};
route[3] {
# workaround for location saving
xlog("L_INFO", "saving location\n");
save("location","r");
}
Your contacts will be saved by opensips only when a 200 OK was received
for the REGISTER you send upstream.
Regards,
Bogdan
> we now have the following code in route(1) of sample script
>
> if (method=="REGISTER")
> {
> xlog("saving AoR non local domain \n");
>
> if (!save("location","mr"))
> {
> xlog("couldn't save location in route 1 \n");
> sl_reply_error();
> }
>
>
> if (!t_relay()) {
> sl_reply_error();
> }
>
> exit;
> }
>
> we are not challenging the UAC if the domain is not the opensips proxy, we just let it go through and save location. We take it if you issue a challenge here you need a copy of the credentials of the UAC on the opensips proxy, as we will not have this, is the above valid?
>
> --- On Sun, 1/8/10, Bogdan-Andrei Iancu <bogdan at voice-system.ro> wrote:
>
>
>> From: Bogdan-Andrei Iancu <bogdan at voice-system.ro>
>> Subject: Re: [OpenSIPS-Users] Location info when using OpenSIPS as outbound proxy
>> To: "OpenSIPS users mailling list" <users at lists.opensips.org>
>> Date: Sunday, 1 August, 2010, 19:14
>> Hi Andrew,
>>
>> what you are doing is dangerous :)
>>
>> Even if the contacts+expires values will be properly
>> extracted from the
>> reply, other data will be bogus, like:
>> - user agent
>> - socket info (only if you do change it
>> before relaying the register)
>> - path info
>> - received value + branch flags (if some
>> forking is done)
>>
>> Regards,
>> Bogdan
>>
>> Andrew Pogrebennyk wrote:
>>
>>> On 01.08.2010 20:37, Bogdan-Andrei Iancu wrote:
>>>
>>>
>>>> 2) ideally, for an outbound proxy, you should do
>>>>
>> the registration
>>
>>>> processing at reply time, once the main registrar
>>>>
>> accepted the
>>
>>>> registration and eventually made all the changes
>>>>
>> over it. But right
>>
>>>> now
>>>> opensips does not accept registration processing
>>>>
>> for replies.
>>
>>>>
>>>>
>>> Just in case - some time ago I did something like:
>>>
>>> onreply_route[3] {
>>> # Here we handle REGISTER replies
>>> xlog("L_INFO", "[$mi] [$rs
>>>
>> $rr]\n");
>>
>>> if (status=~"200") {
>>> route(3);
>>> };
>>>
>>> route[3] {
>>> # workaround for location saving
>>> xlog("L_INFO", "saving
>>>
>> location\n");
>>
>>> save("location","0x02");
>>> }
>>>
>>>
>>> 0x02 - do not generate a SIP reply to the current
>>>
>> REGISTER request.
>>
>>>
>>>
>> --
>> Bogdan-Andrei Iancu
>> OpenSIPS Bootcamp
>> 20 - 24 September 2010, Frankfurt, Germany
>> www.voice-system.ro
>>
>>
>> _______________________________________________
>> 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
>
>
--
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
20 - 24 September 2010, Frankfurt, Germany
www.voice-system.ro
More information about the Users
mailing list