Solved

500:Make RTP Packet

Posted on 2006-11-24
7
437 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
  • 3
  • 2
7 Comments
 
LVL 48

Expert Comment

by:hernst42
Comment Utility
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
Comment Utility
Yes but do I need to implement the UDP aswell?... I.e. implement UDP and RTP protocol.
0
 
LVL 48

Expert Comment

by:hernst42
Comment Utility
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
Comment Utility
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 500 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now