[Kamailio-Users] [sr-dev] [OT] SIP ALG Detector released

Klaus Darilion klaus.mailinglists at pernau.at
Mon Jun 15 23:35:35 CEST 2009


Iñaki Baz Castillo wrote:
> El Lunes, 15 de Junio de 2009, Klaus Darilion escribió:
>>  How do you get the original request untouched (no ;received param and so)?
>>
>> $mb ?
>>
>>> Also, the reply should be "Content-Type: text/plain".
>> {..
>>   set_reply_body("$mb{s.base64}", "text/plain");
>>   //                      \
>>   //                       -> to be implemented
>>   //
>>   sl_send_reply("200","have fun");
>>   exit;
>> }
> 
> Hi Klaus, I remember now that it's not so easy:
> 
> If the server encodes *all* the original received request in Base64 and sets 
> it in the response body, it becomes a very very long line (no \r\n) and some 
> routers *doing SIP ALG* will fail when processing it, so the client doesn't 
> get the response.
> Confirmed with a Cisco router.
> 
> So waht I do in the server I've coded, is separate the request headers and the 
> request body, encode each part in Base64 and send two responses: a 180 
> containing the requests headers in the body (Base64) and a 500 containing the 
> request SDP.
> 
> For this to implement in a Kamailio/SR module, it will be required a pv to get 
> the received headers and other for the received body, is it possible?

AFAIK there is no PV for the headers, but for the body: $rb. So, using 
transformations you can "calculate" the headers:
  $mb{s.substr,0,$mb{s.l}-$rb{s.len}-4}

Maybe the length calculation must be done separately. You can also use 
$ml, $cl or the newly introduced PV for the real body length ($bs).
http://sip-router.org/wiki/cookbooks/pseudo-variables/devel#sip_message_length

klaus




More information about the sr-users mailing list