ios10 iphone5s voip siphon pjsip2.5.5 Error opening sound device - ios

Someone could tell me why this happen?
iOS10, iPhone5s, VOIP Siphon pjsip2.5.5.
These issue was not appear every time,it came sometimes when you want to make call or answer call (add at:20161226).
Error opening sound device:
14:06:03.137742 pjsua_aud.c ....Set sound device: capture=-1, playback=-2
14:06:03.137775 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#16000/1/20ms
14:06:03.137837 coreaudio_dev. ......Using VoiceProcessingIO audio unit
14:06:03.147404 acquire_call enter,call_id:2
14:06:03.233365 level:4,msg:14:06:03.233 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#44100/1/20ms
14:06:03.233488 level:4,msg:14:06:03.233 coreaudio_dev. ......Using VoiceProcessingIO audio unit
14:06:03.263379 AVAudioSessionRouteChangeNotification ..changeReason..3
14:06:03.439201 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#48000/1/20ms
14:06:03.444813 coreaudio_dev. ......Using VoiceProcessingIO audio unit
14:06:03.518592 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#32000/1/20ms
14:06:03.518731 coreaudio_dev. ......Using VoiceProcessingIO audio unit
14:06:03.587808 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#16000/1/20ms
14:06:03.587936 coreaudio_dev. ......Using VoiceProcessingIO audio unit
14:06:03.659660 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#8000/1/20ms
14:06:03.659837 coreaudio_dev. ......Using VoiceProcessingIO audio unit
14:06:03.734433 pjsua_aud.c .....Unable to open sound device: Unknown OpenSSL error 503317117 [status=506637]
14:06:03.734512 pjsua_aud.c ....Error opening sound device: Unknown OpenSSL error 503317117 [status=506637]
14:06:03.734534 pjsua_aud.c ...Conf connect: 0 --> 2
14:06:03.734555 pjsua_aud.c ....Set sound device: capture=-1, playback=-2
14:06:03.734586 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#16000/1/20ms
14:06:03.734651 coreaudio_dev. ......Using VoiceProcessingIO audio unit
14:06:03.799718 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#44100/1/20ms
14:06:03.799847 coreaudio_dev. ......Using VoiceProcessingIO audio unit
14:06:03.868825 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#48000/1/20ms
14:06:03.869031 coreaudio_dev. ......Using VoiceProcessingIO audio unit
14:06:03.936294 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#32000/1/20ms
14:06:03.936423 coreaudio_dev. ......Using VoiceProcessingIO audio unit
14:06:04.006834 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#16000/1/20ms
14:06:04.006962 coreaudio_dev. ......Using VoiceProcessingIO audio unit
14:06:04.075150 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#8000/1/20ms
14:06:04.075288 coreaudio_dev. ......Using VoiceProcessingIO audio unit
14:06:04.144082 pjsua_aud.c .....Unable to open sound device: Unknown OpenSSL error 503317117 [status=506637]
14:06:04.144165 pjsua_aud.c ....Error opening sound device: Unknown OpenSSL error 503317117 [status=506637]
14:06:04.144186 pjsua_conf_connect:pjsua_conf_connect_value 506637 ret 506637
today(2016-12-16),I get the same bug,but the error number is different(iphone5 ios10.1.1 siphone pjsip2.5.5)
316-981188544 2016-12-16 10:52:29.160553 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#44100/1/20ms
316-981188544 2016-12-16 10:52:29.160689 coreaudio_dev. ......Using VoiceProcessingIO audio unit
316-981188544 2016-12-16 10:52:29.167254 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#48000/1/20ms
316-981188544 2016-12-16 10:52:29.167391 coreaudio_dev. ......Using VoiceProcessingIO audio unit
316-981188544 2016-12-16 10:52:29.172857 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#32000/1/20ms
316-981188544 2016-12-16 10:52:29.172994 coreaudio_dev. ......Using VoiceProcessingIO audio unit
316-981188544 2016-12-16 10:52:29.178400 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#16000/1/20ms
316-981188544 2016-12-16 10:52:29.178539 coreaudio_dev. ......Using VoiceProcessingIO audio unit
316-981188544 2016-12-16 10:52:29.184486 pjsua_aud.c .....Opening sound device (speaker + mic) PCM#8000/1/20ms
316-981188544 2016-12-16 10:52:29.184631 coreaudio_dev. ......Using VoiceProcessingIO audio unit
316-981188544 2016-12-16 10:52:29.195032 pjsua_aud.c .....Unable to open sound device: Unknown error -1701297535 [status=-1701297535]
316-981188544 2016-12-16 10:52:29.195105 pjsua_aud.c ....Error opening sound device: Unknown error -1701297535 [status=-1701297535]

Step 1: At first open info.plist file in your xcode project in Supporting Files Folder and click "+" in Information property list.
Step 2: Select and Add Privacy - Microphone Usage Description in the list.
Step 3: Add the value Microphone in the Privacy - Microphone Usage Description.
Now Compile and run your project.

At last,I fix this bug with IOS's CallKit,take a look at this website: https://trac.pjsip.org/repos/ticket/1941
Details: CallKit framework allows apps to use the native phone UI to receive incoming calls and make outgoing calls. In order to achieve this, CallKit requires the call audio to start only when audio session has been activated, thus it's recommended that when using PJSIP, you open the sound device only when necessary. It can be done by:
Starting PJSIP with no sound device (by calling pjsua_set_no_snd_dev() after startup). Close the sound device when unused, also with the same API (pjsua_set_no_snd_dev()). Upon audio session activation, open the sound device with the API pjsua_set_snd_dev(). Below is an example on how to integrate CallKit with PJSIP, with the delegate functions taken from ​Speakerbox sample app provided by Apple.
To make outgoing call:
func provider(_ provider: CXProvider, perform action: CXStartCallAction) {
/* 1. We must not start call audio here, and can only do so
* once the audio session has been activated by the system
* after having its priority elevated. So, make sure that the sound
* device is closed at this point.
*/
/* 2. Provide your own implementation to configure
* the audio session here.
*/
configureAudioSession()
/* 3. Make call with pjsua_call_make_call().
* Then use pjsua's on_call_state() callback to report significant
* events in the call's lifecycle, by calling iOS API
* CXProvider.reportOutgoingCall(with: startedConnectingAt:) and
* CXProvider.reportOutgoingCall(with: ConnectedAt:)
*/
/* 4. If step (3) above returns PJ_SUCCESS, call action.fulfill(),
* otherwise call action.fail().
*/
}
To handle incoming call:
func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {
/* 1. We must not start call audio here, and can only do so
* once the audio session has been activated by the system
* after having its priority elevated. So, make sure that the sound
* device is closed at this point.
*/
/* 2. Provide your own implementation to configure
* the audio session here.
*/
configureAudioSession()
/* 3. Answer the call with pjsua_call_answer().
*/
/* 4. If step (3) above returns PJ_SUCCESS, call action.fulfill(),
* otherwise call action.fail().
*/
}
To start sound device:
func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession) {
/* Start call audio media, now that the audio session has been
* activated after having its priority boosted.
*
* Call pjsua API pjsua_set_snd_dev() here.
*/
}

My issue was that, when I played a sound on incoming calls I set the AudioSession caterogry Playback like:
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback)
I changed it to Play and record:
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord)
and it worked after that. So if you somewhere in your code set the audio session to playback, change it to play and record.
#Altanai
func setAudioSessionActive(active: Bool) -> Bool{
let sessionInterface = AVAudioSession.sharedInstance()
do{
try sessionInterface.setActive(active)
if(active){
if(sessionInterface.category != AVAudioSessionCategoryPlayAndRecord){
try sessionInterface.setCategory(AVAudioSessionCategoryPlayAndRecord)
}
if(sessionInterface.mode != AVAudioSessionModeVoiceChat){
try sessionInterface.setMode(AVAudioSessionModeVoiceChat)
}
}
return true
}
catch let error{
return false
}
}
func configureAudioSession(){
let sessionInterface = AVAudioSession.sharedInstance()
do{
if(sessionInterface.responds(to: #selector(AVAudioSession.setCategory(_:with:)))){
try sessionInterface.setCategory(AVAudioSessionCategoryPlayAndRecord, with: AVAudioSessionCategoryOptions.allowBluetooth)
}
else{
try sessionInterface.setCategory(AVAudioSessionCategoryPlayAndRecord)
}
try sessionInterface.setMode(AVAudioSessionModeVoiceChat)
}
catch let error{
NSLog("SipManager - configureAudioSession error: \(error)")
}
}

Related

CallKit Audio Initialisation Error in Background - Audio not working after first Call

I have added pjsip VoIP functionality to my iOS App recently. Using pjsip offers no problem while the App is active, I can both receive and make Calls without issues.
But I seem to have a Problem with the sound devices in the background. The first call I receive from the background works fine, I get sound and I can close it normally.
The problem is after the first call I get no sound what so ever when I accept a call from the Background. The same happens if I make or receive a call while the App is active and then go to the background and receive a call.
When I close the app, the first Call from the background works normally again.
I have no idea what could cause that.
I have tried to manually close all calls via CallManager and I call a CXEndCallAction when the Server Side terminates the call, to get CallKit to close properly.
I'd be happy to post specific code passages, but currently, I have no clue where the problem could lie...
UPDATE:
I have figured out that the pjsip coreaudio initializes differently the second time.
Now the Question is, how do I reset CoreAudio in pjsip properly?
Successful Call Init:
11:03:01.615 tsx0x1030710a8 .....State changed from Trying to
Proceeding, event=TX_MSG
11:03:01.615 dlg0x1030840a8 ......Transaction tsx0x1030710a8 state changed to Proceeding
2019-02-13 11:03:01.615745+0100 VarioCallCTI[11928:2820452] Incoming call from "Matthias" <sip:238#80.80.245.33>
11:03:01.618 pjsua_aud.c ..Set sound device: capture=0, playback=0
11:03:01.618 pjsua_aud.c !Set sound device: capture=0, playback=0
11:03:01.619 pjsua_aud.c !...Opening sound device PCM#16000/1/20ms
11:03:01.619 coreaudio_dev. ....Using VoiceProcessingIO audio unit
2019-02-13 11:03:01.808024+0100 VarioCallCTI[11928:2820452] [aurioc] 1029: failed: '!int' (enable 3, outf< 1 ch, 16000 Hz, Int16> inf< 1 ch, 16000 Hz, Int16>)
11:03:01.851 pjsua_aud.c ...Opening sound device PCM#44100/1/20ms
11:03:01.851 coreaudio_dev. ....Using VoiceProcessingIO audio unit
2019-02-13 11:03:01.859854+0100 VarioCallCTI[11928:2820452] [aurioc] 1029: failed: '!int' (enable 3, outf< 1 ch, 44100 Hz, Int16> inf< 1 ch, 44100 Hz, Int16>)
11:03:01.860 pjsua_aud.c ...Opening sound device PCM#48000/1/20ms
11:03:01.860 coreaudio_dev. ....Using VoiceProcessingIO audio unit
2019-02-13 11:03:01.867061+0100 VarioCallCTI[11928:2820452] [aurioc] 1029: failed: '!int' (enable 3, outf< 1 ch, 48000 Hz, Int16> inf< 1 ch, 48000 Hz, Int16>)
11:03:01.867 pjsua_aud.c ...Opening sound device PCM#32000/1/20ms
11:03:01.867 coreaudio_dev. ....Using VoiceProcessingIO audio unit
2019-02-13 11:03:01.874321+0100 VarioCallCTI[11928:2820452] [aurioc] 1029: failed: '!int' (enable 3, outf< 1 ch, 32000 Hz, Int16> inf< 1 ch, 32000 Hz, Int16>)
11:03:01.875 pjsua_aud.c ...Opening sound device PCM#16000/1/20ms
11:03:01.875 coreaudio_dev. ....Using VoiceProcessingIO audio unit
2019-02-13 11:03:01.881126+0100 VarioCallCTI[11928:2820452] [aurioc] 1029: failed: '!int' (enable 3, outf< 1 ch, 16000 Hz, Int16> inf< 1 ch, 16000 Hz, Int16>)
11:03:01.881 pjsua_aud.c ...Opening sound device PCM#8000/1/20ms
11:03:01.881 coreaudio_dev. ....Using VoiceProcessingIO audio unit
2019-02-13 11:03:01.888214+0100 VarioCallCTI[11928:2820452] [aurioc] 1029: failed: '!int' (enable 3, outf< 1 ch, 8000 Hz, Int16> inf< 1 ch, 8000 Hz, Int16>)
11:03:01.888 pjsua_aud.c ...Unable to open sound device: Unknown error -560117684 [status=-560117684]
Error in Setting of Audio Devices - IncomingCall
TESTPRINT FOR NOTIFICATION INFO: eingehender anruf von 238
TESTPRINT FOR NOTIFICATION INFO: 238
Unsuccessful Call Init:
11:03:49.840 tsx0x103064ea8 .....State changed from Trying to Proceeding, event=TX_MSG
11:03:49.840 dlg0x1030906a8 ......Transaction tsx0x103064ea8 state changed to Proceeding
2019-02-13 11:03:49.841013+0100 VarioCallCTI[11928:2820906] Incoming call from "Matthias" <sip:238#80.80.245.33>
11:03:49.842 pjsua_aud.c ..Set sound device: capture=0, playback=0
11:03:49.842 pjsua_aud.c ...Opening sound device PCM#16000/1/20ms
11:03:49.842 coreaudio_dev. ....Using VoiceProcessingIO audio unit
11:03:49.847 pjsua_aud.c !Set sound device: capture=0, playback=0
2019-02-13 11:03:50.276837+0100 VarioCallCTI[11928:2820280] [avas] AVAudioSessionPortImpl.mm:56:ValidateRequiredFields: Unknown selected data source for Port Speaker (type: Speaker)
2019-02-13 11:03:50.277597+0100 VarioCallCTI[11928:2820280] [avas] AVAudioSessionPortImpl.mm:56:ValidateRequiredFields: Unknown selected data source for Port Receiver (type: Receiver)
2019-02-13 11:03:50.292488+0100 VarioCallCTI[11928:2820280] [avas] AVAudioSessionPortImpl.mm:56:ValidateRequiredFields: Unknown selected data source for Port Receiver (type: Receiver)
2019-02-13 11:03:50.293379+0100 VarioCallCTI[11928:2820280] [avas] AVAudioSessionPortImpl.mm:56:ValidateRequiredFields: Unknown selected data source for Port Receiver (type: Receiver)
11:03:50.383 coreaudio_dev. !....core audio stream started
Setting of Audio Devices Successfull - IncomingCall
TESTPRINT FOR NOTIFICATION INFO: eingehender anruf von 238
TESTPRINT FOR NOTIFICATION INFO: 238
I have figured out how to solve the Problem.
Since the PJSIP Library Init caused the coreAudio to initialize before the priority bump required by iOS was fully finished, I had to open CallKit and register at the PJSIP Server inside the CallKit - ProviderDelegate
func reportIncomingCall(uuid: UUID, handle: String, hasVideo: Bool = false, completion: ((NSError?) -> Void)?) {
let update = CXCallUpdate()
update.remoteHandle = CXHandle(type: .generic, value: handle)
update.hasVideo = hasVideo
//MARK: Final Working Solution
print("Starting PJSIP after PUSH")
pjsipfunctions.init().registersip(mainUser.sipData["User"], mainUser.sipData["Password"], mainUser.sipData["Server"])
provider.reportNewIncomingCall(with: uuid, update: update) { error in
if error == nil {
let call = Call(uuid: uuid, handle: handle)
self.callManager.add(call: call)
userTerminatedCall = false
}
completion?(error as? NSError)
}
}
}

PJSIP : Video Call In Background

I am working on PJSIP. Two ways Video and Audio call are working fine but the issue is when app is in background and I made a new Incoming call, The callKit is showing new incoming call and I picked up the call. Then app moves from background to foreground but video is not showing and audio is working at that time. If I made a call in foreground then video is showing at both end.
Please find below the logs :
15:48:19.251 ios_opengl_dev .......Failed to initialize iOS OpenGL because we are in background
15:48:19.251 vid_port.c .......Closing OpenGL renderer..
15:48:19.319 pjsua_vid.c .......Window 0: destroying..
15:48:19.319 pjsua_media.c ....pjsua_vid_channel_update() failed for call_id 0 media 1: video subsystem not initialized (PJMEDIA_EVID_INIT)
15:48:19.319 pjsua_media.c ....Error updating media call00:1: video subsystem not initialized (PJMEDIA_EVID_INIT)
15:48:19.319 pjsua_app.c ...Call 0 media 0 [type=audio], status is Active
15:48:19.319 pjsua_aud.c ...Conf connect: 3 --> 0
15:48:19.319 pjsua_app.c ....Turning sound device ON
15:48:19.319 conference.c ....Port 3 (sip:linchpin#192.168.1.7) transmitting to port 0 (Master/sound)
15:48:19.319 pjsua_aud.c ...Conf connect: 0 --> 3
15:48:19.319 conference.c ....Port 0 (Master/sound) transmitting to port 3 (sip:linchpin#192.168.1.7)
15:48:19.319 pjsua_app.c ...Call 0 media 1 [type=video], status is Error
15:48:19.319 pjsua_app.c ...Just rejected incoming video offer on call 0, use "vid call enable 1" or "vid call add" to enable video!
Add some delay in answering the call it will work as sometimes PJSIP is taking time to initiate the camera.

iOS: RTSP Stream in background

I'm developing an iOS app to play a RTSP Stream (with two tracks, one audio and one for video), and i'm using libVLC to do it.
Playing the video or only audio (adding the option "--no-video") works perfectly. If i start the player with only audio and then enter background the player keeps playing the stream.
The problem i'm having is that if i enter background when video is playing, i want to stop the video and start a new libVLC player with only audio. In that scenario i get this error message:
ERROR: [0x48e2000] >aurioc> 783: failed: '!int' (enable 2, outf< 2 ch, 48000 Hz, Float32, inter> inf< 2 ch, 0 Hz, Float32, non-inter>)
[1973b5e4] audiounit_ios audio output error: failed to init AudioUnit (560557684)
[1973b5e4] audiounit_ios audio output error: opening AudioUnit output failed
[1973b5e4] core audio output error: module not functional
[17a27e74] core decoder error: failed to create audio output
The code in my appDelegate:
- (void)applicationDidEnterBackground:(UIApplication *)application
{
NSLog(#"applicationDidEnterBackground");
if(_playerController!=NULL){
[_playerController performSelector:#selector(goToBackground) withObject:nil afterDelay:1];
_playerController=NULL;
}
}
And in my uiViewController:
-(void)close:(BOOL)enterBackground
{
[_mediaPlayer stop];
NSArray* options = #[[NSString stringWithFormat:#"--no-video"]];
_mediaPlayer = [[VLCMediaPlayer alloc] initWithOptions:options];
_mediaPlayer.delegate = self;
_mediaPlayer.drawable = _videoView;
_mediaPlayer.media = [VLCMedia mediaWithURL:[NSURL URLWithString:url]];
[_mediaPlayer play];
}
Am i doing anything wrong?
yes, don't stop the video and start a new player. Just disable video decoding on the existing player and re-enable it once your app is in the foreground again. This is way more efficient, elegant and faster. Additionally, you won't run into this audio session locking issue.
How is VLC for iOS doing this? When the app is on the way to the background, we store the current video track's ID, which can be "1" but also something entirely else depending on the played stream, in a variable next to the media player object. Then, we we switch the media player's video track to "-1", which is the value for "off" in any case. Video decoding stops. Once the app moves to the foreground again, the media player's video track is set to the cached track ID again and video decoding starts again.

iOS - When starting a recording, the bluetooth device thinks I'm making a phone call

I have a recording app. I'm running into a problem that when I open my app and the phone is paired to a bluetooth device, as soon as I start recording, the bluetooth device thinks I'm starting a phone call. It makes an outgoing call sound, and displays on the screen "ON CALL" (always talking about the BT device), but no actual call is being made of course.
This is how I'm currently initializing my session:
[[AVAudioSession sharedInstance] overrideOutputAudioPort:AVAudioSessionPortOverrideNone
error:nil];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord
withOptions:AVAudioSessionCategoryOptionMixWithOthers |
AVAudioSessionCategoryOptionAllowBluetooth
error: nil];
I tried it on 2 different bluetooth devices and similar outcomes happen on the same. Both try to establish a phone call.
After looking at BlueTooth logs, I found some clue as to what it is doing:
12:24:07.185 A2DPClient.cpp:390 StopStreaming A2DP Notice Stopping A2DP audio streaming
12:24:07.186 A2DPClient.cpp:415 StopStreaming A2DP Notice Sending 'A2DP audio disconnected' event for device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:24:07.201 HandsfreeAudioPlugIn.cpp:971 audioDataAvailable Handsfree Notice HandsfreeAudioPlugIn:: Audio available event for 00:19:B5:FE:05:9B, reason: 2
12:24:07.203 HandsfreeAudioPlugIn.cpp:971 audioDataAvailable Handsfree Notice HandsfreeAudioPlugIn:: Audio available event for 00:19:B5:FE:05:9B, reason: 4
12:24:07.203 HandsfreeAudioPlugIn.cpp:971 audioDataAvailable Handsfree Notice HandsfreeAudioPlugIn:: Audio available event for 00:19:B5:FE:05:9B, reason: 1
12:24:07.203 HandsfreeGateway.cpp:699 createVisualVoicemai Handsfree Notice Setting up virtual call
12:24:07.205 AudioSendThread.cpp:91 run Audio Notice AudioSendThread stopping
12:24:07.207 HandsfreeGateway.cpp:1540 initiateScoConnectio Handsfree Notice Initiating SCO connection with delay of 20 milliseconds
12:24:07.207 HandsfreeGateway.cpp:3179 handleUpdateCallStat Handsfree Notice Updating call status for call(s): [ [#1: Outgoing to +XXXXXXXXXXXXX "My Number" (voicemail)] ]
12:24:07.207 HandsfreeGateway.cpp:1523 delayScoConnection Handsfree Notice Delaying SCO connection by 20 milliseconds
12:24:07.208 HandsfreeGateway.cpp:3183 handleUpdateCallStat Handsfree Notice callPresent: no, callState: 1, callSetup: outgoing, heldStatus: none, heldChanged: no, visualVoicemail: yes
12:24:07.208 HandsfreeGateway.cpp:2871 tellEveryOneAboutVVM Handsfree Notice Sending call setup "outgoing" to device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:24:07.208 HandsfreeGateway.cpp:2877 tellEveryOneAboutVVM Handsfree Notice Sending call status "call active" to device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:24:07.208 HandsfreeGateway.cpp:2760 operator() Handsfree Notice Sending call setup "none" to device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:24:07.229 HandsfreeGateway.cpp:1626 internalConnectAudio Handsfree Notice Making outgoing audio connection to device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:24:07.457 HandsfreeGateway.cpp:1161 audioEvent Handsfree Notice Received audio connected event for device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:24:07.471 A2DPClient.cpp:1384 SuspendCfm A2DP Notice Successfully suspended stream to device 00:19:B5:FE:05:9B "VW_RADIO_55"
12:25:36.959 LeObserver.cpp:904 scanTimer Discovery Notice Session "wirelessproxd-central-35-1" is now at scan level 3
12:25:59.599 HandsfreeAudioPlugIn.cpp:1050 audioPauseNotificati Handsfree Notice HandsfreeGateway::audioPauseNotification
12:25:59.599 HandsfreeGateway.cpp:726 deleteVisualVoicemai Handsfree Notice Cleaning up virtual call
12:25:59.599 HandsfreeGateway.cpp:1567 internalDisconnectAu Handsfree Notice Disconnecting audio from device 00:19:B5:FE:05:9B "VW_RADIO_55"
What is that Setting up virtual call??? The only thing I'm doing in code at that point is
[self.audioRecorder record];
self.audioRecorder is an instance of AVAudioRecorder of course.
How can I prevent this?
Change your AVAudioSession options whenever you want to start recording and do not allow Bluetooth:
[[AVAudioSession sharedInstance] overrideOutputAudioPort:AVAudioSessionPortOverrideNone
error:nil];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord
withOptions:AVAudioSessionCategoryOptionMixWithOthers
error: nil];
[self.audioRecorder record];
Once finished the recording, on the delegate call of the AVAudioRecorder instance:
- (void)audioRecorderDidFinishRecording:(AVAudioRecorder *)recorder successfully:(BOOL)flag
Set up back your AVAudioSession options to allow Bluetooth AVAudioSessionCategoryOptionAllowBluetooth this way the AVAudioSession will not assume the recording input should be handled as Voice Call from the connected BT device.

PJSIP error pjsua_call_media_init

I had compiled the code from this link, also I am able to successfully register a account on sip server. But when I make a sip call then it gives a trap error in pjsua_call_media_init.
I need help to understand the reason for error mentioned below.
--end msg--
14:51:34.422 pjsua_acc.c ....SIP outbound status for acc 0 is not active
14:51:34.422 pjsua_acc.c ....sip:ssssingh#sip.antisip.com: registration success, status=200 (OK), will re-register in 300 seconds
14:51:34.422 pjsua_acc.c ....Keep-alive timer started for acc 0, destination:91.121.81.212:5060, interval:15s
2013-07-04 14:51:34.423 GossipExample[1049:4603] Gossip: dispatchRegistrationState(0)
2013-07-04 14:51:46.651 GossipExample[1049:907] Gossip: ringbackWithSoundNamed: /var/mobile/Applications/1B440F28-7F74-46D5-A120-9C0B3C35AD65/GossipExample.app/ringtone.wav
14:51:46.653 pjsua_aud.c !Creating playlist with 1 file(s)..
14:51:46.655 wav_playlist.c .WAV playlist 'WAV playlist' created: samp.rate=44100, ch=2, bufsize=4KB
14:51:46.657 pjsua_aud.c .Playlist created, id=0, slot=1
14:51:47.708 pjsua_call.c Making call with acc #0 to sip:chakrit2#getonsip.com
14:51:47.710 pjsua_aud.c .Set sound device: capture=-1, playback=-2
14:51:47.711 pjsua_aud.c ..Opening sound device PCM#16000/1/20ms
14:51:47.712 coreaudio_dev. ...Using RemoteIO audio unit
14:51:48.013 coreaudio_dev. ...core audio stream started
14:51:48.021 pjsua_media.c .Call 0: initializing media..
After the above sequence of events there is a trap error, image is below

Resources