This is very strange. normally RTP is symmetric. >>that is here I am mentioning that I am available on the port = *22456 , >>*for receiving RTP packets.
So 22456 should be the source port of RTP that you send. It should also be the destination port of RTP that you receive. >>On the other hand from the *200 OK SDP* which I get from the *SIP >>Server* I am parsing the audio port number = *18564 *which I use to send >>the audio RTP packets from the Client side. Good. So you use 18564 as the destination port of RTP that you send. And you would expect 18564 as the source port of RTP that you receive. Sorry if I am repeating myself - looking at your e-mail it seems you know what I have just said but I just want to be clear. What I don't understand is what inspired you to try to use 5060 as the RTP source port? What happens if you try to use a different RTP source port like 10000? All I can think of is that the the local port is not initialised or open. 5060 might be "working" because that port is already "open" or something. Is there something you have forgotten to do? Regards Attila ________________________________ From: Siga [mailto:[email protected]] Sent: 07 March 2011 17:59 To: Attila Sipos Cc: [email protected] Subject: Re: [Sip-implementors] Ports for sending and receiving RTP packets! Hi Attila, thanks for your reply. I am sure that I know this is how it should work but when I try to use the local RTP port (22456), I could not send anything to the server. On the other hand when I change the local RTP port number to 5060, I can see the RTP packets on my network sniffer like this 1.2.3.4 ---> 3.4.5.6 RTP PT=ITU-T G.711 PCMA, SSRC=0xDF53, Seq = 45, Time=12960 (Client to Server) 1.2.3.4 ---> 3.4.5.6 RTP PT=ITU-T G.711 PCMA, SSRC=0xDF53, Seq = 46, Time=13120. 3.4.5.6 ---> 1.2.3.4 RTP PT=ITU-T G.711 PCMA, SSRC=0xF231, Seq = 3457, Time=160(Server to Client) 1.2.3.4 ---> 3.4.5.6 RTP PT=ITU-T G.711 PCMA, SSRC=0xDF53, Seq = 47, Time=13280. 3.4.5.6 ---> 1.2.3.4 RTP PT=ITU-T G.711 PCMA, SSRC=0xF231, Seq = 3458, Time=320 and so on.... that is what I dont understand, how this is happening. So in general am I making some weird mistake. Regards On Mon, Mar 7, 2011 at 6:47 PM, Attila Sipos <[email protected]> wrote: >> is this normal to send RTP packets from the local port = *5060(SIP PORT)* >> with remote port = *18564 *and receive RTP packets from SIP Server on local >> port = *22456 * with remote port = *18564. You are confusing 2 separate things: 1. there is a SIP signalling port 5060 - this is used only to receive SIP messages 2. there is a RTP port 22456 Your RTP packets should use the local RTP port (22456) as the RTP port. 1. SIP and RTP are separate 2. SIP and RTP use separate ports 3. do not mix SIP and RTP ports - in your example you used the SIP port as the local RTP port - this will not work! I hope this helps Regards Attila -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Siga Sent: 07 March 2011 17:32 To: [email protected] Subject: [Sip-implementors] Ports for sending and receiving RTP packets! Hi, I am facing rather a strange problem with the ports for sending and receiving RTP packets. This is the second time I am posting my question. Initially I am able to set up a SIP Client successfully SIP CLIENT SIP SERVER (1.2.3.4) (3.4.5.6) INVITE: 1.2.3.4:5060 --------------------------------------------> 100 Trying: 3.4.5.6 <--------------------------------------------- 200 OK: 3.4.5.6 <-------------------------------------------- ACK: 1.2.3.4:5060 --------------------------------------------> RTP Packets --------------------------------------------> Here comes the problem: my SIP Client INVITE looks like this "INVITE sip:[email protected]/2.0\r\n" "Via:SIP/2.0/UDP 192.168.x.000:5060;branch=z9hG4bKdg18\r\n" "Max-Forwards: 70\r\n" "To: server <sip:[email protected]>\r\n" "From: User<sip:[email protected]>; tag = 76341\r\n" "Call-ID: [email protected]@192.168.x.x\r\n" "CSeq: 1 INVITE\r\n" "Contact: <sip:[email protected]>\r\n" "Content-Type: application/sdp\r\n" "Content-Length:142\r\n"; "\r\n" "v=0\r\n" "o=User 53655765 2353687637 IN IP4 192.168.x.000\r\n" "s=-\r\n" "c=IN IP4 192.168.x.000\r\n" "t=0 0\r\n" "*m=audio 22456 *RTP/AVP 0 8\r\n" "m=video 51372 RTP/AVP 98 49\r\n" "a=rtpmap:0 PCMA/8000\r\n" "a=rtpmap:98 H263-1999/90000\r\n"; that is here I am mentioning that I am available on the port = *22456 , *for receiving RTP packets. On the other hand from the *200 OK SDP* which I get from the *SIP Server* I am parsing the audio port number = *18564 *which I use to send the audio RTP packets from the Client side. Until here everything is fine, but when I try to bind my client to the local address(1.2.3.4) and port number, there are two scenarios 1. If I bind my client to the local port = *22456, *this is how I am doing* **Local.sin_port = 22456**; *When I have done like this* *I cant send anything to the SIP Server, after time out SIP Server sends BYE to the SIP Client. 2. If I bind my client to the local port = *5060 (SIP PORT), **Local.sin_port = 5060**; *When I have done like this* *I can send RTP packets to the SIP Server and there is a constant flow of packets which I can capture and view using Wireshark. For both the above cases, I am declaring the remote port for the Server in this manner* remote.sin_port = **18564 * is this normal to send RTP packets from the local port = *5060(SIP PORT)* with remote port = *18564 *and receive RTP packets from SIP Server on local port = *22456 * with remote port = *18564. *I am really confused here*. *If I am doing something wrong then please correct me*. *If you need any further information then please let me know. Regards* * _______________________________________________ Sip-implementors mailing list [email protected] https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors _______________________________________________ Sip-implementors mailing list [email protected] https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors
