Using subst_uri(), as you discovered, is the tweak to make it working (see the mailing list archives). However, the contact in reply must be handled by the end device (caller). The proxy should take care in case of NAT.
Cheers, Daniel
On 03/06/06 04:02, Dr. Rodney G. McDuff wrote:
I am try to get Windows Messenger v5.1 to play nicely with other UAs and SER/OpenSER and Asterisk. One of the problems that is confounding me is WM5 non-standard contact header which is of the form:
Contact:
sip:user@domain.net:5060;maddr=xxx.xxx.152.57;transport=tcp;proxy=replace.
The SIP RFC say that a maddr URL tag overrides the host part of the url (at least for the Via header). However when a UA uses this contact to send an ACK or BYE back to the WM5 UA , OpenSER does seem to be able to route it to xxx.xxx.152.57. If fact Openser pops the route header off (which contains the IP for the proxy) into the RURI and the response goes nowhere. (See attached trace)
When I rewrite the contact in the config file but put the following code in route[0]:
if (method=="INVITE") { if (search("^Contact:.*;maddr=")) { # find the host name and replace it withj the maddr tag if
(!subst("/^Contact:(.*)sip:([^@]+)@([a-zA-Z0-9.]+)(.*);maddr=([0-9.]+)(.*)/Contact:\1sip:\2@\5\4;maddr=\5\6/i")) { xlog("L_NOTICE", "route[0]: ERROR rewriting maddr contact $hdr(contact[0])\n"); } else { xlog("L_NOTICE", "route[0]: Rewrote maddr contact $hdr(contact[0])\n"); } } }
and the following in onreply_route[1]:
if (status=="200") { if (search("^Contact:.*;maddr=")) { # find the host name and replace it withj the maddr tag if
(!subst("/^Contact:(.*)sip:([^@]+)@([a-zA-Z0-9.]+)(.*);maddr=([0-9.]+)(.*)/Contact:\1sip:\2@\5\4;maddr=\5\6/i")) { xlog("L_NOTICE", "onreply_route[1]: ERROR rewriting maddr contact $hdr(contact[0])\n"); } else { xlog("L_NOTICE", "onreply_route[1]: Rewrote maddr contact $hdr(contact[0])\n"); } } }
the calls proceed and terminate correctly in both directions.
The question then arises should OpenSER handle maddr URL tags in the RURI
PS. Does anyone know what the proxy=replace header tag means?
# T XXX.XXX.152.78:1399 -> XXX.XXX.2.40:5060 [AP] INVITE sip:userwm5@domain.net SIP/2.0. Via: SIP/2.0/TCP XXX.XXX.152.78:5060;branch=z9hG4bK-d87543-9808374cf435475c-1--d87543-;rport. Max-Forwards: 70. Contact: sip:usereb@XXX.XXX.152.78:5060;transport=TCP. To: sip:userwm5@domain.net. From: "usereb"sip:usereb@domain.net;tag=d37fe766. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 1 INVITE. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO. Content-Type: application/sdp. Supported: eventlist. User-Agent: CounterPath eyeBeam release 3013o stamp 23916. Content-Length: 619. . v=0. o=- 5401759 5401834 IN IP4 XXX.XXX.152.78. s=CounterPath eyeBeam. c=IN IP4 XXX.XXX.152.78. t=0 0. m=audio 8972 RTP/AVP 8 0 100 6 3 18 98 97 5 102 101. a=alt:1 1 : 09A01121 0000002D XXX.XXX.152.78 8972. a=fmtp:101 0-15. a=rtpmap:100 speex/16000. a=rtpmap:98 ilbc/8000. a=rtpmap:97 speex/8000. a=rtpmap:102 l16/16000. a=rtpmap:101 telephone-event/8000. a=sendrecv. m=video 8974 RTP/AVP 103 105 34 120. a=alt:1 1 : F4D11C0A 000000FA XXX.XXX.152.78 8974. a=fmtp:105 profile=3;level=20. a=fmtp:34 CIF=2 QCIF=2 MAXBR=5120. a=rtpmap:103 h263-1998/90000. a=rtpmap:105 h263-2000/90000. a=rtpmap:120 h263/90000. a=sendrecv.
# T XXX.XXX.2.40:5060 -> XXX.XXX.152.78:1399 [AP] SIP/2.0 407 Proxy Authentication Required. Via: SIP/2.0/TCP XXX.XXX.152.78:5060;branch=z9hG4bK-d87543-9808374cf435475c-1--d87543-;rport=1399. To: sip:userwm5@domain.net;tag=88cbe004b15faf54e2a8ed57b9c4eaaa.ce87. From: "usereb"sip:usereb@domain.net;tag=d37fe766. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 1 INVITE. Proxy-Authenticate: Digest realm="domain.net", nonce="440b877a9197230dccf837b9adb629fd8ebf8115". Server: OpenSer (1.0.1-tls (i386/linux)). Content-Length: 0. Warning: 392 XXX.XXX.2.40:5060 "Noisy feedback tells: pid=4962 req_src_ip=XXX.XXX.152.78 req_src_port=1399 in_uri=sip:userwm5@domain.net out_uri=sip:userwm5@domain.net via_cnt==1". .
# T XXX.XXX.152.78:1399 -> XXX.XXX.2.40:5060 [AP] ACK sip:userwm5@domain.net SIP/2.0. Via: SIP/2.0/TCP XXX.XXX.152.78:5060;branch=z9hG4bK-d87543-9808374cf435475c-1--d87543-;rport. To: sip:userwm5@domain.net;tag=88cbe004b15faf54e2a8ed57b9c4eaaa.ce87. From: "usereb"sip:usereb@domain.net;tag=d37fe766. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 1 ACK. Content-Length: 0. .
# T XXX.XXX.152.78:1399 -> XXX.XXX.2.40:5060 [A] INVITE sip:userwm5@domain.net SIP/2.0. Via: SIP/2.0/TCP XXX.XXX.152.78:5060;branch=z9hG4bK-d87543-dd728d06512ec00b-1--d87543-;rport. Max-Forwards: 70. Contact: sip:usereb@XXX.XXX.152.78:5060;transport=TCP. To: sip:userwm5@domain.net. From: "usereb"sip:usereb@domain.net;tag=d37fe766. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 2 INVITE. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO. Content-Type: application/sdp. Proxy-Authorization: Digest username="usereb",realm="domain.net",nonce="440b877a9197230dccf837b9adb629fd8ebf8115",uri="sip:userwm5@domain.net",response="4b8c1425b2edd0c05302ec708a793316",algorithm=MD5. Supported: eventlist. User-Agent: CounterPath eyeBeam release 3013o stamp 23916. Content-Length: 619. . v=0. o=- 5401759 5401834 IN IP4 XXX.XXX.152.78. s=CounterPath eyeBeam. c=IN IP4 XXX.XXX.152.78. t=0 0. m=audio 8972 RTP/AVP 8 0 100 6 3 18 98 97 5 102 101. a=alt:1 1 : 09A01121 0000002D XXX.XXX.152.78 8972. a=fmtp:101 0-15. a=rtpmap:100 speex/16000. a=rtpmap:98 ilbc/8000. a=rtpmap:97 speex/8000. a=rtpmap:102 l16/16000. a=rtpmap:101 telephone-event/8000. a=sendrecv. m=video 8974 RTP/AVP 103 105 34 120. a=alt:1 1 : F4D11C0A 000000FA XXX.XXX.152.78 8974. a=fmt # T XXX.XXX.152.78:1399 -> XXX.XXX.2.40:5060 [AP] p:105 profile=3;level=20. a=fmtp:34 CIF=2 QCIF=2 MAXBR=5120. a=rtpmap:103 h263-1998/90000. a=rtpmap:105 h263-2000/90000. a=rtpmap:120 h263/90000. a=sendrecv.
# T XXX.XXX.2.40:5060 -> XXX.XXX.152.78:1399 [AP] SIP/2.0 100 trying -- your call is important to us. Via: SIP/2.0/TCP XXX.XXX.152.78:5060;branch=z9hG4bK-d87543-dd728d06512ec00b-1--d87543-;rport=1399. To: sip:userwm5@domain.net. From: "usereb"sip:usereb@domain.net;tag=d37fe766. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 2 INVITE. Server: OpenSer (1.0.1-tls (i386/linux)). Content-Length: 0. Warning: 392 XXX.XXX.2.40:5060 "Noisy feedback tells: pid=4962 req_src_ip=XXX.XXX.152.78 req_src_port=1399 in_uri=sip:userwm5@domain.net out_uri=sip:YYY.YYY.152.57:5060;transport=tcp via_cnt==1". .
# T XXX.XXX.2.40:42734 -> YYY.YYY.152.57:5060 [AP] INVITE sip:YYY.YYY.152.57:5060;transport=tcp SIP/2.0. Record-Route: sip:XXX.XXX.2.40;transport=tcp;ftag=d37fe766;lr=on;mproxy=yes;invite=tcp. Via: SIP/2.0/TCP XXX.XXX.2.40;branch=z9hG4bK95f.22e73805.0;i=535. Via: SIP/2.0/TCP XXX.XXX.152.78:5060;branch=z9hG4bK-d87543-dd728d06512ec00b-1--d87543-;rport=1399. Max-Forwards: 69. Contact: sip:usereb@XXX.XXX.152.78:5060;transport=TCP. To: sip:userwm5@domain.net. From: "usereb"sip:usereb@domain.net;tag=d37fe766. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 2 INVITE. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO. Content-Type: application/sdp. Supported: eventlist. User-Agent: CounterPath eyeBeam release 3013o stamp 23916. Content-Length: 619. . v=0. o=- 5401759 5401834 IN IP4 XXX.XXX.152.78. s=CounterPath eyeBeam. c=IN IP4 XXX.XXX.2.40. t=0 0. m=audio 35796 RTP/AVP 8 0 100 6 3 18 98 97 5 102 101. a=alt:1 1 : 09A01121 0000002D XXX.XXX.152.78 8972. a=fmtp:101 0-15. a=rtpmap:100 speex/16000. a=rtpmap:98 ilbc/8000. a=rtpmap:97 speex/8000. a=rtpmap:102 l16/16000. a=rtpmap:101 telephone-event/8000. a=sendrecv. m=video 35798 RTP/AVP 103 105 34 120. a=alt:1 1 : F4D11C0A 000000FA XXX.XXX.152.78 8974. a=fmtp:105 profile=3;level=20. a=fmtp:34 CIF=2 QCIF=2 MAXBR=5120. a=rtpmap:103 h263-1998/90000. a=rtpmap:105 h263-2000/90000. a=rtpmap:120 h263/90000. a=sendrecv.
# T YYY.YYY.152.57:5060 -> XXX.XXX.2.40:42734 [AP] SIP/2.0 100 Trying. Via: SIP/2.0/TCP XXX.XXX.2.40;branch=z9hG4bK95f.22e73805.0;i=535. Via: SIP/2.0/TCP XXX.XXX.152.78:5060;branch=z9hG4bK-d87543-dd728d06512ec00b-1--d87543-;rport=1399. From: "usereb"sip:usereb@domain.net;tag=d37fe766. To: sip:userwm5@domain.net;tag=0e106f3ac62449d0bc454368719020a8. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 2 INVITE. User-Agent: RTC/1.3. Content-Length: 0. .
# T YYY.YYY.152.57:5060 -> XXX.XXX.2.40:42734 [AP] SIP/2.0 180 Ringing. Via: SIP/2.0/TCP XXX.XXX.2.40;branch=z9hG4bK95f.22e73805.0;i=535. Via: SIP/2.0/TCP XXX.XXX.152.78:5060;branch=z9hG4bK-d87543-dd728d06512ec00b-1--d87543-;rport=1399. From: "usereb"sip:usereb@domain.net;tag=d37fe766. To: sip:userwm5@domain.net;tag=0e106f3ac62449d0bc454368719020a8. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 2 INVITE. Record-Route: sip:XXX.XXX.2.40;transport=tcp;ftag=d37fe766;lr=on;mproxy=yes;invite=tcp. User-Agent: RTC/1.3. Content-Length: 0. .
# T XXX.XXX.2.40:5060 -> XXX.XXX.152.78:1399 [AP] SIP/2.0 180 Ringing. Via: SIP/2.0/TCP XXX.XXX.152.78:5060;branch=z9hG4bK-d87543-dd728d06512ec00b-1--d87543-;rport=1399. From: "usereb"sip:usereb@domain.net;tag=d37fe766. To: sip:userwm5@domain.net;tag=0e106f3ac62449d0bc454368719020a8. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 2 INVITE. Record-Route: sip:XXX.XXX.2.40;transport=tcp;ftag=d37fe766;lr=on;mproxy=yes;invite=tcp. User-Agent: RTC/1.3. Content-Length: 0. .
# U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# T YYY.YYY.152.57:5060 -> XXX.XXX.2.40:42734 [AP] SIP/2.0 200 OK. Via: SIP/2.0/TCP XXX.XXX.2.40;branch=z9hG4bK95f.22e73805.0;i=535. Via: SIP/2.0/TCP XXX.XXX.152.78:5060;branch=z9hG4bK-d87543-dd728d06512ec00b-1--d87543-;rport=1399. From: "usereb"sip:usereb@domain.net;tag=d37fe766. To: sip:userwm5@domain.net;tag=0e106f3ac62449d0bc454368719020a8. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 2 INVITE. Record-Route: sip:XXX.XXX.2.40;transport=tcp;ftag=d37fe766;lr=on;mproxy=yes;invite=tcp. Contact: sip:userwm5@domain.net:5060;maddr=YYY.YYY.152.57;transport=tcp;proxy=replace. User-Agent: RTC/1.3. Content-Type: application/sdp. Content-Length: 390. . v=0. o=- 0 0 IN IP4 YYY.YYY.152.57. s=CounterPath eyeBeam. c=IN IP4 YYY.YYY.152.57. b=CT:1000. t=0 0. m=audio 5350 RTP/AVP 8 0 6 3 5 101. a=rtpmap:8 PCMA/8000. a=rtpmap:0 PCMU/8000. a=rtpmap:6 DVI4/16000. a=rtpmap:3 GSM/8000. a=rtpmap:5 DVI4/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. m=video 5352 RTP/AVP 34 120. a=recvonly. a=rtpmap:34 H263/90000. a=rtpmap:120 h263/90000.
# T XXX.XXX.2.40:5060 -> XXX.XXX.152.78:1399 [AP] SIP/2.0 200 OK. Via: SIP/2.0/TCP XXX.XXX.152.78:5060;branch=z9hG4bK-d87543-dd728d06512ec00b-1--d87543-;rport=1399. From: "usereb"sip:usereb@domain.net;tag=d37fe766. To: sip:userwm5@domain.net;tag=0e106f3ac62449d0bc454368719020a8. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 2 INVITE. Record-Route: sip:XXX.XXX.2.40;transport=tcp;ftag=d37fe766;lr=on;mproxy=yes;invite=tcp. Contact: sip:userwm5@domain.net:5060;maddr=YYY.YYY.152.57;transport=tcp;proxy=replace. User-Agent: RTC/1.3. Content-Type: application/sdp. Content-Length: 390. . v=0. o=- 0 0 IN IP4 YYY.YYY.152.57. s=CounterPath eyeBeam. c=IN IP4 XXX.XXX.2.40. b=CT:1000. t=0 0. m=audio 35796 RTP/AVP 8 0 6 3 5 101. a=rtpmap:8 PCMA/8000. a=rtpmap:0 PCMU/8000. a=rtpmap:6 DVI4/16000. a=rtpmap:3 GSM/8000. a=rtpmap:5 DVI4/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. m=video 35798 RTP/AVP 34 120. a=recvonly. a=rtpmap:34 H263/90000. a=rtpmap:120 h263/90000.
# T XXX.XXX.152.78:1399 -> XXX.XXX.2.40:5060 [AP] ACK sip:userwm5@domain.net:5060;maddr=YYY.YYY.152.57;transport=tcp SIP/2.0. Via: SIP/2.0/TCP XXX.XXX.152.78:5060;branch=z9hG4bK-d87543-e063223a7b420f71-1--d87543-;rport. Max-Forwards: 70. Route: sip:XXX.XXX.2.40;transport=tcp;lr;ftag=d37fe766;mproxy=yes;invite=tcp. Contact: sip:usereb@XXX.XXX.152.78:5060;transport=TCP. To: sip:userwm5@domain.net;tag=0e106f3ac62449d0bc454368719020a8. From: "usereb"sip:usereb@domain.net;tag=d37fe766. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 2 ACK. Proxy-Authorization: Digest username="usereb",realm="domain.net",nonce="440b877a9197230dccf837b9adb629fd8ebf8115",uri="sip:userwm5@domain.net",response="4b8c1425b2edd0c05302ec708a793316",algorithm=MD5. User-Agent: CounterPath eyeBeam release 3013o stamp 23916. Content-Length: 0. .
# T XXX.XXX.2.40:42736 -> XXX.XXX.2.40:5060 [AP] ACK sip:XXX.XXX.2.40;transport=tcp;lr;ftag=d37fe766;mproxy=yes;invite=tcp SIP/2.0. Record-Route: sip:XXX.XXX.2.40;transport=tcp;ftag=d37fe766;lr=on. Via: SIP/2.0/TCP XXX.XXX.2.40;branch=0;i=535. Via: SIP/2.0/TCP XXX.XXX.152.78:5060;branch=z9hG4bK-d87543-e063223a7b420f71-1--d87543-;rport=1399. Max-Forwards: 69. Contact: sip:usereb@XXX.XXX.152.78:5060;transport=TCP. To: sip:userwm5@domain.net;tag=0e106f3ac62449d0bc454368719020a8. From: "usereb"sip:usereb@domain.net;tag=d37fe766. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 2 ACK. Proxy-Authorization: Digest username="usereb",realm="domain.net",nonce="440b877a9197230dccf837b9adb629fd8ebf8115",uri="sip:userwm5@domain.net",response="4b8c1425b2edd0c05302ec708a793316",algorithm=MD5. User-Agent: CounterPath eyeBeam release 3013o stamp 23916. Content-Length: 0. .
# U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# U XXX.XXX.2.40:5060 -> XXX.XXX.153.42:8664 .... # U XXX.XXX.2.40:5060 -> 138.217.188.239:19110 .... # U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# T YYY.YYY.152.57:2544 -> XXX.XXX.2.40:5060 [AP] BYE sip:XXX.XXX.2.40;transport=tcp;ftag=d37fe766;lr=on;mproxy=yes;invite=tcp SIP/2.0. Via: SIP/2.0/TCP YYY.YYY.152.57:5060. Max-Forwards: 70. From: sip:userwm5@domain.net;tag=0e106f3ac62449d0bc454368719020a8. To: "usereb"sip:usereb@domain.net;tag=d37fe766. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 1 BYE. Route: sip:usereb@XXX.XXX.152.78:5060;transport=TCP. User-Agent: RTC/1.3. Content-Length: 0. .
# T XXX.XXX.2.40:42737 -> XXX.XXX.152.78:5060 [AP] BYE sip:usereb@XXX.XXX.152.78:5060;transport=TCP SIP/2.0. Record-Route: sip:XXX.XXX.2.40;transport=tcp;ftag=0e106f3ac62449d0bc454368719020a8;lr=on. Via: SIP/2.0/TCP XXX.XXX.2.40;branch=z9hG4bKc5f.77604c67.0;i=435. Via: SIP/2.0/TCP YYY.YYY.152.57:5060. Max-Forwards: 69. From: sip:userwm5@domain.net;tag=0e106f3ac62449d0bc454368719020a8. To: "usereb"sip:usereb@domain.net;tag=d37fe766. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 1 BYE. User-Agent: RTC/1.3. Content-Length: 0. .
# T XXX.XXX.152.78:1400 -> XXX.XXX.2.40:5060 [AP] SIP/2.0 200 OK. Via: SIP/2.0/TCP XXX.XXX.2.40;branch=z9hG4bKc5f.77604c67.0;i=435. Via: SIP/2.0/TCP YYY.YYY.152.57:5060. Record-Route: sip:XXX.XXX.2.40;transport=tcp;lr;ftag=0e106f3ac62449d0bc454368719020a8. Contact: sip:usereb@XXX.XXX.152.78:5060;transport=TCP. To: "usereb"sip:usereb@domain.net;tag=d37fe766. From: sip:userwm5@domain.net;tag=0e106f3ac62449d0bc454368719020a8. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 1 BYE. User-Agent: CounterPath eyeBeam release 3013o stamp 23916. Content-Length: 0. .
# T XXX.XXX.2.40:5060 -> YYY.YYY.152.57:2544 [AP] SIP/2.0 200 OK. Via: SIP/2.0/TCP YYY.YYY.152.57:5060. Record-Route: sip:XXX.XXX.2.40;transport=tcp;lr;ftag=0e106f3ac62449d0bc454368719020a8. Contact: sip:usereb@XXX.XXX.152.78:5060;transport=TCP. To: "usereb"sip:usereb@domain.net;tag=d37fe766. From: sip:userwm5@domain.net;tag=0e106f3ac62449d0bc454368719020a8. Call-ID: 6f309543f11f7056@c3RnLWRlbGw.. CSeq: 1 BYE. User-Agent: CounterPath eyeBeam release 3013o stamp 23916. Content-Length: 0. .
# U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
# U XXX.XXX.2.40:5060 -> XXX.XXX.153.42:8664 .... # U XXX.XXX.2.40:5060 -> 138.217.188.239:19110 .... # U XXX.XXX.153.42:8664 -> XXX.XXX.2.40:5060 .
exit
Devel mailing list Devel@openser.org http://openser.org/cgi-bin/mailman/listinfo/devel