Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pjsip ios : Bluetooth not working

I'm building a sample voip app in iOS using pjsip version 2.3 (stable). Everything works fine except that bluetooth headset does not work with app.

I'm enabling bluetooth from AVAudioSession by

AVAudioSession *session = [AVAudioSession sharedInstance];
[session setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionAllowBluetooth error:nil];

I enable the AVAudioSession instance before making a call.

AVAudioSession *session = [AVAudioSession sharedInstance];
    [session setActive:YES error:nil];

I disable the AVAudioSession instance after the call ends.

AVAudioSession *session = [AVAudioSession sharedInstance];
    [session setActive:NO error:nil];

I also followed the instructions given here

https://trac.pjsip.org/repos/wiki/Getting-Started/iPhone#UnabletosupportBluetoothinput):

But bluetooth does not seem to work at all.

I'm pretty sure this is something to do with pjsip because I created a simple iOS app that could record and play sound that uses AVAudioSession the same way as mentioned above and bluetooth works totally fine.

Device being used : iPhone 5s iOS 8.4

Kindly provide me inputs to configure pjsip so that I can enable bluetooth.

like image 877
adsun Avatar asked Dec 08 '25 07:12

adsun


1 Answers

This fix by PJSIP fixed the bluetooth problem: https://trac.pjsip.org/repos/changeset/5142

It seems to be working for me.

like image 56
ssk Avatar answered Dec 10 '25 22:12

ssk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!