Hello,
I'm using a very ugly code to test remove_body(): request_route { remove_body(); $rd = "192.168.254.85"; t_relay(); }
Original INVITE (with SDP): --------------------------------- U 192.168.254.102:5060 -> 192.168.254.104:5060 INVITE sip:123@192.168.254.104 SIP/2.0. Via: SIP/2.0/UDP 192.168.254.102:5060;branch=z9hG4bK50cdeeb8. Max-Forwards: 70. From: "10005" sip:10005@192.168.254.102;tag=as78ddcd16. To: sip:123@192.168.254.104. Contact: sip:10005@192.168.254.102:5060. Call-ID: 79a1c78f01914f1814bfcb7d622cf735@192.168.254.102:5060. CSeq: 102 INVITE. User-Agent: Asterisk PBX 1.8.7.1. Date: Sat, 18 May 2013 05:47:32 GMT. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH. Supported: replaces, timer. Content-Type: application/sdp. Content-Length: 269. . v=0. o=root 1763381182 1763381182 IN IP4 192.168.254.102. s=Asterisk PBX 1.8.7.1. c=IN IP4 192.168.254.102. t=0 0. m=audio 16162 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=silenceSupp:off - - - -. a=ptime:20. a=sendrecv. ---------------------------------
Modified INVITE (after remove_body()): --------------------------------- U 192.168.254.104:5060 -> 192.168.254.85:5060 INVITE sip:123@192.168.254.85 SIP/2.0. Via: SIP/2.0/UDP 0.0.0.0;branch=z9hG4bK6c5c.6160e017.0. Via: SIP/2.0/UDP 192.168.254.102:5060;branch=z9hG4bK50cdeeb8. Max-Forwards: 70. From: "10005" sip:10005@192.168.254.102;tag=as78ddcd16. To: sip:123@192.168.254.104. Contact: sip:10005@192.168.254.102:5060. Call-ID: 79a1c78f01914f1814bfcb7d622cf735@192.168.254.102:5060. CSeq: 102 INVITE. User-Agent: Asterisk PBX 1.8.7.1. Date: Sat, 18 May 2013 05:47:32 GMT. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH. Supported: replaces, timer. *Content-Type: application/sdp.* Content-Length: 0. . ---------------------------------
So, remove_body() is actualy removes SDP from request but leaves Content-Type header. Why ?
Because there is no logic implement removing the header automatically. So you have to call remove_hf("Content-Type") afterwards.
regards Klaus
On 18.05.2013 08:00, Konstantin M. wrote:
Hello,
I'm using a very ugly code to test remove_body(): request_route { remove_body(); $rd = "192.168.254.85"; t_relay(); }
Original INVITE (with SDP):
U 192.168.254.102:5060 http://192.168.254.102:5060 -> 192.168.254.104:5060 http://192.168.254.104:5060 INVITE sip:123@192.168.254.104 mailto:sip%3A123@192.168.254.104 SIP/2.0. Via: SIP/2.0/UDP 192.168.254.102:5060;branch=z9hG4bK50cdeeb8. Max-Forwards: 70. From: "10005" <sip:10005@192.168.254.102 mailto:sip%3A10005@192.168.254.102>;tag=as78ddcd16. To: <sip:123@192.168.254.104 mailto:sip%3A123@192.168.254.104>. Contact: <sip:10005@192.168.254.102:5060 http://sip:10005@192.168.254.102:5060>. Call-ID: 79a1c78f01914f1814bfcb7d622cf735@192.168.254.102:5060 http://79a1c78f01914f1814bfcb7d622cf735@192.168.254.102:5060. CSeq: 102 INVITE. User-Agent: Asterisk PBX 1.8.7.1. Date: Sat, 18 May 2013 05:47:32 GMT. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH. Supported: replaces, timer. Content-Type: application/sdp. Content-Length: 269. . v=0. o=root 1763381182 1763381182 IN IP4 192.168.254.102. s=Asterisk PBX 1.8.7.1. c=IN IP4 192.168.254.102. t=0 0. m=audio 16162 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=silenceSupp:off - - - -. a=ptime:20. a=sendrecv.
Modified INVITE (after remove_body()):
U 192.168.254.104:5060 http://192.168.254.104:5060 -> 192.168.254.85:5060 http://192.168.254.85:5060 INVITE sip:123@192.168.254.85 mailto:sip%3A123@192.168.254.85 SIP/2.0. Via: SIP/2.0/UDP 0.0.0.0;branch=z9hG4bK6c5c.6160e017.0. Via: SIP/2.0/UDP 192.168.254.102:5060;branch=z9hG4bK50cdeeb8. Max-Forwards: 70. From: "10005" <sip:10005@192.168.254.102 mailto:sip%3A10005@192.168.254.102>;tag=as78ddcd16. To: <sip:123@192.168.254.104 mailto:sip%3A123@192.168.254.104>. Contact: <sip:10005@192.168.254.102:5060 http://sip:10005@192.168.254.102:5060>. Call-ID: 79a1c78f01914f1814bfcb7d622cf735@192.168.254.102:5060 http://79a1c78f01914f1814bfcb7d622cf735@192.168.254.102:5060. CSeq: 102 INVITE. User-Agent: Asterisk PBX 1.8.7.1. Date: Sat, 18 May 2013 05:47:32 GMT. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH. Supported: replaces, timer. *Content-Type: application/sdp.* Content-Length: 0. .
So, remove_body() is actualy removes SDP from request but leaves Content-Type header. Why ?
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users