PJSIP How to detect inband DTMF (no rfc2833)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear ALL,

    Can anyone help me in detect inband DTMF?

    I want to use pjmedia API to get incoming audio data then use spandsp to analysis the DTMF info,But I can not get the incoming RTP data,Can someone help me ?



  The flow is what I have done to get the incoming RTP data .


   1.in on_call_media_state



pjsua_call_get_info(call_id,&ci);

if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE)
{
buff = (char*)pj_pool_alloc(pool, 1000*sizeof(char));
pjsua_conf_get_port_info(ci.conf_slot,&info);
pjmedia_mem_capture_create(pool,buff,1000,info.clock_rate,
info.channel_count,info.samples_per_frame,info.bits_per_sample,0,&media_port);
//pjmedia_mem_player_set_eof_cb(media_port,buff,cpa_fft_got_data);
pjmedia_mem_capture_set_eof_cb(media_port,buff,cpa_fft_got_data);

pjsua_conf_add_port(pool,media_port,&listen_port);
pjsua_conf_connect(ci.conf_slot,listen_port);

}
2.in callback cpa_fft_got_data
pj_status_t cpa_fft_got_data(pjmedia_port *port, void *usr_data)
{
pjmedia_frame frame ;
pj_int16_t samplebuf[1024];
frame.buf = samplebuf;
frame.size = 1024;
pjmedia_port_get_frame(port,&frame);
//PJ_LOG(3,(THIS_FILE,"buf buf    %s",usr_data));
if (frame.type== PJMEDIA_FRAME_TYPE_NONE)
{
return 0;
}
       // ....
}

Anyway when I send inband DTMF info by another client in cpa_fft_got_data it shows that
    frame.type == PJMEDIA_FRAE_TYPE_NONE so it will return 0,I can't get any data. So what should I do?

http://comments.gmane.org/gmane.comp.voip.pjsip/9720   this address is the sample which I refered to.


I'm so sorry my english is very poor.

Best Regards.
the PJSIP open source SIP stack () - Gmane<http://comments.gmane.org/gmane.comp.voip.pjsip/9720>
comments.gmane.org
At 10:37 AM 9/15/2009, Archie Rosenblum wrote: Content-Type: multipart/alternative; boundary="----=_NextPart_000_0088_01CA35F8.E071DB00"




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20160216/1a5ae396/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux