Liblinphone
5.0.0
|
Multitasking
Liblinphone for IOS natively supports multitasking assuming application follows multitasking guides provided by Apple.
More...
Functions | |
void | linphone_core_start_dtmf_stream (LinphoneCore *core) |
void | linphone_core_stop_dtmf_stream (LinphoneCore *core) |
void | linphone_core_activate_audio_session (LinphoneCore *core, bool_t actived) |
Special function to indicate if the audio session is activated. More... | |
void | linphone_core_configure_audio_session (LinphoneCore *core) |
Special function to configure audio session with default settings. More... | |
void | linphone_core_enable_callkit (LinphoneCore *core, bool_t enabled) |
Special function to enable the callkit. More... | |
MS2_DEPRECATED void | linphone_core_audio_route_changed (LinphoneCore *core) |
Special function to indicate if the audio route is changed. More... | |
bool_t | linphone_core_callkit_enabled (const LinphoneCore *core) |
Special function to check if the callkit is enabled, False by default. More... | |
bool_t | linphone_core_local_permission_enabled (const LinphoneCore *core) |
Special function to check if the local network permission has been granted by the user (useful for iOS). More... | |
Multitasking
Liblinphone for IOS natively supports multitasking assuming application follows multitasking guides provided by Apple.
First step is to declare application as multitasked. It means adding background mode for both audio and voip to Info.plist file.
Networking
Sound cards
Since IOS 5.0, liblinphone supports 2 sound cards. AU: Audio Unit Receiver based on IO units for voice calls plus AQ: Audio Queue Device dedicated to rings. Here under the recommended settings (I.E default one)
GSM call interaction
To ensure gentle interaction with GSM calls, it is recommended to register an AudioSession delegate. This allows the application to be notified when its audio session is interrupted/resumed (presumably by a GSM call).
Declare an instance of your class as AudioSession's delegate :
Video
Since 3.5 video support has been added to liblinphone for IOS. It requires the application to provide liblinphone with pointers to IOS's views hosting video display and video previous.
These 2 UIView objects must be passed to the core using functions linphone_core_set_native_video_window_id() and linphone_core_set_native_preview_window_id(). here under speudo code:
Screen rotations are also handled by liblinphone. 2 positions are currently supported, namely UIInterfaceOrientationPortrait and UIInterfaceOrientationLandscapeRight. Applications may invoke linphone_core_set_device_rotation() followed by linphone_core_update_call() to notify liblinphone of an orientation change. Here under a speudo code to handle orientation changes
DTMF feebacks
Liblinphone provides functions to play dtmf to the local user. Usually this is used to play a sound when the user presses a digit, inside or outside of any call. On IOS, libLinphone relies on AudioUnits for interfacing with the audio system. Unfortunately the Audio Unit initialization is a quite long operation that may trigger a bad user experience if performed each time a DTMF is played, the sound being delayed half a second after the press. To solve this issue and thus insure real-time precision, liblinphone introduces 2 functions for preloading and unloading the underlying audio graph responsible for playing DTMFs.
For an application using function linphone_core_play_dtmf(), it is recommanded to call linphone_core_start_dtmf_stream() when entering in foreground and linphone_core_stop_dtmf_stream() upon entering background mode.
Plugins
On iOS, plugins are built as static libraries so Liblinphone will not be able to load them at runtime dynamically. Instead, you should declare their prototypes:
Then you should register them after the instantiation of LinphoneCore:
If the plugin has not been enabled at compilation time, a stubbed library will be generated with only libplugin_init method declared, doing nothing. You should see these trace in logs, if plugin is stubbed:
void linphone_core_activate_audio_session | ( | LinphoneCore * | core, |
bool_t | actived | ||
) |
Special function to indicate if the audio session is activated.
Must be called when ProviderDelegate of the callkit notifies that the audio session is activated or deactivated.
core | The LinphoneCore object. |
activated | TRUE to activate the audio session, FALSE to disable it. |
MS2_DEPRECATED void linphone_core_audio_route_changed | ( | LinphoneCore * | core | ) |
Special function to indicate if the audio route is changed.
Must be called in the callback of AVAudioSessionRouteChangeNotification.
core | The LinphoneCore object. |
bool_t linphone_core_callkit_enabled | ( | const LinphoneCore * | core | ) |
Special function to check if the callkit is enabled, False by default.
core | The LinphoneCore object. |
void linphone_core_configure_audio_session | ( | LinphoneCore * | core | ) |
Special function to configure audio session with default settings.
Must be called in ProviderDelegate's callbacks when answer an incoming call and start an outgoing call.
core | The LinphoneCore object. |
void linphone_core_enable_callkit | ( | LinphoneCore * | core, |
bool_t | enabled | ||
) |
Special function to enable the callkit.
core | The LinphoneCore object. |
enabled | TRUE to enable callkit, FALSE to disable it. |
bool_t linphone_core_local_permission_enabled | ( | const LinphoneCore * | core | ) |
Special function to check if the local network permission has been granted by the user (useful for iOS).
The test performed by this function may popup the local network permission dialog, for that reason it could be a good idea to check it twice to conclude that the user has deny the permission.
core | The LinphoneCore object. |
void linphone_core_start_dtmf_stream | ( | LinphoneCore * | core | ) |
core | The LinphoneCore object. Special function to warm up dtmf feeback stream. linphone_core_stop_dtmf_stream() must be called before entering FG mode |
void linphone_core_stop_dtmf_stream | ( | LinphoneCore * | core | ) |
core | The LinphoneCore object. Special function to stop dtmf feed back function. Must be called before entering BG mode |