[OpenSER-Users] subst_body missing /sm flags

Aki Rehn aki.rehn at setera.fi
Tue Oct 9 11:51:03 CEST 2007


Hi Bogdan,

Bogdan-Andrei Iancu kirjoitti:
> Hi Aki,
>
> Even if not documented, the s flag is supported in the subst_* 
> functions...Is the m flag mandatory in your case?
>

Yes, in this case it was mandatory. But not anymore.

Big thanks to Juha Heinänen, who created a filter_body() function to 
textops module to svn head, which then solved my problem.

> regards,
> bogdan
>


Br,
Aki

> Aki Rehn wrote:
>> Hi,
>>
>> I need some help.
>>
>> Here's my input in onreply_route:
>>
>> --- 8< ---
>> U 2007/10/05 12:26:58.832161 xxx.18.234.14:5060 -> xxx.18.238.2:5060
>> SIP/2.0 180 Ringing.
>> From: "aki"<sip:358942419xxx at devel.foo.fi>;tag=as508b1a29.
>> To: 
>> <sip:3584577509xxx at vox.bar.fi>;tag=eea1259-13c4-47060394-b296ee66-575d.
>> Call-ID: 7b18b07b06335629699f1d5818e07548 at devel.foo.fi.
>> CSeq: 102 INVITE.
>> Via: SIP/2.0/UDP xxx.18.238.2;branch=z9hG4bK570f.7ca86953.0.
>> Via: SIP/2.0/UDP xxx.18.238.15:5060;branch=z9hG4bK68f201e6.
>> Contact: <sip:3584577509xxx at xxx.18.234.14>.
>> Record-Route: <sip:xxx.18.238.2;lr;ftag=as508b1a29>.
>> Content-Type: multipart/mixed 
>> ;boundary="Boundary47060397_b296f9ef_3ecc_bc780ec".
>> Content-Length: 397.
>> .
>> --Boundary47060397_b296f9ef_3ecc_bc780ec.
>> Content-Type: application/SDP.
>> .
>> v=0.
>> o=xxx.18.234.23 1191575887 1191575887 IN IP4 xxx.18.234.23.
>> s=Session SDP.
>> c=IN IP4 xxx.18.234.23.
>> t=0 0.
>> m=audio 11130 RTP/AVP 0.
>> a=rtpmap:0 PCMU/8000.
>> a=ptime:20.
>> .
>> --Boundary47060397_b296f9ef_3ecc_bc780ec.
>> Content-Type: application/ISUP ;version=itu-t.
>> .
>> ,.....4)..9.7.7....
>> --Boundary47060397_b296f9ef_3ecc_bc780ec--
>> --- >8 ---
>>
>> These extra Conten-Type (application/ISUP and multipart/mixed) are 
>> messing up some older PBX's of ours, so I need to strip them out.
>>
>> With perl I could do it like this:
>> s/^Content-Type: application\/ISUP 
>> ;version=itu-t.*--Boundary/--Boundary/sm;
>> s/--Boundary.*$//mg;
>>
>> However the subst_body() doesnt seem to support /sm flags.
>>
>> Discussing this on #openser @ freenode we tried solutions with 
>> transformations (thanks NormB!) like:
>> $(hdr(Content-Type)) = $(hdr(Content-Type){s.substr,0,0})
>>
>> .. or like the same with replace* functions.
>>
>> However I didnt find a suitable solutions.
>>
>> Anyone maybe got any ideas?
>>
>>
>> Br,
>> Aki
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at openser.org
>> http://openser.org/cgi-bin/mailman/listinfo/users
>>
>





More information about the Users mailing list