Liblinphone  3.11.1
Macros | Typedefs | Enumerations | Functions
Managing Buddies and buddy list and presence

Macros

#define linphone_friend_new_with_addr   linphone_friend_new_with_address
 
#define linphone_friend_set_addr   linphone_friend_set_address
 
#define linphone_friend_get_send_subscribe   linphone_friend_subscribes_enabled
 
#define linphone_friend_send_subscribe   linphone_friend_enable_subscribes
 

Typedefs

typedef void(* LinphoneFriendListCbsContactCreatedCb) (LinphoneFriendList *list, LinphoneFriend *lf)
 
typedef void(* LinphoneFriendListCbsContactDeletedCb) (LinphoneFriendList *list, LinphoneFriend *lf)
 
typedef void(* LinphoneFriendListCbsContactUpdatedCb) (LinphoneFriendList *list, LinphoneFriend *new_friend, LinphoneFriend *old_friend)
 
typedef void(* LinphoneFriendListCbsSyncStateChangedCb) (LinphoneFriendList *list, LinphoneFriendListSyncStatus status, const char *msg)
 
typedef struct _LinphoneFriend LinphoneFriend
 
typedef struct _LinphoneFriendList LinphoneFriendList
 
typedef struct _LinphoneFriendListCbs LinphoneFriendListCbs
 
typedef enum _LinphoneFriendListStatus LinphoneFriendListStatus
 
typedef enum _LinphoneFriendListSyncStatus LinphoneFriendListSyncStatus
 
typedef struct _LinphonePresenceActivity LinphonePresenceActivity
 
typedef enum LinphonePresenceActivityType LinphonePresenceActivityType
 
typedef enum LinphonePresenceBasicStatus LinphonePresenceBasicStatus
 
typedef struct _LinphonePresenceModel LinphonePresenceModel
 
typedef struct _LinphonePresenceNote LinphonePresenceNote
 
typedef struct _LinphonePresencePerson LinphonePresencePerson
 
typedef struct _LinphonePresenceService LinphonePresenceService
 
typedef enum _LinphoneSubscribePolicy LinphoneSubscribePolicy
 

Enumerations

enum  _LinphoneFriendListStatus {
  LinphoneFriendListOK,
  LinphoneFriendListNonExistentFriend,
  LinphoneFriendListInvalidFriend
}
 
enum  _LinphoneFriendListSyncStatus {
  LinphoneFriendListSyncStarted,
  LinphoneFriendListSyncSuccessful,
  LinphoneFriendListSyncFailure
}
 
enum  LinphonePresenceActivityType {
  LinphonePresenceActivityOffline,
  LinphonePresenceActivityOnline,
  LinphonePresenceActivityAppointment,
  LinphonePresenceActivityAway,
  LinphonePresenceActivityBreakfast,
  LinphonePresenceActivityBusy,
  LinphonePresenceActivityDinner,
  LinphonePresenceActivityHoliday,
  LinphonePresenceActivityInTransit,
  LinphonePresenceActivityLookingForWork,
  LinphonePresenceActivityLunch,
  LinphonePresenceActivityMeal,
  LinphonePresenceActivityMeeting,
  LinphonePresenceActivityOnThePhone,
  LinphonePresenceActivityOther,
  LinphonePresenceActivityPerformance,
  LinphonePresenceActivityPermanentAbsence,
  LinphonePresenceActivityPlaying,
  LinphonePresenceActivityPresentation,
  LinphonePresenceActivityShopping,
  LinphonePresenceActivitySleeping,
  LinphonePresenceActivitySpectator,
  LinphonePresenceActivitySteering,
  LinphonePresenceActivityTravel,
  LinphonePresenceActivityTV,
  LinphonePresenceActivityUnknown,
  LinphonePresenceActivityVacation,
  LinphonePresenceActivityWorking,
  LinphonePresenceActivityWorship
}
 
enum  LinphonePresenceBasicStatus {
  LinphonePresenceBasicStatusOpen,
  LinphonePresenceBasicStatusClosed
}
 
enum  _LinphoneSubscribePolicy {
  LinphoneSPWait,
  LinphoneSPDeny,
  LinphoneSPAccept
}
 

Functions

LinphoneFriendlinphone_core_create_friend (LinphoneCore *lc)
 
LinphoneFriendlinphone_core_create_friend_with_address (LinphoneCore *lc, const char *address)
 
void linphone_core_set_presence_info (LinphoneCore *lc, int minutes_away, const char *alternative_contact, LinphoneOnlineStatus os)
 
void linphone_core_set_presence_model (LinphoneCore *lc, LinphonePresenceModel *presence)
 
LinphoneOnlineStatus linphone_core_get_presence_info (const LinphoneCore *lc)
 
LinphonePresenceModellinphone_core_get_presence_model (const LinphoneCore *lc)
 
void linphone_core_interpret_friend_uri (LinphoneCore *lc, const char *uri, char **result)
 
void linphone_core_add_friend (LinphoneCore *lc, LinphoneFriend *fr)
 
void linphone_core_remove_friend (LinphoneCore *lc, LinphoneFriend *fr)
 
void linphone_core_reject_subscriber (LinphoneCore *lc, LinphoneFriend *lf)
 
const bctbx_list_t * linphone_core_get_friend_list (const LinphoneCore *lc)
 
void linphone_core_notify_all_friends (LinphoneCore *lc, LinphonePresenceModel *presence)
 
LinphoneFriendlinphone_core_get_friend_by_address (const LinphoneCore *lc, const char *addr)
 
LinphoneFriendlinphone_core_find_friend (const LinphoneCore *lc, const LinphoneAddress *addr)
 
LinphoneFriendlinphone_core_get_friend_by_ref_key (const LinphoneCore *lc, const char *key)
 
LinphoneFriendListlinphone_core_create_friend_list (LinphoneCore *lc)
 
void linphone_core_add_friend_list (LinphoneCore *lc, LinphoneFriendList *list)
 
void linphone_core_remove_friend_list (LinphoneCore *lc, LinphoneFriendList *list)
 
const bctbx_list_t * linphone_core_get_friends_lists (const LinphoneCore *lc)
 
LinphoneFriendListlinphone_core_get_default_friend_list (const LinphoneCore *lc)
 
LinphonePresenceActivitylinphone_core_create_presence_activity (LinphoneCore *lc, LinphonePresenceActivityType acttype, const char *description)
 
LinphonePresenceModellinphone_core_create_presence_model (LinphoneCore *lc)
 
LinphonePresenceModellinphone_core_create_presence_model_with_activity (LinphoneCore *lc, LinphonePresenceActivityType acttype, const char *description)
 
LinphonePresenceModellinphone_core_create_presence_model_with_activity_and_note (LinphoneCore *lc, LinphonePresenceActivityType acttype, const char *description, const char *note, const char *lang)
 
LinphonePresenceNotelinphone_core_create_presence_note (LinphoneCore *lc, const char *content, const char *lang)
 
LinphonePresencePersonlinphone_core_create_presence_person (LinphoneCore *lc, const char *id)
 
LinphonePresenceServicelinphone_core_create_presence_service (LinphoneCore *lc, const char *id, LinphonePresenceBasicStatus basic_status, const char *contact)
 
LINPHONE_DEPRECATED LinphoneFriendlinphone_friend_new (void)
 
LINPHONE_DEPRECATED LinphoneFriendlinphone_friend_new_with_address (const char *addr)
 
void linphone_friend_destroy (LinphoneFriend *lf)
 
int linphone_friend_set_address (LinphoneFriend *fr, const LinphoneAddress *address)
 
const LinphoneAddresslinphone_friend_get_address (const LinphoneFriend *lf)
 
void linphone_friend_add_address (LinphoneFriend *lf, const LinphoneAddress *addr)
 
const bctbx_list_t * linphone_friend_get_addresses (const LinphoneFriend *lf)
 
void linphone_friend_remove_address (LinphoneFriend *lf, const LinphoneAddress *addr)
 
void linphone_friend_add_phone_number (LinphoneFriend *lf, const char *phone)
 
bctbx_list_t * linphone_friend_get_phone_numbers (LinphoneFriend *lf)
 
void linphone_friend_remove_phone_number (LinphoneFriend *lf, const char *phone)
 
int linphone_friend_set_name (LinphoneFriend *lf, const char *name)
 
const char * linphone_friend_get_name (const LinphoneFriend *lf)
 
bool_t linphone_friend_subscribes_enabled (const LinphoneFriend *lf)
 
int linphone_friend_enable_subscribes (LinphoneFriend *fr, bool_t val)
 
int linphone_friend_set_inc_subscribe_policy (LinphoneFriend *fr, LinphoneSubscribePolicy pol)
 
LinphoneSubscribePolicy linphone_friend_get_inc_subscribe_policy (const LinphoneFriend *lf)
 
void linphone_friend_edit (LinphoneFriend *fr)
 
void linphone_friend_done (LinphoneFriend *fr)
 
LinphoneOnlineStatus linphone_friend_get_status (const LinphoneFriend *lf)
 
LinphoneSubscriptionState linphone_friend_get_subscription_state (const LinphoneFriend *lf)
 
const LinphonePresenceModellinphone_friend_get_presence_model (const LinphoneFriend *lf)
 
const LinphonePresenceModellinphone_friend_get_presence_model_for_uri_or_tel (const LinphoneFriend *lf, const char *uri_or_tel)
 
void linphone_friend_set_presence_model (LinphoneFriend *lf, LinphonePresenceModel *presence)
 
void linphone_friend_set_presence_model_for_uri_or_tel (LinphoneFriend *lf, const char *uri_or_tel, LinphonePresenceModel *presence)
 
bool_t linphone_friend_is_presence_received (const LinphoneFriend *lf)
 
void linphone_friend_set_user_data (LinphoneFriend *lf, void *data)
 
void * linphone_friend_get_user_data (const LinphoneFriend *lf)
 
BuddyInfolinphone_friend_get_info (const LinphoneFriend *lf)
 
void linphone_friend_set_ref_key (LinphoneFriend *lf, const char *key)
 
const char * linphone_friend_get_ref_key (const LinphoneFriend *lf)
 
bool_t linphone_friend_in_list (const LinphoneFriend *lf)
 
LinphoneFriendlinphone_friend_ref (LinphoneFriend *lf)
 
void linphone_friend_unref (LinphoneFriend *lf)
 
LinphoneCorelinphone_friend_get_core (const LinphoneFriend *fr)
 
LinphoneVcardlinphone_friend_get_vcard (LinphoneFriend *fr)
 
void linphone_friend_set_vcard (LinphoneFriend *fr, LinphoneVcard *vcard)
 
bool_t linphone_friend_create_vcard (LinphoneFriend *fr, const char *name)
 
LinphoneFriendlinphone_friend_new_from_vcard (LinphoneVcard *vcard)
 
void linphone_friend_save (LinphoneFriend *fr, LinphoneCore *lc)
 
LinphoneFriendListlinphone_friend_list_ref (LinphoneFriendList *list)
 
void linphone_friend_list_unref (LinphoneFriendList *list)
 
void * linphone_friend_list_get_user_data (const LinphoneFriendList *list)
 
void linphone_friend_list_set_user_data (LinphoneFriendList *list, void *ud)
 
const char * linphone_friend_list_get_display_name (const LinphoneFriendList *list)
 
void linphone_friend_list_set_display_name (LinphoneFriendList *list, const char *display_name)
 
const char * linphone_friend_list_get_rls_uri (const LinphoneFriendList *list)
 
void linphone_friend_list_set_rls_uri (LinphoneFriendList *list, const char *rls_uri)
 
const LinphoneAddresslinphone_friend_list_get_rls_address (const LinphoneFriendList *list)
 
void linphone_friend_list_set_rls_address (LinphoneFriendList *list, const LinphoneAddress *rls_addr)
 
LinphoneFriendListStatus linphone_friend_list_add_friend (LinphoneFriendList *list, LinphoneFriend *lf)
 
LinphoneFriendListStatus linphone_friend_list_add_local_friend (LinphoneFriendList *list, LinphoneFriend *lf)
 
LinphoneFriendListStatus linphone_friend_list_remove_friend (LinphoneFriendList *list, LinphoneFriend *lf)
 
const bctbx_list_t * linphone_friend_list_get_friends (const LinphoneFriendList *list)
 
LinphoneFriendlinphone_friend_list_find_friend_by_address (const LinphoneFriendList *list, const LinphoneAddress *address)
 
LinphoneFriendlinphone_friend_list_find_friend_by_uri (const LinphoneFriendList *list, const char *uri)
 
LinphoneFriendlinphone_friend_list_find_friend_by_ref_key (const LinphoneFriendList *list, const char *ref_key)
 
void linphone_friend_list_update_subscriptions (LinphoneFriendList *list)
 
void linphone_friend_list_notify_presence (LinphoneFriendList *list, LinphonePresenceModel *presence)
 
const char * linphone_friend_list_get_uri (const LinphoneFriendList *list)
 
void linphone_friend_list_set_uri (LinphoneFriendList *list, const char *uri)
 
void linphone_friend_list_update_revision (LinphoneFriendList *list, int rev)
 
LinphoneFriendListCbslinphone_friend_list_get_callbacks (const LinphoneFriendList *list)
 
LinphoneFriendListCbslinphone_friend_list_cbs_ref (LinphoneFriendListCbs *cbs)
 
void linphone_friend_list_cbs_unref (LinphoneFriendListCbs *cbs)
 
void * linphone_friend_list_cbs_get_user_data (const LinphoneFriendListCbs *cbs)
 
void linphone_friend_list_cbs_set_user_data (LinphoneFriendListCbs *cbs, void *ud)
 
LinphoneFriendListCbsContactCreatedCb linphone_friend_list_cbs_get_contact_created (const LinphoneFriendListCbs *cbs)
 
void linphone_friend_list_cbs_set_contact_created (LinphoneFriendListCbs *cbs, LinphoneFriendListCbsContactCreatedCb cb)
 
LinphoneFriendListCbsContactDeletedCb linphone_friend_list_cbs_get_contact_deleted (const LinphoneFriendListCbs *cbs)
 
void linphone_friend_list_cbs_set_contact_deleted (LinphoneFriendListCbs *cbs, LinphoneFriendListCbsContactDeletedCb cb)
 
LinphoneFriendListCbsContactUpdatedCb linphone_friend_list_cbs_get_contact_updated (const LinphoneFriendListCbs *cbs)
 
void linphone_friend_list_cbs_set_contact_updated (LinphoneFriendListCbs *cbs, LinphoneFriendListCbsContactUpdatedCb cb)
 
LinphoneFriendListCbsSyncStateChangedCb linphone_friend_list_cbs_get_sync_status_changed (const LinphoneFriendListCbs *cbs)
 
void linphone_friend_list_cbs_set_sync_status_changed (LinphoneFriendListCbs *cbs, LinphoneFriendListCbsSyncStateChangedCb cb)
 
void linphone_friend_list_synchronize_friends_from_server (LinphoneFriendList *list)
 
void linphone_friend_list_update_dirty_friends (LinphoneFriendList *list)
 
LinphoneCorelinphone_friend_list_get_core (const LinphoneFriendList *list)
 
int linphone_friend_list_import_friends_from_vcard4_file (LinphoneFriendList *list, const char *vcard_file)
 
int linphone_friend_list_import_friends_from_vcard4_buffer (LinphoneFriendList *list, const char *vcard_buffer)
 
void linphone_friend_list_export_friends_as_vcard4_file (LinphoneFriendList *list, const char *vcard_file)
 
void linphone_friend_list_enable_subscriptions (LinphoneFriendList *list, bool_t enabled)
 
LinphonePresenceModellinphone_presence_model_new_with_activity (LinphonePresenceActivityType activity, const char *description)
 
LinphonePresenceModellinphone_presence_model_new_with_activity_and_note (LinphonePresenceActivityType activity, const char *description, const char *note, const char *lang)
 
LinphonePresenceBasicStatus linphone_presence_model_get_basic_status (const LinphonePresenceModel *model)
 
int linphone_presence_model_set_basic_status (LinphonePresenceModel *model, LinphonePresenceBasicStatus basic_status)
 
time_t linphone_presence_model_get_timestamp (const LinphonePresenceModel *model)
 
char * linphone_presence_model_get_contact (const LinphonePresenceModel *model)
 
int linphone_presence_model_set_contact (LinphonePresenceModel *model, const char *contact)
 
int linphone_presence_model_set_presentity (LinphonePresenceModel *model, const LinphoneAddress *presentity)
 
const LinphoneAddresslinphone_presence_model_get_presentity (const LinphonePresenceModel *model)
 
LinphonePresenceActivitylinphone_presence_model_get_activity (const LinphonePresenceModel *model)
 
int linphone_presence_model_set_activity (LinphonePresenceModel *model, LinphonePresenceActivityType activity, const char *description)
 
unsigned int linphone_presence_model_get_nb_activities (const LinphonePresenceModel *model)
 
LinphonePresenceActivitylinphone_presence_model_get_nth_activity (const LinphonePresenceModel *model, unsigned int idx)
 
int linphone_presence_model_add_activity (LinphonePresenceModel *model, LinphonePresenceActivity *activity)
 
int linphone_presence_model_clear_activities (LinphonePresenceModel *model)
 
LinphonePresenceNotelinphone_presence_model_get_note (const LinphonePresenceModel *model, const char *lang)
 
int linphone_presence_model_add_note (LinphonePresenceModel *model, const char *note_content, const char *lang)
 
int linphone_presence_model_clear_notes (LinphonePresenceModel *model)
 
LinphonePresenceModellinphone_presence_model_new (void)
 
unsigned int linphone_presence_model_get_nb_services (const LinphonePresenceModel *model)
 
LinphonePresenceServicelinphone_presence_model_get_nth_service (const LinphonePresenceModel *model, unsigned int idx)
 
int linphone_presence_model_add_service (LinphonePresenceModel *model, LinphonePresenceService *service)
 
int linphone_presence_model_clear_services (LinphonePresenceModel *model)
 
unsigned int linphone_presence_model_get_nb_persons (const LinphonePresenceModel *model)
 
LinphonePresencePersonlinphone_presence_model_get_nth_person (const LinphonePresenceModel *model, unsigned int idx)
 
int linphone_presence_model_add_person (LinphonePresenceModel *model, LinphonePresencePerson *person)
 
int linphone_presence_model_clear_persons (LinphonePresenceModel *model)
 
LinphonePresenceServicelinphone_presence_service_new (const char *id, LinphonePresenceBasicStatus basic_status, const char *contact)
 
char * linphone_presence_service_get_id (const LinphonePresenceService *service)
 
int linphone_presence_service_set_id (LinphonePresenceService *service, const char *id)
 
LinphonePresenceBasicStatus linphone_presence_service_get_basic_status (const LinphonePresenceService *service)
 
int linphone_presence_service_set_basic_status (LinphonePresenceService *service, LinphonePresenceBasicStatus basic_status)
 
char * linphone_presence_service_get_contact (const LinphonePresenceService *service)
 
int linphone_presence_service_set_contact (LinphonePresenceService *service, const char *contact)
 
unsigned int linphone_presence_service_get_nb_notes (const LinphonePresenceService *service)
 
LinphonePresenceNotelinphone_presence_service_get_nth_note (const LinphonePresenceService *service, unsigned int idx)
 
int linphone_presence_service_add_note (LinphonePresenceService *service, LinphonePresenceNote *note)
 
int linphone_presence_service_clear_notes (LinphonePresenceService *service)
 
LinphonePresencePersonlinphone_presence_person_new (const char *id)
 
char * linphone_presence_person_get_id (const LinphonePresencePerson *person)
 
int linphone_presence_person_set_id (LinphonePresencePerson *person, const char *id)
 
unsigned int linphone_presence_person_get_nb_activities (const LinphonePresencePerson *person)
 
LinphonePresenceActivitylinphone_presence_person_get_nth_activity (const LinphonePresencePerson *person, unsigned int idx)
 
int linphone_presence_person_add_activity (LinphonePresencePerson *person, LinphonePresenceActivity *activity)
 
int linphone_presence_person_clear_activities (LinphonePresencePerson *person)
 
unsigned int linphone_presence_person_get_nb_notes (const LinphonePresencePerson *person)
 
LinphonePresenceNotelinphone_presence_person_get_nth_note (const LinphonePresencePerson *person, unsigned int idx)
 
int linphone_presence_person_add_note (LinphonePresencePerson *person, LinphonePresenceNote *note)
 
int linphone_presence_person_clear_notes (LinphonePresencePerson *person)
 
unsigned int linphone_presence_person_get_nb_activities_notes (const LinphonePresencePerson *person)
 
LinphonePresenceNotelinphone_presence_person_get_nth_activities_note (const LinphonePresencePerson *person, unsigned int idx)
 
int linphone_presence_person_add_activities_note (LinphonePresencePerson *person, LinphonePresenceNote *note)
 
int linphone_presence_person_clear_activities_notes (LinphonePresencePerson *person)
 
LinphonePresenceActivitylinphone_presence_activity_new (LinphonePresenceActivityType acttype, const char *description)
 
char * linphone_presence_activity_to_string (const LinphonePresenceActivity *activity)
 
LinphonePresenceActivityType linphone_presence_activity_get_type (const LinphonePresenceActivity *activity)
 
int linphone_presence_activity_set_type (LinphonePresenceActivity *activity, LinphonePresenceActivityType acttype)
 
const char * linphone_presence_activity_get_description (const LinphonePresenceActivity *activity)
 
int linphone_presence_activity_set_description (LinphonePresenceActivity *activity, const char *description)
 
LinphonePresenceNotelinphone_presence_note_new (const char *content, const char *lang)
 
const char * linphone_presence_note_get_content (const LinphonePresenceNote *note)
 
int linphone_presence_note_set_content (LinphonePresenceNote *note, const char *content)
 
const char * linphone_presence_note_get_lang (const LinphonePresenceNote *note)
 
int linphone_presence_note_set_lang (LinphonePresenceNote *note, const char *lang)
 
LinphonePresenceModellinphone_presence_model_ref (LinphonePresenceModel *model)
 
LinphonePresenceModellinphone_presence_model_unref (LinphonePresenceModel *model)
 
void linphone_presence_model_set_user_data (LinphonePresenceModel *model, void *user_data)
 
void * linphone_presence_model_get_user_data (const LinphonePresenceModel *model)
 
LinphonePresenceServicelinphone_presence_service_ref (LinphonePresenceService *service)
 
LinphonePresenceServicelinphone_presence_service_unref (LinphonePresenceService *service)
 
void linphone_presence_service_set_user_data (LinphonePresenceService *service, void *user_data)
 
void * linphone_presence_service_get_user_data (const LinphonePresenceService *service)
 
LinphonePresencePersonlinphone_presence_person_ref (LinphonePresencePerson *person)
 
LinphonePresencePersonlinphone_presence_person_unref (LinphonePresencePerson *person)
 
void linphone_presence_person_set_user_data (LinphonePresencePerson *person, void *user_data)
 
void * linphone_presence_person_get_user_data (const LinphonePresencePerson *person)
 
LinphonePresenceActivitylinphone_presence_activity_ref (LinphonePresenceActivity *activity)
 
LinphonePresenceActivitylinphone_presence_activity_unref (LinphonePresenceActivity *activity)
 
void linphone_presence_activity_set_user_data (LinphonePresenceActivity *activity, void *user_data)
 
void * linphone_presence_activity_get_user_data (const LinphonePresenceActivity *activity)
 
LinphonePresenceNotelinphone_presence_note_ref (LinphonePresenceNote *note)
 
LinphonePresenceNotelinphone_presence_note_unref (LinphonePresenceNote *note)
 
void linphone_presence_note_set_user_data (LinphonePresenceNote *note, void *user_data)
 
void * linphone_presence_note_get_user_data (const LinphonePresenceNote *note)
 

Detailed Description

Buddies and buddy list
Each buddy is represented by a LinphoneFriend object created by function linphone_friend_new(). Buddy configuration parameters like sip uri or status publication policy for this friend are configurable for each buddy.
Here under a typical buddy creation:

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*/
linphone_friend_set_inc_subscribe_policy(my_friend,LinphoneSPAccept); /* accept Incoming subscription request for this friend*/

friends status changes are reported by callback LinphoneCoreVTable.notify_presence_recv

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));
}


Once created a buddy can be added to the buddy list using function linphone_core_add_friend() . Added friends will be notified about local status changes
Any subsequente modifications to LinphoneFriend must be first started by a call to function linphone_friend_edit() and validated by function linphone_friend_done()

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*/

Publishing presence status
Local presence status can be changed using function linphone_core_set_presence_model() .New status is propagated to all friends previously added to LinphoneCore.

Handling incoming subscription request
New incoming subscription requests are process according to the incoming subscription policy state for subscription initiated by members of the buddy list.
For incoming request comming from an unknown buddy, the call back LinphoneCoreVTable.new_subscription_request is invoked.


A complete tutorial can be found at : Registration tutorial

Macro Definition Documentation

§ linphone_friend_new_with_addr

#define linphone_friend_new_with_addr   linphone_friend_new_with_address

§ linphone_friend_set_addr

#define linphone_friend_set_addr   linphone_friend_set_address

Typedef Documentation

§ LinphoneFriend

typedef struct _LinphoneFriend LinphoneFriend

Represents a buddy, all presence actions like subscription and status change notification are performed on this object

§ LinphoneFriendList

typedef struct _LinphoneFriendList LinphoneFriendList

The LinphoneFriendList object representing a list of friends.

§ LinphoneFriendListCbs

typedef struct _LinphoneFriendListCbs LinphoneFriendListCbs

An object to handle the callbacks for LinphoneFriend synchronization.

§ LinphoneFriendListCbsContactCreatedCb

typedef void(* LinphoneFriendListCbsContactCreatedCb) (LinphoneFriendList *list, LinphoneFriend *lf)

Callback used to notify a new contact has been created on the CardDAV server and downloaded locally

Parameters
listThe LinphoneFriendList object the new contact is added to
lfThe LinphoneFriend object that has been created

§ LinphoneFriendListCbsContactDeletedCb

typedef void(* LinphoneFriendListCbsContactDeletedCb) (LinphoneFriendList *list, LinphoneFriend *lf)

Callback used to notify a contact has been deleted on the CardDAV server

Parameters
listThe LinphoneFriendList object a contact has been removed from
lfThe LinphoneFriend object that has been deleted

§ LinphoneFriendListCbsContactUpdatedCb

typedef void(* LinphoneFriendListCbsContactUpdatedCb) (LinphoneFriendList *list, LinphoneFriend *new_friend, LinphoneFriend *old_friend)

Callback used to notify a contact has been updated on the CardDAV server

Parameters
listThe LinphoneFriendList object in which a contact has been updated
new_friendThe new LinphoneFriend object corresponding to the updated contact
old_friendThe old LinphoneFriend object before update

§ LinphoneFriendListCbsSyncStateChangedCb

typedef void(* LinphoneFriendListCbsSyncStateChangedCb) (LinphoneFriendList *list, LinphoneFriendListSyncStatus status, const char *msg)

Callback used to notify the status of the synchronization has changed

Parameters
listThe LinphoneFriendList object for which the status has changed
statusThe new synchronisation status
msgAn additional information on the status update

§ LinphoneFriendListStatus

Enum describing the status of a LinphoneFriendList operation.

§ LinphoneFriendListSyncStatus

Enum describing the status of a CardDAV synchronization

§ LinphonePresenceActivity

typedef struct _LinphonePresenceActivity LinphonePresenceActivity

Presence activity type holding information about a presence activity.

§ LinphonePresenceActivityType

Activities as defined in section 3.2 of RFC 4480

§ LinphonePresenceBasicStatus

Basic status as defined in section 4.1.4 of RFC 3863

§ LinphonePresenceModel

typedef struct _LinphonePresenceModel LinphonePresenceModel

Presence model type holding information about the presence of a person.

§ LinphonePresenceNote

typedef struct _LinphonePresenceNote LinphonePresenceNote

Presence note type holding information about a presence note.

§ LinphonePresencePerson

typedef struct _LinphonePresencePerson LinphonePresencePerson

Presence person holding information about a presence person.

§ LinphonePresenceService

typedef struct _LinphonePresenceService LinphonePresenceService

Presence service type holding information about a presence service.

§ LinphoneSubscribePolicy

Enum controlling behavior for incoming subscription request. Use by linphone_friend_set_inc_subscribe_policy()

Enumeration Type Documentation

§ _LinphoneFriendListStatus

Enum describing the status of a LinphoneFriendList operation.

§ _LinphoneFriendListSyncStatus

Enum describing the status of a CardDAV synchronization

§ _LinphoneSubscribePolicy

Enum controlling behavior for incoming subscription request. Use by linphone_friend_set_inc_subscribe_policy()

Enumerator
LinphoneSPWait 

Does not automatically accept an incoming subscription request. This policy implies that a decision has to be taken for each incoming subscription request notified by callback LinphoneCoreVTable.new_subscription_requested

LinphoneSPDeny 

Rejects incoming subscription request

LinphoneSPAccept 

Automatically accepts a subscription request

§ LinphonePresenceActivityType

Activities as defined in section 3.2 of RFC 4480

Enumerator
LinphonePresenceActivityOffline 

This value is not defined in the RFC, it corresponds to no activity with a basic status of "closed".

LinphonePresenceActivityOnline 

This value is not defined in the RFC, it corresponds to no activity with a basic status of "open".

LinphonePresenceActivityAppointment 

The person has a calendar appointment, without specifying exactly of what type. This activity is indicated if more detailed information is not available or the person chooses not to reveal more information.

LinphonePresenceActivityAway 

The person is physically away from all interactive communication devices.

LinphonePresenceActivityBreakfast 

The person is eating the first meal of the day, usually eaten in the morning.

LinphonePresenceActivityBusy 

The person is busy, without further details.

LinphonePresenceActivityDinner 

The person is having his or her main meal of the day, eaten in the evening or at midday.

LinphonePresenceActivityHoliday 

This is a scheduled national or local holiday.

LinphonePresenceActivityInTransit 

The person is riding in a vehicle, such as a car, but not steering.

LinphonePresenceActivityLookingForWork 

The person is looking for (paid) work.

LinphonePresenceActivityLunch 

The person is eating his or her midday meal.

LinphonePresenceActivityMeal 

The person is scheduled for a meal, without specifying whether it is breakfast, lunch, or dinner, or some other meal.

LinphonePresenceActivityMeeting 

The person is in an assembly or gathering of people, as for a business, social, or religious purpose. A meeting is a sub-class of an appointment.

LinphonePresenceActivityOnThePhone 

The person is talking on the telephone.

LinphonePresenceActivityOther 

The person is engaged in an activity with no defined representation. A string describing the activity in plain text SHOULD be provided.

LinphonePresenceActivityPerformance 

A performance is a sub-class of an appointment and includes musical, theatrical, and cinematic performances as well as lectures. It is distinguished from a meeting by the fact that the person may either be lecturing or be in the audience, with a potentially large number of other people, making interruptions particularly noticeable.

LinphonePresenceActivityPermanentAbsence 

The person will not return for the foreseeable future, e.g., because it is no longer working for the company.

LinphonePresenceActivityPlaying 

The person is occupying himself or herself in amusement, sport, or other recreation.

LinphonePresenceActivityPresentation 

The person is giving a presentation, lecture, or participating in a formal round-table discussion.

LinphonePresenceActivityShopping 

The person is visiting stores in search of goods or services.

LinphonePresenceActivitySleeping 

The person is sleeping.

LinphonePresenceActivitySpectator 

The person is observing an event, such as a sports event.

LinphonePresenceActivitySteering 

The person is controlling a vehicle, watercraft, or plane.

LinphonePresenceActivityTravel 

The person is on a business or personal trip, but not necessarily in-transit.

LinphonePresenceActivityTV 

The person is watching television.

LinphonePresenceActivityUnknown 

The activity of the person is unknown.

LinphonePresenceActivityVacation 

A period of time devoted to pleasure, rest, or relaxation.

LinphonePresenceActivityWorking 

The person is engaged in, typically paid, labor, as part of a profession or job.

LinphonePresenceActivityWorship 

The person is participating in religious rites.

§ LinphonePresenceBasicStatus

Basic status as defined in section 4.1.4 of RFC 3863

Enumerator
LinphonePresenceBasicStatusOpen 

This value means that the associated contact element, if any, is ready to accept communication.

LinphonePresenceBasicStatusClosed 

This value means that the associated contact element, if any, is unable to accept communication.

Function Documentation

§ linphone_core_add_friend()

void linphone_core_add_friend ( LinphoneCore lc,
LinphoneFriend fr 
)

Add a friend to the current buddy list, if subscription attribute is set, a SIP SUBSCRIBE message is sent.

Parameters
lcLinphoneCore object
frLinphoneFriend to add
Deprecated:
use linphone_friend_list_add_friend() instead.

§ linphone_core_add_friend_list()

void linphone_core_add_friend_list ( LinphoneCore lc,
LinphoneFriendList list 
)

Add a friend list.

Parameters
[in]lcLinphoneCore object
[in]listLinphoneFriendList object

§ linphone_core_create_friend()

LinphoneFriend* linphone_core_create_friend ( LinphoneCore lc)

Create a default LinphoneFriend.

Parameters
[in]lcLinphoneCore object
Returns
The created LinphoneFriend object

§ linphone_core_create_friend_list()

LinphoneFriendList* linphone_core_create_friend_list ( LinphoneCore lc)

Create a new empty LinphoneFriendList object.

Parameters
[in]lcLinphoneCore object.
Returns
A new LinphoneFriendList object.

§ linphone_core_create_friend_with_address()

LinphoneFriend* linphone_core_create_friend_with_address ( LinphoneCore lc,
const char *  address 
)

Create a LinphoneFriend from the given address.

Parameters
[in]lcLinphoneCore object
[in]addressA string containing the address to create the LinphoneFriend from
Returns
The created LinphoneFriend object

§ linphone_core_create_presence_activity()

LinphonePresenceActivity* linphone_core_create_presence_activity ( LinphoneCore lc,
LinphonePresenceActivityType  acttype,
const char *  description 
)

Create a LinphonePresenceActivity with the given type and description.

Parameters
[in]lcLinphoneCore object.
[in]acttypeThe LinphonePresenceActivityType to set for the activity.
[in]descriptionAn additional description of the activity to set for the activity. Can be NULL if no additional description is to be added.
Returns
The created LinphonePresenceActivity object.

§ linphone_core_create_presence_model()

LinphonePresenceModel* linphone_core_create_presence_model ( LinphoneCore lc)

Create a default LinphonePresenceModel.

Parameters
[in]lcLinphoneCore object.
Returns
The created LinphonePresenceModel object.

§ linphone_core_create_presence_model_with_activity()

LinphonePresenceModel* linphone_core_create_presence_model_with_activity ( LinphoneCore lc,
LinphonePresenceActivityType  acttype,
const char *  description 
)

Create a LinphonePresenceModel with the given activity type and activity description.

Parameters
[in]lcLinphoneCore object.
[in]acttypeThe LinphonePresenceActivityType to set for the activity of the created model.
[in]descriptionAn additional description of the activity to set for the activity. Can be NULL if no additional description is to be added.
Returns
The created LinphonePresenceModel object.

§ linphone_core_create_presence_model_with_activity_and_note()

LinphonePresenceModel* linphone_core_create_presence_model_with_activity_and_note ( LinphoneCore lc,
LinphonePresenceActivityType  acttype,
const char *  description,
const char *  note,
const char *  lang 
)

Create a LinphonePresenceModel with the given activity type, activity description, note content and note language.

Parameters
[in]lcLinphoneCore object.
[in]acttypeThe LinphonePresenceActivityType to set for the activity of the created model.
[in]descriptionAn additional description of the activity to set for the activity. Can be NULL if no additional description is to be added.
[in]noteThe content of the note to be added to the created model.
[in]langThe language of the note to be added to the created model.
Returns
The created LinphonePresenceModel object.

§ linphone_core_create_presence_note()

LinphonePresenceNote* linphone_core_create_presence_note ( LinphoneCore lc,
const char *  content,
const char *  lang 
)

Create a LinphonePresenceNote with the given content and language.

Parameters
[in]lcLinphoneCore object.
[in]contentThe content of the note to be created.
[in]langThe language of the note to be created.
Returns
The created LinphonePresenceNote object.

§ linphone_core_create_presence_person()

LinphonePresencePerson* linphone_core_create_presence_person ( LinphoneCore lc,
const char *  id 
)

Create a LinphonePresencePerson with the given id.

Parameters
[in]lcLinphoneCore object
[in]idThe id of the person to be created.
Returns
The created LinphonePresencePerson object.

§ linphone_core_create_presence_service()

LinphonePresenceService* linphone_core_create_presence_service ( LinphoneCore lc,
const char *  id,
LinphonePresenceBasicStatus  basic_status,
const char *  contact 
)

Create a LinphonePresenceService with the given id, basic status and contact.

Parameters
[in]lcLinphoneCore object.
[in]idThe id of the service to be created.
[in]basic_statusThe basic status of the service to be created.
[in]contactA string containing a contact information corresponding to the service to be created.
Returns
The created LinphonePresenceService object.

§ linphone_core_find_friend()

LinphoneFriend* linphone_core_find_friend ( const LinphoneCore lc,
const LinphoneAddress addr 
)

Search a LinphoneFriend by its address.

Parameters
[in]lcLinphoneCore object.
[in]addrThe address to use to search the friend.
Returns
The LinphoneFriend object corresponding to the given address.

§ linphone_core_get_default_friend_list()

LinphoneFriendList* linphone_core_get_default_friend_list ( const LinphoneCore lc)

Retrieves the first list of LinphoneFriend from the core.

Parameters
[in]lcLinphoneCore object
Returns
the first LinphoneFriendList object or NULL

§ linphone_core_get_friend_by_address()

LinphoneFriend* linphone_core_get_friend_by_address ( const LinphoneCore lc,
const char *  addr 
)

Search a LinphoneFriend by its address.

Parameters
[in]lcLinphoneCore object.
[in]addrThe address to use to search the friend.
Returns
The LinphoneFriend object corresponding to the given address.
Deprecated:
use linphone_core_find_friend() instead.

§ linphone_core_get_friend_by_ref_key()

LinphoneFriend* linphone_core_get_friend_by_ref_key ( const LinphoneCore lc,
const char *  key 
)

Search a LinphoneFriend by its reference key.

Parameters
[in]lcLinphoneCore object.
[in]keyThe reference key to use to search the friend.
Returns
The LinphoneFriend object corresponding to the given reference key.

§ linphone_core_get_friend_list()

const bctbx_list_t* linphone_core_get_friend_list ( const LinphoneCore lc)

Get Buddy list of LinphoneFriend

Parameters
[in]lcLinphoneCore object
Returns
A list of LinphoneFriend objects.
Deprecated:
use linphone_core_get_friends_lists() or linphone_friend_list_get_friends() instead.

§ linphone_core_get_friends_lists()

const bctbx_list_t* linphone_core_get_friends_lists ( const LinphoneCore lc)

Retrieves the list of LinphoneFriendList from the core.

Parameters
[in]lcLinphoneCore object
Returns
A list of LinphoneFriendList objects. a list of LinphoneFriendList

§ linphone_core_get_presence_info()

LinphoneOnlineStatus linphone_core_get_presence_info ( const LinphoneCore lc)

Get my presence status

Parameters
[in]lcLinphoneCore object
Returns
#LinphoneOnlineStatus
Deprecated:
Use linphone_core_get_presence_model() instead

§ linphone_core_get_presence_model()

LinphonePresenceModel* linphone_core_get_presence_model ( const LinphoneCore lc)

Get my presence model

Parameters
[in]lcLinphoneCore object
Returns
A LinphonePresenceModel object, or NULL if no presence model has been set.

§ linphone_core_interpret_friend_uri()

void linphone_core_interpret_friend_uri ( LinphoneCore lc,
const char *  uri,
char **  result 
)

§ linphone_core_notify_all_friends()

void linphone_core_notify_all_friends ( LinphoneCore lc,
LinphonePresenceModel presence 
)

Notify all friends that have subscribed

Parameters
lcLinphoneCore object
presenceLinphonePresenceModel to notify

§ linphone_core_reject_subscriber()

void linphone_core_reject_subscriber ( LinphoneCore lc,
LinphoneFriend lf 
)

Black list a friend. same as linphone_friend_set_inc_subscribe_policy() with LinphoneSPDeny policy;

Parameters
lcLinphoneCore object
lfLinphoneFriend to add

§ linphone_core_remove_friend()

void linphone_core_remove_friend ( LinphoneCore lc,
LinphoneFriend fr 
)

Removes a friend from the buddy list

Parameters
lcLinphoneCore object
frLinphoneFriend to remove
Deprecated:
use linphone_friend_list_remove_friend() instead.

§ linphone_core_remove_friend_list()

void linphone_core_remove_friend_list ( LinphoneCore lc,
LinphoneFriendList list 
)

Removes a friend list.

Parameters
[in]lcLinphoneCore object
[in]listLinphoneFriendList object

§ linphone_core_set_presence_info()

void linphone_core_set_presence_info ( LinphoneCore lc,
int  minutes_away,
const char *  alternative_contact,
LinphoneOnlineStatus  os 
)

Set my presence status

Parameters
[in]lcLinphoneCore object
[in]minutes_awayhow long in away
[in]alternative_contactsip uri used to redirect call in state #LinphoneStatusMoved
[in]os#LinphoneOnlineStatus
Deprecated:
Use linphone_core_set_presence_model() instead

§ linphone_core_set_presence_model()

void linphone_core_set_presence_model ( LinphoneCore lc,
LinphonePresenceModel presence 
)

Set my presence model

Parameters
[in]lcLinphoneCore object
[in]presenceLinphonePresenceModel

§ linphone_friend_add_address()

void linphone_friend_add_address ( LinphoneFriend lf,
const LinphoneAddress addr 
)

Adds an address in this friend

Parameters
lfLinphoneFriend object
addrLinphoneAddress object

§ linphone_friend_add_phone_number()

void linphone_friend_add_phone_number ( LinphoneFriend lf,
const char *  phone 
)

Adds a phone number in this friend

Parameters
lfLinphoneFriend object
phonenumber to add

§ linphone_friend_create_vcard()

bool_t linphone_friend_create_vcard ( LinphoneFriend fr,
const char *  name 
)

Creates a vCard object associated to this friend if there isn't one yet and if the full name is available, either by the parameter or the one in the friend's SIP URI

Parameters
[in]frLinphoneFriend object
[in]nameThe full name of the friend or NULL to use the one from the friend's SIP URI
Returns
true if the vCard has been created, false if it wasn't possible (for exemple if name and the friend's SIP URI are null or if the friend's SIP URI doesn't have a display name), or if there is already one vcard

§ linphone_friend_destroy()

void linphone_friend_destroy ( LinphoneFriend lf)

Destroy a LinphoneFriend.

Parameters
lfLinphoneFriend object
Deprecated:
Use linphone_friend_unref() instead.

§ linphone_friend_done()

void linphone_friend_done ( LinphoneFriend fr)

Commits modification made to the friend configuration.

Parameters
frLinphoneFriend object

§ linphone_friend_edit()

void linphone_friend_edit ( LinphoneFriend fr)

Starts editing a friend configuration.

Because friend configuration must be consistent, applications MUST call linphone_friend_edit() before doing any attempts to modify friend configuration (such as address or subscription policy and so on). Once the modifications are done, then the application must call linphone_friend_done() to commit the changes.

§ linphone_friend_enable_subscribes()

int linphone_friend_enable_subscribes ( LinphoneFriend fr,
bool_t  val 
)

Configure LinphoneFriend to subscribe to presence information

Parameters
frLinphoneFriend object
valif TRUE this friend will receive subscription message

§ linphone_friend_get_address()

const LinphoneAddress* linphone_friend_get_address ( const LinphoneFriend lf)

Get address of this friend.

Note
the LinphoneAddress object returned is hold by the LinphoneFriend, however calling several time this function may return different objects.
Parameters
lfLinphoneFriend object
Returns
LinphoneAddress

§ linphone_friend_get_addresses()

const bctbx_list_t* linphone_friend_get_addresses ( const LinphoneFriend lf)

Returns a list of LinphoneAddress for this friend

Parameters
lfLinphoneFriend object
Returns
A list of LinphoneAddress objects.

§ linphone_friend_get_core()

LinphoneCore* linphone_friend_get_core ( const LinphoneFriend fr)

Returns the LinphoneCore object managing this friend, if any.

Parameters
[in]frLinphoneFriend object

§ linphone_friend_get_inc_subscribe_policy()

LinphoneSubscribePolicy linphone_friend_get_inc_subscribe_policy ( const LinphoneFriend lf)

get current subscription policy for this LinphoneFriend

Parameters
lfLinphoneFriend object
Returns
LinphoneSubscribePolicy

§ linphone_friend_get_name()

const char* linphone_friend_get_name ( const LinphoneFriend lf)

Get the display name for this friend

Parameters
lfLinphoneFriend object
Returns
The display name of this friend

§ linphone_friend_get_phone_numbers()

bctbx_list_t* linphone_friend_get_phone_numbers ( LinphoneFriend lf)

Returns a list of phone numbers for this friend

Parameters
lfLinphoneFriend object
Returns
A list of const char * objects.

§ linphone_friend_get_presence_model()

const LinphonePresenceModel* linphone_friend_get_presence_model ( const LinphoneFriend lf)

Get the presence model of a friend

Parameters
[in]lfA LinphoneFriend object
Returns
A LinphonePresenceModel object, or NULL if the friend do not have presence information (in which case he is considered offline)

§ linphone_friend_get_presence_model_for_uri_or_tel()

const LinphonePresenceModel* linphone_friend_get_presence_model_for_uri_or_tel ( const LinphoneFriend lf,
const char *  uri_or_tel 
)

Get the presence model for a specific SIP URI or phone number of a friend

Parameters
[in]lfA LinphoneFriend object
[in]uri_or_telThe SIP URI or phone number for which to get the presence model
Returns
A LinphonePresenceModel object, or NULL if the friend do not have presence information for this SIP URI or phone number

§ linphone_friend_get_ref_key()

const char* linphone_friend_get_ref_key ( const LinphoneFriend lf)

Get the reference key of a friend.

Parameters
[in]lfLinphoneFriend object.
Returns
The reference key of the friend.

§ linphone_friend_get_status()

LinphoneOnlineStatus linphone_friend_get_status ( const LinphoneFriend lf)

Get the status of a friend

Parameters
[in]lfA LinphoneFriend object
Returns
#LinphoneOnlineStatus
Deprecated:
Use linphone_friend_get_presence_model() instead

§ linphone_friend_get_subscription_state()

LinphoneSubscriptionState linphone_friend_get_subscription_state ( const LinphoneFriend lf)

Get subscription state of a friend

Parameters
[in]lfA LinphoneFriend object
Returns
LinphoneSubscriptionState

§ linphone_friend_get_user_data()

void* linphone_friend_get_user_data ( const LinphoneFriend lf)

Retrieve user data associated with friend.

§ linphone_friend_get_vcard()

LinphoneVcard* linphone_friend_get_vcard ( LinphoneFriend fr)

Returns the vCard object associated to this friend, if any

Parameters
[in]frLinphoneFriend object

§ linphone_friend_in_list()

bool_t linphone_friend_in_list ( const LinphoneFriend lf)

Check that the given friend is in a friend list.

Parameters
[in]lfLinphoneFriend object.
Returns
TRUE if the friend is in a friend list, FALSE otherwise.

§ linphone_friend_is_presence_received()

bool_t linphone_friend_is_presence_received ( const LinphoneFriend lf)

Tells whether we already received presence information for a friend.

Parameters
[in]lfA LinphoneFriend object
Returns
TRUE if presence information has been received for the friend, FALSE otherwise.

§ linphone_friend_list_add_friend()

LinphoneFriendListStatus linphone_friend_list_add_friend ( LinphoneFriendList list,
LinphoneFriend lf 
)

Add a friend to a friend list. If or when a remote CardDAV server will be attached to the list, the friend will be sent to the server.

Parameters
[in]listLinphoneFriendList object.
[in]lfLinphoneFriend object to add to the friend list.
Returns
LinphoneFriendListOK if successfully added, LinphoneFriendListInvalidFriend if the friend is not valid.

§ linphone_friend_list_add_local_friend()

LinphoneFriendListStatus linphone_friend_list_add_local_friend ( LinphoneFriendList list,
LinphoneFriend lf 
)

Add a friend to a friend list. The friend will never be sent to a remote CardDAV server. Warning! LinphoneFriends added this way will be removed on the next synchronization, and the callback contact_deleted will be called.

Parameters
[in]listLinphoneFriendList object.
[in]lfLinphoneFriend object to add to the friend list.
Returns
LinphoneFriendListOK if successfully added, LinphoneFriendListInvalidFriend if the friend is not valid.

§ linphone_friend_list_cbs_get_contact_created()

LinphoneFriendListCbsContactCreatedCb linphone_friend_list_cbs_get_contact_created ( const LinphoneFriendListCbs cbs)

Get the contact created callback.

Parameters
[in]cbsLinphoneFriendListCbs object.
Returns
The current contact created callback.

§ linphone_friend_list_cbs_get_contact_deleted()

LinphoneFriendListCbsContactDeletedCb linphone_friend_list_cbs_get_contact_deleted ( const LinphoneFriendListCbs cbs)

Get the contact deleted callback.

Parameters
[in]cbsLinphoneFriendListCbs object.
Returns
The current contact deleted callback.

§ linphone_friend_list_cbs_get_contact_updated()

LinphoneFriendListCbsContactUpdatedCb linphone_friend_list_cbs_get_contact_updated ( const LinphoneFriendListCbs cbs)

Get the contact updated callback.

Parameters
[in]cbsLinphoneFriendListCbs object.
Returns
The current contact updated callback.

§ linphone_friend_list_cbs_get_sync_status_changed()

LinphoneFriendListCbsSyncStateChangedCb linphone_friend_list_cbs_get_sync_status_changed ( const LinphoneFriendListCbs cbs)

Get the sync status changed callback.

Parameters
[in]cbsLinphoneFriendListCbs object.
Returns
The current sync status changedcallback.

§ linphone_friend_list_cbs_get_user_data()

void* linphone_friend_list_cbs_get_user_data ( const LinphoneFriendListCbs cbs)

Retrieve the user pointer associated with a LinphoneFriendListCbs object.

Parameters
[in]cbsLinphoneFriendListCbs object.
Returns
The user pointer associated with the LinphoneFriendListCbs object.

§ linphone_friend_list_cbs_ref()

LinphoneFriendListCbs* linphone_friend_list_cbs_ref ( LinphoneFriendListCbs cbs)

Acquire a reference to a LinphoneFriendListCbs object.

Parameters
[in]cbsLinphoneFriendListCbs object.
Returns
The same LinphoneFriendListCbs object.

§ linphone_friend_list_cbs_set_contact_created()

void linphone_friend_list_cbs_set_contact_created ( LinphoneFriendListCbs cbs,
LinphoneFriendListCbsContactCreatedCb  cb 
)

Set the contact created callback.

Parameters
[in]cbsLinphoneFriendListCbs object.
[in]cbThe contact created to be used.

§ linphone_friend_list_cbs_set_contact_deleted()

void linphone_friend_list_cbs_set_contact_deleted ( LinphoneFriendListCbs cbs,
LinphoneFriendListCbsContactDeletedCb  cb 
)

Set the contact deleted callback.

Parameters
[in]cbsLinphoneFriendListCbs object.
[in]cbThe contact deleted to be used.

§ linphone_friend_list_cbs_set_contact_updated()

void linphone_friend_list_cbs_set_contact_updated ( LinphoneFriendListCbs cbs,
LinphoneFriendListCbsContactUpdatedCb  cb 
)

Set the contact updated callback.

Parameters
[in]cbsLinphoneFriendListCbs object.
[in]cbThe contact updated to be used.

§ linphone_friend_list_cbs_set_sync_status_changed()

void linphone_friend_list_cbs_set_sync_status_changed ( LinphoneFriendListCbs cbs,
LinphoneFriendListCbsSyncStateChangedCb  cb 
)

Set the contact updated callback.

Parameters
[in]cbsLinphoneFriendListCbs object.
[in]cbThe sync status changed to be used.

§ linphone_friend_list_cbs_set_user_data()

void linphone_friend_list_cbs_set_user_data ( LinphoneFriendListCbs cbs,
void *  ud 
)

Assign a user pointer to a LinphoneFriendListCbs object.

Parameters
[in]cbsLinphoneFriendListCbs object.
[in]udThe user pointer to associate with the LinphoneFriendListCbs object.

§ linphone_friend_list_cbs_unref()

void linphone_friend_list_cbs_unref ( LinphoneFriendListCbs cbs)

Release a reference to a LinphoneFriendListCbs object.

Parameters
[in]cbsLinphoneFriendListCbs object.

§ linphone_friend_list_enable_subscriptions()

void linphone_friend_list_enable_subscriptions ( LinphoneFriendList list,
bool_t  enabled 
)

Enable subscription to NOTIFYes of all friends list

Parameters
[in]listthe LinphoneFriendList object
[in]enabledshould subscription be enabled or not

§ linphone_friend_list_export_friends_as_vcard4_file()

void linphone_friend_list_export_friends_as_vcard4_file ( LinphoneFriendList list,
const char *  vcard_file 
)

Creates and export LinphoneFriend objects from LinphoneFriendList to a file using vCard 4 format

Parameters
[in]listthe LinphoneFriendList object
[in]vcard_filethe path to a file that will contain the vCards

§ linphone_friend_list_find_friend_by_address()

LinphoneFriend* linphone_friend_list_find_friend_by_address ( const LinphoneFriendList list,
const LinphoneAddress address 
)

Find a friend in the friend list using a LinphoneAddress.

Parameters
[in]listLinphoneFriendList object.
[in]addressLinphoneAddress object of the friend we want to search for.
Returns
A LinphoneFriend if found, NULL otherwise.

§ linphone_friend_list_find_friend_by_ref_key()

LinphoneFriend* linphone_friend_list_find_friend_by_ref_key ( const LinphoneFriendList list,
const char *  ref_key 
)

Find a friend in the friend list using a ref key.

Parameters
[in]listLinphoneFriendList object.
[in]ref_keyThe ref key string of the friend we want to search for.
Returns
A LinphoneFriend if found, NULL otherwise.

§ linphone_friend_list_find_friend_by_uri()

LinphoneFriend* linphone_friend_list_find_friend_by_uri ( const LinphoneFriendList list,
const char *  uri 
)

Find a friend in the friend list using an URI string.

Parameters
[in]listLinphoneFriendList object.
[in]uriA string containing the URI of the friend we want to search for.
Returns
A LinphoneFriend if found, NULL otherwise.

§ linphone_friend_list_get_callbacks()

LinphoneFriendListCbs* linphone_friend_list_get_callbacks ( const LinphoneFriendList list)

Get the LinphoneFriendListCbs object associated with a LinphoneFriendList.

Parameters
[in]listLinphoneFriendList object
Returns
The LinphoneFriendListCbs object associated with the LinphoneFriendList.

§ linphone_friend_list_get_core()

LinphoneCore* linphone_friend_list_get_core ( const LinphoneFriendList list)

Returns the LinphoneCore object attached to this LinphoneFriendList.

Parameters
[in]listLinphoneFriendList object.
Returns
a LinphoneCore object

§ linphone_friend_list_get_display_name()

const char* linphone_friend_list_get_display_name ( const LinphoneFriendList list)

Get the display name of the friend list.

Parameters
[in]listLinphoneFriendList object.
Returns
The display name of the friend list.

§ linphone_friend_list_get_friends()

const bctbx_list_t* linphone_friend_list_get_friends ( const LinphoneFriendList list)

Retrieves the list of LinphoneFriend from this LinphoneFriendList.

Parameters
[in]listLinphoneFriendList object
Returns
A list of LinphoneFriend objects. a list of LinphoneFriend

§ linphone_friend_list_get_rls_address()

const LinphoneAddress* linphone_friend_list_get_rls_address ( const LinphoneFriendList list)

Get the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.

Parameters
[in]listLinphoneFriendList object.
Returns
The RLS URI associated with the friend list.

§ linphone_friend_list_get_rls_uri()

const char* linphone_friend_list_get_rls_uri ( const LinphoneFriendList list)

Get the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.

Parameters
[in]listLinphoneFriendList object.
Returns
The RLS URI associated with the friend list.

§ linphone_friend_list_get_uri()

const char* linphone_friend_list_get_uri ( const LinphoneFriendList list)

Get the URI associated with the friend list.

Parameters
[in]listLinphoneFriendList object.
Returns
The URI associated with the friend list.

§ linphone_friend_list_get_user_data()

void* linphone_friend_list_get_user_data ( const LinphoneFriendList list)

Retrieve the user pointer associated with the friend list.

Parameters
[in]listLinphoneFriendList object.
Returns
The user pointer associated with the friend list.

§ linphone_friend_list_import_friends_from_vcard4_buffer()

int linphone_friend_list_import_friends_from_vcard4_buffer ( LinphoneFriendList list,
const char *  vcard_buffer 
)

Creates and adds LinphoneFriend objects to LinphoneFriendList from a buffer that contains the vCard(s) to parse

Parameters
[in]listthe LinphoneFriendList object
[in]vcard_bufferthe buffer that contains the vCard(s) to parse
Returns
the amount of linphone friends created

§ linphone_friend_list_import_friends_from_vcard4_file()

int linphone_friend_list_import_friends_from_vcard4_file ( LinphoneFriendList list,
const char *  vcard_file 
)

Creates and adds LinphoneFriend objects to LinphoneFriendList from a file that contains the vCard(s) to parse

Parameters
[in]listthe LinphoneFriendList object
[in]vcard_filethe path to a file that contains the vCard(s) to parse
Returns
the amount of linphone friends created

§ linphone_friend_list_notify_presence()

void linphone_friend_list_notify_presence ( LinphoneFriendList list,
LinphonePresenceModel presence 
)

Notify our presence to all the friends in the friend list that have subscribed to our presence directly (not using a RLS).

Parameters
[in]listLinphoneFriendList object.
[in]presenceLinphonePresenceModel object.

§ linphone_friend_list_ref()

LinphoneFriendList* linphone_friend_list_ref ( LinphoneFriendList list)

Acquire a reference to the friend list.

Parameters
[in]listLinphoneFriendList object.
Returns
The same LinphoneFriendList object.

§ linphone_friend_list_remove_friend()

LinphoneFriendListStatus linphone_friend_list_remove_friend ( LinphoneFriendList list,
LinphoneFriend lf 
)

Remove a friend from a friend list.

Parameters
[in]listLinphoneFriendList object.
[in]lfLinphoneFriend object to remove from the friend list.
Returns
LinphoneFriendListOK if removed successfully, LinphoneFriendListNonExistentFriend if the friend is not in the list.

§ linphone_friend_list_set_display_name()

void linphone_friend_list_set_display_name ( LinphoneFriendList list,
const char *  display_name 
)

Set the display name of the friend list.

Parameters
[in]listLinphoneFriendList object.
[in]display_nameThe new display name of the friend list.

§ linphone_friend_list_set_rls_address()

void linphone_friend_list_set_rls_address ( LinphoneFriendList list,
const LinphoneAddress rls_addr 
)

Set the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.

Parameters
[in]listLinphoneFriendList object.
[in]rls_addrThe RLS URI to associate with the friend list.

§ linphone_friend_list_set_rls_uri()

void linphone_friend_list_set_rls_uri ( LinphoneFriendList list,
const char *  rls_uri 
)

Set the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.

Parameters
[in]listLinphoneFriendList object.
[in]rls_uriThe RLS URI to associate with the friend list.

§ linphone_friend_list_set_uri()

void linphone_friend_list_set_uri ( LinphoneFriendList list,
const char *  uri 
)

Set the URI associated with the friend list.

Parameters
[in]listLinphoneFriendList object.
[in]uriThe URI to associate with the friend list.

§ linphone_friend_list_set_user_data()

void linphone_friend_list_set_user_data ( LinphoneFriendList list,
void *  ud 
)

Assign a user pointer to the friend list.

Parameters
[in]listLinphoneFriendList object.
[in]udThe user pointer to associate with the friend list.

§ linphone_friend_list_synchronize_friends_from_server()

void linphone_friend_list_synchronize_friends_from_server ( LinphoneFriendList list)

Starts a CardDAV synchronization using value set using linphone_friend_list_set_uri.

Parameters
[in]listLinphoneFriendList object.

§ linphone_friend_list_unref()

void linphone_friend_list_unref ( LinphoneFriendList list)

Release reference to the friend list.

Parameters
[in]listLinphoneFriendList object.

§ linphone_friend_list_update_dirty_friends()

void linphone_friend_list_update_dirty_friends ( LinphoneFriendList list)

Goes through all the LinphoneFriend that are dirty and does a CardDAV PUT to update the server.

Parameters
[in]listLinphoneFriendList object.

§ linphone_friend_list_update_revision()

void linphone_friend_list_update_revision ( LinphoneFriendList list,
int  rev 
)

Sets the revision from the last synchronization.

Parameters
[in]listLinphoneFriendList object.
[in]revThe revision

§ linphone_friend_list_update_subscriptions()

void linphone_friend_list_update_subscriptions ( LinphoneFriendList list)

Update presence subscriptions for the entire list. Calling this function is necessary when list subscriptions are enabled, ie when a RLS presence server is used.

Parameters
[in]listthe friend list

§ linphone_friend_new()

LINPHONE_DEPRECATED LinphoneFriend* linphone_friend_new ( void  )

Contructor

Returns
a new empty LinphoneFriend
Deprecated:
use linphone_core_create_friend instead

§ linphone_friend_new_from_vcard()

LinphoneFriend* linphone_friend_new_from_vcard ( LinphoneVcard vcard)

Contructor same as linphone_friend_new() + linphone_friend_set_address()

Parameters
vcarda vCard object
Returns
a new LinphoneFriend with vCard initialized

§ linphone_friend_new_with_address()

LINPHONE_DEPRECATED LinphoneFriend* linphone_friend_new_with_address ( const char *  addr)

§ linphone_friend_ref()

LinphoneFriend* linphone_friend_ref ( LinphoneFriend lf)

Acquire a reference to the linphone friend.

Parameters
[in]lfLinphoneFriend object
Returns
The same LinphoneFriend object

§ linphone_friend_remove_address()

void linphone_friend_remove_address ( LinphoneFriend lf,
const LinphoneAddress addr 
)

Removes an address in this friend

Parameters
lfLinphoneFriend object
addrLinphoneAddress object

§ linphone_friend_remove_phone_number()

void linphone_friend_remove_phone_number ( LinphoneFriend lf,
const char *  phone 
)

Removes a phone number in this friend

Parameters
lfLinphoneFriend object
phonenumber to remove

§ linphone_friend_save()

void linphone_friend_save ( LinphoneFriend fr,
LinphoneCore lc 
)

Saves a friend either in database if configured, otherwise in linphonerc

Parameters
frthe linphone friend to save
lcthe linphone core

§ linphone_friend_set_address()

int linphone_friend_set_address ( LinphoneFriend fr,
const LinphoneAddress address 
)

Set LinphoneAddress for this friend

Parameters
frLinphoneFriend object
addressLinphoneAddress

§ linphone_friend_set_inc_subscribe_policy()

int linphone_friend_set_inc_subscribe_policy ( LinphoneFriend fr,
LinphoneSubscribePolicy  pol 
)

Configure incoming subscription policy for this friend.

Parameters
frLinphoneFriend object
polLinphoneSubscribePolicy policy to apply.

§ linphone_friend_set_name()

int linphone_friend_set_name ( LinphoneFriend lf,
const char *  name 
)

Set the display name for this friend

Parameters
lfLinphoneFriend object
name

§ linphone_friend_set_presence_model()

void linphone_friend_set_presence_model ( LinphoneFriend lf,
LinphonePresenceModel presence 
)

Set the presence model of a friend

Parameters
[in]lfA LinphoneFriend object
[in]presenceThe LinphonePresenceModel object to set for the friend

§ linphone_friend_set_presence_model_for_uri_or_tel()

void linphone_friend_set_presence_model_for_uri_or_tel ( LinphoneFriend lf,
const char *  uri_or_tel,
LinphonePresenceModel presence 
)

Set the presence model for a specific SIP URI or phone number of a friend

Parameters
[in]lfA LinphoneFriend object
[in]uri_or_telThe SIP URI or phone number for which to set the presence model
[in]presenceThe LinphonePresenceModel object to set

§ linphone_friend_set_ref_key()

void linphone_friend_set_ref_key ( LinphoneFriend lf,
const char *  key 
)

Set the reference key of a friend.

Parameters
[in]lfLinphoneFriend object.
[in]keyThe reference key to use for the friend.

§ linphone_friend_set_user_data()

void linphone_friend_set_user_data ( LinphoneFriend lf,
void *  data 
)

Store user pointer to friend object.

§ linphone_friend_set_vcard()

void linphone_friend_set_vcard ( LinphoneFriend fr,
LinphoneVcard vcard 
)

Binds a vCard object to a friend

Parameters
[in]frLinphoneFriend object
[in]vcardThe vCard object to bind

§ linphone_friend_subscribes_enabled()

bool_t linphone_friend_subscribes_enabled ( const LinphoneFriend lf)

get subscription flag value

Parameters
lfLinphoneFriend object
Returns
returns true is subscription is activated for this friend

§ linphone_friend_unref()

void linphone_friend_unref ( LinphoneFriend lf)

Release a reference to the linphone friend.

Parameters
[in]lfLinphoneFriend object

§ linphone_presence_activity_get_description()

const char* linphone_presence_activity_get_description ( const LinphonePresenceActivity activity)

Gets the description of a presence activity.

Parameters
[in]activityA pointer to the LinphonePresenceActivity for which to get the description.
Returns
A pointer to the description string of the presence activity, or NULL if no description is specified.

§ linphone_presence_activity_get_type()

LinphonePresenceActivityType linphone_presence_activity_get_type ( const LinphonePresenceActivity activity)

Gets the activity type of a presence activity.

Parameters
[in]activityA pointer to the LinphonePresenceActivity for which to get the type.
Returns
The LinphonePresenceActivityType of the activity.

§ linphone_presence_activity_get_user_data()

void* linphone_presence_activity_get_user_data ( const LinphonePresenceActivity activity)

Gets the user data of a LinphonePresenceActivity object.

Parameters
[in]activityThe LinphonePresenceActivity object for which to get the user data.
Returns
A pointer to the user data.

§ linphone_presence_activity_new()

LinphonePresenceActivity* linphone_presence_activity_new ( LinphonePresenceActivityType  acttype,
const char *  description 
)

Creates a presence activity.

Parameters
[in]acttypeThe LinphonePresenceActivityType to set for the activity.
[in]descriptionAn additional description of the activity to set for the activity. Can be NULL if no additional description is to be added.
Returns
The created presence activity, NULL on error.

§ linphone_presence_activity_ref()

LinphonePresenceActivity* linphone_presence_activity_ref ( LinphonePresenceActivity activity)

Increase the reference count of the LinphonePresenceActivity object.

Parameters
[in]activityThe LinphonePresenceActivity object for which the reference count is to be increased.
Returns
The LinphonePresenceActivity object with the increased reference count.

§ linphone_presence_activity_set_description()

int linphone_presence_activity_set_description ( LinphonePresenceActivity activity,
const char *  description 
)

Sets the description of a presence activity.

Parameters
[in]activityThe LinphonePresenceActivity object for which to set the description.
[in]descriptionAn additional description of the activity. Can be NULL if no additional description is to be added.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_activity_set_type()

int linphone_presence_activity_set_type ( LinphonePresenceActivity activity,
LinphonePresenceActivityType  acttype 
)

Sets the type of activity of a presence activity.

Parameters
[in]activityThe LinphonePresenceActivity for which to set for the activity type.
[in]acttypeThe activity type to set for the activity.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_activity_set_user_data()

void linphone_presence_activity_set_user_data ( LinphonePresenceActivity activity,
void *  user_data 
)

Sets the user data of a LinphonePresenceActivity object.

Parameters
[in]activityThe LinphonePresenceActivity object for which to set the user data.
[in]user_dataA pointer to the user data to set.

§ linphone_presence_activity_to_string()

char* linphone_presence_activity_to_string ( const LinphonePresenceActivity activity)

Gets the string representation of a presence activity.

Parameters
[in]activityA pointer to the LinphonePresenceActivity object for which to get a string representation.
Returns
A pointer a dynamically allocated string representing the given activity.

The returned string is to be freed by calling ms_free().

§ linphone_presence_activity_unref()

LinphonePresenceActivity* linphone_presence_activity_unref ( LinphonePresenceActivity activity)

Decrease the reference count of the LinphonePresenceActivity object and destroy it if it reaches 0.

Parameters
[in]activityThe LinphonePresenceActivity object for which the reference count is to be decreased.
Returns
The LinphonePresenceActivity object if the reference count is still positive, NULL if the object has been destroyed.

§ linphone_presence_model_add_activity()

int linphone_presence_model_add_activity ( LinphonePresenceModel model,
LinphonePresenceActivity activity 
)

Adds an activity to a presence model.

Parameters
[in]modelThe LinphonePresenceModel object for which to add an activity.
[in]activityThe LinphonePresenceActivity object to add to the model.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_model_add_note()

int linphone_presence_model_add_note ( LinphonePresenceModel model,
const char *  note_content,
const char *  lang 
)

Adds a note to a presence model.

Parameters
[in]modelThe LinphonePresenceModel object to add a note to.
[in]note_contentThe note to be added to the presence model.
[in]langThe language of the note to be added. Can be NULL if no language is to be specified for the note.
Returns
0 if successful, a value < 0 in case of error.

Only one note for each language can be set, so e.g. setting a note for the 'fr' language if there is only one will replace the existing one.

§ linphone_presence_model_add_person()

int linphone_presence_model_add_person ( LinphonePresenceModel model,
LinphonePresencePerson person 
)

Adds a person to a presence model.

Parameters
[in]modelThe LinphonePresenceModel object for which to add a person.
[in]personThe LinphonePresencePerson object to add to the model.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_model_add_service()

int linphone_presence_model_add_service ( LinphonePresenceModel model,
LinphonePresenceService service 
)

Adds a service to a presence model.

Parameters
[in]modelThe LinphonePresenceModel object for which to add a service.
[in]serviceThe LinphonePresenceService object to add to the model.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_model_clear_activities()

int linphone_presence_model_clear_activities ( LinphonePresenceModel model)

Clears the activities of a presence model.

Parameters
[in]modelThe LinphonePresenceModel object for which to clear the activities.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_model_clear_notes()

int linphone_presence_model_clear_notes ( LinphonePresenceModel model)

Clears all the notes of a presence model.

Parameters
[in]modelThe LinphonePresenceModel for which to clear notes.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_model_clear_persons()

int linphone_presence_model_clear_persons ( LinphonePresenceModel model)

Clears the persons of a presence model.

Parameters
[in]modelThe LinphonePresenceModel object for which to clear the persons.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_model_clear_services()

int linphone_presence_model_clear_services ( LinphonePresenceModel model)

Clears the services of a presence model.

Parameters
[in]modelThe LinphonePresenceModel object for which to clear the services.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_model_get_activity()

LinphonePresenceActivity* linphone_presence_model_get_activity ( const LinphonePresenceModel model)

Gets the first activity of a presence model (there is usually only one).

Parameters
[in]modelThe LinphonePresenceModel object to get the activity from.
Returns
A LinphonePresenceActivity object if successful, NULL otherwise.

§ linphone_presence_model_get_basic_status()

LinphonePresenceBasicStatus linphone_presence_model_get_basic_status ( const LinphonePresenceModel model)

Gets the basic status of a presence model.

Parameters
[in]modelThe LinphonePresenceModel object to get the basic status from.
Returns
The LinphonePresenceBasicStatus of the LinphonePresenceModel object given as parameter.

§ linphone_presence_model_get_contact()

char* linphone_presence_model_get_contact ( const LinphonePresenceModel model)

Gets the contact of a presence model.

Parameters
[in]modelThe LinphonePresenceModel object to get the contact from.
Returns
A pointer to a dynamically allocated string containing the contact, or NULL if no contact is found.

The returned string is to be freed by calling ms_free().

§ linphone_presence_model_get_nb_activities()

unsigned int linphone_presence_model_get_nb_activities ( const LinphonePresenceModel model)

Gets the number of activities included in the presence model.

Parameters
[in]modelThe LinphonePresenceModel object to get the number of activities from.
Returns
The number of activities included in the LinphonePresenceModel object.

§ linphone_presence_model_get_nb_persons()

unsigned int linphone_presence_model_get_nb_persons ( const LinphonePresenceModel model)

Gets the number of persons included in the presence model.

Parameters
[in]modelThe LinphonePresenceModel object to get the number of persons from.
Returns
The number of persons included in the LinphonePresenceModel object.

§ linphone_presence_model_get_nb_services()

unsigned int linphone_presence_model_get_nb_services ( const LinphonePresenceModel model)

Gets the number of services included in the presence model.

Parameters
[in]modelThe LinphonePresenceModel object to get the number of services from.
Returns
The number of services included in the LinphonePresenceModel object.

§ linphone_presence_model_get_note()

LinphonePresenceNote* linphone_presence_model_get_note ( const LinphonePresenceModel model,
const char *  lang 
)

Gets the first note of a presence model (there is usually only one).

Parameters
[in]modelThe LinphonePresenceModel object to get the note from.
[in]langThe language of the note to get. Can be NULL to get a note that has no language specified or to get the first note whatever language it is written into.
Returns
A pointer to a LinphonePresenceNote object if successful, NULL otherwise.

§ linphone_presence_model_get_nth_activity()

LinphonePresenceActivity* linphone_presence_model_get_nth_activity ( const LinphonePresenceModel model,
unsigned int  idx 
)

Gets the nth activity of a presence model.

Parameters
[in]modelThe LinphonePresenceModel object to get the activity from.
[in]idxThe index of the activity to get (the first activity having the index 0).
Returns
A pointer to a LinphonePresenceActivity object if successful, NULL otherwise.

§ linphone_presence_model_get_nth_person()

LinphonePresencePerson* linphone_presence_model_get_nth_person ( const LinphonePresenceModel model,
unsigned int  idx 
)

Gets the nth person of a presence model.

Parameters
[in]modelThe LinphonePresenceModel object to get the person from.
[in]idxThe index of the person to get (the first person having the index 0).
Returns
A pointer to a LinphonePresencePerson object if successful, NULL otherwise.

§ linphone_presence_model_get_nth_service()

LinphonePresenceService* linphone_presence_model_get_nth_service ( const LinphonePresenceModel model,
unsigned int  idx 
)

Gets the nth service of a presence model.

Parameters
[in]modelThe LinphonePresenceModel object to get the service from.
[in]idxThe index of the service to get (the first service having the index 0).
Returns
A pointer to a LinphonePresenceService object if successful, NULL otherwise.

§ linphone_presence_model_get_presentity()

const LinphoneAddress* linphone_presence_model_get_presentity ( const LinphonePresenceModel model)

Gets the presentity of a presence model.

Parameters
[in]modelThe LinphonePresenceModel object to get the contact from.
Returns
A pointer to a const LinphoneAddress, or NULL if no contact is found.

§ linphone_presence_model_get_timestamp()

time_t linphone_presence_model_get_timestamp ( const LinphonePresenceModel model)

Gets the timestamp of a presence model.

Parameters
[in]modelThe LinphonePresenceModel object to get the timestamp from.
Returns
The timestamp of the LinphonePresenceModel object or -1 on error.

§ linphone_presence_model_get_user_data()

void* linphone_presence_model_get_user_data ( const LinphonePresenceModel model)

Gets the user data of a LinphonePresenceModel object.

Parameters
[in]modelThe LinphonePresenceModel object for which to get the user data.
Returns
A pointer to the user data.

§ linphone_presence_model_new()

LinphonePresenceModel* linphone_presence_model_new ( void  )

Creates a default presence model.

Returns
The created presence model, NULL on error.
See also
linphone_presence_model_new_with_activity
linphone_presence_model_new_with_activity_and_note

The created presence model is considered 'offline'.

§ linphone_presence_model_new_with_activity()

LinphonePresenceModel* linphone_presence_model_new_with_activity ( LinphonePresenceActivityType  activity,
const char *  description 
)

Creates a presence model specifying an activity.

Parameters
[in]activityThe activity to set for the created presence model.
[in]descriptionAn additional description of the activity (mainly useful for the 'other' activity). Set it to NULL to not add a description.
Returns
The created presence model, or NULL if an error occured.
See also
linphone_presence_model_new
linphone_presence_model_new_with_activity_and_note

The created presence model has the activity specified in the parameters.

§ linphone_presence_model_new_with_activity_and_note()

LinphonePresenceModel* linphone_presence_model_new_with_activity_and_note ( LinphonePresenceActivityType  activity,
const char *  description,
const char *  note,
const char *  lang 
)

Creates a presence model specifying an activity and adding a note.

Parameters
[in]activityThe activity to set for the created presence model.
[in]descriptionAn additional description of the activity (mainly useful for the 'other' activity). Set it to NULL to not add a description.
[in]noteAn additional note giving additional information about the contact presence.
[in]langThe language the note is written in. It can be set to NULL in order to not specify the language of the note.
Returns
The created presence model, or NULL if an error occured.
See also
linphone_presence_model_new_with_activity
linphone_presence_model_new_with_activity_and_note

The created presence model has the activity and the note specified in the parameters.

§ linphone_presence_model_ref()

LinphonePresenceModel* linphone_presence_model_ref ( LinphonePresenceModel model)

Increase the reference count of the LinphonePresenceModel object.

Parameters
[in]modelThe LinphonePresenceModel object for which the reference count is to be increased.
Returns
The LinphonePresenceModel object with the increased reference count.

§ linphone_presence_model_set_activity()

int linphone_presence_model_set_activity ( LinphonePresenceModel model,
LinphonePresenceActivityType  activity,
const char *  description 
)

Sets the activity of a presence model (limits to only one activity).

Parameters
[in]modelThe LinphonePresenceModel object for which to set the activity.
[in]activityThe LinphonePresenceActivityType to set for the model.
[in]descriptionAn additional description of the activity to set for the model. Can be NULL if no additional description is to be added.
Returns
0 if successful, a value < 0 in case of error.

WARNING: This function will modify the basic status of the model according to the activity being set. If you don't want the basic status to be modified automatically, you can use the combination of linphone_presence_model_set_basic_status(), linphone_presence_model_clear_activities() and linphone_presence_model_add_activity().

§ linphone_presence_model_set_basic_status()

int linphone_presence_model_set_basic_status ( LinphonePresenceModel model,
LinphonePresenceBasicStatus  basic_status 
)

Sets the basic status of a presence model.

Parameters
[in]modelThe LinphonePresenceModel object for which to set the basic status.
[in]basic_statusThe LinphonePresenceBasicStatus to set for the LinphonePresenceModel object.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_model_set_contact()

int linphone_presence_model_set_contact ( LinphonePresenceModel model,
const char *  contact 
)

Sets the contact of a presence model.

Parameters
[in]modelThe LinphonePresenceModel object for which to set the contact.
[in]contactThe contact string to set.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_model_set_presentity()

int linphone_presence_model_set_presentity ( LinphonePresenceModel model,
const LinphoneAddress presentity 
)

Sets the presentity of a presence model.

Parameters
[in]modelThe LinphonePresenceModel object for which to set the contact.
[in]presentityThe presentity address to set (presentity is copied).
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_model_set_user_data()

void linphone_presence_model_set_user_data ( LinphonePresenceModel model,
void *  user_data 
)

Sets the user data of a LinphonePresenceModel object.

Parameters
[in]modelThe LinphonePresenceModel object for which to set the user data.
[in]user_dataA pointer to the user data to set.

§ linphone_presence_model_unref()

LinphonePresenceModel* linphone_presence_model_unref ( LinphonePresenceModel model)

Decrease the reference count of the LinphonePresenceModel object and destroy it if it reaches 0.

Parameters
[in]modelThe LinphonePresenceModel object for which the reference count is to be decreased.
Returns
The LinphonePresenceModel object if the reference count is still positive, NULL if the object has been destroyed.

§ linphone_presence_note_get_content()

const char* linphone_presence_note_get_content ( const LinphonePresenceNote note)

Gets the content of a presence note.

Parameters
[in]noteA pointer to the LinphonePresenceNote for which to get the content.
Returns
A pointer to the content of the presence note.

§ linphone_presence_note_get_lang()

const char* linphone_presence_note_get_lang ( const LinphonePresenceNote note)

Gets the language of a presence note.

Parameters
[in]noteA pointer to the LinphonePresenceNote for which to get the language.
Returns
A pointer to the language string of the presence note, or NULL if no language is specified.

§ linphone_presence_note_get_user_data()

void* linphone_presence_note_get_user_data ( const LinphonePresenceNote note)

Gets the user data of a LinphonePresenceNote object.

Parameters
[in]noteThe LinphonePresenceNote object for which to get the user data.
Returns
A pointer to the user data.

§ linphone_presence_note_new()

LinphonePresenceNote* linphone_presence_note_new ( const char *  content,
const char *  lang 
)

Creates a presence note.

Parameters
[in]contentThe content of the note to be created.
[in]langThe language of the note to be created. Can be NULL if no language is to be specified for the note.
Returns
The created presence note, NULL on error.

§ linphone_presence_note_ref()

LinphonePresenceNote* linphone_presence_note_ref ( LinphonePresenceNote note)

Increase the reference count of the LinphonePresenceNote object.

Parameters
[in]noteThe LinphonePresenceNote object for which the reference count is to be increased.
Returns
The LinphonePresenceNote object with the increased reference count.

§ linphone_presence_note_set_content()

int linphone_presence_note_set_content ( LinphonePresenceNote note,
const char *  content 
)

Sets the content of a presence note.

Parameters
[in]noteThe LinphonePresenceNote object for which to set the content.
[in]contentThe content of the note.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_note_set_lang()

int linphone_presence_note_set_lang ( LinphonePresenceNote note,
const char *  lang 
)

Sets the language of a presence note.

Parameters
[in]noteThe LinphonePresenceNote object for which to set the language.
[in]langThe language of the note.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_note_set_user_data()

void linphone_presence_note_set_user_data ( LinphonePresenceNote note,
void *  user_data 
)

Sets the user data of a LinphonePresenceNote object.

Parameters
[in]noteThe LinphonePresenceNote object for which to set the user data.
[in]user_dataA pointer to the user data to set.

§ linphone_presence_note_unref()

LinphonePresenceNote* linphone_presence_note_unref ( LinphonePresenceNote note)

Decrease the reference count of the LinphonePresenceNote object and destroy it if it reaches 0.

Parameters
[in]noteThe LinphonePresenceNote object for which the reference count is to be decreased.
Returns
The LinphonePresenceNote object if the reference count is still positive, NULL if the object has been destroyed.

§ linphone_presence_person_add_activities_note()

int linphone_presence_person_add_activities_note ( LinphonePresencePerson person,
LinphonePresenceNote note 
)

Adds an activities note to a presence person.

Parameters
[in]personThe LinphonePresencePerson object for which to add an activities note.
[in]noteThe LinphonePresenceNote object to add to the person.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_person_add_activity()

int linphone_presence_person_add_activity ( LinphonePresencePerson person,
LinphonePresenceActivity activity 
)

Adds an activity to a presence person.

Parameters
[in]personThe LinphonePresencePerson object for which to add an activity.
[in]activityThe LinphonePresenceActivity object to add to the person.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_person_add_note()

int linphone_presence_person_add_note ( LinphonePresencePerson person,
LinphonePresenceNote note 
)

Adds a note to a presence person.

Parameters
[in]personThe LinphonePresencePerson object for which to add a note.
[in]noteThe LinphonePresenceNote object to add to the person.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_person_clear_activities()

int linphone_presence_person_clear_activities ( LinphonePresencePerson person)

Clears the activities of a presence person.

Parameters
[in]personThe LinphonePresencePerson object for which to clear the activities.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_person_clear_activities_notes()

int linphone_presence_person_clear_activities_notes ( LinphonePresencePerson person)

Clears the activities notes of a presence person.

Parameters
[in]personThe LinphonePresencePerson object for which to clear the activities notes.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_person_clear_notes()

int linphone_presence_person_clear_notes ( LinphonePresencePerson person)

Clears the notes of a presence person.

Parameters
[in]personThe LinphonePresencePerson object for which to clear the notes.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_person_get_id()

char* linphone_presence_person_get_id ( const LinphonePresencePerson person)

Gets the id of a presence person.

Parameters
[in]personThe LinphonePresencePerson object to get the id from.
Returns
A pointer to a dynamically allocated string containing the id, or NULL in case of error.

The returned string is to be freed by calling ms_free().

§ linphone_presence_person_get_nb_activities()

unsigned int linphone_presence_person_get_nb_activities ( const LinphonePresencePerson person)

Gets the number of activities included in the presence person.

Parameters
[in]personThe LinphonePresencePerson object to get the number of activities from.
Returns
The number of activities included in the LinphonePresencePerson object.

§ linphone_presence_person_get_nb_activities_notes()

unsigned int linphone_presence_person_get_nb_activities_notes ( const LinphonePresencePerson person)

Gets the number of activities notes included in the presence person.

Parameters
[in]personThe LinphonePresencePerson object to get the number of activities notes from.
Returns
The number of activities notes included in the LinphonePresencePerson object.

§ linphone_presence_person_get_nb_notes()

unsigned int linphone_presence_person_get_nb_notes ( const LinphonePresencePerson person)

Gets the number of notes included in the presence person.

Parameters
[in]personThe LinphonePresencePerson object to get the number of notes from.
Returns
The number of notes included in the LinphonePresencePerson object.

§ linphone_presence_person_get_nth_activities_note()

LinphonePresenceNote* linphone_presence_person_get_nth_activities_note ( const LinphonePresencePerson person,
unsigned int  idx 
)

Gets the nth activities note of a presence person.

Parameters
[in]personThe LinphonePresencePerson object to get the activities note from.
[in]idxThe index of the activities note to get (the first note having the index 0).
Returns
A pointer to a LinphonePresenceNote object if successful, NULL otherwise.

§ linphone_presence_person_get_nth_activity()

LinphonePresenceActivity* linphone_presence_person_get_nth_activity ( const LinphonePresencePerson person,
unsigned int  idx 
)

Gets the nth activity of a presence person.

Parameters
[in]personThe LinphonePresencePerson object to get the activity from.
[in]idxThe index of the activity to get (the first activity having the index 0).
Returns
A pointer to a LinphonePresenceActivity object if successful, NULL otherwise.

§ linphone_presence_person_get_nth_note()

LinphonePresenceNote* linphone_presence_person_get_nth_note ( const LinphonePresencePerson person,
unsigned int  idx 
)

Gets the nth note of a presence person.

Parameters
[in]personThe LinphonePresencePerson object to get the note from.
[in]idxThe index of the note to get (the first note having the index 0).
Returns
A pointer to a LinphonePresenceNote object if successful, NULL otherwise.

§ linphone_presence_person_get_user_data()

void* linphone_presence_person_get_user_data ( const LinphonePresencePerson person)

Gets the user data of a LinphonePresencePerson object.

Parameters
[in]personThe LinphonePresencePerson object for which to get the user data.
Returns
A pointer to the user data.

§ linphone_presence_person_new()

LinphonePresencePerson* linphone_presence_person_new ( const char *  id)

Creates a presence person.

Parameters
[in]idThe id of the presence person to be created. Can be NULL to generate it automatically.
Returns
The created presence person, NULL on error.

§ linphone_presence_person_ref()

LinphonePresencePerson* linphone_presence_person_ref ( LinphonePresencePerson person)

Increase the reference count of the LinphonePresencePerson object.

Parameters
[in]personThe LinphonePresencePerson object for which the reference count is to be increased.
Returns
The LinphonePresencePerson object with the increased reference count.

§ linphone_presence_person_set_id()

int linphone_presence_person_set_id ( LinphonePresencePerson person,
const char *  id 
)

Sets the id of a presence person.

Parameters
[in]personThe LinphonePresencePerson object for which to set the id.
[in]idThe id string to set. Can be NULL to generate it automatically.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_person_set_user_data()

void linphone_presence_person_set_user_data ( LinphonePresencePerson person,
void *  user_data 
)

Sets the user data of a LinphonePresencePerson object.

Parameters
[in]personThe LinphonePresencePerson object for which to set the user data.
[in]user_dataA pointer to the user data to set.

§ linphone_presence_person_unref()

LinphonePresencePerson* linphone_presence_person_unref ( LinphonePresencePerson person)

Decrease the reference count of the LinphonePresencePerson object and destroy it if it reaches 0.

Parameters
[in]personThe LinphonePresencePerson object for which the reference count is to be decreased.
Returns
The LinphonePresencePerson object if the reference count is still positive, NULL if the object has been destroyed.

§ linphone_presence_service_add_note()

int linphone_presence_service_add_note ( LinphonePresenceService service,
LinphonePresenceNote note 
)

Adds a note to a presence service.

Parameters
[in]serviceThe LinphonePresenceService object for which to add a note.
[in]noteThe LinphonePresenceNote object to add to the service.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_service_clear_notes()

int linphone_presence_service_clear_notes ( LinphonePresenceService service)

Clears the notes of a presence service.

Parameters
[in]serviceThe LinphonePresenceService object for which to clear the notes.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_service_get_basic_status()

LinphonePresenceBasicStatus linphone_presence_service_get_basic_status ( const LinphonePresenceService service)

Gets the basic status of a presence service.

Parameters
[in]serviceThe LinphonePresenceService object to get the basic status from.
Returns
The LinphonePresenceBasicStatus of the LinphonePresenceService object given as parameter.

§ linphone_presence_service_get_contact()

char* linphone_presence_service_get_contact ( const LinphonePresenceService service)

Gets the contact of a presence service.

Parameters
[in]serviceThe LinphonePresenceService object to get the contact from.
Returns
A pointer to a dynamically allocated string containing the contact, or NULL if no contact is found.

The returned string is to be freed by calling ms_free().

§ linphone_presence_service_get_id()

char* linphone_presence_service_get_id ( const LinphonePresenceService service)

Gets the id of a presence service.

Parameters
[in]serviceThe LinphonePresenceService object to get the id from.
Returns
A pointer to a dynamically allocated string containing the id, or NULL in case of error.

The returned string is to be freed by calling ms_free().

§ linphone_presence_service_get_nb_notes()

unsigned int linphone_presence_service_get_nb_notes ( const LinphonePresenceService service)

Gets the number of notes included in the presence service.

Parameters
[in]serviceThe LinphonePresenceService object to get the number of notes from.
Returns
The number of notes included in the LinphonePresenceService object.

§ linphone_presence_service_get_nth_note()

LinphonePresenceNote* linphone_presence_service_get_nth_note ( const LinphonePresenceService service,
unsigned int  idx 
)

Gets the nth note of a presence service.

Parameters
[in]serviceThe LinphonePresenceService object to get the note from.
[in]idxThe index of the note to get (the first note having the index 0).
Returns
A pointer to a LinphonePresenceNote object if successful, NULL otherwise.

§ linphone_presence_service_get_user_data()

void* linphone_presence_service_get_user_data ( const LinphonePresenceService service)

Gets the user data of a LinphonePresenceService object.

Parameters
[in]serviceThe LinphonePresenceService object for which to get the user data.
Returns
A pointer to the user data.

§ linphone_presence_service_new()

LinphonePresenceService* linphone_presence_service_new ( const char *  id,
LinphonePresenceBasicStatus  basic_status,
const char *  contact 
)

Creates a presence service.

Parameters
[in]idThe id of the presence service to be created. Can be NULL to generate it automatically.
[in]basic_statusThe LinphonePresenceBasicStatus to set for the LinphonePresenceService object.
[in]contactThe contact string to set.
Returns
The created presence service, NULL on error.

The created presence service has the basic status 'closed'.

§ linphone_presence_service_ref()

LinphonePresenceService* linphone_presence_service_ref ( LinphonePresenceService service)

Increase the reference count of the LinphonePresenceService object.

Parameters
[in]serviceThe LinphonePresenceService object for which the reference count is to be increased.
Returns
The LinphonePresenceService object with the increased reference count.

§ linphone_presence_service_set_basic_status()

int linphone_presence_service_set_basic_status ( LinphonePresenceService service,
LinphonePresenceBasicStatus  basic_status 
)

Sets the basic status of a presence service.

Parameters
[in]serviceThe LinphonePresenceService object for which to set the basic status.
[in]basic_statusThe LinphonePresenceBasicStatus to set for the LinphonePresenceService object.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_service_set_contact()

int linphone_presence_service_set_contact ( LinphonePresenceService service,
const char *  contact 
)

Sets the contact of a presence service.

Parameters
[in]serviceThe LinphonePresenceService object for which to set the contact.
[in]contactThe contact string to set.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_service_set_id()

int linphone_presence_service_set_id ( LinphonePresenceService service,
const char *  id 
)

Sets the id of a presence service.

Parameters
[in]serviceThe LinphonePresenceService object for which to set the id.
[in]idThe id string to set. Can be NULL to generate it automatically.
Returns
0 if successful, a value < 0 in case of error.

§ linphone_presence_service_set_user_data()

void linphone_presence_service_set_user_data ( LinphonePresenceService service,
void *  user_data 
)

Sets the user data of a LinphonePresenceService object.

Parameters
[in]serviceThe LinphonePresenceService object for which to set the user data.
[in]user_dataA pointer to the user data to set.

§ linphone_presence_service_unref()

LinphonePresenceService* linphone_presence_service_unref ( LinphonePresenceService service)

Decrease the reference count of the LinphonePresenceService object and destroy it if it reaches 0.

Parameters
[in]serviceThe LinphonePresenceService object for which the reference count is to be decreased.
Returns
The LinphonePresenceService object if the reference count is still positive, NULL if the object has been destroyed.