Thank you for that Greger. I have altered my script so that it exactly mimics the one in
the onsip document besides the has_totag and fix_nated register. All is good when I ring
from a private phone to a public phone i.e. the audio is very clear and the following
messages are in /var/log.
ERROR: extract_body: message body has length zero
ERROR: force_rtp_proxy2: cant extract body from the message.
I assume this is because of the 200 OK to a register message where theres no sdp?? Is this
correct?
However when I try to phone from public into private I get:
ERROR: send_rtpp_command: cant read reply from a RTP Proxy.
I find this confusing because I know the rtpproxy is working.
BR
Vivienne.
"Greger V. Teigre" <greger(a)teigre.com> wrote:
Yes, you can use fix_nated_contact instead. It is not entirely RFC-compliant, but
that's what you have in 0.8.14.
The has_totag() only tests to see if the INVITE has a To header, which means that it is
in-dialog and thus is a re-INVITE. An INVITE will normally not have loose routing unless
you have another SIP proxy forwarding an INVITE to you (in which case you should assume
that the other proxy handles NAT and thus not trigger NAT-related code). You can safely
remove the has_totag() if you use force_rtp_proxy("l")
g-)
---- Original Message ----
From: Vivienne Curran
To: Greger V. Teigre ; serusers(a)lists.iptel.org
Sent: Tuesday, April 05, 2005 02:25 PM
Subject: Re: [Serusers] Contact Header and SDP not rewritten
Greger,
Since fix_nated_register does not exist with 0.8.14, will
fix_nated_contact do instead? Also if I am leaving out the
has_totag() at the start of the script, will this greatly effect its
functionality?
Thank you,
Vivienne
"Greger V. Teigre" <greger(a)teigre.com> wrote:
Vivienne,
This is the first INVITE going from SER to your public phone. I have
prefixed my comments with *==>
U 84.203.148.146:5060 -> 157.190.74.151:5060
INVITE sip:2092@157.190.74.151 SIP/2.0..Via: SIP/2.0/UDP
84.203.148.146;branch=z9hG4bK77bc.b54ca216.0..
Via: SIP/2.0/UDP
172.16.3.31;rport=5060;received=84.203.148.14;branch=z9hG4bK1a48edc121f5bc1f..
From: "2093" <sip:2093@84.203.148.146>;tag=2dc376dcd4655094..
To: <sip:2092@84.203.148.146>..
Contact: <sip:2093@84.203.148.14:5060>..
*==> Correctly changed to the public address and port of 2093
Supported: replaces..Call-ID: 44e1ae63c476fbff@172.16.3.31..CSeq:
10327 INVITE..
User-Agent: Grandstream BT100 1.0.5.18..
Max-Forwards: 69..Allow:
INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE..
Content-Type: application/sdp..
Content-Length: 443....v=0..
o=2093 8000 0 IN IP4 172.16.3.31..
s=SIP Call..
c=IN IP4 84.203.148.1484.203.148.146..
*==> Here it seems that first fix_nated_sdp("3") is called (replace
private IP with public IP), then force_rtp_proxy() (replace with
proxy IP). You must only call one of them (fix_nated_sdp("1") is ok)
t=0 0..
m=audio 35006 RTP/AVP 0 8 4 18 2 15 99 9..
a=sendrecv..
a=rtpmap:0 PCMU/8000/3..
a=rtpmap:8 PCMA/8000/3..
a=rtpmap:4 G723/8000/3..a=rtpmap:18 G729/8000/3..
a=rtpmap:2 G726-32/8000/3..
a=rtpmap:15 G728/8000/3..
a=rtpmap:99 iLBC/8000/3..
a=fmtp:99 mode=20..
a=rtpmap:9 G722/8000/3..
a=ptime:20..
a=direction:active..
*==> Added by fix_nated_sdp("1") (and "3")
a=oldmediaip:172.16.3.31..
*==> Added by fix_nated_sdp("3")
a=nortpproxy:yes..
*==> Added by force_rtp_proxy()
So, your call is proxied. Try using fix_nated_sdp("1"). It should
make the INVITE correct. You have not posted the OK, so I don't know
what is happening there. If you have followed the rtpproxy
ONsip.org
example in your onreply_route, you should be fine.
Good luck!
g-)
---- Original Message ----
From: Vivienne Curran
To: serusers(a)lists.iptel.org
Sent: Tuesday, April 05, 2005 01:23 PM
Subject: [Serusers] Contact Header and SDP not rewritten
> Hello,
>
> I have a problem whereby when a private client rings a public client
> only the public user can hear voice and when the public user rings
> the private user, no audio is transmitted. After looking at the
> messages I have have determined that the contact header and sdp part
> of the invite contains the private address of the natted client. This
> would lead me to believe that the registration process is incorrect.
> My problem is that I believe my script should handle the registration
> process correctly and I suspect that the following code is being
> skipped: I tried changing it to nat_uac_test("19") and
> fix_nated_sdp("3") but that didnt help.
>> if (nat_uac_test("3")){
> if (method == "REGISTER" || ! search("^Record-Route:")){
> log("Log: Someone trying to register from private
> IP,rewriting\n"); fix_nated_contact(); #Rewrite contact with
> source IP if (method == "INVITE"){
> fix_nated_sdp("1"); #Add direction=active to SDP
> force_rtp_proxy();
> };
> force_rport(); # Add rport parameter to topmost Via
> setflag(6); # Mark as Nated
> };
> };
>
> I have included the log message below and my ser.cfg as an
> attachment. Please let me know where I could be going wrong.
>
> Thank you,
> Vivienne.