?
Solved

500:Make RTP Packet

Posted on 2006-11-24
7
Medium Priority
?
451 Views
Last Modified: 2008-07-06
Hi all,

I have visited an excellent sight explaining how to construct your own ICMP protocol ‘echo’ request using PHP.  The function used for implementing your own protocol in PHP is ‘socket_create()’.
See:   http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1786&lngWId=8

I know that the UDP protocol socket function is already created in PHP but I want to send RTP data packets. So can I have an example on how this could be done using PHP.  Take note that UDP is a transport protocol and that RTP is (in more cases than not) considered as an application protocol which sits on top of UDP (or TCP but I want UDP).

Do I need to create my own protocol set i.e. UDP and RTP on top??
Or can I use the UDP sockets already available and send some extra initiall headers to represent RTP? Will that work or will the UDP sockets only pack and unpack the packets as UDP packets only, thus ignoring RTP header and treating them as part of the UDP packet itself…….

Please advise on how to go about achieving this or give example code if they exist and available……

Many thanks
0
Comment
Question by:smotbd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 48

Expert Comment

by:hernst42
ID: 18007898
As RTP is on top of you UDP you can set and get all information as raw-data from RTP, but you will nned to implement the wholde RTP-protocol in PHP like the listed PING. AFAIk there is no php-class/extension where you just can use RTP
0
 

Author Comment

by:smotbd
ID: 18008097
Yes but do I need to implement the UDP aswell?... I.e. implement UDP and RTP protocol.
0
 
LVL 48

Expert Comment

by:hernst42
ID: 18017870
No as RTP is on top of udp and if you are using udp-sockets the underlying laying is taking care of the udp-headers
0
 

Author Comment

by:smotbd
ID: 18018152
So, if I understand you correctly then- I can use the UDP socket php-class/extension and then simply pack all data packets with an RTP header i.e. just send the RTP header before any packets.

Is this correct? How does the UDP socket understand that it is RTP headers and not just UDP data?

Thanks again
0
 
LVL 48

Accepted Solution

by:
hernst42 earned 2000 total points
ID: 18018569
RTP is run on top of UDP so UDP does not need to care about the RTP-headers. Those are evaluated by yor application/RTP library
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question