Changes between Version 5 and Version 6 of pjsip-doc/call


Ignore:
Timestamp:
Feb 10, 2014 11:28:04 AM (10 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pjsip-doc/call

    v5 v6  
    88Subclassing the Call Class 
    99------------------------------------ 
    10 To use the Call class, normally application SHOULD create its own subclass, such as:: 
     10To use the Call class, normally application SHOULD create its own subclass, such as: 
     11 
     12.. code-block:: c++ 
    1113 
    1214    class MyCall : public Call 
     
    3133Making Outgoing Calls 
    3234-------------------------------------- 
    33 Making outgoing call is simple, just invoke ​makeCall() method of the Call object. Assuming you have the Account object as acc variable and destination URI string in dest_uri, you can initiate outgoing call with the snippet below:: 
     35Making outgoing call is simple, just invoke ​makeCall() method of the Call object. Assuming you have the Account object as acc variable and destination URI string in dest_uri, you can initiate outgoing call with the snippet below: 
     36 
     37.. code-block:: c++ 
    3438 
    3539    Call *call = new MyCall(*acc); 
     
    4751Incoming calls are reported as ​onIncomingCall() of the ​Account class. You must derive a class from the Account class to handle incoming calls. 
    4852 
    49 Below is a sample code of the callback implementation:: 
     53Below is a sample code of the callback implementation: 
     54 
     55.. code-block:: c++ 
    5056 
    5157    void MyAccount::onIncomingCall(OnIncomingCallParam &iprm) 
     
    5359        Call *call = new MyCall(*this, iprm.callId); 
    5460        CallOpParam prm; 
    55         prm.statusCode = (pjsip_status_code)200; 
     61        prm.statusCode = PJSIP_SC_OK; 
    5662        call->answer(prm); 
    5763    } 
     
    6773Call disconnection event is a special event since once the callback that reports this event returns, the call is no longer valid and any operations invoked to the call object will raise error exception. Thus, it is recommended to delete the call object inside the callback. 
    6874 
    69 The call disconnection is reported in ​onCallState() method of ​Call and it can be detected as follows:: 
     75The call disconnection is reported in ​onCallState() method of ​Call and it can be detected as follows: 
     76 
     77.. code-block:: c++ 
    7078 
    7179    void MyCall::onCallState(OnCallStateParam &prm) 
     
    8492Below is a sample code to connect the call to the sound device when the media is active:: 
    8593 
     94.. code-block:: c++ 
     95 
    8696    void MyCall::onCallMediaState(OnCallMediaStateParam &prm) 
    8797    { 
     
    8999        // Iterate all the call medias 
    90100        for (unsigned i = 0; i < ci.media.size(); i++) { 
    91             if (getMedia(i)) { // Check if the media is valid 
     101            if (ci.media[i].type==PJMEDIA_TYPE_AUDIO && getMedia(i)) { 
    92102                AudioMedia *aud_med = (AudioMedia *)getMedia(i); 
    93103