mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-19 12:08:11 +00:00
119 lines
3 KiB
Text
119 lines
3 KiB
Text
/**
|
|
* @mainpage
|
|
*
|
|
* @see http://www.linphone.org
|
|
*
|
|
* @section what_is_it What is liblinphone
|
|
*
|
|
* Liblinphone is a high level library for bringing SIP video call functionnality
|
|
* into an application. It aims at making easy the integration of the SIP
|
|
* video calls into any applications. All variants of linphone are directly based
|
|
* on it:
|
|
* - linphone (gtk interface)
|
|
*
|
|
* - linphonec (console interface)
|
|
*
|
|
* Liblinphone is GPL (see COPYING file). Please understand the licencing details
|
|
* before using it!
|
|
*
|
|
* For any use of this library beyond the rights granted to you by the
|
|
* GPL license, please contact Belledonne Communications
|
|
* (contact@belledonne-communications.com)
|
|
*
|
|
*
|
|
**/
|
|
|
|
/**
|
|
* @page liblinphone_license COPYING
|
|
* @verbinclude COPYING
|
|
*/
|
|
|
|
/**
|
|
* @defgroup tutorial_liblinphone Tutorial: Placing and receiving calls with liblinphone
|
|
*
|
|
|
|
<H1>Initialize liblinphone</H1>
|
|
|
|
The first thing to do is to initialize the library passing it a set of callbacks functions to receive
|
|
various notifications: incoming calls, progress of calls etc...
|
|
These callbacks are all grouped in the LinphoneCoreVTable structure.
|
|
All are optionnals (use NULL if you don't need them).
|
|
The following code shows how initialize liblinphone:
|
|
|
|
<PRE>
|
|
##include <linphonecore.h>
|
|
|
|
//callback function for notification of incoming calls
|
|
static void on_invite_recv(LinphoneCore *lc, const char *from){
|
|
printf("Receiving a call from %s\n",from);
|
|
}
|
|
|
|
//callback function for notification end of calls (by remote)
|
|
static void on_bye_recv(LinphoneCore *lc, const char *from){
|
|
printf("Remote end hangup\n");
|
|
}
|
|
|
|
/
|
|
static void on_display_status(LinphoneCore *lc, const char *msg){
|
|
printf("%s",msg);
|
|
}
|
|
|
|
int main(int argc, char *argv[]){
|
|
LinphoneCoreVTable vtable;
|
|
|
|
memset(&vtable,0,sizeof(vtable));
|
|
vtable.inv_recv=&on_invite_recv;
|
|
vtable.bye_recv=&on_bye_recv;
|
|
vtable.display_status=&on_display_status;
|
|
|
|
}
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
/**
|
|
* @defgroup initializing Initialization and destruction
|
|
*
|
|
**/
|
|
|
|
/**
|
|
* @defgroup call_control Call control
|
|
*
|
|
* The application can initiate outgoing calls with linphone_core_invite().
|
|
* It is notified of incoming call thanks to the inv_recv callback of the LinphoneCoreVTable
|
|
* structure that is passed at creation of the LinphoneCore object.
|
|
* It can then answer calls with linphone_core_accept_call().
|
|
* Calls can be terminated or declined with linphone_core_terminate_call().
|
|
* The application is notified when the remote party hangups thanks to
|
|
* bye_recv callback of the #LinphoneCoreVTable.
|
|
**/
|
|
|
|
/**
|
|
* @defgroup media_parameters Controlling media parameters
|
|
**/
|
|
|
|
/**
|
|
* @defgroup proxies Managing proxies
|
|
**/
|
|
|
|
/**
|
|
* @defgroup network_parameters Controlling network parameters (ports, mtu...)
|
|
**/
|
|
|
|
/**
|
|
* @defgroup authentication Managing authentication: userid and passwords
|
|
**/
|
|
|
|
/**
|
|
* @defgroup call_logs Managing call logs
|
|
**/
|
|
|
|
/**
|
|
* @defgroup linphone_address SIP address parser API.
|
|
* This api is useful for manipulating SIP addresses ('from' or 'to' headers).
|
|
**/
|
|
|
|
/**
|
|
* @defgroup misc Miscenalleous: logs, version strings, config storage
|
|
**/
|