reSIProcate/DialogUsageManager  9694
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
resip::BasicClientCall Class Reference

#include <basicClientCall.hxx>

Inheritance diagram for resip::BasicClientCall:
Inheritance graph
[legend]
Collaboration diagram for resip::BasicClientCall:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BasicClientCall (BasicClientUserAgent &userAgent)
virtual ~BasicClientCall ()
virtual void initiateCall (const Uri &target, SharedPtr< UserProfile > profile)
virtual void terminateCall ()
virtual void timerExpired ()

Protected Member Functions

virtual SharedPtr< UserProfileselectUASUserProfile (const SipMessage &)
virtual void onNewSession (resip::ClientInviteSessionHandle h, resip::InviteSession::OfferAnswerType oat, const resip::SipMessage &msg)
virtual void onNewSession (resip::ServerInviteSessionHandle h, resip::InviteSession::OfferAnswerType oat, const resip::SipMessage &msg)
virtual void onFailure (resip::ClientInviteSessionHandle h, const resip::SipMessage &msg)
virtual void onEarlyMedia (resip::ClientInviteSessionHandle, const resip::SipMessage &, const resip::SdpContents &)
virtual void onProvisional (resip::ClientInviteSessionHandle, const resip::SipMessage &msg)
virtual void onConnected (resip::ClientInviteSessionHandle h, const resip::SipMessage &msg)
virtual void onConnected (resip::InviteSessionHandle, const resip::SipMessage &msg)
virtual void onStaleCallTimeout (resip::ClientInviteSessionHandle)
virtual void onTerminated (resip::InviteSessionHandle h, resip::InviteSessionHandler::TerminatedReason reason, const resip::SipMessage *msg)
virtual void onRedirected (resip::ClientInviteSessionHandle, const resip::SipMessage &msg)
virtual void onAnswer (resip::InviteSessionHandle, const resip::SipMessage &msg, const resip::SdpContents &)
virtual void onOffer (resip::InviteSessionHandle handle, const resip::SipMessage &msg, const resip::SdpContents &offer)
virtual void onOfferRequired (resip::InviteSessionHandle, const resip::SipMessage &msg)
virtual void onOfferRejected (resip::InviteSessionHandle, const resip::SipMessage *msg)
virtual void onOfferRequestRejected (resip::InviteSessionHandle, const resip::SipMessage &msg)
virtual void onRemoteSdpChanged (resip::InviteSessionHandle, const resip::SipMessage &msg, const resip::SdpContents &sdp)
virtual void onInfo (resip::InviteSessionHandle, const resip::SipMessage &msg)
virtual void onInfoSuccess (resip::InviteSessionHandle, const resip::SipMessage &msg)
virtual void onInfoFailure (resip::InviteSessionHandle, const resip::SipMessage &msg)
virtual void onRefer (resip::InviteSessionHandle, resip::ServerSubscriptionHandle, const resip::SipMessage &msg)
virtual void onReferAccepted (resip::InviteSessionHandle, resip::ClientSubscriptionHandle, const resip::SipMessage &msg)
virtual void onReferRejected (resip::InviteSessionHandle, const resip::SipMessage &msg)
virtual void onReferNoSub (resip::InviteSessionHandle, const resip::SipMessage &msg)
virtual void onMessage (resip::InviteSessionHandle, const resip::SipMessage &msg)
virtual void onMessageSuccess (resip::InviteSessionHandle, const resip::SipMessage &msg)
virtual void onMessageFailure (resip::InviteSessionHandle, const resip::SipMessage &msg)
virtual void onForkDestroyed (resip::ClientInviteSessionHandle)
virtual void onReadyToSend (InviteSessionHandle, SipMessage &msg)
virtual void onFlowTerminated (InviteSessionHandle)
virtual void onTrying (resip::AppDialogSetHandle, const resip::SipMessage &msg)
virtual void onNonDialogCreatingProvisional (resip::AppDialogSetHandle, const resip::SipMessage &msg)
virtual void onUpdatePending (resip::ClientSubscriptionHandle h, const resip::SipMessage &notify, bool outOfOrder)
virtual void onUpdateActive (resip::ClientSubscriptionHandle h, const resip::SipMessage &notify, bool outOfOrder)
virtual void onUpdateExtension (resip::ClientSubscriptionHandle h, const resip::SipMessage &notify, bool outOfOrder)
virtual void onNotifyNotReceived (resip::ClientSubscriptionHandle h)
virtual void onTerminated (resip::ClientSubscriptionHandle h, const resip::SipMessage *notify)
virtual void onNewSubscription (resip::ClientSubscriptionHandle h, const resip::SipMessage &notify)
virtual int onRequestRetry (resip::ClientSubscriptionHandle h, int retrySeconds, const resip::SipMessage &notify)
virtual void onRedirectReceived (AppDialogSetHandle h, const SipMessage &msg)

Private Member Functions

bool isUACConnected ()
bool isStaleFork (const resip::DialogId &dialogId)
void makeOffer (SdpContents &offer)

Private Attributes

BasicClientUserAgentmUserAgent
resip::InviteSessionHandle mInviteSessionHandle
unsigned int mTimerExpiredCounter
bool mPlacedCall
resip::InviteSessionHandle mInviteSessionHandleReplaced
resip::DialogId mUACConnectedDialogId

Friends

class BasicClientUserAgent

Detailed Description

Definition at line 17 of file basicClientCall.hxx.


Constructor & Destructor Documentation

BasicClientCall::BasicClientCall ( BasicClientUserAgent userAgent)

Definition at line 55 of file basicClientCall.cxx.

References mUserAgent, and resip::BasicClientUserAgent::registerCall().

Referenced by onFlowTerminated().

Here is the call graph for this function:

BasicClientCall::~BasicClientCall ( ) [virtual]

Definition at line 65 of file basicClientCall.cxx.

References mUserAgent, and resip::BasicClientUserAgent::unregisterCall().

Here is the call graph for this function:


Member Function Documentation

void BasicClientCall::initiateCall ( const Uri target,
SharedPtr< UserProfile profile 
) [virtual]
bool BasicClientCall::isStaleFork ( const resip::DialogId dialogId) [private]

Definition at line 123 of file basicClientCall.cxx.

References resip::Data::empty(), resip::DialogId::getCallId(), and mUACConnectedDialogId.

Referenced by onAnswer(), onOffer(), onOfferRejected(), onOfferRequired(), onProvisional(), and onTerminated().

{
   return (!mUACConnectedDialogId.getCallId().empty() && dialogId != mUACConnectedDialogId);
}

Here is the call graph for this function:

bool BasicClientCall::isUACConnected ( ) [private]

Definition at line 117 of file basicClientCall.cxx.

References resip::Data::empty(), resip::DialogId::getCallId(), and mUACConnectedDialogId.

Referenced by onConnected(), onNonDialogCreatingProvisional(), and onTrying().

Here is the call graph for this function:

void BasicClientCall::makeOffer ( SdpContents offer) [private]

Definition at line 129 of file basicClientCall.cxx.

References resip::Data::data(), resip::Timer::getTimeMicroSec(), resip::SdpContents::session(), resip::Data::size(), and type.

Referenced by initiateCall(), onFlowTerminated(), and onOfferRequired().

{
   static Data txt("v=0\r\n"
                   "o=- 0 0 IN IP4 0.0.0.0\r\n"
                   "s=basicClient\r\n"
                   "c=IN IP4 0.0.0.0\r\n"  
                   "t=0 0\r\n"
                   "m=audio 8000 RTP/AVP 0 101\r\n"
                   "a=rtpmap:0 pcmu/8000\r\n"
                   "a=rtpmap:101 telephone-event/8000\r\n"
                   "a=fmtp:101 0-15\r\n");

   static HeaderFieldValue hfv(txt.data(), txt.size());
   static Mime type("application", "sdp");
   static SdpContents offerSdp(hfv, type);

   offer = offerSdp;

   // Set sessionid and version for this offer
   UInt64 currentTime = Timer::getTimeMicroSec();
   offer.session().origin().getSessionId() = currentTime;
   offer.session().origin().getVersion() = currentTime;  
}

Here is the call graph for this function:

void BasicClientCall::onAnswer ( resip::InviteSessionHandle  h,
const resip::SipMessage msg,
const resip::SdpContents sdp 
) [protected, virtual]

Definition at line 353 of file basicClientCall.cxx.

References resip::Message::brief(), InfoLog, and isStaleFork().

{
   if(isStaleFork(h->getDialogId()))
   {
      // If we receive a response from a stale fork (ie. after someone sends a 200), then we want to ignore it
      InfoLog(<< "onAnswer: from stale fork, msg=" << msg.brief() << ", sdp=" << sdp);
      return;
   }
   InfoLog(<< "onAnswer: msg=" << msg.brief() << ", sdp=" << sdp);

   // Process Answer here
}

Here is the call graph for this function:

void BasicClientCall::onConnected ( resip::ClientInviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 248 of file basicClientCall.cxx.

References resip::Message::brief(), CallTimerTime, resip::BasicClientUserAgent::getDialogUsageManager(), InfoLog, isUACConnected(), resip::BasicClientUserAgent::mStack, mUACConnectedDialogId, mUserAgent, and resip::SipStack::post().

{
   InfoLog(<< "onConnected: msg=" << msg.brief());
   if(!isUACConnected())
   {
      // It is possible in forking scenarios to get multiple 200 responses, if this is 
      // our first 200 response, then this is the leg we accept, store the connected DialogId
      mUACConnectedDialogId = h->getDialogId();
      // Note:  each forked leg will update mInviteSessionHandle (in onNewSession call) - need to set mInviteSessionHandle for final answering leg on 200
      mInviteSessionHandle = h->getSessionHandle();  

      // start call timer
      auto_ptr<ApplicationMessage> timer(new CallTimer(mUserAgent, this));
      mUserAgent.mStack.post(timer, CallTimerTime, &mUserAgent.getDialogUsageManager());
   }
   else
   {
      // We already have a connected leg - end this one with a BYE
      h->end();
   }
}

Here is the call graph for this function:

void BasicClientCall::onConnected ( resip::InviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 271 of file basicClientCall.cxx.

References resip::Message::brief(), and InfoLog.

{
   InfoLog(<< "onConnected: msg=" << msg.brief());
}

Here is the call graph for this function:

void BasicClientCall::onEarlyMedia ( resip::ClientInviteSessionHandle  h,
const resip::SipMessage msg,
const resip::SdpContents sdp 
) [protected, virtual]

Definition at line 228 of file basicClientCall.cxx.

References resip::Message::brief(), and InfoLog.

{
   InfoLog(<< "onEarlyMedia: msg=" << msg.brief() << ", sdp=" << sdp);
}

Here is the call graph for this function:

void BasicClientCall::onFailure ( resip::ClientInviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 207 of file basicClientCall.cxx.

References resip::Message::brief(), resip::SipMessage::getReceivedTransport(), h_StatusLine, resip::SipMessage::header(), resip::SipMessage::isResponse(), and WarningLog.

{
   WarningLog(<< "onFailure: msg=" << msg.brief());

   if (msg.isResponse()) 
   {
      switch(msg.header(h_StatusLine).statusCode()) 
      {
         case 408:
         case 503:
            if(msg.getReceivedTransport() == 0)
            {
               // Try another flow? 
            }
         default:
            break;
      }
   }
}

Here is the call graph for this function:

void BasicClientCall::onFlowTerminated ( InviteSessionHandle  h) [protected, virtual]

Definition at line 540 of file basicClientCall.cxx.

References BasicClientCall(), resip::BasicClientUserAgent::getDialogUsageManager(), resip::AppDialogSet::getUserProfile(), InfoLog, resip::DialogUsageManager::makeInviteSession(), makeOffer(), mInviteSessionHandle, mInviteSessionHandleReplaced, mPlacedCall, mUserAgent, resip::DialogUsageManager::send(), and resip::NameAddr::uri().

{
   if(h->isConnected())
   {
      NameAddr inviteWithReplacesTarget;
      if(h->remoteTarget().uri().exists(p_gr))
      {
         // If remote contact is a GRUU then use it
         inviteWithReplacesTarget.uri() = h->remoteTarget().uri();
      }
      else
      {
         //.Use remote AOR
         inviteWithReplacesTarget.uri() = h->peerAddr().uri();
      }
      InfoLog(<< "BasicClientCall::onFlowTerminated: trying INVITE w/replaces to " << inviteWithReplacesTarget);
      // The flow terminated - try an Invite (with Replaces) to recover the call
      BasicClientCall *replacesCall = new BasicClientCall(mUserAgent);      

      // Copy over flag that indicates wether original call was placed or received
      replacesCall->mPlacedCall = mPlacedCall;  

      // Note:  We want to end this call since it is to be replaced.  Normally the endpoint
      // receiving the INVITE with replaces would send us a BYE for the session being replaced.
      // However, since the old flow is dead, we will never see this BYE.  We need this call to
      // go away somehow, however we cannot just end it directly here via terminateCall.
      // Since the flow to other party is likely fine - if we terminate this call now the BYE 
      // is very likely to make it to the far end, before the above INVITE - if this happens then 
      // the replaces logic of the INVITE will have no effect.  We want to delay the release of 
      // this call, by passing our handle to the new INVITE call and have it terminate this call, 
      // once we know the far end has processed our new INVITE.
      replacesCall->mInviteSessionHandleReplaced = mInviteSessionHandle;

      SdpContents offer;
      replacesCall->makeOffer(offer);
      SharedPtr<SipMessage> invite = mUserAgent.getDialogUsageManager().makeInviteSession(inviteWithReplacesTarget, h, getUserProfile(), &offer, replacesCall);
      mUserAgent.getDialogUsageManager().send(invite);
   }
}

Here is the call graph for this function:

void BasicClientCall::onForkDestroyed ( resip::ClientInviteSessionHandle  h) [protected, virtual]

Definition at line 529 of file basicClientCall.cxx.

References InfoLog.

{
   InfoLog(<< "onForkDestroyed:");
}
void BasicClientCall::onInfo ( resip::InviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 452 of file basicClientCall.cxx.

References resip::Message::brief(), and InfoLog.

{
   InfoLog(<< "onInfo: msg=" << msg.brief());

   // Handle message here
   h->acceptNIT();
}

Here is the call graph for this function:

void BasicClientCall::onInfoFailure ( resip::InviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 467 of file basicClientCall.cxx.

References resip::Message::brief(), and WarningLog.

{
   WarningLog(<< "onInfoFailure: msg=" << msg.brief());
}

Here is the call graph for this function:

void BasicClientCall::onInfoSuccess ( resip::InviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 461 of file basicClientCall.cxx.

References resip::Message::brief(), and InfoLog.

{
   InfoLog(<< "onInfoSuccess: msg=" << msg.brief());
}

Here is the call graph for this function:

void BasicClientCall::onMessage ( resip::InviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 501 of file basicClientCall.cxx.

References resip::Message::brief(), InfoLog, and mPlacedCall.

{
   InfoLog(<< "onMessage: msg=" << msg.brief());

   // Handle message here
   h->acceptNIT();

   if(!mPlacedCall)
   {
      // If we didn't place the call - answer the message with another message
      PlainContents plain("test message answer");
      h->message(plain);
   }
}

Here is the call graph for this function:

void BasicClientCall::onMessageFailure ( resip::InviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 523 of file basicClientCall.cxx.

References resip::Message::brief(), and WarningLog.

{
   WarningLog(<< "onMessageFailure: msg=" << msg.brief());
}

Here is the call graph for this function:

void BasicClientCall::onMessageSuccess ( resip::InviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 517 of file basicClientCall.cxx.

References resip::Message::brief(), and InfoLog.

{
   InfoLog(<< "onMessageSuccess: msg=" << msg.brief());
}

Here is the call graph for this function:

void BasicClientCall::onNewSession ( resip::ClientInviteSessionHandle  h,
resip::InviteSession::OfferAnswerType  oat,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 158 of file basicClientCall.cxx.

References resip::Message::brief(), resip::Handle< T >::get(), InfoLog, resip::Handle< T >::isValid(), mInviteSessionHandle, mInviteSessionHandleReplaced, and terminateCall().

{
   InfoLog(<< "onNewSession(ClientInviteSessionHandle): msg=" << msg.brief());
   mInviteSessionHandle = h->getSessionHandle();  // Note:  each forked leg will update mInviteSession - need to set mInviteSessionHandle for final answering leg on 200
   if(mInviteSessionHandleReplaced.isValid())
   {
       // See comment in flowTerminated for an explanation of this logic
       ((BasicClientCall*)mInviteSessionHandleReplaced->getAppDialogSet().get())->terminateCall();
   }
}

Here is the call graph for this function:

virtual void resip::BasicClientCall::onNewSession ( resip::ServerInviteSessionHandle  h,
resip::InviteSession::OfferAnswerType  oat,
const resip::SipMessage msg 
) [protected, virtual]
void BasicClientCall::onNewSubscription ( resip::ClientSubscriptionHandle  h,
const resip::SipMessage notify 
) [protected, virtual]

Definition at line 663 of file basicClientCall.cxx.

References resip::Message::brief(), and InfoLog.

Referenced by resip::BasicClientUserAgent::onNewSubscription().

{
   InfoLog(<< "onNewSubscription(ClientSubscriptionHandle): " << msg.brief());
}

Here is the call graph for this function:

void BasicClientCall::onNonDialogCreatingProvisional ( resip::AppDialogSetHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 593 of file basicClientCall.cxx.

References resip::Message::brief(), InfoLog, and isUACConnected().

Referenced by resip::BasicClientUserAgent::onNonDialogCreatingProvisional().

{
   InfoLog(<< "onNonDialogCreatingProvisional: msg=" << msg.brief());
   if(isUACConnected()) return;  // Ignore provionals if already connected

   // Handle message here
}

Here is the call graph for this function:

void BasicClientCall::onNotifyNotReceived ( resip::ClientSubscriptionHandle  h) [protected, virtual]

Definition at line 638 of file basicClientCall.cxx.

References InfoLog.

Referenced by resip::BasicClientUserAgent::onNotifyNotReceived().

{
   InfoLog(<< "onNotifyNotReceived(ClientSubscriptionHandle)");
   h->end();
}
void BasicClientCall::onOffer ( resip::InviteSessionHandle  handle,
const resip::SipMessage msg,
const resip::SdpContents offer 
) [protected, virtual]

Definition at line 367 of file basicClientCall.cxx.

References resip::ServerInviteSession::accept(), resip::Message::brief(), resip::Handle< T >::get(), InfoLog, resip::InviteSession::isAccepted(), and isStaleFork().

{         
   if(isStaleFork(h->getDialogId()))
   {
      // If we receive a response from a stale fork (ie. after someone sends a 200), then we want to ignore it
      InfoLog(<< "onOffer: from stale fork, msg=" << msg.brief() << ", sdp=" << sdp);
      return;
   }
   InfoLog(<< "onOffer: msg=" << msg.brief() << ", sdp=" << sdp);

   // Provide Answer here - for test client just echo back same SDP as received for now
   h->provideAnswer(sdp);
   ServerInviteSession* uas = dynamic_cast<ServerInviteSession*>(h.get());
   if(uas && !uas->isAccepted())
   {
      uas->accept();
   }
}

Here is the call graph for this function:

void BasicClientCall::onOfferRejected ( resip::InviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 405 of file basicClientCall.cxx.

References resip::Message::brief(), isStaleFork(), and WarningLog.

{
   if(isStaleFork(h->getDialogId()))
   {
      // If we receive a response from a stale fork (ie. after someone sends a 200), then we want to ignore it
      if(msg)
      {
         WarningLog(<< "onOfferRejected: from stale fork, msg=" << msg->brief());
      }
      else
      {
         WarningLog(<< "onOfferRejected: from stale fork");
      }
      return;
   }
   if(msg)
   {
      WarningLog(<< "onOfferRejected: msg=" << msg->brief());
   }
   else
   {
      WarningLog(<< "onOfferRejected");
   }
}

Here is the call graph for this function:

void BasicClientCall::onOfferRequestRejected ( resip::InviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 431 of file basicClientCall.cxx.

References resip::Message::brief(), and InfoLog.

{
   InfoLog(<< "onOfferRequestRejected: msg=" << msg.brief());
   // This is called when we are waiting to resend a INVITE with no sdp after a glare condition, and we 
   // instead receive an inbound INVITE or UPDATE
}

Here is the call graph for this function:

void BasicClientCall::onOfferRequired ( resip::InviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 387 of file basicClientCall.cxx.

References resip::Message::brief(), InfoLog, isStaleFork(), and makeOffer().

{
   if(isStaleFork(h->getDialogId()))
   {
      // If we receive a response from a stale fork (ie. after someone sends a 200), then we want to ignore it
      InfoLog(<< "onOfferRequired: from stale fork, msg=" << msg.brief());
      return;
   }
   InfoLog(<< "onOfferRequired: msg=" << msg.brief());

   // Provide Offer Here
   SdpContents offer;
   makeOffer(offer);

   h->provideOffer(offer);
}

Here is the call graph for this function:

void BasicClientCall::onProvisional ( resip::ClientInviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 234 of file basicClientCall.cxx.

References resip::Message::brief(), InfoLog, and isStaleFork().

{
   InfoLog(<< "onProvisional: msg=" << msg.brief());

   if(isStaleFork(h->getDialogId()))
   {
      // If we receive a response from a stale fork (ie. after someone sends a 200), then we want to ignore it
      InfoLog(<< "onProvisional: from stale fork, msg=" << msg.brief());
      return;
   }
   InfoLog(<< "onProvisional: msg=" << msg.brief());
}

Here is the call graph for this function:

void BasicClientCall::onReadyToSend ( InviteSessionHandle  h,
SipMessage msg 
) [protected, virtual]

Definition at line 535 of file basicClientCall.cxx.

{
}
void BasicClientCall::onRedirected ( resip::ClientInviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 346 of file basicClientCall.cxx.

References resip::Message::brief(), and InfoLog.

{
   // DUM will recurse on redirect requests, so nothing to do here
   InfoLog(<< "onRedirected: msg=" << msg.brief());
}

Here is the call graph for this function:

void BasicClientCall::onRedirectReceived ( AppDialogSetHandle  h,
const SipMessage msg 
) [protected, virtual]

Definition at line 676 of file basicClientCall.cxx.

References resip::Message::brief(), and InfoLog.

Referenced by resip::BasicClientUserAgent::onRedirectReceived().

{
   InfoLog(<< "onRedirectReceived: msg=" << msg.brief());
}

Here is the call graph for this function:

void BasicClientCall::onRefer ( resip::InviteSessionHandle  h,
resip::ServerSubscriptionHandle  ss,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 473 of file basicClientCall.cxx.

References resip::Message::brief(), and InfoLog.

Referenced by resip::BasicClientUserAgent::onNewSubscriptionFromRefer().

{
   InfoLog(<< "onRefer: msg=" << msg.brief());

   // Handle Refer request here
}

Here is the call graph for this function:

void BasicClientCall::onReferAccepted ( resip::InviteSessionHandle  h,
resip::ClientSubscriptionHandle  csh,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 481 of file basicClientCall.cxx.

References resip::Message::brief(), and InfoLog.

{
   InfoLog(<< "onReferAccepted: msg=" << msg.brief());
}

Here is the call graph for this function:

void BasicClientCall::onReferNoSub ( resip::InviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 493 of file basicClientCall.cxx.

References resip::Message::brief(), and InfoLog.

{
   InfoLog(<< "onReferNoSub: msg=" << msg.brief());

   // Handle Refer request with (no-subscription indication) here
}

Here is the call graph for this function:

void BasicClientCall::onReferRejected ( resip::InviteSessionHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 487 of file basicClientCall.cxx.

References resip::Message::brief(), and WarningLog.

{
   WarningLog(<< "onReferRejected: msg=" << msg.brief());
}

Here is the call graph for this function:

void BasicClientCall::onRemoteSdpChanged ( resip::InviteSessionHandle  h,
const resip::SipMessage msg,
const resip::SdpContents sdp 
) [protected, virtual]

called when a modified SDP is received in a 2xx response to a session-timer reINVITE. Under normal circumstances where the response SDP is unchanged from current remote SDP no handler is called There is not much we can do about this. If session timers are used then they are managed seperately per leg and we have no real mechanism to notify the other peer of new SDP without starting a new offer/answer negotiation

Definition at line 439 of file basicClientCall.cxx.

References InfoLog.

{
   InfoLog(<< "onRemoteSdpChanged: msg=" << msg << ", sdp=" << sdp);

   // Process SDP Answer here
}
int BasicClientCall::onRequestRetry ( resip::ClientSubscriptionHandle  h,
int  retrySeconds,
const resip::SipMessage notify 
) [protected, virtual]

Definition at line 669 of file basicClientCall.cxx.

References resip::Message::brief(), and InfoLog.

Referenced by resip::BasicClientUserAgent::onRequestRetry().

{
   InfoLog(<< "onRequestRetry(ClientSubscriptionHandle): " << msg.brief());
   return -1;
}

Here is the call graph for this function:

void BasicClientCall::onStaleCallTimeout ( resip::ClientInviteSessionHandle  h) [protected, virtual]

Definition at line 277 of file basicClientCall.cxx.

References WarningLog.

{
   WarningLog(<< "onStaleCallTimeout");
}
void BasicClientCall::onTerminated ( resip::InviteSessionHandle  h,
resip::InviteSessionHandler::TerminatedReason  reason,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 283 of file basicClientCall.cxx.

References resip::Message::brief(), resip::InviteSessionHandler::Error, InfoLog, isStaleFork(), resip::InviteSessionHandler::LocalBye, resip::InviteSessionHandler::LocalCancel, resip::InviteSessionHandler::Referred, resip::InviteSessionHandler::Rejected, resip::InviteSessionHandler::RemoteBye, resip::InviteSessionHandler::RemoteCancel, resip::InviteSessionHandler::Replaced, and resip::InviteSessionHandler::Timeout.

Referenced by resip::BasicClientUserAgent::onTerminated().

{
   Data reasonData;

   switch(reason)
   {
   case InviteSessionHandler::RemoteBye:
      reasonData = "received a BYE from peer";
      break;
   case InviteSessionHandler::RemoteCancel:
      reasonData = "received a CANCEL from peer";
      break;   
   case InviteSessionHandler::Rejected:
      reasonData = "received a rejection from peer";
      break;
   case InviteSessionHandler::LocalBye:
      reasonData = "ended locally via BYE";
      break;
   case InviteSessionHandler::LocalCancel:
      reasonData = "ended locally via CANCEL";
      break;
   case InviteSessionHandler::Replaced:
      reasonData = "ended due to being replaced";
      break;
   case InviteSessionHandler::Referred:
      reasonData = "ended due to being referred";
      break;
   case InviteSessionHandler::Error:
      reasonData = "ended due to an error";
      break;
   case InviteSessionHandler::Timeout:
      reasonData = "ended due to a timeout";
      break;
   default:
      assert(false);
      break;
   }

   if(isStaleFork(h->getDialogId()))
   {
      // If we receive a response from a stale fork (ie. after someone sends a 200), then we want to ignore it
      if(msg)
      {
         InfoLog(<< "onTerminated: from stale fork, reason=" << reasonData << ", msg=" << msg->brief());
      }
      else
      {
         InfoLog(<< "onTerminated: from stale fork, reason=" << reasonData);
      }
      return;
   }

   if(msg)
   {
      InfoLog(<< "onTerminated: reason=" << reasonData << ", msg=" << msg->brief());
   }
   else
   {
      InfoLog(<< "onTerminated: reason=" << reasonData);
   }
}

Here is the call graph for this function:

void BasicClientCall::onTerminated ( resip::ClientSubscriptionHandle  h,
const resip::SipMessage notify 
) [protected, virtual]

Definition at line 645 of file basicClientCall.cxx.

References resip::Message::brief(), resip::SipMessage::exists(), resip::SipMessage::header(), InfoLog, and resip::SipMessage::isRequest().

{
   if(msg)
   {
      InfoLog(<< "onTerminated(ClientSubscriptionHandle): " << msg->brief());
      //Note:  Final notify is sometimes only passed in the onTerminated callback
      if (msg->isRequest() && msg->exists(h_Event) && msg->header(h_Event).value() == "refer")
      {
         //process Refer Notify Here
      }
   }
   else
   {
      InfoLog(<< "onTerminated(ClientSubscriptionHandle)");
   }
}

Here is the call graph for this function:

void BasicClientCall::onTrying ( resip::AppDialogSetHandle  h,
const resip::SipMessage msg 
) [protected, virtual]

Definition at line 584 of file basicClientCall.cxx.

References resip::Message::brief(), InfoLog, and isUACConnected().

Referenced by resip::BasicClientUserAgent::onTrying().

{
   InfoLog(<< "onTrying: msg=" << msg.brief());
   if(isUACConnected()) return;  // Ignore 100's if already connected

   // Handle message here
}

Here is the call graph for this function:

void BasicClientCall::onUpdateActive ( resip::ClientSubscriptionHandle  h,
const resip::SipMessage notify,
bool  outOfOrder 
) [protected, virtual]

Definition at line 616 of file basicClientCall.cxx.

References resip::Message::brief(), resip::SipMessage::exists(), resip::SipMessage::header(), and InfoLog.

Referenced by resip::BasicClientUserAgent::onUpdateActive().

{
   InfoLog(<< "onUpdateActive(ClientSubscriptionHandle): " << msg.brief());
   if (msg.exists(h_Event) && msg.header(h_Event).value() == "refer")
   {
      //process Refer Notify Here
   }
   h->acceptUpdate();
}

Here is the call graph for this function:

void BasicClientCall::onUpdateExtension ( resip::ClientSubscriptionHandle  h,
const resip::SipMessage notify,
bool  outOfOrder 
) [protected, virtual]

Definition at line 627 of file basicClientCall.cxx.

References resip::Message::brief(), resip::SipMessage::exists(), resip::SipMessage::header(), and InfoLog.

Referenced by resip::BasicClientUserAgent::onUpdateExtension().

{
   InfoLog(<< "onUpdateExtension(ClientSubscriptionHandle): " << msg.brief());
   if (msg.exists(h_Event) && msg.header(h_Event).value() == "refer")
   {
      //process Refer Notify Here
   }
   h->acceptUpdate();
}

Here is the call graph for this function:

void BasicClientCall::onUpdatePending ( resip::ClientSubscriptionHandle  h,
const resip::SipMessage notify,
bool  outOfOrder 
) [protected, virtual]

Definition at line 605 of file basicClientCall.cxx.

References resip::Message::brief(), resip::SipMessage::exists(), resip::SipMessage::header(), and InfoLog.

Referenced by resip::BasicClientUserAgent::onUpdatePending().

{
   InfoLog(<< "onUpdatePending(ClientSubscriptionHandle): " << msg.brief());
   if (msg.exists(h_Event) && msg.header(h_Event).value() == "refer")
   {
      //process Refer Notify Here
   }
   h->acceptUpdate();
}

Here is the call graph for this function:

SharedPtr< UserProfile > BasicClientCall::selectUASUserProfile ( const SipMessage msg) [protected, virtual]

Reimplemented from resip::AppDialogSet.

Definition at line 111 of file basicClientCall.cxx.

References resip::BasicClientUserAgent::getIncomingUserProfile(), and mUserAgent.

Here is the call graph for this function:

void BasicClientCall::terminateCall ( ) [virtual]

Definition at line 81 of file basicClientCall.cxx.

References resip::AppDialogSet::end().

Referenced by onNewSession(), and timerExpired().

Here is the call graph for this function:

void BasicClientCall::timerExpired ( ) [virtual]

Definition at line 87 of file basicClientCall.cxx.

References CallTimeCounterToByeOn, CallTimerTime, resip::BasicClientUserAgent::getDialogUsageManager(), resip::Handle< T >::isValid(), mInviteSessionHandle, resip::BasicClientUserAgent::mStack, mTimerExpiredCounter, mUserAgent, resip::SipStack::post(), and terminateCall().

Referenced by resip::BasicClientUserAgent::onCallTimeout().

{
   mTimerExpiredCounter++;
   if(mTimerExpiredCounter < CallTimeCounterToByeOn)
   {
      // First few times, send a message to the other party
      if(mInviteSessionHandle.isValid())
      {
         PlainContents plain("test message");
         mInviteSessionHandle->message(plain);
      }
   }
   else 
   {
      // Then hangup
      terminateCall();
   }

   // start timer for next one
   auto_ptr<ApplicationMessage> timer(new CallTimer(mUserAgent, this));
   mUserAgent.mStack.post(timer, CallTimerTime, &mUserAgent.getDialogUsageManager());
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class BasicClientUserAgent [friend]

Definition at line 28 of file basicClientCall.hxx.


Member Data Documentation

Definition at line 82 of file basicClientCall.hxx.

Referenced by onFlowTerminated(), onNewSession(), and timerExpired().

Definition at line 85 of file basicClientCall.hxx.

Referenced by onFlowTerminated(), and onNewSession().

Definition at line 84 of file basicClientCall.hxx.

Referenced by initiateCall(), onFlowTerminated(), and onMessage().

Definition at line 83 of file basicClientCall.hxx.

Referenced by timerExpired().

Definition at line 90 of file basicClientCall.hxx.

Referenced by isStaleFork(), isUACConnected(), and onConnected().


The documentation for this class was generated from the following files: