Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VOIP dialler tone for outgoing call iOS webrtc

Tags:

ios

webrtc

voip

I am working on VOIP in iOS using webrtc.

How to produce dialer tone for outgoing call , i.e. how to produce the ringer sound in ear speaker till the outgoing call connected?

like image 216
Mohan Kumar Avatar asked Nov 10 '22 15:11

Mohan Kumar


1 Answers

NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/TEST.aif", [[NSBundle mainBundle] resourcePath]]];
AVAudioPlayer * keepAwakePlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];

UInt32 doSetProperty = TRUE;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: nil];   AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof(doSetProperty), &doSetProperty);        
keepAwakePlayer.numberOfLoops = -1;
   [keepAwakePlayer play];
like image 179
Maverick King Avatar answered Nov 15 '22 05:11

Maverick King