Ring tone(yet not solved)

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

 



hi all,

        Few days ago i asked about the ring tone problem, still i am not
getting ring. i got answers also but i am not able to make that. can anyone
explain me plz how to add code for that. And i was looking for playfile
which is given in sample , but that one also giving me break point. what
should i do????
i am posting my code what ever i am adding( with playfile)



void CMFCDlg::ring()
{
    status = pj_init();
    pj_caching_pool_init(&cp, &pj_pool_factory_default_policy, 0);
    status = pjmedia_endpt_create(&cp.factory, NULL, 1, &med_endpt);
    pool = pj_pool_create( &cp.factory,        /* pool factory        */
               "wav",        /* pool name.        */
               4000,        /* init size        */
               4000,        /* increment size        */
               NULL            /* callback on error    */
               );
    status = pjmedia_wav_player_port_create(  pool,    /* memory pool
*/
                          soundfile,    /* file to play        */
                          20,    /* ptime.        */
                          0,    /* flags        */
                          0,    /* default buffer   */
                          &file_port/* returned port    */
                          );
    status = pjmedia_snd_port_create_player(
         pool,                    /* pool            */
         -1,                    /* use default dev.        */
         file_port->info.clock_rate,        /* clock rate.        */
         file_port->info.channel_count,        /* # of channels.        */
         file_port->info.samples_per_frame, /* samples per frame.   */
         file_port->info.bits_per_sample,   /* bits per sample.        */
         0,                    /* options            */
         &snd_port                /* returned port        */
         );
    pj_thread_sleep(100);
    status = pjmedia_snd_port_connect( snd_port, file_port);
    CCallring allring;
    if(allring.DoModal())
    pjmedia_snd_port_disconnect(snd_port);
    pj_thread_sleep(100);
    //return 0;
}

static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id,
                 pjsip_rx_data *rdata)
{
    CMFCDlg dlg;
    dlg.ring();
    CCallring allring;
    pjsua_call_info ci;
    PJ_UNUSED_ARG(acc_id);
    PJ_UNUSED_ARG(rdata);
    pjsua_call_get_info(call_id, &ci);
    pjsua_call_answer(call_id, 180, NULL, NULL);
    dlg.ring();
         if(allring.DoModal())
    pjsua_call_answer(call_id,200,NULL,NULL);

}

see this is my all code but it is breaking me in mutex and thread . can
anyone tell me where is the problem......



Regards
New_bie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090113/02e9e680/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