Giter VIP home page Giter VIP logo

Comments (10)

RogerHardiman avatar RogerHardiman commented on May 25, 2024

The RTSP standard is for video. It does not have fields for Event ID, EndOfEvent, EventDuration etc.

Can you tell us more about what you are trying to do please and the server you are trying to connect to.

from sharprtsp.

 avatar commented on May 25, 2024

actually i will be working for RTSP shortly, as of now trying to detect the DTMF in RTP packet and i saw the dissection in "private void Rtsp_client_DataReceived", we can add functionality to get the Event ID, EndOfEvent, EventDuration etc.... like this might be ...

                  // the DTMF key pressed or released. 
                   DTMF_Event = DtmfPayload >> 24; 

                  // the "end" bit. 
                   DTMF_E = (DtmfPayload >> 23) & 0x01; 

                  // reserved bit - not used. 
                   DTMF_R = (DtmfPayload >> 22) & 0x01; 

                  // the DTMF power level (volume). 
                   DTMF_Volume = (DtmfPayload >> 16) & 0x3f; 

                  // tone duration. 
                   DTMF_Duration = DtmfPayload & 0xffff; 

from sharprtsp.

RogerHardiman avatar RogerHardiman commented on May 25, 2024

The 'payload start' tells you where in the RTP packet the DtmfPayload is located.
That should be where the RFC 4733 DTMF data is located and then you can use the shifting and AND functions.

from sharprtsp.

 avatar commented on May 25, 2024

can you tell me what codes need to be added after this to get the ` int rtp_version = (e.Message.Data[0] >> 6);
int rtp_padding = (e.Message.Data[0] >> 5) & 0x01;
int rtp_extension = (e.Message.Data[0] >> 4) & 0x01;
int rtp_csrc_count = (e.Message.Data[0] >> 0) & 0x0F;
int rtp_marker = (e.Message.Data[1] >> 7) & 0x01;
int rtp_payload_type = (e.Message.Data[1] >> 0) & 0x7F;
uint rtp_sequence_number = ((uint)e.Message.Data[2] << 8) + (uint)(e.Message.Data[3]);
uint rtp_timestamp = ((uint)e.Message.Data[4] <<24) + (uint)(e.Message.Data[5] << 16) + (uint)(e.Message.Data[6] << 8) + (uint)(e.Message.Data[7]);
uint rtp_ssrc = ((uint)e.Message.Data[8] << 24) + (uint)(e.Message.Data[9] << 16) + (uint)(e.Message.Data[10] << 8) + (uint)(e.Message.Data[11]);

      int rtp_payload_start = 4 // V,P,M,SEQ
                          + 4 // time stamp
                          + 4 // ssrc
                          + (4 * rtp_csrc_count); // zero or more csrcs

      uint rtp_extension_id = 0;
      uint rtp_extension_size = 0;
      if (rtp_extension == 1)
      {
          rtp_extension_id = ((uint)e.Message.Data[rtp_payload_start + 0] << 8) + (uint)(e.Message.Data[rtp_payload_start + 1] << 0);
          rtp_extension_size = ((uint)e.Message.Data[rtp_payload_start + 2] << 8) + (uint)(e.Message.Data[rtp_payload_start + 3] << 0);
          rtp_payload_start += 4 + (int)rtp_extension_size;  // extension header and extension payload
      }`

DTMF event and end of event etc

from sharprtsp.

RogerHardiman avatar RogerHardiman commented on May 25, 2024

So
uint DtmfPayload = e.Message.Data[rtp_payload_start];

Then you will use the bitwise operations eg >> and & from your code.

from sharprtsp.

 avatar commented on May 25, 2024

Hey i was not able to get the DTMF event using my code, if you know, how to get it using the bitwise operation, can you provide me the code.

// the payload data is 4 bytes as per RFC 2833 (see section 3.5)
//
// 0 1 2 3
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// | event |E|R| volume | duration |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//
// Figure 1: Payload Format for Named Events
//

from sharprtsp.

RogerHardiman avatar RogerHardiman commented on May 25, 2024

None of us have written code to process RTP packets containing DTMF data.
So we cannot help.

Could you post a dump of the RTP Packet in Hex and the code do carry out the bitwise operations and I can see if I can spot something.

from sharprtsp.

 avatar commented on May 25, 2024

can you share your mail id? or mail me on [email protected]
I hope that works

from sharprtsp.

RogerHardiman avatar RogerHardiman commented on May 25, 2024

Actually the easiest place is to post it here on github. You can attach files to the post too.

from sharprtsp.

RogerHardiman avatar RogerHardiman commented on May 25, 2024

thread has gone dormant so closing

from sharprtsp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.