[Serusers] append_hf_helper brings strange characters.

szj zjsun at biigroup.com
Tue Mar 22 02:39:01 CET 2005


Marian Dumitru wrote:

> Hi Sun Zongjun,
>
> Note that most of string in ser are not null terminated, but kept with 
> length.
> Most probably, when you insert the lump you give an invalid length.

Hi,  Marian:

   Thanks very much for your kind instructions. You are absolutely right.
I have corrected my code.
  Thanks again.
  
  Best Regards.

Sun Zongjun

>
> Best regards,
> Marian
>
> szj wrote:
>
>>
>>  I use the SER 0.10.99 version. I want to modify
>> the procedure of tm module. Before sending the request
>> and forwarding the reply, I managed to modify the
>> request and response, f.e, to insert another header
>> into the request and response. In the request, it
>> works correctly.But in the response, sometime it
>> works, sometimes it failed. The debug log is as
>> follows.
>>
>> 2(2196)  old size: 784, new size: 869
>> 2(2196) build_res_from_sip_res: copied size: orig:76, new: 161, rest: 
>> 708 msg=
>> SIP/2.0 200 OK^M
>>  >P-Security-Nobody:Zgrrv1Y/19zYJGyKXm4obgHZZP5jY59qxbhLxEUgZO11uI41w1QzJKqSbjYQ6G7e/ViClnetse/aCE+dj/TbAZFQa45dL/wPzAS4MDKABos=^M 
>>
>>  >/QjFhTWNKQaL8k=^M/*<90>*Via: SIP/2.0/UDP 
>> 192.168.0.19:5500;branch=z9hG4bK1648283653^M
>> Record-Route: <sip:192.168.0.19;ftag=549451184;lr>^M
>> From: <sip:861111 at sip.suntest.com>;tag=81929894;tag=549451184^M
>> To: <sip:862222 at sip.suntest.com>;tag=882426148^M
>> Call-ID: 903055665 at 192.168.0.19^M
>> CSeq: 21 INVITE^M
>> Contact: <sip:862222 at 192.168.0.19:6600>^M
>> Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, MESSAGE, 
>> INFO^M
>> Content-Type: application/sdp^M
>> Content-Length:   261^M
>> ^M
>> v=0^M
>> o=nobody 20041028 20000001 IN IP4 192.168.0.19^M
>> s=A call^M
>> c=IN IP4 192.168.0.19^M
>> t=1111396796 1111400396^M
>> m=audio 7100 RTP/AVP 0 8^M
>> a=rtpmap:0 PCMU/8000^M
>> a=rtpmap:8 PCMA/8000^M
>> m=video 7600 RTP/AVP 98 31^M
>> a=rtpmap:98 H263/90000^M
>> a=rtpmap:31 vf=4/CIF/1/768^M
>>
>>  I insert the header "P-Security-Nobody: " into the
>> response using the modified version of function
>> "append_hf_helper". There are some strange code in
>> the backend of inserted header. f.e, the italic black
>> characters in the log. I had added a null terminator
>> at the tail of the inserted header.
>>
>>  I guess it is caused by the data_lump functions.
>>  Who can tell me the real reason of that?
>>
>>  Thanks for your kind help.
>>  Best Regards.
>>
>> Sun Zongjun
>>
>> _______________________________________________
>> Serusers mailing list
>> serusers at lists.iptel.org
>> http://lists.iptel.org/mailman/listinfo/serusers
>>
>




More information about the sr-users mailing list