Changes between Version 2 and Version 3 of pjsip-doc/call
- Timestamp:
- Dec 4, 2013 7:14:14 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
pjsip-doc/call
v2 v3 31 31 Making Outgoing Calls 32 32 -------------------------------------- 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 d st_uri, you can initiate outgoing call with the snippet below::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:: 34 34 35 35 Call *call = new MyCall(*acc); … … 38 38 call->makeCall(dest_uri, prm); 39 39 } catch(Error& err) { 40 cout << err.info() << endl; 40 41 } 41 42 42 The snippet above creates a Call object and initiates outgoing call to d st_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.43 The 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. 43 44 44 45 Receiving Incoming Calls … … 56 57 } 57 58 58 For incoming calls, the call instance is created in the callback parameteras shown above. Application should make sure to store the call instance during the lifetime of the call (that is until the call is disconnected).59 For 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). 59 60 60 61 Call Properties 61 ---------------- ---62 ---------------- 62 63 All 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. 63 64 64 65 Call Disconnection 65 ------------------- -------------------66 ------------------- 66 67 Call 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. 67 68 … … 79 80 Working with Call's Audio Media 80 81 ------------------------------------------------- 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.82 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 Call.getMedia() will return a valid audio media. 82 83 83 84 Below is a sample code to connect the call to the sound device when the media is active:: … … 86 87 { 87 88 CallInfo ci = getInfo(); 88 // Iterate all medias89 // Iterate all the call medias 89 90 for (unsigned i = 0; i < ci.media.size(); i++) { 90 91 if (getMedia(i)) { // Check if the media is valid 91 92 AudioMedia *aud_med = getMedia(i); 92 93 // 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); 95 97 } 96 98 } … … 100 102 101 103 Call 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 ------------------- 105 You 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. 104 106 105 107 }}}