[OpenSIPS-Users] Deleting a line from SDP

Chris Martineau chris at ghosttelecom.com
Mon Jul 18 11:34:34 CEST 2011


 

Further to my email below I tried setting the index to 2 and the results
were just as random. Sometimes it detected 1 c line as 2 ( in this case
3!) causing an incorrect replacement and others it just completely
ignored it even when there were 2 c lines.

 

Conclusion is that this particular function does not work consistently
enough to be useful.

 

Any help you could offer would be greatly appreciated.

 

Regards

 

Chris

 

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/20110718/e76b1f46/attachment.htm>


More information about the Users mailing list