[OpenSIPS-Users] Validate dialog confusion
Vlad Paiu
vladpaiu at opensips.org
Fri Jan 2 15:12:36 CET 2015
Hello,
In order to be able to route such broken sequential requests with no
Route headers you must first catch them in your script with match_dialog
, eg :
if (loose_route() || match_dialog())
and then you need to fix them
if ($DLG_status!=NULL && !validate_dialog() ) {
if (fix_route_dialog())
xlog(" received bogus in-dialog request, but properly fixed \n");
else
xlog(" in-dialog bogus request \n");
}
Best Regards,
Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com
On 31.12.2014 14:27, John Nash wrote:
> Or may be should try to match_dialog and then relay
>
> On Wed, Dec 31, 2014 at 5:57 PM, John Nash <john.nash778 at gmail.com
> <mailto:john.nash778 at gmail.com>> wrote:
>
> OK got it. I also have a situation where I receive BYE from callee
> which has "To" tag but no route header. As per default script this
> request should not be allowed to go further. Would
> fix_route_dialog(); work or I should just relay it?
>
> On Wed, Dec 31, 2014 at 1:37 AM, Bogdan-Andrei Iancu
> <bogdan at opensips.org <mailto:bogdan at opensips.org>> wrote:
>
> Hi John,
>
> 1) if the request does not match any dialog it will go on the
> "else" branch where it simply logs the "valid request" - this
> is a simple example, but the idea is that without dialog state
> you cannot check if valid or not; and you maybe do not create
> dialogs for all your calls and maybe not all your sequential
> request are part of a INVITE dialog (you may have re-SUBSCRIBE
> or NOTIFYs)
>
> 2) the function just fixes, you need to send it out as usual
> via the t_relay(),
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
>
> On 30.12.2014 12:16, John Nash wrote:
>> I was looking at usage of validate_dialog() and saw the
>> following snippet from module documentation page. If you
>> check the else part... as per my understanding if a dialog is
>> not found ($DLG_status) will be NULL) it will go to else part
>> which indicates a message has To tag but dialog not found.
>> How can it be a valid in-dialog request.
>>
>> if (has_totag()) {
>> loose_route();
>> if ($DLG_status!=NULL && !validate_dialog() ) {
>> xlog(" in-dialog bogus request \n");
>> } else {
>> xlog(" in-dialog valid request - $DLG_dir !\n");
>> }
>> }
>> Also there is one more code
>> if (has_totag()) {
>> loose_route();
>> if ($DLG_status!=NULL)
>> if (!validate_dialog())
>> fix_route_dialog();
>> }
>>
>> After calling fix_route_dialog() do I need to just relay the
>> message? I mean this function will "fix" the message and
>> send?....I was trying to look for some security check where
>> someone can inject a route header and a to tag (Bogus of
>> course) to reach to my gateways through my proxy.
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org <mailto: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/20150102/052a8121/attachment.htm>
More information about the Users
mailing list