[OpenSIPS-Users] fix_route_dialog problem
Guido Negro
guido.negro at gradwell.com
Mon Jan 31 12:35:34 CET 2011
Hi,
just a quick note to tell you that I actually thought about this way of
using fix_route_dialog() because of this ticket:
http://sourceforge.net/tracker/?func=detail&aid=3090388&group_id=232389&atid=1086413
You may want to correct it?
Guido
On 25/01/11 11:14, Vlad Paiu wrote:
> Hi,
>
> Are you sure you are calling record_route() properly in your script ?
> If you do this, you shouldn't receive any SIP msgs without any route
> headers, as there would be at least 1 route header, the one OpenSIPS
> has added in the first place.
>
> The dialog module depends on the RR module. If a SIP msg with no route
> headers is received, the loose_route() part rejects it as it isn't
> valid from it's point of view, and the message isn't attempted to be
> matched to any certain dialog.
>
> Could you please post a full SIP trace for such a call ?
>
> Regards,
> Vlad
>
>
> On 01/24/2011 06:35 PM, Guido Negro wrote:
>> Hi,
>>
>> thanks for your reply.
>>
>> I am using the script reported in the Opensips book ("Building
>> telephony systems with Opensips") at page 81, that is :
>>
>>
>> if (has_totag() ) {
>> # sequential request withing a dialog should
>> # take the path determined by record-routing
>> if (loose_route() ) {
>> if (is_method("BYE" ) ) {
>> setflag(1) ; # do accounting . . .
>> setflag(3 ) ; # . . . even if the transaction fails
>> } else if ( is_method( "INVITE" ) ) {
>> # even if in most of the cases is useless, do RR for
>> # re-INVITEs alos, as some buggy clients do change route set
>> # during the dialog.
>> record_route() ;
>> }
>> # route it out to whatever destination was set by loose_route()
>> # in $du (destination URI) .
>> route( 1) ;
>> } else {
>> if ( is_method(" ACK") ) {
>> if ( t_check_trans( ) ) {
>> # non loose- route, but stateful ACK; must be an ACK after
>> # a 487 or e. g. 4 04 from upstream server
>> t_relay() ;
>> exit;
>> } else {
>> # ACK without matching transaction ->
>> # ignore and discard
>> exit;
>> }
>> }
>> sl_send_reply("4 04" , " Not here") ;
>> }
>> exit;
>> }
>>
>>
>> Now I've got 2 problems. When a BYE with correct to/from tag &
>> correct call-id, but without any route headers arrives (a message I'd
>> like to 'fix'):
>>
>> 1) I get the variable $DLG_status to be <null> after loose_route() (I
>> checked with specific experiments) and this also causes an error in
>> the log: opensips[3216]: ERROR:dialog:w_validate_dialog: null dialog
>>
>> 2) loose_route() fails, so I always get a 404 response on the callee
>> side that tried to disconnect, and the caller remains connected.
>>
>>
>> I am probably using fix_route_dialog not in the correct way, but what
>> I wanted to do is something like this (very-pseudo code):
>>
>> When loose_route fails (or more in general for every in-dialog
>> subsequent request):
>> Try to fix the request according to saved dialog infos:
>> - Fix succesful: forward the request.
>> - Couldnt fix it: reject the request (send 404 back).
>>
>>
>> Regards,
>>
>> Guido.
>>
>
>
More information about the Users
mailing list