Managing Buddies and buddy list and presence 管理好友、好友列表以及在线
宏
#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_subscribe_enabled
#define linphone_friend_sent_subscribe linphone_friend_enable_subscribes
自定义类型
枚举类型
enum _LinphoneFriendListStatus{
LinphoneFriendListOk,
LinphoneFriendListNonExistentFriend,
LinphoneFriendListInvalidFriend}
enum _LinphoneFriendListSyncStatus{
LinphoneFriendListSyncStarted,
LinphoneFriendListSyncSuccessful,
LinphoneFriendListSyncFailure }
enum _LinphoneSubscribePolicy{
LinphoneSPWait,
LinphoneSPDeny,
LinphoneSPAccept }
enum _LinphoneOnlineStatus{
LinphoneStatusOffline,
LinphoneStatusOnline,
LinphoneStatusBusy,
LinphoneStatusBeRightBack,
LinphoneStatusAway,
LinphoneStatusOnThePhone,
LinphoneStatusOutToLunch,
LinphoneStatusDoNotDisturb,
LinphoneStatusMoved,
LinphoneStatusAltService,
LinphoneStatusPending,
LinphoneStatusVacation,
LinphoneStatusEnd }
enum LinphonePresenceBasicStatus{
LinphonePresenceBasicStatusOpen,
LinphonePresenceBasicStatusClosed
}
enum LinphonePresenceActivityType{
LinphonePresenceActivityOffline,
LinphonePresenceActivityOnline,
LinphonePresenceActivityAppointment,
LinphonePresenceActivityAway,
LinphonePresenceActivityBreakfast,
LinphonePresenceActivityBusy,
LinphonePresenceActivityDinner,
LinphonePresenceActivityHoliday,
LinphonePresenceActivityInTransit,
LinphonePresenceActivityLookingForWork,
LinphonePresenceActivityLunchm
LinphonePresenceActivityMeal,
LinphonePresenceActivityMeeting,
LinphonePresenceActivityOnThePhone,
LinphonePresenceActivityOther,
LinphonePresenceActivityPerformance,
LinphonePresenceActivityPermanentAbsence,
LinphonePresenceActivityPlaying,
LinphonePresenceActivityPresentation,
LinphonePresenceActivityShopping,
LinphonePresenceActivitySleeping,
LinphonePresenceActivitySpectator,
LinphonePresenceActivitySteering,
LinphonePresenceActivityTravel,
LinphonePresenceActivityTV,
LinphonePresenceActivityUnknown,
LinphonePresenceActivityVacation,
LinphonePresenceActivityWorking,
LinphonePresenceActivityWorship }
函数
详细说明
好友和好友列表
每一个好友代表一个LinphoneFriend对象,是由函数linphone_friend_new()创建的.好友配置参数像sip uri或者状态发布策略.
下面是一个典型的好友创建实例:
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*/
好友状态发送改变由回调函数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));
}
一旦好友创建完成,可以使用函数linphone_core_add_friend()将好友添加到好友列表. 添加的好友会被通知本地的状态更改(参见linphone_core_set_presence_info)
任何后面对LinphoneFriend的修改必须先调用linphone_friend_edit()然后由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*/
发布在线状态
本地在线状态可以由函数linphone_core_set_presence_model()来修改.新状态被传播到所有好友,之前已添加到LinphoneCore(参见linphone_core_add_friend).
处理传入的订阅请求
根据传入的订阅策略状态(针对由好友列表的成员发起的订阅),对新传入的订阅请求进行处理
对于来自一个不明好友的传入请求,回调LinphoneCore_VTable.new_subscription_request被调用
一个完整的教程:Basic buddy status notification
宏定义文档
#define linphone_friend_new_with_addr linphone_friend_new_with_address
构造函数 相对于 linphone_friend_new() + linphone_friend_set_address()
已弃用:
用linphone_friend_new_with_address代替
#define linphone_friend_set_addr linphone_friend_set_address
为这个好友设置LinphoneAddress
已弃用:
用linphone_friend_set_address代替
自定义类型文档
typedef struct _LinphoneFriend LinphoneFriend
代表一个好友,所有在线操作例如订阅和状态更改通知都是在这个对象上执行
typedef struct _LinphoneFriendList LinphoneFriendList
LinphoneFriendList对象代表一个好友列表
typedef struct _LinphoneFriendListCbs LinphoneFriendListCbs
控制回调函数实现LinphoneFriend同步的对象
typedef void(* LinphoneFriendListCbsContactCreateCb)(LinphoneFriendList * list, LinphoneFriend* lf)
回调函数用于通知一个新的联系人已经被添加在CardDAV服务器上并已在本地下载
参数
list LinphoneFriendList对象 代表新联系人被添加到该列表中
lf LinphoneFriend对象 代表已经被添加的联系人
typedef void(*LinphoneFriendListCbsContactDeletedCb)(LinphoneFriendList* list, LinphoneFriend* lf)
回调函数用于通知一个联系人在CardDAV服务器上删除.
参数
list LinphoneFriendList对象 代表联系人从该列表中删除
lf LinphoneFriend对象 代表被删除的联系人
typedef void(* LinphoneFriendListCbsContactUpdateCb)(LinphoneFriendList* list, LinphoneFriend* new_friend, LinphoneFriend* old_friend)
回调函数用于通知一个联系人在CardDav服务器上被更新
参数
list LinphoneFriendList对象 代表更新的联系人所在的列表
new_friend 与更新的联系人对应新的LinphoneFriend对象
old_friend 更新前的LinphoneFriend对象
typedef void(* LinphoneFriendListCbsSyncStateChangedCb)(LinphoneFriendList* list,LinphoneFriendListSyncStates status, const char*msg)
回调函数用于通知同步的状态已经改变
参数
list状态发生改变的LinphoneFriendList对象
status 新的同步状态
msg 在状态更新上的额外信息
typedef enum _LinphoneFriendListStatus LinphoneFriendListStatus
枚举描述LinphoneFriendList操作的状态
typedef enum _LinphoneFriendListSyncStatus LinphoneFriendListSyncStatus
枚举 描述CardDAV同步的状态
typedef enum _LinphoneOnlineStatus LinphoneOnlineStatus
枚举 描述远程好友的状态
已弃用:
用 LinphonePresenceModel和LinphonePresenceActivity代替
typedef enum _LinphoneOnlineStatus LinphoneOnlineStatus
枚举 描述远程的好友状态
已弃用:
用LinphonePresenceModel和LinphonePresenceActivity代替
typedef struct _LinphonePresenceActivity LinphonePresenceActivity
在线活动类型
typedef enum _LinphonePresenceActivityType LinphonePresenceActivityType
在RFC 4480的3.2节中定义的活动
typedef enum _LinphonePresenceBasicStatus LinphonePresenceBasicStatus
在RFC 3863的4.1.4节中的定义的基本状态
typedef struct _LinphonePresenceModel LinphonePresenceModel
在线模式类型 包含了关于一个人的在线信息
typedef struct _LinphonePresenceNote LinphonePresenceNote
在线状态记录类型 包含了一个在线状态记录的信息
typedef struct _LinphonePresencePerson LinphonePresencePerson
在线的人 包含一个在线的人的信息
typedef struct _LinphonePresenceService LinphonePresenceService
在线服务类型 包含一个在线服务的信息
typedef enum _LinphoneSubscribePolicy LinphoneSubscribePolicy
枚举 针对传入的订阅请求的控制行为.被用于linphone_friend_set_inc_subscribe_policy()
枚举类型文档
enum _LinphoneFriendListStatus
枚举 描述一个LinphoneFriendList操作的状态
enum _LinphoneFriendListSyncStatus
枚举 描述 CardDAV同步的状态
enum _LinphoneOnlineStatus
枚举 描述远程好友状态
已弃用:
用 LinphonePresenceModel和LinphonePresenceActivity代替
枚举成员
LinphoneStatusOffline Offline 离线
LinphoneStatusOnline Online 在线
LinphoneStatusBusy Busy 忙碌
LinphoneStatusBeRighBack Be right back 很快回来
LinphoneStatusAway Away 离开
LinphoneStatusOnThePhone On the phone 正在通话
LinphoneStatusOutToLunch Out to lunch 外出吃饭
LinphoneStatusDoNotDisturb Do not disturb 请勿打扰
LinphoneStatusMoved 在这个状态下,如果一个备用联系地址已经被设置(通过使用函数 linphone_core_set_presence_info()), 通话可以被重定向.
LinphoneStatusAltService 正在使用其他消息服务
LinphoneStatusPending 挂起
LinphoneStatusVacation 休假
enum _LinphoneSubscribePolicy
枚举 传入的订阅请求的控制行为 被用于linphone_friend_set_inc_subscribe_policy()
枚举成员
LinphoneSPWait 不自动接受一个个传入订阅请求. 这个策略意味着决定每个传入的订阅请求由回调 LinphoneCoreVTable.new_subscription_requested
LinphoneSPDeny 拒绝传入的订阅请求
LinphoneSPAccept 自动接受一个订阅请求
enum LinphonePresenceActivityType
RFC 4480的3.2节中定义的Activities
枚举成员
LinphonePresenceActivityOffline 这个值没有在RFC中定义,对应"关闭"的基本状态
LinphonePresenceActivityOnline 这个值没有在RFC中定义,对应"打开"的基本状态
LinphonePresenceActivityAppointment 该人有约会
LinphonePresenceActivityAway 该人在身体上远离了所有交互式通信设备
LinphonePresenceActivityBreakfast 在吃早餐
LinphonePresenceActivityBusy 该人很忙,没有进一步的细节说明
LinphonePresenceActivityDinner 在吃晚餐
LinphonePresenceActivityHoliday 这是一个预定的国家或当地的节日
LinphonePresenceActivityInTransit 在行车中
LinphonePresenceActivityLookingForWork 该人正在找(高薪)工作
LinphonePresenceActivityLunch 在吃午餐
LinphonePresenceActivityMeal 在用餐,不指定是早餐午餐还是晚餐,还是其他聚餐
LinphonePresenceActivityOnThePhone 正在通话中
LinphonePresenceActivityOther 从事没有定义陈述的活动.
LinphonePresenceActivityPerformance 表演是约会的子类,包括音乐、戏剧和电影表演以及讲座.这个区别于会议
LinphonePresenceActivityPermanentAbsence 该人不会回来,例如,他不再为这家公司工作
LinphonePresenceActivityPlaying 在娱乐,运动
LinphonePresenceActivityPresentation 在演讲,讲座,或参加一个正式的圆桌讨论
LinphonePresenceActivityShopping 在购物或者购买服务
LinphonePresenceActivitySleeping 在睡觉
LinphonePresenceActivitySpectator 在观察事件,例如体育赛事
LinphonePresenceActivitySteering 在驾驶汽车、船、飞机
LinphonePresenceActivityTravel 在出差或者个人旅行,但一定在途中
LinphonePresenceActivityTV 在看电视
LinphonePresenceActivityUnkown 未知活动
LinphonePresenceActivityVacation 一段时间内致力于快乐、休息或放松
LinphonePresenceActivityWorking 在工作
LinphonePresenceActivityWorship 这个人在参加宗教仪式
enum LinphonePresenceBasicStatus
RFC3863 4.1.4节定义的基本状态
枚举成员
LinphonePresenceBasicStatusOpen 这个值意味着相关的连接元素,如果有的话,准备接受通信
LinphonePresenceBasicStatusClosed 这个值意味着相关的连接元素,如果有的话, 无法接受通信
函数文档
void linphone_core_add_friend(LinphoneCore* lc, LinphoneFriend* fr)
添加一个朋友到当前的好友列表,如果设置了订阅属性,SIP SUBSCRIBE消息会被发送
参数
lc LinphoneCore对象
fr LinphoneFriend 需要添加的好友
已弃用:
用linphone_friend_list_add_friend()代替
void linphone_core_add_friend_list(LinphoneCore* lc, LinphoneFriendList* list)
添加一个好友列表
参数
[in] lc LinphoneCore对象
[in] list LinphoneFriendList对象
LinphoneFriend* linphone_core_create_friend(LinphoneCore* lc)
参数
[in] lc LinphoneCore对象
[in] list LinphoneFriendList对象
LinphoneFriend* linphone_core_create_friend_list(LinphoneCore* lc)
创建一个新的空的LinphoneFriendList对象
参数
[in] lc LinphoneCore对象
返回
一个新的LinphoneFriendList对象
LinphoneFriend* linphone_core_create_friend_with_address(LinphoneCore* lc, const char* address)
从一个给定的地址创建一个LinphoneFriend
参数
[in] lc LinphoneCore对象
[in] address
返回
创建的LinphoneFriend对象
LinphonePresenceActivity* linphone_core_create_presence_activity(LinphoneCore* lc, LinphonePresenceActivityType accttype, const char* description)
用给定的类型和描述创建一个LinphonePresenceActivity
参数
[in] lc LinphoneCore对象
[in] acttype 为在线状态设置的LinphonePresenceActivityType对象
[in] description 在线状态的额外描述.如果不添加额外的描述,可以设为NULL
返回
创建的LinphonePresenceActivity对象
LinphonePresenceModel* linphone_core_create_presence_model(LinphoneCore* lc)
创建一个默认的LinphonePresenceModel.
参数
[in] lc LinphoneCore对象
返回
创建LinphonePresenceModel 对象
LinphonePresenceModel * linphone_core_create_presence_model_with_activity(LinphoneCore* lc, LinphonePresenceActivityType acttype, const char* description)
用给定的活动类型和活动描述来创建一个LinphonePresenceModel
参数
[in] lc LinphoneCore对象
[in] acttype LinphonePresenceActivity 对象
[in] description 额外的描述,如果不添加额外的描述,可以设置为NULL
返回
创建LinphonePresenceModel对象
LinphonePresenceModel* linphone_core_create_presence_model_with_activity_and_note(LinphoneCore* lc, LinphonePresenceActivityType acttype, const char* description, const char* note, const char* lang)
用给定的活动类型、活动描述、记录内容和记录语言
参数
[in] lc LinphoneCore对象
[in] acttype 为创建的model的activity设置的LinphonePresenceActivityType对象
[in] description 活动的额外描述,如果不添加额外的描述可以设置为NULL
[in] note 记录内容
[in] lang 记录的语言
返回
创建的LinphonePresenceModel对象
LinphonePresenceNote* linphone_core_create_presence_note(LinphoneCore* lc, const char* content, const char* lang)
用给定的内容和语言来创建一个LinphonePresenceNote对象
参数
[in] lc LinphoneCore对象
[in] content 创建的记录的内容
[in] lang 创建的记录的语言
返回
创建的LinphonePresenceNote对象
LinphonePresencePerson* linphone_core_create_presence_person(LinphoneCore* lc, const char* id)
用给定的id创建一个LinphonePresencePerson对象
参数
[in] lc LinphoneCore对象
[in] id 被创建人的id
返回
创建的LinphonePresencePerson对象
LinphonePresenceService* linphone_core_create_presence_service(LinphoneCore* lc, const char* id, LinphonePresenceBasicStatus basic_status, const char* contact)
用给定的id、basic status和contact创建一个LinphoePresenceService对象
参数
[in] lc LinphoneCore对象
[in] id 创建的service的id
[in] basic_status
[in] contact 包含与创建的服务相关的联系信息的字符串
返回
创建LinphonePresenceService对象
LinphoneFriend* linphone_core_find_friend(const LinphoneCore* lc, const LinphoneAddress* addr)
通过地址查找一个LinphoneFriend对象
参数
[in] lc LinphoneCore对象
[in] addr 用于搜索好友的地址
返回
与给定地址相关联的LinphoneFriend对象
LinphoneFriendList* linphone_core_get_default_friend_list(const LinphoneCore* lc)
从内核中检索出第一个LinphoeFriend列表
参数
[in] lc LinphoneCore对象
返回
第一个LinphoneFriendList对象或者NULL
LinphoneFriend* linphone_core_get_friend_by_address(const LinphoneCore* lc, const char* addr)
通过地址搜索一个LinphoneFriend对象
参数
[in] lc LinphoneCore对象
[in] addr 用来搜索好友的地址
返回
与给定地址相关联的LinphoneFriend对象
已弃用:
用linphone_core_find_friend()代替
LinphoneFriend* linphone_core_get_friend_by_ref_key(const LinphoneCore* lc, const char* key)
通过它的引用键来搜索一个LinphoneFriend对象
参数
[in] lc LinphoneCore对象
[in] key 用来搜索好友的引用键
返回
与给定引用键相关联的LinphoneFriend对象
const bctbx_list_t* linphone_core_get_friend_list(const LinphoneCore* lc)
获取好友列表
参数
[in] lc LinphoneCore对象
返回
一个LinphoneFriend对象的列表
已弃用:
用linphone_core_get_friends_lists()或linphone_friend_list_get_friends()代替
const bctbx_list_t* linphone_core_get_friends_lists(const LinphoneCore* lc)
从core中获取LinphoneFriendList的链表
参数
[in] lc LinphoneCore对象
返回
LinphoneFriendList对象的列表.
LinphoneOnlineStatus linphone_core_get_presence_info(const LinphoneCore* lc)
获取我的在线状态
参数
[in] lc LinphoneCore对象
返回
LinphoneOnlineStatus
已弃用:
用linphone_core_get_presence_model()代替
LinphonePresenceModel* linphone_core_get_presence_model(const LinphoneCore* lc)
获取我的在线模式
参数
[in] lc LinphoneCore对象
返回
LinphonePresenceModel对象,如果没有设置在线模式返回NULL.
void linphone_core_interpret_friend_uri(LinphoneCore* lc, const char* uri, char** result)
已弃用:
用linphone_core_interpret_url()代替
void linphone_core_notify_all_friends(LinphoneCore* lc, LinphonePresenceModel* presence)
通知所有已订阅的好友
参数
lc LinphoneCore对象
presence 用来通知的LinphonePresenceModel对象
void linphone_core_reject_subscriber(LinphoneCore* lc, LinphoneFriend* lf)
拉黑一个好友.等同于 linphone_friend_set_inc_subscribe_policy()设置为LinphoneSPD策略
参数
lc LinphoneCore对象
lf LinphoneFriend对象
void linphone_core_remove_friend(LinphoneCore* lc, LinphoneFriend* fr)
从好友列表中移除好友
参数
lc LinphoneCore对象
fr 要移除的LinphoneFriend对象
已移除:
用linphone_friend_list_remove_friend()代替
void linphone_core_set_presence_info(LinphoneCore* lc, int minutes_away, const char* alternative_contact, LinphoneOnlineStatus os)
设置我的在线状态
参数
[in] lc LinphoneCore对象
[in] minutes_away 离开多久
[in] alternative_contact sip uri用于重定向通话,在状态LinphoneStatusMoved中
[in] os LinphoneOnlineStatus
已弃用:
用linphone_core_set_presence_model()代替
void linphone_core_set_presence_model(LinphoneCore* lc, LinphonePresenceModel* presence)
设置我的在线模式
参数
[in] lc LinphoneCore对象
[in] presence LinphonePresenceModel对象
void linphone_friend_add_address(LinphoneFriend* lf, const LinphoneAddress* addr)
添加一个地址到指定好友
参数
lf LinphoneFriend对象
addr LinphoneAddress对象
void linphone_friend_add_phone_number(LinphoneFriend* lf, const char* phone)
添加一个手机号码到指定好友
参数
lf LinphoneFriend对象
phone 手机号码
bool_t linphone_friend_create_vcard(LinphoneFriend* lf, const char* name)
创建一个电子名片对象关联到这个好友,如果没有全名可用,也可通过参数或好友的SIP URI
参数
[in] fr LinphoneFriend对象
[in] name 好友的全名 或者 NULL (用好友的sip uri)
返回
如果电子名片创建成功返回 true,如果不可能(例如,如果name和好友的SIP URI都是NULL 或者 好友的SIP URI没有显示名称),或者这里已经有一个电子名片了,就返回false
void linphone_friend_destroy(LinphoneFriend* lf)
销毁一个LinphoneFriend对象
参数
lf LinphoneFriend对象
已弃用:
用linphone_friend_unref()代替
void linphone_friend_done(LinphoneFriend* fr)
提交对好友配置的修改
参数
fr LinphoneFriend对象
void linphone_friend_edit(LinphoneFriend* fr)
开启编辑一个好友配置
因为好友配置必须一致,所有在对好友配置进行任何修改之前(例如address、subscription policy),应用程序必须先调用 才 linphone_friend_edit().一旦完成更改,应用程序必须调用linphone_friend_done()来提交修改.
int linphone_friend_enable_subscribes(LinphoneFriend* fr, bool_t val)
配置LinphoneFriend订阅在线信息
参数
fr LinphoneFriend对象
val 如果为TRUE ,这个好友会收到订阅消息
const LinphoneAddress* linphone_friend_get_address(const LinphoneFriend* lf)
获取这个好友的地址
参数
lf LinphoneFriend对象
返回
LinphoneAddress对象
bctbx_list_t* linphone_friend_get_addresses(LinphoneFriend* lf)
返回这个好友的LinphoneAddress列表
参数
lf LinphoneFriend对象
返回
LinphoneAddress对象列表
LinphoneCore* linphone_friend_get_core(const LinphoneFriend* fr)
返回管理这个好友的LinphoneCore对象,如果有的话.
参数
[in] fr LinphoneFriend对象
LinphoneSubscribePolicy linphone_friend_get_inc_subscribe_policy(const LinphoneFriend* lf)
获取指定LinphoneFriend对象当前的订阅策略
参数
lf LinphoneFriend对象
返回
LinphoneSubscribePolicy
const char* linphone_friend_get_name(const LinphoneFriend* lf)
获取指定好友的显示名称
参数
lf LinphoneFriend对象
返回
好友的显示名称
bctbc_list_t* linphone_friend_get_phone_numbers(LinphoneFriend* lf)
返回指定好友的手机号码列表
参数
lf LinphoneFriend对象
返回
一个constchar*对象的列表
const LinphonePresenceModel* linphone_friend_get_presence_model(LinphoneFriend* lf)
获取一个好友的在线模式
参数
[in] lf LinphoneFriend 对象
返回
一个LinphonePresenceModel对象,如果好友没有在线信息(在这种情况下,他被认为离线)为NULL
const char* linphone_friend_get_ref_key(const LinphoneFriend* lf)
获取一个好友的引用键
参数
[in] lf LinphoneFriend对象
返回
好友的引用键
LinphoneOnlineStatus linphone_friend_get_status(const LinphoneFriend* lf)
获取好友的状态
参数
[in] lf LinphoneFriend对象
返回
LinphoneOnlineStatus
已弃用:
用linphone_friend_get_presence_model() 代替
LinphoneSubscriptionState linphone_friend_get_subscription_state(const LinphoneFriend* lf)
获取好友的订阅状态
参数
[in] lf LinphoneFriend对象
返回
LinphoneSubscriptionState
void* linphone_friend_get_user_data(const LinphoneFriend* lf)
获取与好友相关联的user data
LinphoneVcard* linphone_friend_get_vcard(LinphoneFriend* fr)
返回与指定好友相关的电子名片,如果有的话.
参数
[in] fr LinphoneFriend对象
bool_t linphone_friend_in_list(const LinphoneFriend* lf)
检测给定的好友是否在好友列表
参数
[in] lf LinphoneFriend对象
返回
如果好友在好友列表中返回TRUE,否则返回FALSE.
bool_t linphone_friend_is_presence_received(const LinphoneFriend* lf)
告诉我们是否已经收到一个好友的在线信息.
参数
[in] lf LinphoneFriend对象
返回
如果指定好友的在线信息已经收到,返回TRUE, 否则返回FALSE
LinphoneFriendListStatus linphone_friend_list_add_friend(LinphoneFriendList * list, LinphoneFriend* lf)
添加一个好友到好友列表.如果或者当远程CardDAV服务器将被连接到该列表,该好友会发送到服务器.
参数
[in] list LinphoneFriendList对象
[in] lf LinphoneFriend对象
返回
如果添加成功返回LinphoneFriendListOK,如果好友是无效的返回LinphoneFriendListInvalidFriend
LinphoneFriendListStatus linphone_friend_list_add_local_friend(LinphoneFriendList* list, LinphoneFriend* lf)
添加一个好友到好友列表.该好友永远不会发送到远程的CardDAV服务器.警告! 这样添加的LinphoneFriend会在下次同步的时候移除.并contact_deleted回调会被调用.
参数
[in] list LinphoneFriendList对象
[in] lf 添加到好友列表的LinphoneFriend对象
返回
如果天添加成功返回LinphoneFriendListOK,如果好友无效返回LinphoneFriendInvalidFriend
LinphoneFriendListCbsContactCreateCb linphone_friend_list_cbs_get_contact_created(const LinphoneFriendListCbs* cbs)
获取contact创建回调
参数
[in] cbs LinphoneFriendListCbs对象
返回
当前contact创建回调
LinphoneFriendListCbsContactDeletedCb linphone_friend_list_cbs_get_contact_deleted(const LinphoneFriendListCbs* cbs)
获取contact删除回调
参数
[in] cbs LinphoneFriendListCbs对象
返回
当前contact删除回调
LinphoneFriendListCbsContactUpdatedCb linphone_friend_list_cbs_get_contact_updated(const LinphoneFriendListCbs* cbs)
获取contact更新回调
参数
[in] cbs LinphoneFriendListCbs对象
返回
当前contact更新回调
LinphoneFriendListCbsSyncStateChangedCb linphone_friend_list_cbs_get_sync_status_changed(const LinphoneFriendListCbs* cbs)
获取同步状态改变回调
参数
[in] cbs LinphoneFriendListCbs对象
返回
当前同步状态改变回调
void* linphone_friend_list_cbs_get_user_data(const LinphoneFriendListCbs* cbs)
获取与LinphoneFriendListCbs对象有关的用户指针(user_data)
参数
[in] cbs LinphoneFriendListCbs对象
返回
当前同步状态改变回调
LinphoneFriendListCbs* linphone_friend_list_cbs_ref(LinphoneFriendListCbs* cbs)
获取一个LinphoneFriendListCbs对象的引用
参数
[in] cbs LinphoneFriendListCbs对象
返回
一样的LinphoneFriendList对象
void linphone_friend_list_cbs_set_contact_created(LinphoneFriendListCbs* LinphoneFriendListCbsContactCreatedCb cb)
设置contact创建回调
参数
[in] cbs LinphoneFriendListCbs对象
[in] cb 用于contact创建
返回
一样的LinphoneFriendListCbs对象
void linphone_friend_list_cbs_set_contact_deleted(LinphoneFriendListCbs* cbs, LinphoneFriendListCbsContactDeletedCb cb)
设置contact删除回调
参数
[in] cbs LinphoneFriendListCbs对象
[in] cb 用于contact删除
void linphone_friend_list_cbs_set_contact_updated(LinphoneFriendListCbs* cbs, LinphoneFriendListCbsContactUpdatedCb cb)
设置contact更新回调
参数
[in] cbs LinphoneFriendListCbs对象
[in] cb 用于contact更新
void linphone_friend_list_cbs_set_sync_status_changed(LinphoneFriendListCbs* cbs, LinphoneFriendListCbsSyncStateChangedCb cb)
设置同步状态改变回调
参数
[in] cbs LinphoneFriendListCbs对象
[in] cb 用于同步状态改变
void linphone_friend_list_cbs_set_user_data(LinphoneFriendListCbs* cbs, void* ud)
设置一个用户指针给LinphoneFriendListCbs对象
参数
[in] cbs LinphoneFriendListCbs对象
[in] ud 与LinphoneFriendListCbs对象相关联的用户指针
void linphone_friend_list_cbs_unref(LinphoneFriendListCbs* cbs)
释放一个LinphoneFriendListCbs对象的引用
c参数
[in] cbs LinphoneFriendListCbs对象
void linphone_friend_list_enable_subscriptions(LinphoneFriendList* list, bool_t enabled)
启用订阅所有好友列表的通知
参数
[in] list LinphoneFriendList对象
[in] enabled 禁用或者启用订阅
void linphone_friend_list_export_friends_as_vcard4_file(LinphoneFriendList* list, const char* vcard_file)
创建并从LinphoneFriendList中将LinphoneFriend对象导出到一个文件(vCard4格式)
参数
[in] list LinphoneFriendList对象
[in] vcard_file 包含vCards的文件路径
LinphoneFriend* linphone_friend_list_find_friend_by_address(const LinphoneFriendList* list, const LinphoneAddress* address)
用LinphoneAddress来在好友列表中搜索好友
参数
[in] list LinphoneFriendList 对象
[in] address LinphoneAddress对象
返回
如果找到放回LinphoneFriend对象,否则返回NULL.
LinphoneFriend* linphone_friend_list_find_friend_by_uri(const LinphoneFriendList* list, const char* uri)
用URI字符串在好友列表中搜索好友
参数
[in] list LinphoneFriendList对象
[in] uri URI字符串
返回
如果找到返回LinphoneFriend对象,否则返回NULL
LinphoneFriendListCbs* libphone_friend_list_get_callbacks(const LinphoneFriendList* list)
获取与LinphoneFriendList相关联的LinphoneFriendListCbs对象
参数
[in] list LinphoneFriendList对象
返回
一个LinphoneCore对象
const char* linphone_friend_list_get_display_name(const LinphoneFriendList* list)
获取好友列表的显示名称
参数
[in] list LinphoneFriendList 对象
返回
好友列表的显示名称
const bctbx_list_t* linphone_friend_list_get_friends(const LinphoneFriendList* list)
从指定的LinphoneFriendList中获取好友列表
参数
[in] list LinphoneFriendList对象
返回
LinphoneFriend对象的列表
const char* linphone_friend_list_get_rls_uri(const LinphoneFriendList* list)
获取与好友列表相关联的RLS(资源列表服务器)URI,订阅这些好友的在线状态
参数
[in] list LinphoneFriendList对象
返回
与好友列表相关联的RLS URI
const char* linphone_friend_list_get_uri(const LinphoneFriendList* list)
获取与好友列表相关联的URI
参数
[in] list LinphoneFriendList对象
返回
与好友列表相关联的URI
void* linphone_friend_list_get_user_data(const LinphoneFriendList* list)
获取与好友列表相关联的用户指针
参数
[in] list LinphoneFriendList对象
返回
与好友列表相关联的用户指针
int linphone_friend_list_import_friends_from_vcard4_buffer(LinphoneFriendList* list, const char* vcard_buffer)
创建并添加一个LinphoneFriend对象到LinphoneFriendList 从一个缓存区中(包含vCard(s)解析)
参数
[in] list LinphoneFriendList对象
[in] vcard_buffer 包含需要解析vCards的缓冲区
返回
新创建的linphoneFriend数目
void linphone_friend_list_notify_presence(LinphoneFriendList* list, LinphonePresenceModel* presence)
通知我们的在线状态给所有在好友列表上的好友,他们都已经直接订阅了我们的在线状态(没有使用RLS)
参数
[in] list LinphoneFriendList对象
[in] presence LinphonePresenceModel对象
LinphoneFriendList* linphone_friend_list_ref(LinphoneFriendList* list)
获取好友列表的引用
参数
[in] list LinphoneFriendList对象
返回
一样的LinphoneFriendList对象
LinphoneFriendListStatus linphone_friend_list_remove_friend(LinphoneFriendList* list, LinphoneFriend* lf)
从一个好友列表中移除一个好友
参数
[in] list LinphoneFriendList对象
[in] lf 从好友列表中移除的LinphoneFriend对象
返回
如果移除成功返回 LinphoneFriendListOk,如果好友不在这个好友列表中,返回LinphoneFriendListNonExistenFriend
void linphone_friend_list_set_display_name(LinphoneFriendList* list, const char* display_name)
设置好友列表的显示名称
参数
[in] list LinphoneFriendList对象
[in] display_name 好友列表的新的显示名称
void linphone_friend_list_set_rls_uri(LinphoneFriendList* list, const char* rls_uri)
设置与好友列表相关联的RLS(资源列表服务器)URI,来订阅这些好友在线状态
参数
[in] list LinphoneFriendList对象
[in] rls_uri 与该好友列表相关联的RLS 的URI
void linphone_friend_list_set_uri(LinphoneFriendList* list, const char* uri)
设置与好友列表相关联的URI
参数
[in] list LinphoneFriendList对象
[in] uri 与好友列表相关联的URI
void linphone_friend_list_set_user_data(LinphoneFriendList* list, void* ud)
设置一个用户指针给好友列表
参数
[in] list LinphoneFriendList对象
[in] ud 与好友列表相关联的用户指针
void linphone_friend_list_synchronize_friend_from_server(LinphoneFriendList* list)
开始一个CardDAV同步,通过使用由linphone_friend_list_set_uri设置的值
参数
[in] list LinphoneFriendList对象
void linphone_friend_list_unref(LinphoneFriendList* list)
释放好友列表的引用
参数
[in] list LinphoneFriendList对象
void linphone_friend_list_update_dirty_friends(LinphoneFriendList* list)
检查所有的dirty的LinphoneFriend, 并且做CardDAV PUT更新到服务器
参数
[in] list LinphoneFriendList对象
void linphone_friend_list_update_revision(LinphoneFriendList *list, int rev)
从最近同步中设置修订本.
参数
[in] list LinphoneFriendList 对象
[in] rev 修订版
LINPHONE_DEPRECATED LinphoneFriend* linphone_friend_new(void )
构造函数
返回
一个新的空的LinphoneFriend对象
已弃用
用linphone_core_create_friend代替
LinphoneFriend* linphone_friend_new_from_vcard(LinphoneVcard* vcard)
构造函数 等同于 linphone_friend_new()+linphone_friend_set_address()
参数
vcard 一个vCard对象
返回
用vCard初始化的新建的LinphoneFriend对象
LINPHONE_DEPRECATED LinphoneFriend* linphone_friend_new_with_address(const char* addr)
构造函数 等同于linphone_friend_new() + linphone_friend_set_address()
参数
addr 好友地址,必须是一个sip地址 像sip:joe@sip.linphone.org
返回
用地址初始化的LinphoneFriend对象
已弃用:
用linphone_core_create_friend_with_address 代替
LinphoneFriend* linphone_friend_ref(LinphoneFriend* lf)
获取LinphoneFriend的引用
参数
[in] lf LinphoneFriend对象
返回
一样的LinphoneFriend对象
void linphone_friend_remove_address(LinphoneFriend* lf, const LinphoneAddress* addr)
从好友中移除一个地址
参数
lf LinphoneFriend对象
addr LinphoneAddress对象
void linphone_friend_remove_phone_number(LinphoneFriend* lf, const char* phone)
从好友中移除一个手机号码
参数
lf LinphoneFriend对象
phone 移除的号码
void linphone_friend_save(LinphoneFriend* fr, LinphoneCore* lc)
保存一个好友到数据库,如果配置有数据库,否则保存到linphonerc
参数
fr 要保存的好友
lc LinphoneCore对象
int linphone_friend_set_address(LinphoneFriend* fr, const LinphoneAddress* address)
为好友设置LinphoneAddress
参数
fr LinphoneFriend对象
address LinphoneAddress对象
int linphone_friend_set_inc_subscribe_policy(LinphoneFriend* fr, LinphoneSubscribePolicy pol)
为这个好友配置传入订阅策略
参数
fr LinphoneFriend对象
pol LinphoneSubscribePolicy 应用的策略
int linphone_friend_set_name(LinphoneFriend* lf, const char* name)
设置好友显示的名称例如joe
参数
lf LinphoneFriend对象
name
void linphone_friend_set_presence_model(LinphoneFriend* lf, LinphonePresenceModel* presence)
设置一个好友的在线模式
参数
[in] lf LinphoneFriend对象
[in] presence LinphonePresenceModel对象
void linphone_friend_set_ref_key(LinphoneFriend* lf, const char* key)
设置好友的引用键
参数
[in] lf LinphoneFriend对象
[in] key
void linphone_friend_set_user_data(LinphoneFriend* lf, void* data)
设置用户指针到好友对象
void linphone_friend_set_vcard(LinphoneFriend* fr, LinphoneVcard* vcard)
绑定一个vCard对象到好友
参数
[in] fr LinphoneFriend对象
[in] vcard vCard对象
bool_t linphone_friend_subscribes_enabled(const LinphoneFriend* lf)
获取订阅标记值
参数
lf LinphoneFriend对象
返回
如果为这个好友的订阅已经激活,就返回TRUE
void linphone_friend_unref(LinphoneFriend* lf)
释放LinphoneFriend的引用
参数
lf LinphoneFriend对象
const char* linphone_online_status_to_string(LinphoneOnlineStatus ss)
返回人类可读的在线状态
参数
ss
已弃用:
用LinphonePresenceModel, LinphonePresenceActivity和linphone_presence_activity_to_string()代替
const char* linphone_presence_activity_get_description(const LinphonePresenceActivity* activity)
获取在线活动的描述
参数
[in] activity 需要获取描述的LinphonePresenceActivity对象的指针.
返回
描述字符串的指针,如果没有指定的描述返回NULL.
LinphonePresenceActivityType linphone_presence_activity_get_type(const LinphonePresenceActivity* activity)
获取在线活动的活动类型
参数
[in] activity LinphonePresenceActivity类型
返回
活动的LinphonePresenceActivityType
void* linphone_presence_activity_get_user_data(const LinphonePresenceActivity* activity)
获取LinphonePresenceActivity对象的用户指针
参数
[in] activity LinphonePresenceActivity对象
返回
用户指针
LinphonePresenceActivity* linphone_presence_activity_new(LinphonePresenceActivityType acttype, const char* description)
创建一个在线活动
参数
[in] acttype 为活动设置的LinphonePresenceActivityType
[in] description 额外的描述.如何没有需要描述的就设置NULL.
返回
创建的在线活动对象,如果出错返回NULL
LinphonePresenceActivity* linphone_presence_activity_ref(LinphonePresenceActivity* activity)
增加LinphonePresenceActivity对象的引用计数
参数
[in] activity 需要增加引用计数的LinphonePresenceActivity对象
返回
带增加引用计数的LinphonePresenceActivity对象
int linphone_presence_activity_set_description(LinphonePresenceActivity* activity, const char* description)
设置一个在线活动的描述
参数
[in] activity LinphonePresenceActivity对象
[in] description 活动的额外描述.如果不设置额外描述可用设置为NULL
返回
如果成功返回0, 如果出错返回负数
int linphone_presence_activity_set_type(LinphonePresenceActivity* activity, LinphonePresenceActivityType* acctype)
设置在线获得的活动类型
参数
[in] activity 需要设置活动类型的LinphonePresenceActivity对象
[in] acttype 设置的活动类型
返回
如果成功返回0, 如果出错返回负数
void linphone_presence_activity_set_user_data(LinphonePresenceActivity* activity, void* user_data)
设置LinphonePresenceActivity对象的用户指针
参数
[in] activity 需要设置用户指针的LinphonePresenceActivity对象
[in] user_data 用户指针
char* linphone_presence_activity_to_string(const LinphonePresenceActivity* activity)
获取在线活动的字符串表示
参数
[in] activity LinphonePresenceActivity对象
返回
一个动态分配的字符串表示一个指定的活动.该字符串要调用ms_free()来释放
LinphonePresenceActivity* linphone_presence_activity_unref(LinphonePresenceActivity* activity)
减少LinphonePresenceActivity对象的引用计数,如果计数为0销毁该对象
参数
[in] activity 需要减少引用计数的LinphonePrensenceActivity对象
返回
如果计数一直是正的,返回LinphonePresenceActivity对象,如果对象已经被销毁返回NULL.
int linphone_presence_model_add_activity(LinphonePresenceModel* model, LinphonePresenceActivity* activity)
添加一个活动到一个在线模式
参数
[in] model LinphonePresenceModel对象
[in] activity LinphonePresenceActivity对象
返回
如果成功为0,如果出错返回负数
int linphone_presence_model_add_note(LinphonePresenceModel* model, const char* note_content, const char* lang)
添加一个记录到一个在线模式
参数
[in] model LinphonePresenceModel对象
[in] note_content
[in] lang 记录语言,如果不特定的语言可以设置NULL
返回
如果成功返回0,如果出错返回负数
每个语言只能设置一个记录,所以例如为“fr"语言设置一个记录,如果已经有了,就会取代现有的一个
int linphone_presence_model_add_person(LinphonePresenceModel* model, LinphonePresencePerson* person)
添加一个人到在线模式
参数
[in] model LinphonePresenceModel对象
[in] person LinphonePresencePerson对象
返回
如果成功返回0,如果出错返回负数
int linphone_presence_model_add_service(LinphonePresenceModel* model, LinphonePresenceService* service)
添加一个服务到在线模式
参数
[in] model 需要添加服务的LinphonePresenceModel 对象
[in] service LinphonePrensenceSerivice对象
返回
如果成功的话返回 0,如果出错返回负数
int linphone_presence_model_clear_activities(LinphonePresenceModel* model)
清除一个在线模式中的所有活动
参数
[in] model LinphonePresenceModel对象
返回
如果成功返回0,如果出错返回负数
int linphone_presence_model_clear_notes(LinphonePresenceModel* model)
清除一个在线模式的所有记录
参数
[in] model LinphonePresenceModel对象
返回
如果成功的返回0,如果出错返回负数
int linphone_presence_model_clear_persons(LinphonePresenceModel* model)
清除一个在线模式的所有人
参数
[in] model LinphonePresenceModel对象
返回
如果成功返回0,如果出错返回负数
int linphone_presence_model_clear_services(LinphonePresenceModel* model)
清除一个在线模式的所有服务
参数
model LinphonePresenceModel对象
返回
如果成功返回0,如果出错返回负数
LinphonePresenceActivity* linphone_presence_model_get_activity(const LinphonePresenceModel* model)
获取一个在线模式的第一个活动(这通常就只有一个)
参数
[in] model LinphonePresenceModel对象
返回
如果成功,LinphonePresenceActivity对象,否则返回NULL
LinphonePresenceBasicStatus linphone_presence_model_get_basic_status(const LinphonePresenceModel* model)
获取一个在线模式的基本状态
参数
[in] model LinphonePresenceModel对象 ,从该对象中获取到基本状态
返回
指定LinphonePresenceModel对象的LinphonePresenceBasicStatus
char* linphone_presence_model_get_contact(const LinphonePresenceModel* model)
获取一个在线模式的的联系方式
参数
[in] model LinphonePresenceModel对象
返回
一个动态分配的字符串包含了联系方法.如果没有找到返回NULL.该字符串由ms_free()释放
unsigned int linphone_presence_model_get_nb_activities(const LinphonePresenceModel* model)
获取在指定在线模式中的活动的数量
参数
[in] model LinphonePresenceModel对象
返回
数量
unsigned int linphone_presence_model_get_nb_persons(const LinphonePresenceModel* model)
获取包含在在线模式中人的数量
参数
[in] model LinphonePresenceModel对象
返回
被包含在LinphonePresenceModel对象中的人的数量
unsigned int linphone_presence_model_get_nb_services(const LinphonePresenceModel* model)
获取包含在在线模式中的服务数量
参数
[in] model LinphonePresenceModel对象
返回
包含在LinphonePresenceModel对象的服务数量
LinphonePresenceNote* linphone_presence_model_get_note(const LinphonePresenceModel* model, const char* lang)
获取在线模式的第一个note(通常只有一个)
参数
model LinphonePresenceModel对象
lang 获取记录的语言,可以为NULL
返回
如果成功,返回指向LinphonePresenceNote对象的指针,否则返回NULL
LinphonePresenceActivity* linphone_presence_model_get_nth_activity(const LinphonePresenceModel* model, unsigned int idx)
获取在线模式中的第idx个活动
参数
[in] model LinphonePresenceModel对象
[in]idx 获取活动的索引,(第一为0)
LinphonePresencePerson* linphone_presence_model_get_nth_person(const LinphonePresenceModel* model, unsigned int idx)
获取在线模式中的第idx个人
参数
[in] model LinphonePresenceModel对象
[in] idx
返回
如果成功返回 LinphonePresencePerson对象,否则返回NULL
LinphonePresenceService* linphone_presence_model_get_nth_service(const LinphonePresenceModel* model, unsigned int idx)
获取在线模式中的第idx个服务
参数
[in] model LinphonePresenceModel对象
[in] idx
返回
如果成功返回LinphonePresenceService对象,否则返回NULL
const LinphoneAddress* linphone_presence_model_get_presentity(const LinphonePresenceModel* model)
获取一个在线模式的在线状态实体
参数
[in] model LinphonePresenceModel对象,从中获取联系地址
返回
一个指向LinphoneAddress地址的指针,如果没有就返回NULL
time_t linphone_presence_model_get_timestamp(const LinphonePresenceModel* model)
获取一个在线模式的时间戳
参数
[in] model LinphonePresenceModel对象,从中获取时间戳
返回
LinphonePresenceModel对象的时间戳,如果出错返回-1.
void* linphone_presence_model_get_user_data(const LinphonePresenceModel* model)
获取LinphonePresenceModel对象的用户指针
参数
[in] model LinphonePresenceModel对象
返回
用户指针
LinphonePresenceModel* linphone_presence_model_new(void )
创建一个默认的在线模式
返回
一个LinphonePresenceModel对象 ,如果出错返回NULL.
另参见
linphone_presence_model_new_with_activity
linphone_presence_model_new_with_activity_and_notw
这样创建的在线模式被认为“offline”
LinphonePresenceModel* linphone_presence_model_new_with_activity(LinphonePresenceActivityType activity, const char* description)
创建一个在线模式指定一个活动
参数
[in] activity 为创建的在线模式设置的活动
[in] description 关于该活动的额外描述(主要用于‘other’活动).如果不添加描述设置为NULL.
返回
创建的在线模式,如果出错返回NULL
另参见
linphone_presence_model_new
linphone_presence_model_new_with_activity_and_note
创建在线模式指定特定的参活动
LinphonePresenceModel* linphone_presence_model_new_with_activity_and_note(LinphonePresenceActivity activity, const char* description, const char* note, const char* lang)
创建一个在线模式指定一个活动和添加一个记录
参数
[in] activity 被设置到创建的在线模式的活动
[in] description 活动的描述(主要用于“other”活动),如果不添加描述,设置为NULL.
[in] note 额外的记录
[in] lang 记录的语言,如果不指定用特定语言可以设置为NULL
返回
创建在线模式,如果发生错误返回NULL
另参见
linphone_presence_model_new_with_activity
linphone_presence_model_new_with_activity_and_note
LinphonePresenceModel* linphone_presence_model_ref(LinphonePresenceModel* model)
减少LinphonePresenceModel对象的引用计数
参数
[in] model LinphonePresenceModel对象
返回
减少引用计数的LinphonePresenceModel对象
int linphone_presence_model_set_activity(LinphonePresenceModel* model, LinphonePresenceActivityType activty, const char* description)
设置一个在线模式的活动(仅限一个活动)
参数
[in] model LinphonePresenceModel对象
[in] activity LinphonePresenceActivityType对象
[in] description 活动的额外描述.如果不添加描述设置为NULL
返回
如果成功为0,如果出错返回负数
警告: 这个函数会修改该模式的基本状态根据设置的活动.如果你不想基本状态被自动修改,你可用使用 linphone_presence_model_set_basic_status(),linphone_presence_model_clear_activities()和linphone_presence_model_add_activity()的组合.
int linphone_presence_model_set_basic_status(LinphonePresenceModel* model, LinphonePresenceBasicStatus basic_status)
设置一个在线模式的基本状态
参数
[in] model LinphonePresenceModel对象
[in] basic_status LinphonePresenceBasicStatus 对象
返回
如果成功返回0,出错返回负数
int linphone_presence_model_set_contact(LinphonePresenceModel* model, const char* contact)
设置一个在线模式的联系方式
参数
[in] model LinphonePresenceModel对象
[in] contact 联系方式字符串
返回
如果成功返回0,出错返回负数
int linphone_presence_model_set_presentity(LinphonePresenceModel* model, const LinphoneAddress* presentity)
设置在线模式的在线状态实体
参数
[in] model LinphonePresenceModel对象
[in] presentity 在线状态实体地址(presentity is copied)
返回
如果成功返回0,出错返回负数
void linphone_presence_model_set_user_data(LinphonePresenceModel* model, void* user_data)
设置LinphonePresenceModel对象的用户指针
参数
[in] model Linphone_presenceModel对象
[in] user_data 用户指针
LinphonePresenceModel* linphone_presence_model_unref(LinphonePresenceModel* model)
减少LinphonePresenceModel对象的引用计数,如果达到0就销毁该对象
参数
[in] model LinphonePresenceModel对象
返回
如果引用计数为正数,返回LinphonePresenceModel对象,如果对象被销毁返回NULL.
const char* linphone_presence_note_get_content(const LinphonePresenceNote* note)
获取一个在线记录的内容
参数
[in] note LinphonePresenceNote的指针
返回
内容的指针
const char* linphone_presence_note_get_lang(const LinphonePresenceNote* note)
获取在线记录的语言
参数
[in] note LinphonePresenceNote对象指针
返回
在线记录的语言字符串指针,如果没有特定的语言返回NULL.
void* linphone_presence_note_get_user_data(const LinphonePresenceNote* note)
获取LinphonePresenceNote对象的用户数据
参数
[in] note LinphonePresenceNote对象
返回
用户指针
LinphonePresenceNote* linphone_presence_note_new(const char* content, const char* lang)
创建一个在线记录
参数
[in] content 新建记录的内容
[in] lang 新建记录的语言,如果没有特定的语言设置为NULL.
返回
新建的在线记录,如果出错返回NULL
LinphonePresenceNote* linphone_presence_note_ref(LinphonePresenceNote* note)
增加LinphonePresenceNote对象的引用计数
参数
[in] note LinphonePresenceNote对象
返回
增加引用计数的LinphonePresenceNote对象
int linphone_presence_note_set_content(LinphonePresenceNote* note, const char* content)
设置一个在线记录的内容
参数
[in] note LinphonePresenceNote对象
[in] content 记录的内容
返回
如果成功返回0,出错返回负数
int linphone_presence_note_set_lang(LinphonePresenceNote* note, const char* lang)
设置在线记录的语言
参数
[in] note LinphonePresenceNote对象
[in] lang 记录的语言
返回
如果成功返回0,出错返回负数
void linphone_presence_note_set_user_data(LinphonePresenceNote* note, void* user_data)
设置LinphonePresenceNote的用户数据
参数
[in] note LinphonePresenceNote对象
[in] user_data 用户指针
LinphonePresenceNote* linphone_presence_note_unref(LinphonePresenceNote* note)
减少LinphonePresenceNote对象的引用计数,如果达到0就销毁对象.
参数
[in] note LinphonePresenceNote对象
返回
如果引用计数为正,返回LinphonePresenceNote对象.如果对象被销毁返回NULL.
int linphone_presence_person_add_activities_note(LinphonePresencePerson* person, LinphonePresenceNote* note)
添加一个活动记录到在线人
参数
[in] person LinphonePresencePerson对象
[in] note LinphonePresenceNote对象
返回
如果成功返回0,出错返回负数
int linphone_presence_person_add_activity(LinphonePresencePerson* person, LinphonePresenActivity* activity)
添加一个活动到在线人
参数
[in] person LinphonePresencePerson对象
[in] activity LinphonePresenceActivity对象
返回
如果成功返回0,出错返回负数
int linphone_presence_person_add_note(LinphonePresencePerson* person, LinphonePresenceNote* note)
添加一个记录到一个在线人
参数
[in] persion LinphonePresencePerson对象
[in] note LinphonePresenceNote对象
返回
如果成功返回0,出错返回负数
int linphone_presence_person_clear_activities(LinphonePresencePerson* person)
清除在线人的活动
参数
[in] person LinphonePresencePerson对象
返回
如果成功放0,出错返回负数
int linphone_presence_person_clear_activities_notes(LinphonePresencePerson* person)
清除在线人的活动记录
参数
[in] person LinphonePresencePerson对象
返回
如果成功返回0,出错返回负数
int linphone_presence_person_clear_notes(LinphonePresencePerson* person)
清除在线人的记录
参数
[in] person LinphonePresencePerson对象
返回
如果成功返回0,出错返回负数
char* linphone_presence_person_get_id(const LinphonePresencePerson* person)
获取在线人的id
参数
[in] person LinphonePresencePerson对象
返回
一个指针指向一个动态分配的包含id的字符串,如果出错返回NULL.返回的字符串由ms_free()释放
unsigned int linphone_presence_person_get_nb_activities(const LinphonePresencePerson* person)
获取在线人包含的活动数量
参数
[in] person LinphonePresencePerson 对象
返回
LinphonePresencePerson对象包含的活动数量
unsigned int linphone_presence_person_get_nb_activities_notes(const LinphonePresencePerson* person)
获取在线人包含的活动记录的数量
参数
[in] person LinphonePresencePerson对象
返回
LinphonePresencePerson对象包含的活动记录
unsigned int linphone_presence_person_get_nb_notes(const LinphonePresencePerson* person)
获取在线人包含的记录数量
参数
[in] person LinphonePresencePerson 对象
返回
LinphonePresencePerson对象包含的记录数量
LinphonePresenceNote* linphone_presence_person_get_nth_activities_note(const LinphonePresencePerson person, unsigned int idx)
获取在线人的第idx个活动记录
参数
[in] person LinphonePresencePerson对象
[in] idx 要获取的活动记录的索引(第一个记录为索引0)
返回
如果成功返回LinphonePresenceNote指针,否则返回NULL.
LinphonePresenceActivity* linphone_presence_person_get_nth_activity(const LinphonePresencePerson* person, unsigned int idx)
获取在线人的第idx个活动
参数
[in] person LinphonePresencePerson对象
[in] idx 索引号
返回
如果成功返回LinphonePresenceActivity指针,否则为NULL.
LinphonePresenceNote* linphone_presence_person_get_nth_note(const LinphonePresencePerson* person, unsigned int idx)
获取在线人的第几个记录
参数
[in] person LinphonePresencePerson对象
[in] idx 索引号
返回
如果成功返回LinphonePresenceNote对象指针,否则返回NULL.
void* linphone_persence_person_get_user_data(const LinphonePresencePerson* person)
获取LinphonePresencePerson对象的用户数据
参数
[in] person LinphonePresencePerson对象
返回
用户数据指针
LinphonePresencePerson* linphone_presence_person_new(const char* id)
创建一个在线人
参数
[in] 在线人的id,可以为NULL ,自动生成它
返回
新创建的在线人,出错返回NULL
LinphonePresencePerson* linphone_presence_person_ref(LinphonePresencePerson* person)
减少LinphonePresencePerson对象的引用计数
参数
[in] person LinphonePresencePerson对象
返回
减少引用计数的LinphonePresencePerson对象
int linphone_presence_person_set_id(LinphonePresencePerson* person, const char* id)
设置在线人的id
参数
[in] person LinphonePresencePerson对象
[in] id 设置id字符串,可以为NULL,自动生成id
返回
如果成功返回0,出错返回负数
void linphone_presence_person_set_user_data(LinphonePresencePerson* person, void* user_data)
设置LinphonePresencePerson对象的用户数据
参数
[in] person LinphonePresencePerson对象
[in] user_data 要设置的用户数据指针
LinphonePresencePerson* linphone_presence_person_unref(LinphonePresencePerson* person)
减少LinphonePresencePerson对象的引用计数,如果它达到0销毁对象
参数
[in] person LinphonePresenPerson对象
返回
如果计数一直为正数,返回LinphonePresencePerson对象.如果对象已经销毁返回NULL
int linphone_presence_service_add_note(LinphonePresenceService* service, LinphonePresenceNote* note)
添加记录到在线服务器
参数
[in] service LinphonePresenceService对象
[in] note LinphonePresenceNote 对象
返回
如果成功返回0,出错返回负数
int linphone_presence_service_clear_notes(LinphonePresenceService* service)
清除在线服务器的记录
参数
[in] service LinphonePresenceService 对象
返回
如果成功返回0,出错返回负数
LinphonePresenceBasicStatus linphone_presence_service_get_basic_status(const LinphonePresenceService* service)
获取在线服务器的基本状态
参数
[in] service LinphonePresenceService对象
返回
给定LinphonePresenceService对象最为参数的LinphonePresenceBasicStatus对象
char* linphone_presence_service_get_contact(const LinphonePresenceService* service)
获取在线服务器的联系地址
参数
[in] service LinphonePresenceService对象
返回
一个动态分配的字符串指针,包含了联系地址,如果没有找到联系地址返回NULL.
char* linphone_presence_service_get_id(const LinphonePresenceService* service)
获取在线服务器的id
参数
service LinphonePresenceService对象
返回
一个动态分配的字符串指针,包含了id,如果出错返回NULL
返回的字符串由ms_free()释放
unsigned int linphone_presence_service_get_nb_notes(const LinphonePresenceService* service)
获取在线服务器中的记录数目
参数
service LinphonePresenceService对象
返回
包含在LinphonePresenceService中的记录数量
LinphonePresenceNote* linphone_presence_service_get_nth_note(const LinphonePresenceService* service, unsigned int idx)
获取在线服务器中的第idx个记录
参数
[in] service LinphonePresenceService对象
[in] idx 要获取的记录的索引号(第一条记录为索引0)
返回
如果成功返回LinphonePresenceNote对象的指针,否则返回NULL
void* linphone_presence_service_get_user_data(const LinphonePrsenceService* service)
获取LinphonePrsenceService对象的用户数据
参数
[in] service LinphonePresenceService对象
返回
一个用户数据指针
LinphonePresenceService* linphone_presence_service_new(const char* id, LinphonePresenceBasicStatus basic_status, const char* contact)
创建一个在线服务器
参数
[in] id 创建的在线服务器的id.如果为NULL 自动生成id
[in] basic_status 为LinphonePresenceService对象的LinphonePresenceBasicStatus对象
[in] contact 设置的联系字符串
返回
新创建的在线服务器,出错返回NULL.
创建的在线服务器,基本状态为“closed”
LinphonePresenService* linphone_presence_service_ref(LinphonePresenceService* service)
增加LinphonePresenceService对象的引用计数
参数
[in] service LinphonePresenceService对象
返回
增加引用计数的LinphonePresenceService对象
int linphone_presence_service_set_basic_status(LinphonePresenceService* service, LinphonePresenceBasicStatus basic_status)
设置在线服务器的基本状态
参数
[in] service LinphonePresenceService对象
[in] basic_status 为LinphonePresenceService对象设置的LinphonePresenceBasicStatus
返回
如果成功返回0,如果出错返回负数
int linphone_presence_service_set_id(LinphonePresenceService* service, const char* id)
设置在线服务器的id
参数
[in] service LinphonePresenceService对象 设置id
[in] id 设置id字符串,可以为NULL 自动生成id
返回
如果成功返回0,出错返回负数
void linphone_presence_service_set_user_data(LinphonePresenceService* service, void* user_data)
设置LinphonePresenceService对象的用户数据
参数
[in] service 设置用户数据的LinphonePresenceService对象
[in] user_data 设置的用户数据的指针
LinphonePresenceService* linphone_presence_unref(LinphonePresenceService* service)
减少LinphonePresenceService对象的引用计数,如果达到0销毁对象.
参数
[in] service LinphonePresenceService对象
返回
如果引用计数为正数,返回LinphonePresenceService对象,如果对象已经销毁返回NULL