Liblinphone 3.9.1中文--Modules--Managing generic subscriptions and publishes

来源:互联网 发布:php网站上传到服务器 编辑:程序博客网 时间:2024/06/08 13:52

Managing generic subscriptions and publishes   管理通用的订阅和发布

    

           

               #define LinphoneSubscriptionOutgoingInit  LinphoneSubscriptionOutgoingInit

               #define LinphoneSubscriptionOutgoingInit  LinphoneSubscriptionOutgoingProgress

    

     自定义


             typedef struct _LinphoneEvent LinphoneEvent

             typedef enum   _LinphoneSubscriptionDir LinphoneSubscriptionDir

             typedef enum   _LinphoneSubscriptionState LinphoneSubscriptionState

             typedef enum   _LinphonePublishState LinphonePublishState

             typedef void(*LinphoneCoreNotifyReceivedCb) (LinphoneCore* lc, LinphoneEvent* lev, const char* notified_event, const LinphoneContent* body)

             typedef void(* LinphoneCoreSubscriptionStateChangedCb)(LinphoneCore* lc, LinphoneEvent* lev, LinphoneSubscriptionState state)

             typedef void(* LinphonePublishStateChangedCb)(LinphoneCore* lc, LinphoneEvent* lev, LinphonePublishState state)



     枚举类型

        enum  _LinphoneSubscriptionDir{

                 LinphoneSubscriptionIncoming,

                 LinphoneSubscriptionOutgoing,

                 LinphoneSubscriptionInvalidDir

                }


       enum   _LinphoneSubscriptionState{

                LinphoneSubscriptionNone,

                LinphoneSubscriptionOutgoingProgress,

                LinphoneSubscriptionIncomingReceived,

                LinphoneSubscriptionPending,

                LinphoneSubscriptionActive,

                LinphoneSubscriptionTerminated,

                LinphoneSubscriptionError,

                LinphoneSubscriptionExpiring

               }


      enum   _LinphonePublisState{

                LinphonePublishNone,

                LinphonePublishProgress,

                LinphonePublishOk,

                LinphonePublishError,

                LinphonePublishExpiring,

                LinphonePublishCleared

              }


函数

const char * linphone_subscription_state_to_string(LinphoneSubscriptionState state) const char * linphone_publish_state_to_string(LinphonePublishState state) LinphoneEvent * linphone_core_subscribe (LinphoneCore *lc, constLinphoneAddress *resource, const char *event, int expires, const LinphoneContent *body) LinphoneEvent * linphone_core_create_subscribe (LinphoneCore*lc, const LinphoneAddress *resource, const char *event, int expires) LinphoneEvent * linphone_core_create_notify (LinphoneCore *lc, const LinphoneAddress *resource, const char *event) int linphone_event_send_subscribe (LinphoneEvent*ev, const LinphoneContent *body) int linphone_event_update_subscribe (LinphoneEvent*lev, const LinphoneContent *body) int linphone_event_refresh_subscribe (LinphoneEvent*lev) int linphone_event_accept_subscription(LinphoneEvent *lev) int linphone_event_deny_subscription (LinphoneEvent*lev, LinphoneReason reason) int linphone_event_notify (LinphoneEvent *lev, constLinphoneContent *body) LinphoneEvent * linphone_core_publish (LinphoneCore *lc, constLinphoneAddress *resource, const char *event, int expires, const LinphoneContent *body) LinphoneEvent * linphone_core_create_publish (LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires) int linphone_event_send_publish (LinphoneEvent *lev, const LinphoneContent *body) int linphone_event_update_publish (LinphoneEvent*lev, const LinphoneContent *body) int linphone_event_refresh_publish (LinphoneEvent*lev) void linphone_event_pause_publish (LinphoneEvent*lev) LinphoneReason linphone_event_get_reason (const LinphoneEvent*lev) const LinphoneErrorInfo * linphone_event_get_error_info (constLinphoneEvent *lev) LinphoneSubscriptionState linphone_event_get_subscription_state (constLinphoneEvent *lev) LinphonePublishState linphone_event_get_publish_state (constLinphoneEvent *lev) LinphoneSubscriptionDir linphone_event_get_subscription_dir(LinphoneEvent *lev) void linphone_event_set_user_data (LinphoneEvent *ev, void *up) void * linphone_event_get_user_data (constLinphoneEvent *ev) void linphone_event_add_custom_header (LinphoneEvent*ev, const char *name, const char *value) const char * linphone_event_get_custom_header (LinphoneEvent*ev, const char *name) void linphone_event_terminate (LinphoneEvent *lev) LinphoneEvent * linphone_event_ref (LinphoneEvent *lev) void linphone_event_unref (LinphoneEvent *lev) const char * linphone_event_get_name (const LinphoneEvent*lev) const LinphoneAddress * linphone_event_get_from (const LinphoneEvent*lev) const LinphoneAddress * linphone_event_get_resource (const LinphoneEvent*lev) LinphoneCore * linphone_event_get_core (const LinphoneEvent*lev)

详细说明

         LinphoneEvent api允许应用程序控制订阅,接收通知和发布到同行(peers),以通用的方式.

 


自定义文档

           typedef void(* LinphoneCoreNotifyReceivedCb)(LinphoneCore* lc, LinphoneEvent *lev, const char* notifief_event, const LinphoneContent* body)

         回调原型,用于通知应用程序关于从网络中接受到的通知  


          typedef void(* LinphoneCorePublishStateChangedCb)(LinphoneCore* lc, LinphoneEvent* lev, LinphonePublishState state)

         回调原型,用于通知应用程序关于发布状态变更.


         typedef struct _LinphoneEvent LinphoneEvent

         代表一个事件状态的对象,其已经订阅或发布

         另参见  

                 linphone_core_publish()

                 linphone_core_subscribe()


         typedef enum _LinphonePublishState LinphonePublishState

         发布状态的枚举类型


         typedef enum _LinphoneSubscriptionDir LinphoneSubscriptionDir

         _LinphoneSubscriptionDir的别名


         typedef enum _LinphoneSubscriptionState LinphoneSubscriptionState

         为订阅状态枚举类型定义


          

枚举类型文档

         

          enum _LinphonePublishState

          为发布状态枚举

         枚举成员

            LinphonePublishNone         初始状态,不要使用

            LinphonePublishProgress      一个向外的发布被创建和提交

            LinphonePublishOk            发布被接受

            LinphonePublishError        发布出错,linphone_event_get_reason()获取原因代码

            LinphonePublishExpiring     发布即将到期,只有发送如果[sip]-refresh_generic_publish属性被设置为0.

            LinphonePublishCleared      事件已经被发送


         enum _LinphoneSubscriptionDir

         为订阅方向枚举(传入或传出)

         枚举成员

                  LinphoneSubscriptionIncoming  传入订阅

                  LinphoneSubscriptionOutgoing  传出订阅

                  LinphoneSubscriptionInvalidDir   无效的订阅方向


          enum _LinphoneSubscriptionState

          为订阅状态枚举

          枚举成员

                LinphoneSubscriptionNone   初始状态,不应该使用

                LinphoneSubscriptionOutgoingProgress  一个传出的订阅被发送

                LinphoneSubscriptionIncomingReceived  一个传入的订阅被收到

                LinphoneSubscriptionPending          订阅等待中,等待用户的批准

                LinphoneSubscriptionActive           订阅被接受

                LinphoneSubscriptionTerminated       订阅被正常地终止

                LinphoneSubscriptionError            订阅出错,由linphone_event_get_reason()获取出错原因

                LinphoneSubscriptionExpiring         订阅将到期,只有发送如果[sip]->refresh_generic_subscribe属性设置为0



函数文档

     LinphoneEvent* linphone_core_create_notify(LinphoneCore* lc, const LinphoneAddress* resource, const                         char* event)

     创建一个out-of-dialog通知,指定目的地资源,时间名称.通知可以用linphone_event_notify()来发送

     参数

              lc  LinphoneCore对象

             resources  目的地资源

             evnet  事件名称

    返回

              一个包含通知上下文的LinphoneEvent对象



    LinphoneEvent* linphone_core_create_publish(LinphoneCore* lc, const LinphoneAddress* resource, const char*             event, int expires)

    为一个事件状态创建一个发布上下文.创建以后,该发布必须用linphone_event_send_publish()来发送.到期后,出版物被刷新,除非在这之前意见被终止.

      参数

                       lc     LinphoneCore对象

                resources      事件的源uri

                    event     事件的名称

                  expires      发布事件的生命周期,如果没有相关的持续时间设置为-1,在这种情况下,他不会刷新.


     返回

            一个包含发布上下文的LinphoneEvent对象



      LinphoneEvent* linphone_core_create_subscribe(LinphoneCore* lc, const LinphoneAddress* resource, const char* event,  int expires)

      创建一个传出的订阅,指定目的地址源,事件名称,和可选上下文主体.如果接受,订阅在有效时间内运行,但是如果在没有终止之前,它会自动更新.与linphone_core_subscribe()不一样,订阅不会立即发送.它会在调用linphone_event_send_subscribe()时发送.

      参数

                      lc   LinphoneCore对象               

               resources   目的地源

                  event    事件名称

                expires    订阅的呼呼作声的持续时间

      返回

                一个包含新建的订阅上下文的LinphoneEvent对象

 

     LinphoneEvent* linphone_core_publish(LinphoneCore* lc, const LinphoneAddress* resource, const char* event, int expires,  const LinphoneContent* body)

     发布一个事件状态.这首先用linphone_core_create_publish()创建一个LinphoneEvent对象,并调用linphone_event_send_publish()来发送它.到期之后,出版被刷新,除非它在这之前已经被终止.

     参数

               lc  LinphoneCore对象

              resources  事件的源URI

              event      事件的名称

              expires   发送的事件的生命周期,如果没有相关的持续时间设置为-1,在这种情况下它不会被刷新.

               body     实际发布的数据

     返回

              一个包含发布上下文的LinphoneEvent对象



 

      LinphoneEvent* linphone_core_subscribe(LinphoneCore* lc,  const LinphoneAddress*  resource, const char*  event, int  expires, const LinphoneContent* body)

      创建一个传出的订阅,指定目的地源,事件名称,和一个可选的上下文主体.如果接受,订阅在有限时间内运行, 但是会自动更新,如果没有在这之前没有终止.
      参数

                       lc  LinphoneCore对象

                resources   目的地源

                    event  事件名称

                  expires   订阅的呼呼作声的持续时间

                     body   可选主体,可能是NULL

       返回

                  一个包含新建的订阅上下文的LinphoneEvent对象



       int linphone_event_accept_subscription(LinphoneEvent* lev)

       接受一个传入订阅

 



        void  linphone_event_add_custom_header(LinphoneEvent* ev, const char* name, const char* value)

        添加一个自定义头到一个传出的订阅或者发布

        参数

                    ev  LinphoneEvent对象

                   name  头名字

                  value  头对应的值



         int linphone_event_deny_subscription(LinphoneEvent* lev, LinphoneReason reason)

         拒绝一个传入的订阅并附带给定的原因



 

          LinphoneCore* linphone_event_get_core(const LinphoneEvent* lev)

          返回创建lev这个LinphoneEvent对象的LinphoneCore对象的指针

          



           const char* linphone_event_get_custom_header(LinphoneEvent* ev, const char* name)

           为一个传入订阅获取指定头字段的值

           参数

                     ev  LinphoneEvent对象

                    name  头的名称

           返回

                      头的值, 如果这个头不存在返回NULL.



           const LinphoneErrorInfo* linphone_event_get_error_info(const LinphoneEvent* lev)

           获取关于一个出错的完整细节

            


           const LinphoneAddress* linphone_event_get_from(const LinphoneEvent* lev)

           获取订阅的“from”地址



            const char* linphone_event_get_name(const LinphoneEvent* lev)

            获取事件的名称,按照事件包RFC指定的.



           LinphonePublishState linphone_event_get_publish_state(const LinphoneEvent* lev)

           获取发布状态.如果事件对象并不是由发布机制创建的,返回LinphonePublishNone.



          LinphoneReason linphone_event_get_reason(const LinphoneEvent* lev)

          返回原因的代码(在错误代码到达的情况下)


         const LinphoneAddress* linphone_event_get_resource(const LinphoneEvent* lev)

         获取订阅或发布的源地址

    

        

         LinphoneSubscriptionDir linphone_event_get_subscription_dir(LinphoneEvent* lev)

         获取订阅的方向,如果对象不是由订阅机制创建的,返回LinphoneSubscriptionInvalidDir.


         

          LinphoneSubscriptionState linphone_event_get_subscription_state(const LinphoneEvent* lev)

          获取订阅状态.如果事件对象不是由订阅机制创建的,返回LinphoneSubscriptionNone.



         void* linphone_event_get_user_data(const LinphoneEvent* ev)

         获取用户指针

         参数

                lev LinphoneEvent对象对应 预先接收和接受的传入的订阅

                body 一个可选主体,包含实际的通知数据.

         返回

                 如果成功返回0,否则返回-1.



        void linphone_event_pause_publish(LinphoneEvent* lev)

        防止一个事件刷新它的发布.这有利于让注册自然地到期(或者)当应用程序想保持控制刷新发送.刷新操作可以用linphone_proxy_config_refresh_register()恢复.

        参数

               [in]  lev LinphoneEvent对象



        LinphoneEvent* linphone_event_ref(LinphoneEvent* lev)

        增加LinphoneEvent对象的引用计数.由默认的LinphoneEvents被创建由指定的core,那么它只属于这个core.应用程序希望保存一个指向它的引用,必须调用linphone_event_ref().当这个引用不在需要的时候,必须调用linphone_event_unref().

    


        int linphone_event_refresh_publish(LinphoneEvent* lev)

        刷新一个传出发布保持一样的主体

        参数

                    lev  LinphoneEvent对象

        返回

                     如果成功返回0,否则返回-1



        int linphone_event_refresh_subscribe(LinphoneEvent* lev)

        刷新一个传出的订阅保持一样的主体

        参数

                      lev  LinphoneEvent对象

        返回

                     如果成功返回0,否则返回-1




         int linphone_event_send_publish(LinphoneEvent* lev, const LinphoneContent* body)

         发送一个发布,由linphone_core_create_subscribe()创建的.

         参数

                  ev  LinphoneEvent对象

                 body 新发布的数据

   

         


         int linphone_event_send_subscribe(LinphoneEvent* ev, const LinphoneContent* body)

         发送一个订阅,预先由linphone_core_create_subscribe()创建的

         参数

                 ev  LinphoneEvent对象

                body 可选内容附加订阅

         返回

                 如果成功返回0,否则返回-1.



         void linphone_event_set_user_data(LinphoneEvent* ev, void* up)

         设置一个用户(应用程序)指针


         

         void linphone_event_terminate(LinphoneEvent* lev)

         终止以前接受到传入或传出的订阅,或一个以前的出版物.在这个操作之后,LinphoneEvent不应再被使用.除非应用程序明确地用linphone_event_ref()获取一个对象的引用.

         



         void linphone_event_unref(LinphoneEvent* lev)

         减少引用计数

         另参见

                    linphone_event_ref()



         int linphone_event_update_publish(LinphoneEvent* lev, const LinphoneContent* body)

         更新(刷新)一个发布

         参数

                      lev  LinphoneEvent对象

                     body  要发布的新数据


         int linphone_event_updata_subscribe(LinphoneEvent* lev, const LinphoneContent* body)

         更新(刷新)一个传出订阅,改变主体

         参数

                       lev  LinphoneEvent对象

                      body  包含在订阅更新中的一个可选主体,可能是NULL    

               


            

         

0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 吸财树叶子蔫了怎么办 民族团结手抄报间单有漂亮怎么办 鹦鹉尾巴毛掉了怎么办 羊绒衫领子打太大了怎么办 内裤洗了还有一股味道怎么办 月经下不来内裤上总有脏东西怎么办 夏天外衣薄露出内衣怎么办 金毛体味很重怎么办 直筒连衣裙太短怎么办 托班社会下雨了怎么办 托班下雨了怎么办教案 吃鸡界面有鼠标怎么办 老年机成英语了怎么办 手机成了英语了怎么办 塑料袋融化粘到衣服上怎么办 厕所被卫生纸堵了怎么办 钻石画的胶不粘了怎么办 客厅沙发选大了怎么办 连衣裙腰大了怎么办呀 憋尿后出现尿急尿涨怎么办 脚有酸酸的味道怎么办 三星手机home键失灵怎么办 三星s6返回键失灵怎么办 三星s7屏幕漏液怎么办 三星s8出现蓝框怎么办 三星手机短信图标没了怎么办 ps没有足够的ram怎么办 ps性能调不了是怎么办 苹果6p照相模糊怎么办 相框玻璃碎了怎么办 word文档加密后忘记密码怎么办 手机wps密码忘了怎么办 苹果手表忘了密码怎么办 苹果系统忘了密码怎么办 ps画板建小了怎么办 wps表格密码忘了怎么办 word文档变成虚的怎么办 wps论文中表格跨页怎么办 word文档复制过来有边框怎么办 wps表格跨页断开怎么办 锅的铆钉老是松怎么办