| 447 | |
| 448 | === How Can I Detect Inband Tone == #tone-detect |
| 449 | |
| 450 | Currently PJMEDIA lacks built-in tone detection routine. But if you you have the routine, it shouldn't be straightforward to integrate it to the framework: |
| 451 | 1. First, you need to wrap your routine as [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__PORT__CONCEPT.htm pjmedia_port] so that it can be plugged to the media framework. Your implementation would be similar to [http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__FILE__REC.htm WAV writer] media port ([source:pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c pjmedia/wav_writer.c]), but instead of writing to WAV file, it would monitor the audio signal for tone and call some callback when a tone is detected. |
| 452 | 1. Once you have the tone detector media port implementation, you can just add this media port to the conference bridge with [http://www.pjsip.org/pjsip/docs/html/group__PJSUA__LIB__MEDIA.htm#g833528c1019f4ab5c8fb216b4b5f788b pjsua_conf_add_port()], and connect the audio source to your tone detector. |
| 453 | |