Fixing the 200OK - ACK race in OpenSIPS 1.4

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Fixing the 200OK - ACK race in OpenSIPS 1.4

Saúl Ibarra Corretgé
Hi Bogdan,

A while ago the race between 200OK and ACK was spotted and fixed
according to this ticket:
http://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2080954&group_id=232389

That fix was made after version 1.4 was released, so this version
doesn't include it. Currently I can't upgrade OpenSIPS from version 1.4
and this issue started affecting so I tried backporting the fix myself.

I backported svn revisions 5420 and 5422 but it didn't work :-(

AFAIS in the changes, a new callback was added to the TM module to deal
with this situation (TMCP_RESPONSE_PRE_OUT) which should set the proper
state when the 200 OK is sent so the race with the ACK is avoided. Is
this correct?

Then, this callback is registered in the dlg_create_dialog function, but
OpenSIPS doesn't have this function and all the functionality seems to
be done in dlg_onreq. Because of this, rev 5422 doesn't apply correctly
to version 1.4, so I modified dlg_onreq to "match" dlg_create_dialog in
the following way:

         if ( d_tmb.register_tmcb( 0, t,
 
TMCB_RESPONSE_PRE_OUT|TMCB_TRANS_DELETED|TMCB_RESPONSE_FWDED,
                                 dlg_onreply, (void*)dlg, 0)<0 ) {
                 LM_ERR("failed to register TMCB\n");
                 goto error;
         }

After some testing I can see the error is still occurring (I see bogus
state 6 for state 1 in the logs) so I'm a bit lost here.

I know it's been long since you did this change but do you recall if
some other change needs to be backported or if am in the right path for
backporting this?


Thank you in advance, best regards

--
Saúl Ibarra Corretgé
AG Projects

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: Fixing the 200OK - ACK race in OpenSIPS 1.4

Bogdan-Andrei Iancu
Hi Saúl,

Saúl Ibarra Corretgé wrote:

> Hi Bogdan,
>
> A while ago the race between 200OK and ACK was spotted and fixed
> according to this ticket:
> http://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2080954&group_id=232389
>
> That fix was made after version 1.4 was released, so this version
> doesn't include it. Currently I can't upgrade OpenSIPS from version 1.4
> and this issue started affecting so I tried backporting the fix myself.
>
> I backported svn revisions 5420 and 5422 but it didn't work :-(
>  
yes, that 2  revs should do it (the TM add on and the DIALOG fix)
> AFAIS in the changes, a new callback was added to the TM module to deal
> with this situation (TMCP_RESPONSE_PRE_OUT) which should set the proper
> state when the 200 OK is sent so the race with the ACK is avoided. Is
> this correct?
>  
Correct

> Then, this callback is registered in the dlg_create_dialog function, but
> OpenSIPS doesn't have this function and all the functionality seems to
> be done in dlg_onreq. Because of this, rev 5422 doesn't apply correctly
> to version 1.4, so I modified dlg_onreq to "match" dlg_create_dialog in
> the following way:
>
>          if ( d_tmb.register_tmcb( 0, t,
>  
> TMCB_RESPONSE_PRE_OUT|TMCB_TRANS_DELETED|TMCB_RESPONSE_FWDED,
>                                  dlg_onreply, (void*)dlg, 0)<0 ) {
>                  LM_ERR("failed to register TMCB\n");
>                  goto error;
>          }
>  
Again correct.
> After some testing I can see the error is still occurring (I see bogus
> state 6 for state 1 in the logs) so I'm a bit lost here.
>
> I know it's been long since you did this change but do you recall if
> some other change needs to be backported or if am in the right path for
> backporting this?
>  
It may not be an easy task as the dialog state machine was dramatically
changed from 1.4 to 1.5, so an "adliteram" patch may not be valid for 1.4.

Maybe a solution for you will be trying to grab the whole dialog module
from 1.5 and "fit" it to 1.4 (of course, you need to backport some TM
dependencies also)

Best regards,
Bogdan
>
> Thank you in advance, best regards
>
>  


--
Bogdan-Andrei Iancu
www.voice-system.ro


_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: Fixing the 200OK - ACK race in OpenSIPS 1.4

Saúl Ibarra Corretgé
Hi Bogdan,

> It may not be an easy task as the dialog state machine was dramatically
> changed from 1.4 to 1.5, so an "adliteram" patch may not be valid for 1.4.
>
> Maybe a solution for you will be trying to grab the whole dialog module
> from 1.5 and "fit" it to 1.4 (of course, you need to backport some TM
> dependencies also)
>

This sounds like a better idea :) I'll go this way and port 1.5 dialog
module to 1.4. Thanks for the suggestion!


Kind regards,

--
Saúl Ibarra Corretgé
AG Projects

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: Fixing the 200OK - ACK race in OpenSIPS 1.4

Saúl Ibarra Corretgé
Hi Bogdan,

>> It may not be an easy task as the dialog state machine was dramatically
>> changed from 1.4 to 1.5, so an "adliteram" patch may not be valid for 1.4.
>>
>> Maybe a solution for you will be trying to grab the whole dialog module
>> from 1.5 and "fit" it to 1.4 (of course, you need to backport some TM
>> dependencies also)
>>

That did the job :) Currently I have OpenSIPS 1.4 with the dialog module
from version 1.5 and no more 200OK - ACK races :)

I had to backport a bunch of revisions to make it run, so if anyone is
interested let me know and I can send over the patch.

Thanks for the tip!


Kind regards,

--
Saúl Ibarra Corretgé
AG Projects

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel