简体   繁体   中英

How to enable pjsip bluetooth in ios?

we made VoIP app using pjsip and we required to add support of the Bluetooth. For that, we added the following code:-

pjmedia_aud_dev_route route = PJMEDIA_AUD_DEV_ROUTE_BLUETOOTH;
pj_status_t status =
pjsua_snd_set_setting(PJMEDIA_AUD_DEV_CAP_INPUT_ROUTE, &route,
                      PJ_TRUE);
NSLog(@"statuys is--->%d",status);

But above code give status code "420008".so how to add Bluetooth in pjsip.

so anyone has a solution for that then please help me.

Thank you.

You need use AVAudioSession to route the sound in bluetooth device but before routing you need to call pjsip library for sound pjsua_set_snd_dev(0,0);

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionAllowBluetooth error:&error];

Happy to help you :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM