Hi Klaus, did you find a solution to this problem? I'm working with SIP-I and having the same issue with Binary encoding. I need to encode a 0x00 value and when the config script gets to that point, it breaks. If I encode any other hex value it's fine. This is the config part I'm using:
route[INSERT_ACM]{ if(has_body()){ # Save the SDP body for future reference $var(sdp_body) = $rb; replace_body_atonce("^.+$", ""); remove_hf("Content-Type"); append_hf("MIME-Version: 1.0\r\n", "Content-Length"); append_hf("Content-Type: multipart/mixed; boundary=unique-boundary-1\r\n", "Allow"); replace_body_atonce("^.+$", "--unique-boundary-1\r\nContent-Disposition: signal; handling=optional\r\nContent-Type: application/isup; version=itu-t92+\r\n\r\n'\x06''\x02''\x04''\x01''\x29''\x01''\x01''\x00'\r\n-unique-boundary-1\r\n"); msg_apply_changes(); replace_body_all("\047", ""); append_body_part("$var(sdp_body)","application/sdp"); } return; }
I tried with the escape character \0 which should be translated to ASCII hex value '00' but it's parsed as ASCII literal values \0...
Thanks!
Federico
Federico San Martín e-mail : fsanmartin@telecentro.net.ar
On 9/17/13 4:34 PM, Daniel wrote:
On 9/17/13 4:03 PM, Klaus Feichtinger wrote:
Hi Frederico,
the only (quick) solution I had found was doing message parsing (MIME body) in an external PERL script, returning the information that I was searching for (from that body) to the config script and reducing the multipart body to a single body. This is (until now) working fine... However, I was using Kamailio version 3.2.x in this situation, but I think that there will be no change to the newest version, as it is a basic C language problem.
Please note that PERL was the language that I was finding the fastest solution with. Maybe you can use an alternative language, too.
regards, Klaus
Am 21.02.2015 um 01:19 schrieb Federico San Martín:
Thank you for the quick reply Klaus! I'm currently trying a new patch for the SIPT module created by Torrey Searle that allows me to modify the binary data on the BCI byte, the only caveat is that you have to receive the BCI to modify it, you can't create it on the fly.
BR,
Federico
----- Original Message -----
From: "Klaus Feichtinger" klaus.lists@inode.at To: sr-users@lists.sip-router.org, fsanmartin@telecentro.net.ar Sent: Thursday, February 26, 2015 5:10:22 PM Subject: Re: [SR-Users] TEXTOPS parser problem with binary data in MIME body
Hi Frederico,
the only (quick) solution I had found was doing message parsing (MIME body) in an external PERL script, returning the information that I was searching for (from that body) to the config script and reducing the multipart body to a single body. This is (until now) working fine... However, I was using Kamailio version 3.2.x in this situation, but I think that there will be no change to the newest version, as it is a basic C language problem.
Please note that PERL was the language that I was finding the fastest solution with. Maybe you can use an alternative language, too.
regards, Klaus
Am 21.02.2015 um 01:19 schrieb Federico San Martín: