Call Hold Play Wav File Strange Error

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

 



Hello to all of you, i have implement a call hold feature in my voip
softphone and during the first time call hold it play the wav file and stop
when call release.

Therefore, i try to hold the call again and it does not play the wav file in
second time or third time for the same call.

My code is get from playfile.c

[code]
void VOIP::InitCallHoldRemoteTonePlayer()
{
 pj_caching_pool_init(&cachingPool,
  &pj_pool_factory_default_policy, 0);

 status = pjmedia_endpt_create(&cachingPool.factory,
  NULL, 1, &mediaEndPt);

 pool = pj_pool_create(&cachingPool.factory, "WAV",
  4000, 4000, NULL);

 status = pjmedia_wav_player_port_create(pool,
  "D:\\C++\\FYP\\HoldMusic.wav",
  20, 0, 0, &filePort);

 status = pjmedia_snd_port_create_player(pool, -1,
           filePort->info.clock_rate,
           filePort->info.channel_count,
           filePort->info.samples_per_frame,
           filePort->info.bits_per_sample,
             0, &sndPort);

 status = pjmedia_snd_port_connect(sndPort, filePort);
 pj_thread_sleep(100);

 status = pjsua_player_create(&pj_str("D:\\C++\\FYP\\HoldMusic.wav"),
  PJMEDIA_FILE_NO_LOOP, &remoteHoldPlayerID);

 /*pjsua_conf_connect(pjsua_player_get_conf_port(remoteHoldPlayerID),
  pjsua_call_get_conf_port(callID) );
*/
}

void VOIP::DestroyCallHoldRemoteTonePlayer()
{
 pjsua_conf_disconnect(pjsua_player_get_conf_port(remoteHoldPlayerID),
  pjsua_call_get_conf_port(callID) );

 status = pjmedia_snd_port_disconnect(sndPort);
 pj_thread_sleep(10);
 status = pjmedia_snd_port_destroy(sndPort);
 status = pjmedia_port_destroy(filePort);
 pj_pool_release(pool);
 pjmedia_endpt_destroy(mediaEndPt);
 pj_caching_pool_destroy(&cachingPool);

/*

*/
}



[/code]

Does anyone has idea what wrong with it ?

Please help.

Thanks.




-- 
Linux
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20091028/0cd61573/attachment-0001.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