ios - Native incoming call is killing my VOIP app's access to audio -


i'm developing voip app allows people make voip calls. whenever user in voip call , receives native call on phone audio of voip app stops working.

i've read 1 must reinitialize audiosession , i'm doing block of code not working. suggestions?

self.callcenter = [[ctcallcenter alloc] init]; [self handlecall];  - (void)handlecall {     avaudiosession *session = [avaudiosession sharedinstance];      self.callcenter.calleventhandler = ^(ctcall *call){      if ([call.callstate isequaltostring: ctcallstateconnected])     {     }     else if ([call.callstate isequaltostring: ctcallstatedialing])     {     }     else if ([call.callstate isequaltostring: ctcallstatedisconnected])     {       nslog(@"call ended");        dispatch_after(dispatch_time(dispatch_time_now, 2 * nsec_per_sec), dispatch_get_main_queue(), ^{          [session setactive:yes error:nil];        });     }     else if ([call.callstate isequaltostring: ctcallstateincoming])     {       nslog(@"call received");     }   }; } 

i have worked on voip app sip library using. if using same library, while getting native call if voip call existed, native call terminate voip call audio session. so, while getting native call, make "mute" sip library , after ended native call, "unmute" thats it.

    pjsua_conf_adjust_rx_level(0 /* pjsua_conf_port_id slot*/, 0.0f); //for mute audio      pjsua_conf_adjust_rx_level(0 /* pjsua_conf_port_id slot*/, 1.0f); //for unmute audio. 

i hope you.


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -