kdaits.blogg.se

Asterisk dtmf
Asterisk dtmf












It's important to note that for the duration of the event it's the only thing being sent. The SendRtp method shown below is what takes the events off the queue and hands them over to the RTPSession for transmitting. _dtmfEvents.Enqueue(new RTPEvent(0x02, false, RTPEvent.DEFAULT_VOLUME, 1200, DTMF_EVENT_PAYLOAD_ID)) _dtmfEvents.Enqueue(new RTPEvent(0x09, false, RTPEvent.DEFAULT_VOLUME, 1200, DTMF_EVENT_PAYLOAD_ID)) _dtmfEvents.Enqueue(new RTPEvent(0x05, false, RTPEvent.DEFAULT_VOLUME, 1200, DTMF_EVENT_PAYLOAD_ID))

asterisk dtmf

These will be transmitted by the SendRtp thread. The duration is not critical but is useful to allow multiple RTP event packets to be generated and minimise the likelihood of the event being lost on an unreliable transport such as UDP. The fourth parameter is the duration of the tone. The first byte in the RTPEvent constructor is the DTMF tone to send. The code that adds the DTMF events to the queue is shown below. The mechanism used to send the DTMF tones is to add them to a queue which is monitored by the thread generating the RTP stream.

asterisk dtmf asterisk dtmf

The difference is that the RTP stream from is now hard coded to send silence with 3 DTMF tones interspersed. The send DTMF example is based on the UserAgentClient example. The SendDtmf contains an example of how to send DTMF tones using RTP events as specified in RFC2833.














Asterisk dtmf