Changes between Version 2 and Version 3 of pjsip-doc/call


Ignore:
Timestamp:
Dec 4, 2013 7:14:14 AM (10 years ago)
Author:
ming
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pjsip-doc/call

    v2 v3  
    3131Making Outgoing Calls 
    3232-------------------------------------- 
    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 dst_uri, you can initiate outgoing call with the snippet below:: 
     33Making 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:: 
    3434 
    3535    Call *call = new MyCall(*acc); 
     
    3838        call->makeCall(dest_uri, prm); 
    3939    } catch(Error& err) { 
     40        cout << err.info() << endl; 
    4041    } 
    4142 
    42 The snippet above creates a Call object and initiates outgoing call to dst_uri using the default call settings. Subsequent operations to the call can use the method in the ​call instance, and events to the call will be reported to the callback. More on the callback will be explained a bit later. 
     43The snippet above creates a Call object and initiates outgoing call to dest_uri using the default call settings. Subsequent operations to the call can use the method in the ​call instance, and events to the call will be reported to the callback. More on the callback will be explained a bit later. 
    4344 
    4445Receiving Incoming Calls 
     
    5657    } 
    5758 
    58 For incoming calls, the call instance is created in the callback parameter as shown above. Application should make sure to store the call instance during the lifetime of the call (that is until the call is disconnected). 
     59For incoming calls, the call instance is created in the callback function as shown above. Application should make sure to store the call instance during the lifetime of the call (that is until the call is disconnected). 
    5960 
    6061Call Properties 
    61 ------------------- 
     62---------------- 
    6263All call properties such as state, media state, remote peer information, etc. are stored as ​CallInfo class, which can be retrieved from the call object with using getInfo() method of the Call. 
    6364 
    6465Call Disconnection 
    65 -------------------------------------- 
     66------------------- 
    6667Call 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. 
    6768 
     
    7980Working with Call's Audio Media 
    8081------------------------------------------------- 
    81 You can only operate with the call's audio media (e.g. connecting the call to the sound device in the conference bridge) when the call's audio media is ready (or active). The changes to the call's media state is reported in ​onCallMediaState() callback, and if the call’s audio media is ready (or active) the function getMedia() will return a valid audio media. 
     82You can only operate with the call's audio media (e.g. connecting the call to the sound device in the conference bridge) when the call's audio media is ready (or active). The changes to the call's media state is reported in ​onCallMediaState() callback, and if the call’s audio media is ready (or active) the function Call.getMedia() will return a valid audio media. 
    8283 
    8384Below is a sample code to connect the call to the sound device when the media is active:: 
     
    8687    { 
    8788        CallInfo ci = getInfo(); 
    88         // Iterate all medias 
     89        // Iterate all the call medias 
    8990        for (unsigned i = 0; i < ci.media.size(); i++) { 
    9091            if (getMedia(i)) { // Check if the media is valid 
    9192                AudioMedia *aud_med = getMedia(i); 
    9293                // Connect the call audio media to sound device 
    93                 aud_med->startTransmit(); 
    94                 ->startTransmit(*aud_med); 
     94                AudDevManager& mgr = Endpoint::instance().audDevManager(); 
     95                aud_med->startTransmit(mgr.getPlaybackDevMedia()); 
     96                mgr.getCaptureDevMedia()->startTransmit(*aud_med); 
    9597            } 
    9698        } 
     
    100102 
    101103Call Operations 
    102 -------------------------------------- 
    103 Some of the operations to the Call object, such as making outgoing call, answering, holding, sending re-INVITE, etc. Please see the reference documentation of Call for more info. 
     104------------------- 
     105You can invoke operations to the Call object, such as hanging up, putting the call on hold, sending re-INVITE, etc. Please see the reference documentation of Call for more info. 
    104106 
    105107}}}