[OpenSIPS-Users] fix_route_dialog problem
Guido Negro
guido.negro at gradwell.com
Tue Jan 25 12:23:38 CET 2011
Hi,
Sorry but I don't have any traces, I'm just doing some experiments. I
know that a BYE that comes in without Route is just wrong ( I did
actually call record_route() ) but that's exactly what I was trying to
workaround. Think of a situation where some proxies not under your
control send back to you BYEs with no route headers (whoever knows why,
they're just broken sometimes) this could cause calls that are not ended
properly on your side and for example, incredibly big bills that you're
gonna have to review later on manually.
I was just thinking that in the case to/from tags and call-id are fine,
it could be possible to 'fix' the route headers with fix_route_dialog()
... but it's definitely not the case as far as I understand! :)
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