[pjsip] A big bug in pjsip

hlzhangxt hlzhangxt at 163.com
Sat Apr 5 08:01:32 EDT 2008


 
 
 
 The big bug is:
 
   When pjsip usa works with asterisk, After it's put on hold, listening to on hold music, or transfered , listening to hold music, It's very possible to be deaf. Only after you send reinvite, rebuild the media channel, then resume.
 
   So this is a big bug, I hope somebody can solve it.
 
   I solve it by changing sound_prot.c, after a little time(1 second), the media port can not get any sound fram, I make it send reinvite. Look the codes below:  
   in function play_cb
 
 return PJ_SUCCESS;
no_frame:
   if (pjsua_call_get_count() > 0)
   {
      
    if (pjsua_call_has_media(0)){
         ++snd_port->no_frame_count;
         if (snd_port->no_frame_count > snd_port->ec_suspend_limit/AEC_SUSPEND_LIMIT*1.1)
   {
           pjsua_call_reinvite(0, PJ_TRUE, NULL);
     snd_port->no_frame_count = 0;
   }
    }
   }
 
    
    if (snd_port->ec_state && !snd_port->ec_suspended) {
 ++snd_port->ec_suspend_count;
 if (snd_port->ec_suspend_count > snd_port->ec_suspend_limit) {
     snd_port->ec_suspended = PJ_TRUE;
     PJ_LOG(4,(THIS_FILE, "EC suspended because of inactivity"));
 }
 if (snd_port->ec_state) {
     /* To maintain correct delay in EC */
     pjmedia_echo_playback(snd_port->ec_state, (pj_int16_t*)output);
 }
    }
 
   
The Blue part is the change. I and a new variable no_frame_count in sn_port,It caculate how many frames not received. If more than 1.1 seconds frames lost, I send reinvite.
 
 
  I know this is not the final solution, But it works. 
 
 I hope somebody can solve it in a final righ way.
 
 
  Regards
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080405/2d7974cf/attachment.html>


More information about the pjsip mailing list