Changes between Version 4 and Version 5 of pjsip-doc/presence


Ignore:
Timestamp:
Feb 10, 2014 11:46:09 AM (8 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pjsip-doc/presence

    v4 v5  
    44Buddy (Presence) 
    55================ 
    6 This class represents a remote buddy (a person, or a SIP endpoint). 
     6Presence feature in PJSUA2 centers around Buddy class. This class represents a remote buddy (a person, or a SIP endpoint). 
    77 
    88Subclassing the Buddy class 
    99---------------------------- 
    10 To use the Buddy class, normally application SHOULD create its own subclass, such as:: 
     10To use the Buddy class, normally application SHOULD create its own subclass, such as: 
     11 
     12.. code-block:: c++ 
    1113 
    1214    class MyBuddy : public Buddy 
     
    2325Subscribing to Buddy's Presence Status 
    2426--------------------------------------- 
    25 To subscribe to buddy's presence status, you need to add a buddy object and subscribe to buddy's presence status. The snippet below shows a sample code to achieve these:: 
     27To subscribe to buddy's presence status, you need to add a buddy object and subscribe to buddy's presence status. The snippet below shows a sample code to achieve these: 
     28 
     29.. code-block:: c++ 
    2630 
    2731    BuddyConfig cfg; 
     
    3438    } 
    3539 
    36 Then you can get the buddy's presence state change inside the onBuddyState() callback:: 
     40Then you can get the buddy's presence state change inside the onBuddyState() callback: 
     41 
     42.. code-block:: c++ 
    3743 
    3844    void MyBuddy::onBuddyState() 
     
    4854By default, incoming presence subscription to an account will be accepted automatically. You will probably want to change this behavior, for example only to automatically accept subscription if it comes from one of the buddy in the buddy list, and for anything else prompt the user if he/she wants to accept the request. 
    4955 
    50 This can be done by overriding the ​onIncomingSubscribe() method of the ​Account class. 
     56This can be done by overriding the ​onIncomingSubscribe() method of the ​Account class. Please see the documentation of this method for more info. 
    5157 
    5258Changing Account's Presence Status 
    5359---------------------------------- 
    54 To change account's presence status, you can use the function Account.setOnlineStatus() to set basic account's presence status (i.e. available or not available) and optionally, some extended information (e.g. busy, away, on the phone, etc), such as:: 
     60To change account's presence status, you can use the function Account.setOnlineStatus() to set basic account's presence status (i.e. available or not available) and optionally, some extended information (e.g. busy, away, on the phone, etc), such as: 
     61 
     62.. code-block:: c++ 
    5563 
    5664    try { 
     
    6472    } 
    6573 
    66 When the presence status is changed, the account will publish the new status to all of its presence subscriber, either with PUBLISH request or SUBSCRIBE request, or both, depending on account configuration. 
     74When the presence status is changed, the account will publish the new status to all of its presence subscriber, either with PUBLISH request or NOTIFY request, or both, depending on account configuration. 
    6775 
    6876Instant Messaging(IM)