ABTO Software VoIP SIP SDK for iphone Developer Manual
Table of Contents INTRODUCTION... 3 RESTRICTIONS AND LIMITATIONS... 4 TECHNICAL BACKGROUND... 5 API 9 ABTO VOIP INTERFACE... 9 ABTO VOIP INTERFACE OBSERVER... 10 ABTO VOIP SESSION... 11 ABTO VOIP SESSION OBSERVER... 11 2013 ABTO Software VoIP SIP SDK www.voipsipsdk.com Skype: sales.abto.software 2
INTRODUCTION VoIP SIP SDK for iphone is a customizable solution to develop your own softphone for iphone and ipad devices. The softphone suits needs of most users and provides the following functionality: voice calls; video calls; several lines; switching between several cameras on the device; text chat; status update (presence); DTMF support; customizable; works good for ios 5 devices; works with most SIP servers, including ABTO Software s VoIP SIP Server and Asterisk; works great with most sip clients, including ABTO Software s VoIP SIP SDK for Windows. 2013 ABTO Software VoIP SIP SDK www.voipsipsdk.com Skype: sales.abto.software 3
RESTRICTIONS AND LIMITATIONS ios minimal version 5.0. Supported architectures: armv7 (ios Device) i386 (ios Device Simulator) The background mode does not work on ios Device Simulator. 2013 ABTO Software VoIP SIP SDK www.voipsipsdk.com Skype: sales.abto.software 4
TECHNICAL BACKGROUND ABTO Software s VoIP SIP SDK is provided as a framework. This means that it can be easily added into the X-code project by simply dragging AbtoSipClientWrapper.embeddedframework directory from the Finder window to the project navigator. No additional work is required. The framework folder name is "AbtoSipClientWrapper.embeddedframework". The embedded framework means that package contains some resources needed by framework itself. ABTO Software s VoIP SIP SDK is based on the event driven approaches. The UA (User Agent) application is supposed to handle events issued by the VoIP engine. There are two types of events: global events (e.g. connection status change) per session events (e.g. call state change) The entire SDK implements only two classes: AbtoVoipInterface AbtoVoipSession 2013 ABTO Software VoIP SIP SDK www.voipsipsdk.com Skype: sales.abto.software 5
Pic.1. Class diagram. AbtoVoipInterface is a namespace (class with no per instance methods) which implements global functions. The entire initialization is distributed in time (Pic. 2): basic initialization various global parameters settings final initialization 2013 ABTO Software VoIP SIP SDK www.voipsipsdk.com Skype: sales.abto.software 6
Client AbtoVoipInterface Initialize SetLocalPort SetSTUN... FinalizeConfiguration Pic. 2. Library initialization. Once the library is initialized You are ready to register on the SIP server. Registration is required to be able establish and accept calls. The registration and call flows are depicted on Pic. 3. 2013 ABTO Software VoIP SIP SDK www.voipsipsdk.com Skype: sales.abto.software 7
Client AbtoVoipInterface AbtoVoipSession LogInOnServer onconnectionstatuschange create (private) oninvite notify(ringing) answercall notify(callinprogress) hangupcall notify(hangedup) StartVoiceCall create(private) notify(dialing) notify(callinprogress) hangupcall notify(hangedup) Pic. 3. Registration and call handling. 2013 ABTO Software VoIP SIP SDK www.voipsipsdk.com Skype: sales.abto.software 8
API Abto VoIP Interface +(BOOL) abtoinitialize:(id <AbtoVoipInterfaceObserver>) observer This function should be called when application starts to initialize the framework. The client must provide global events observer (delegate) which conforms to class (protocol) AbtoVoipInterfaceObserver. +(BOOL) abtologinonserver:(nsstring*) address username:(nsstring*) login password:(nsstring*) passwd Register on SIP server. In this case default SIP port (5060) is used. Arguments: address SIP server IP (or host name) login client id passwd password Return value. +(BOOL) abtologinonserver:(nsstring*) address port:(nsstring*) port username:(nsstring*) login password:(nsstring*) passwd Register on SIP server. Arguments address SIP server IP (or host name) port srver port login client id passwd password Return value. +(BOOL) abtologout Unregister from SIP server. +(void)keepawake:(bool)enable Call this method to be able accept incoming calls while application is in background. Argument. enable YES enable background mode. NO disable. Call this method from UIApplication::applicationWillEnterForeground with enable equal YES to enable background mode. And from method UIApplication::applicationWillEnterForeground with enable equal NO to 2013 ABTO Software VoIP SIP SDK www.voipsipsdk.com Skype: sales.abto.software 9
disable. +(id <AbtoVoipSession>) abtostartvoicecall:(nsstring *) destination notify:(id<abtovoipsessionobserver>)observer; Start voice call. Arguments. destination observer Return value. remote party id (doesn't include @host) session event observer (delegate) which conforms with AbtoVoipSessionObserver class (protocol) +(id <AbtoVoipSession>)abtoStartVideoCall:(NSString *) destination notify:(id<abtovoipsessionobserver>)observer; Not yet supported. +(void)abtoclosesession:(id <AbtoVoipSession>)session Delete session object. Arguments: session active session to be closed Retun value +(void)abtoringbacktoneplayenable:(bool) enable Enable/disable playing ringback tone when calling to remote party. +(void)abtoringtoneplayenable:(bool) enable Enable/disable playing ringtone when calling to remote party. +(BOOL)abtoMuteSpeaker:(BOOL)mute Mute/unmute speaker. Abto VoIP Interface Observer The client should provide AbtoVoipInterfaceObserver instance to handle VoIP framework events. This object must implement the methods below: -(void)onnetworkevent:(abtonetworkevent)event Called on network event -(void)onconnectionstatuschange:(abtosipclientconnectionstatus)status Called when connection/registration status changed. 2013 ABTO Software VoIP SIP SDK www.voipsipsdk.com Skype: sales.abto.software 10
-(void)oninvite:(id <AbtoVoipSession>)session Called on incoming call. The AbtoVoipSession instance is passed as argument. On success return YES. Abto VoIP Session When the client is making or accepting a call the VoIP session object is instantiated. -(BOOL)answerCall Answer incoming call. -(BOOL)hangUpCall Hang up or reject call. -(BOOL)holdCall Put call on hold. -(BOOL)resumeCall Resume previously held call. -(void)setobserver:(id<abtovoipsessionobserver>)observer Before session becomes active (incoming call accepted or outgoing call started) client must provide session observer (delegate). -(NSString*)remotePartyNumber Get remote party number (id). -(AbtoVoipSessionType)type Get session type: voice or video. -(AbtoSessionState)state Get session state. Abto VoIP Session Observer To properly handle VoIP sesstion events UA application must provide class which inherits the AbtoVoipSessionObserver. Class (protocol). Required methods: 2013 ABTO Software VoIP SIP SDK www.voipsipsdk.com Skype: sales.abto.software 11
-(BOOL)notify:(AbtoSessionEvent)event; Called on every session status change. -(void)setsession:(id<abtovoipsession>)session Set session 2013 ABTO Software VoIP SIP SDK www.voipsipsdk.com Skype: sales.abto.software 12