For basics, you can take a look at the README.

How to use liblinphone on IOS

In order to use liblinphone in your IOS app you will need our SDK here is how to get it.

Using a pre-compiled SDK

If you do not need to build the SDK manually, you can download a pre-compiled SDK here.

The SDKs available correspond to our AppStore releases and liblinphone-iphone-sdk-latest.zip represents the SDK of our most recent release.

Once the SDK is downloaded you can unzip it and put it in the root directory of your XCode Project.

Building the SDK manually

Go to your linphone-iphone repository and run the following commands to update your submodules and build the SDK :

git submodule update --recursive --init
./prepare.py -c
./prepare.py
make

The built of the SDK creates a folder named liblinphone-sdk with the binaries in your project's root directory.

Using the SDK

You can find the liblinphone API documentation of liblinphone here.

Handling liblinphone log

In order to see liblinphone logs in your IOS app (for example in your Xcode console) follow these steps :

Put in your code at the launching of the app :

linphone_core_enable_logs_with_cb(your_log_handler);

This will make the liblinphone logs to call your_log_handler and so be processes as a log from your app.

You can set the liblinphone log level by using the following functions :

/**
 * Define the minimum level for logging.
 *
 * @param loglevel Minimum level for logging messages.
**/

LINPHONE_PUBLIC void linphone_core_set_log_level(OrtpLogLevel loglevel);

/**
 * Activate all log level greater or equal than specified level argument.
**/

ORTP_PUBLIC void ortp_set_log_level(const char *domain, OrtpLogLevel level);

Full ipv6 support

 Starting June 1, 2016, all applications submitted to the App Store must work within IPv6-only networks. Linphone supports these requirements since version 3.13.9 released June 15, 2016.

To comply with Apple requirements, you will need to:

  • Update your Linphone-iphone application to 3.13.9 minimum.
  • Make sure not to disable IPV6 accidentally in the application, with 

linphone_core_enable_ipv6() or by setting 

ipv6=0  in 

[net]
section of your linphonerc default or factory configuration files. 

ipv6=1 becomes the default in the 3.3.19 linphone-iphone release.

App upgrade

  • For app upgrades, since version 3.13.9 liblinphone automatically switches on IPV6 during installation.

Server side

  • Thanks to NAT64/DNS64, IPV4 SIP servers can still be used without modifications assuming there are prepared to receive IPV6 addresses in both, VIA, Contact and SDP fields.
  • As NAT64 implementation leverages on features only available since 9.x (I.E NAT64 aware getaddrinfo), NAT64 is only supported on IOS version >= 9.x.

Testing

IOS 10

What's new in Linphone

  • It is no longer possible to listen to a SIP socket in order to detect incoming calls, or new messages, when the application is in background. Now using the push notifications is the only way to do so.
  • Linphone uses VoIP push notifications (from the PushKit framework), in replacement of remote notifications and VoIP sockets, since commit : f84fb0bc0fe5cfa34b0029cb775668cd96a13ce3
  • For IOS 10 and more a new parameter is needed to register for push notifications : pn-token. When registering for push notifications, it is necessary to add "pn-timeout=0" to the request so that the push gateway sends the notifications as soon as possible.
  • FlexiSIP supports VoIP push notifications since commit : a50538897674b2c8cb723e73f6e9d6a969e0b6e0
  • Please find more information about push notifications in FlexiSIP here.

CallKit Integration

  • Since IOS 10, apple provides the CallKit framework. This framework is used to integrate VoIP applications in the native UI of the device. It allows, for instance, to display incoming calls and answer them when the application is killed or in background, or when the device is locked.
  • In order to implement CallKit in an application based on Liblinphone, follow these steps :
    • Add the CallKit framework into your application
    • Implement the CXProviderDelegate protocol within your ApplicationDelegate
  • When answering a call, CallKit needs to start the audio session soon. You need to set your AVAudioSession active into the handler of the report incoming call callback as follow :
   [self reportNewIncomingCallWithUUID:uuid update:update completion:^(NSError* error) {
         AVAudioSession* audioSession = [AVAudioSession sharedInstance];
          [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
         //Configure audio session here
         [audioSession setActive:TRUE error:nil];
   }];
Tags: IOS