Example of Click to Call application for iOS
This example allows to place outgoing audio call with one button click using account specified in server config file
Analyzing the code of the example
To analyze the code, let's take ClickToCall example version, which can be downloaded with build 2.5.2.
1. Import of API. code
2. Connection to the server.
FPWCSApi2 createSession, FPWCSApi2Session connect code
FPWCSApi2SessionOptions object with the following parameters is passed to createSession() method
- URL of WCS server
- appKey of internal server-side application (clickToCallApp)
3. Receiving the event confirming successful connection.
ViewController onConnected, ViewController call code
Onthis event, ViewController call method is called to make outgoing call.
4. Outgoing call.
FPWCSApi2Session createCall, FPWCSApi2Call call code
The next options are passed to the createCall() method:
- callee SIP username
- call constraints: audio only
5. Call hangup.
FPWCSApi2Call hangup code