[OpenSIPS-Users] fix_route_dialog problem

Vlad Paiu vladpaiu at opensips.org
Mon Jan 24 12:34:40 CET 2011


Hello,

The function fix_route_dialog() needs loose_route() to be called, in 
order to set the current dialog pointer that fix_route_dialog() will 
attempt to match and fix accordingly. It isn't mandatory to call 
validate_dialog() first, but it is best practice, because a call to 
validate_dialog() function is very light, while fix_route_dialog() makes 
heavy changes to the SIP msg.

A very basic example of script to fix only BYEs would be

if (has_totag()) {
         loose_route();

         if (is_method("BYE"))
             if (!validate_dialog())
                 fix_route_dialog();
     }

The dialog structure is not cleared from OpenSIPS memory when BYE is 
received. This happens when the respective transaction ends, so the 
above example should work just fine.

Could you please post the script you are using and a high level debug 
log from OpenSIPS ?


On 01/24/2011 12:26 PM, Guido Negro wrote:
> Hi,
>
> I encountered some problems while trying to use fix_route_dialog() 
> function.
>
> Basically what I'd like to do is to use this function to correct Route 
> headers of the BYE messages that
>
>     * have wrong or no Route header at all
>     * have valid to/from & call-id information ( 'valid' in respect to 
> dialog infos saved in opensips )
>
> I tried to use it as suggested in the documentation, that is
>
>     if (has_totag()) {
>         loose_route();
>         if ($DLG_status!=NULL)
>             if (!validate_dialog())
>                 fix_route_dialog();
>     }
>
>
> The problem is that when a BYE comes in, the dialog is automatically 
> deleted in opensips, so I can never really reach fix_route_dialog() 
> call in the case I want to actually use it.
>
> Should I do something like
>
>     if (is_method("BYE"))
>         fix_route_dialog();
>
>
> Is fix_route_dialog() supposed to work even without the checks that 
> are in the doc's code snippet?
>
>
> Thank you very much,
>
>
> Guido.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


-- 
Vlad Paiu
www.voice-system.ro




More information about the Users mailing list