Ignore:
Timestamp:
Feb 24, 2014 11:00:15 AM (10 years ago)
Author:
bennylp
Message:

More re #1715: doxygen integration into the book

Location:
pjproject/trunk/doc/pjsip-book
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/doc/pjsip-book

    • Property svn:ignore set to
      xml
  • pjproject/trunk/doc/pjsip-book/call.rst

    r4704 r4762  
    1  
    21 
    32Calls 
    43===== 
    5 Calls are represented by ​Call class. 
     4Calls are represented by Call class. 
    65 
    76Subclassing the Call Class 
    87------------------------------------ 
    9 To use the Call class, normally application SHOULD create its own subclass, such as:: 
     8To use the Call class, normally application SHOULD create its own subclass, such as: 
     9 
     10.. code-block:: c++ 
    1011 
    1112    class MyCall : public Call 
     
    3031Making Outgoing Calls 
    3132-------------------------------------- 
    32 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: 
     34 
     35.. code-block:: c++ 
    3336 
    3437    Call *call = new MyCall(*acc); 
     
    3740        call->makeCall(dest_uri, prm); 
    3841    } catch(Error& err) { 
    39     } 
    40  
    41 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. 
     42        cout << err.info() << endl; 
     43    } 
     44 
     45The 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. 
    4246 
    4347Receiving Incoming Calls 
    4448-------------------------------------- 
    45 Incoming calls are reported as ​onIncomingCall() of the ​Account class. You must derive a class from the Account class to handle incoming calls. 
    46  
    47 Below is a sample code of the callback implementation:: 
     49Incoming calls are reported as onIncomingCall() of the Account class. You must derive a class from the Account class to handle incoming calls. 
     50 
     51Below is a sample code of the callback implementation: 
     52 
     53.. code-block:: c++ 
    4854 
    4955    void MyAccount::onIncomingCall(OnIncomingCallParam &iprm) 
     
    5157        Call *call = new MyCall(*this, iprm.callId); 
    5258        CallOpParam prm; 
    53         prm.statusCode = (pjsip_status_code)200; 
     59        prm.statusCode = PJSIP_SC_OK; 
    5460        call->answer(prm); 
    5561    } 
    5662 
    57 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). 
     63For 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). 
    5864 
    5965Call Properties 
     66---------------- 
     67All 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. 
     68 
     69Call Disconnection 
    6070------------------- 
    61 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. 
    62  
    63 Call Disconnection 
    64 -------------------------------------- 
    6571Call 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. 
    6672 
    67 The call disconnection is reported in ​onCallState() method of ​Call and it can be detected as follows:: 
     73The call disconnection is reported in onCallState() method of Call and it can be detected as follows: 
     74 
     75.. code-block:: c++ 
    6876 
    6977    void MyCall::onCallState(OnCallStateParam &prm) 
     
    7886Working with Call's Audio Media 
    7987------------------------------------------------- 
    80 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. 
    81  
    82 Below is a sample code to connect the call to the sound device when the media is active:: 
     88You 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 calls audio media is ready (or active) the function Call.getMedia() will return a valid audio media. 
     89 
     90Below is a sample code to connect the call to the sound device when the media is active: 
     91 
     92.. code-block:: c++ 
    8393 
    8494    void MyCall::onCallMediaState(OnCallMediaStateParam &prm) 
    8595    { 
    8696        CallInfo ci = getInfo(); 
    87         // Iterate all medias 
     97        // Iterate all the call medias 
    8898        for (unsigned i = 0; i < ci.media.size(); i++) { 
    89             if (getMedia(i)) { // Check if the media is valid 
    90                 AudioMedia *aud_med = getMedia(i); 
     99            if (ci.media[i].type==PJMEDIA_TYPE_AUDIO && getMedia(i)) { 
     100                AudioMedia *aud_med = (AudioMedia *)getMedia(i); 
     101 
    91102                // Connect the call audio media to sound device 
    92                 aud_med->startTransmit(); 
    93                 ->startTransmit(*aud_med); 
     103                AudDevManager& mgr = Endpoint::instance().audDevManager(); 
     104                aud_med->startTransmit(mgr.getPlaybackDevMedia()); 
     105                mgr.getCaptureDevMedia().startTransmit(*aud_med); 
    94106            } 
    95107        } 
     
    99111 
    100112Call Operations 
    101 -------------------------------------- 
    102 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. 
    103  
     113------------------- 
     114You 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. 
     115 
     116Instant Messaging(IM) 
     117--------------------- 
     118You can send IM within a call using Call.sendInstantMessage(). The transmission status of outgoing instant messages is reported in Call.onInstantMessageStatus() callback method. 
     119 
     120In addition to sending instant messages, you can also send typing indication using Call.sendTypingIndication(). 
     121 
     122Incoming IM and typing indication received within a call will be reported in the callback functions Call.onInstantMessage() and Call.onTypingIndication(). 
     123 
     124Alternatively, you can send IM and typing indication outside a call by using Buddy.sendInstantMessage() and Buddy.sendTypingIndication(). For more information, please see Presence documentation. 
     125 
     126 
     127Class Reference 
     128--------------- 
     129Call 
     130++++ 
     131.. doxygenclass:: pj::Call 
     132        :path: xml 
     133        :members: 
     134 
     135Settings 
     136++++++++ 
     137.. doxygenstruct:: pj::CallSetting 
     138        :path: xml 
     139         
     140 
     141Info and Statistics 
     142+++++++++++++++++++ 
     143.. doxygenstruct:: pj::CallInfo 
     144        :path: xml 
     145         
     146.. doxygenstruct:: pj::CallMediaInfo 
     147        :path: xml 
     148         
     149.. doxygenstruct:: pj::StreamInfo 
     150        :path: xml 
     151         
     152.. doxygenstruct:: pj::StreamStat 
     153        :path: xml 
     154 
     155.. doxygenstruct:: pj::JbufState 
     156        :path: xml 
     157 
     158.. doxygenstruct:: pj::RtcpStat 
     159        :path: xml 
     160 
     161.. doxygenstruct:: pj::RtcpStreamStat 
     162        :path: xml 
     163 
     164.. doxygenstruct:: pj::MathStat 
     165        :path: xml 
     166 
     167.. doxygenstruct:: pj::MediaTransportInfo 
     168        :path: xml 
     169 
     170 
     171Callback Parameters 
     172+++++++++++++++++++ 
     173.. doxygenstruct:: pj::OnCallStateParam 
     174        :path: xml 
     175 
     176.. doxygenstruct:: pj::OnCallTsxStateParam 
     177        :path: xml 
     178 
     179.. doxygenstruct:: pj::OnCallMediaStateParam 
     180        :path: xml 
     181 
     182.. doxygenstruct:: pj::OnCallSdpCreatedParam 
     183        :path: xml 
     184 
     185.. doxygenstruct:: pj::OnStreamCreatedParam 
     186        :path: xml 
     187 
     188.. doxygenstruct:: pj::OnStreamDestroyedParam 
     189        :path: xml 
     190 
     191.. doxygenstruct:: pj::OnDtmfDigitParam 
     192        :path: xml 
     193 
     194.. doxygenstruct:: pj::OnCallTransferRequestParam 
     195        :path: xml 
     196 
     197.. doxygenstruct:: pj::OnCallTransferStatusParam 
     198        :path: xml 
     199 
     200.. doxygenstruct:: pj::OnCallReplaceRequestParam 
     201        :path: xml 
     202 
     203.. doxygenstruct:: pj::OnCallReplacedParam 
     204        :path: xml 
     205 
     206.. doxygenstruct:: pj::OnCallRxOfferParam 
     207        :path: xml 
     208 
     209.. doxygenstruct:: pj::OnCallRedirectedParam 
     210        :path: xml 
     211 
     212.. doxygenstruct:: pj::OnCallMediaEventParam 
     213        :path: xml 
     214 
     215.. doxygenstruct:: pj::OnCallMediaTransportStateParam 
     216        :path: xml 
     217 
     218.. doxygenstruct:: pj::OnCreateMediaTransportParam 
     219        :path: xml 
     220 
     221.. doxygenstruct:: pj::CallOpParam 
     222        :path: xml 
     223 
     224.. doxygenstruct:: pj::CallSendRequestParam 
     225        :path: xml 
     226 
     227.. doxygenstruct:: pj::CallVidSetStreamParam 
     228        :path: xml 
     229 
     230Other 
     231+++++ 
     232.. doxygenstruct:: pj::MediaEvent 
     233        :path: xml 
     234 
     235.. doxygenstruct:: pj::MediaFmtChangedEvent 
     236        :path: xml 
     237 
     238.. doxygenstruct:: pj::SdpSession 
     239        :path: xml 
     240 
     241.. doxygenstruct:: pj::RtcpSdes 
     242        :path: xml 
     243 
     244 
Note: See TracChangeset for help on using the changeset viewer.