[OpenSIPS-Users] Deleting a line from SDP

Chris Martineau chris at ghosttelecom.com
Fri Jul 15 16:19:04 CEST 2011


Hi,

 

I am trying to delete an extra (c) record from the sdp we get from
certain carriers as this is causing some issues downstream.

 

I have sort of done it using the following in the reply route

 

If 183 or 200....

 

$var(line1)=$(rb{sdp.line,c,0});

$var(line2)=$(rb{sdp.line,c,1});

 

If ($var(line2)!=""){

                Replace_body("c=IN IP4 [.0-9]*","t=0 0");  # replaces
the first c record it comes across

}

 

Can't seem to actually delete the line as I can't get rid of the CRLF so
I have replaced it with a filler line which is effectively ignored
anyway.

 

The problem I have is under no load conditions the above works fine but
if the server is loaded then the indexes seem to get screwed with the
index+1 being filled when it shouldn't.

 

So with a single (c) record both indexes 0 and 1 contain the contents of
the c record which screws the above as it will replace it regardless.

 

With 2 (c) records indexes 0 1 and 2 are filled but this isn't a problem
as the check still works and replaces the first (c) record.

 

I suppose I could just check index 2 assuming that the behaviour remains
constant given that it isn't supposed to do that.

 

To simulate the condition on a no load system just run xlog("$rb")
before the above and that seems to have the same loading effect.

 

Any ideas?

 

Many thanks

 

Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20110715/8b6ddbf3/attachment-0001.htm>


More information about the Users mailing list