[sr-dev] [kamailio/kamailio] re.subst cannot process sdp content-length of 2978 (#1592)

Daniel-Constantin Mierla notifications at github.com
Sat Jul 14 08:31:56 CEST 2018


I incremented the size of the buffer to 8196, the old value of 2048 being rather small for dealing with sip messages. In the future, this might be changed to allocated memory at startup based on pv buffer size.

However, in case of dealing with larger values, there are couple of options:

  * navigate line by line in sdp:

```
$var(lc) = $(rb{line.count});
$var(i) = 0;
while($var(i)<$var(lc)) {
  $var(line) = $(rb{line.at,$var(i)});
  # do you re here on $var(line) ...

  $var(i) = $var(i) + 1;
}
```
  * split operation on parts of the value:

```
$var(halflen) = $(rb{s.len}) / 2;
$var(firsthalf) = $(rb{s.substr,0,$var(halflen)});
$var(secondhalf) = $(rb{s.substr,$var(halflen),0});
```
This may have the risk of splitting on the line you want to match, but could be useful for other cases.

  * use an embedded interpreter, for example app_jsdk or app_sqlang have no external dependencies, but you can use also app_lua, app_python, ...

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1592#issuecomment-405002970
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20180713/93ab6780/attachment.html>


More information about the sr-dev mailing list