doxygen.dox 7.94 KB
 jehan committed Oct 07, 2010 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 /** * @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 initializing Initializing liblinphone **/ /** * @defgroup call_control Placing and receiving calls **/ /** * @defgroup media_parameters Controlling media parameters **/ /** * @defgroup proxies Managing proxies  jehan committed Oct 11, 2010 45 46  *User registration is controled by #LinphoneProxyConfig settings.
Each #LinphoneProxyConfig object can be configured with registration informations *like \link linphone_proxy_config_set_server_addr() proxy address \endlink , \link linphone_proxy_config_set_identity() user id \endlink, \link linphone_proxy_config_expires() refresh period \endlink, and so on.  jehan committed Oct 07, 2010 47 48 49 50  *
A created proxy config using linphone_proxy_config_new(), once configured, must be added to #LinphoneCore using function linphone_core_add_proxy_config(). *
It is recommended to set a default \link #LinphoneProxyConfig proxy config \endlink using function linphone_core_set_default_proxy(). Once done, if \link #LinphoneProxyConfig a proxy config \endlink has been configured with attribute \link linphone_proxy_config_enable_register() enable register \endlink , next call to linphone_core_iterate() triggers a SIP register. *
Registration status is reported by #LinphoneRegistrationStateCb. *
 jehan committed Oct 11, 2010 51  *
This pseudo code demonstrates basic registration operations:  jehan committed Oct 07, 2010 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86  *
* Registration sate call back: \code static void registration_state_changed(struct _LinphoneCore *lc, LinphoneProxyConfig *cfg, LinphoneRegistrationState cstate, const char *message){ printf("New registration state %s for user id [%s] at proxy [%s]\n" ,linphone_registration_state_to_string(cstate) ,linphone_proxy_config_get_identity(cfg) ,linphone_proxy_config_get_addr(cfg)); } \endcode *
Authentication: *
Most of the time, registration requires \ref authentication "authentication" to succed. #LinphoneAuthInfo info must be either added to #LinphoneCore using function linphone_core_add_auth_info() before #LinphoneProxyConfig is added to Linphone core, or on demand from call back #AuthInfoRequested . *
*
Unregistration:  jehan committed Oct 11, 2010 87 88  *
Unregistration or any changes to #LinphoneProxyConfig must be first started by a call to function linphone_proxy_config_edit() and validated by function linphone_proxy_config_done() *
This pseudo code shows how to unregister a user associated to a #LinphoneProxyConfig  jehan committed Oct 07, 2010 89 90 91 92 93 94  *\code LinphoneProxyConfig* proxy_cfg; linphone_core_get_default_proxy(lc,&proxy_cfg); /* get default proxy config*/ linphone_proxy_config_edit(proxy_cfg); /*start editing proxy configuration*/ linphone_proxy_config_enable_register(proxy_cfg,FALSE); /*de-activate registration for this proxy config*/ linphone_proxy_config_done(proxy_cfg); /*initiate REGISTER with expire = 0*/  jehan committed Oct 14, 2010 95 \endcode  jehan committed Oct 07, 2010 96 
 jehan committed Oct 14, 2010 97  A complete tutorial can be found at : \ref registration_tutorials "Registration tutorial"  jehan committed Oct 07, 2010 98 99 100 101 102 103 104 105 106 107 **/ /** * @defgroup network_parameters Controlling network parameters (ports, mtu...) **/ /** * @defgroup authentication Managing authentication: userid and passwords **/  jehan committed Oct 08, 2010 108 /**  jehan committed Oct 14, 2010 109 110 111 * @defgroup buddy_list Managing Buddies and buddy list and presence Buddies and buddy list
Each buddy is represented by a #LinphoneFriend object created by function linphone_friend_new().  jehan committed Oct 15, 2010 112 Buddy configuration parameters like \link linphone_friend_set_addr() sip uri \endlink or \link linphone_friend_set_inc_subscribe_policy() status publication \endlink policy for this \link #LinphoneFriend friend \endlink are configurable for each buddy.  jehan committed Oct 14, 2010 113 114 115 116 117 
Here under a typical buddy creation:
\code LinphoneFriend* my_friend=linphone_friend_new_with_addr("sip:joe@sip.linphone.org"); /*creates friend object for buddy joe*/ linphone_friend_enable_subscribes(my_friend,TRUE); /*configure this friend to emit SUBSCRIBE message after being added to LinphoneCore*/  jehan committed Oct 15, 2010 118 linphone_friend_set_inc_subscribe_policy(my_friend,LinphoneSPAccept); /* accept Incoming subscription request for this friend*/  jehan committed Oct 14, 2010 119 120 121 122 123 124 125 126 127 128 129 130 \endcode \link #LinphoneFriend friends \endlink status changes are reported by callback LinphoneCoreVTable.notify_presence_recv \code static void notify_presence_recv_updated (struct _LinphoneCore *lc, LinphoneFriend *friend) { const LinphoneAddress* friend_address = linphone_friend_get_address(friend); printf("New state state [%s] for user id [%s] \n" ,linphone_online_status_to_string(linphone_friend_get_status(friend)) ,linphone_address_as_string (friend_address)); } \endcode
 jehan committed Oct 15, 2010 131 Any subsequente modifications to #LinphoneFriend must be first started by a call to function linphone_friend_edit() and validated by function linphone_friend_done()  jehan committed Oct 14, 2010 132 133 134 135 136 137 138 139 \code linphone_friend_edit(my_friend); /* start editing friend */ linphone_friend_enable_subscribes(my_friend,FALSE); /*disable subscription for this friend*/ linphone_friend_done(my_friend); /*commit changes triggering an UNSUBSCRIBE message*/ \endcode Publishing presence status  jehan committed Oct 15, 2010 140 
Local presence status can be changed using function linphone_core_set_presence_info() .New status is propagated to all friends \link linphone_core_add_friend() previously added \endlink to #LinphoneCore.  jehan committed Oct 14, 2010 141 142  Handling incoming subscription request  jehan committed Oct 15, 2010 143 144 
For incoming request comming from an unknown buddy, the call back LinphoneCoreVTable.new_subscription_request is invoked.  jehan committed Oct 14, 2010 145 146 147 148 
A complete tutorial can be found at : \ref buddy_tutorials "Registration tutorial"  jehan committed Oct 08, 2010 149 150 151 */  jehan committed Oct 07, 2010 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 /** * @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 **/ /** * @defgroup tutorials Tutorials: * **/