reSIProcate/DialogUsageManager  9694
InviteSessionHandler.cxx
Go to the documentation of this file.
00001 #include "resip/dum/AppDialogSet.hxx"
00002 #include "resip/dum/InviteSessionHandler.hxx"
00003 #include "resip/dum/ClientInviteSession.hxx"
00004 #include "resip/stack/SdpContents.hxx"
00005 #include "rutil/Logger.hxx"
00006 
00007 #define RESIPROCATE_SUBSYSTEM Subsystem::DUM
00008 
00009 using namespace resip;
00010 
00011 void 
00012 InviteSessionHandler::onEarlyMedia(ClientInviteSessionHandle h, const SipMessage& msg, const Contents& body)
00013 {
00014         if(!mGenericOfferAnswer)
00015    {
00016       const SdpContents* sdp = dynamic_cast<const SdpContents*>(&body);
00017       assert(sdp);
00018       onEarlyMedia(h, msg, *sdp);
00019    }
00020 }
00021 
00022 void 
00023 InviteSessionHandler::onStaleCallTimeout(ClientInviteSessionHandle handle)
00024 {
00025     InfoLog(<< "InviteSessionHandler::onStaleCallTimeout");
00026 }
00027 
00028 void 
00029 InviteSessionHandler::terminate(ClientInviteSessionHandle h)
00030 {
00031    h->getAppDialogSet()->end();
00032 }
00033 
00034 void 
00035 InviteSessionHandler::onAckReceived(InviteSessionHandle, const SipMessage& msg)
00036 {
00037 }
00038 
00039 void 
00040 InviteSessionHandler::onAckNotReceived(InviteSessionHandle handle)
00041 {
00042    InfoLog(<< "InviteSessionHandler::onAckNotReceived");
00043    handle->end(InviteSession::AckNotReceived);
00044 }
00045 
00046 void 
00047 InviteSessionHandler::onStaleReInviteTimeout(InviteSessionHandle handle)
00048 {
00049    InfoLog(<< "InviteSessionHandler::onStaleReInviteTimeout");
00050    handle->end(InviteSession::StaleReInvite);
00051 }
00052 
00053 void 
00054 InviteSessionHandler::onIllegalNegotiation(InviteSessionHandle handle, const SipMessage& msg)
00055 {
00056    InfoLog(<< "InviteSessionHandler::onIllegalNegotiation");
00057 }
00058 
00059 void 
00060 InviteSessionHandler::onSessionExpired(InviteSessionHandle handle)
00061 {
00062    InfoLog(<< "InviteSessionHandler::onSessionExpired");
00063    handle->end(InviteSession::SessionExpired);
00064 }
00065 
00066 void 
00067 InviteSessionHandler::onAnswer(InviteSessionHandle h, const SipMessage& msg, const Contents& body)
00068 {
00069         if(!mGenericOfferAnswer)
00070    {
00071       const SdpContents* sdp = dynamic_cast<const SdpContents*>(&body);
00072       assert(sdp);
00073       onAnswer(h, msg, *sdp);
00074    }
00075 }
00076 
00077 void
00078 InviteSessionHandler::onOffer(InviteSessionHandle h, const SipMessage& msg, const Contents& body)
00079 {
00080         if(!mGenericOfferAnswer)
00081    {
00082       const SdpContents* sdp = dynamic_cast<const SdpContents*>(&body);
00083       assert(sdp);
00084       onOffer(h, msg, *sdp);
00085    }
00086 }
00087 
00088 void 
00089 InviteSessionHandler::onRemoteSdpChanged(InviteSessionHandle, const SipMessage& msg, const SdpContents&)
00090 {
00091 }
00092 
00093 void 
00094 InviteSessionHandler::onRemoteAnswerChanged(InviteSessionHandle h, const SipMessage& msg, const Contents& body)
00095 {
00096         if(!mGenericOfferAnswer)
00097    {
00098       const SdpContents* sdp = dynamic_cast<const SdpContents*>(&body);
00099       assert(sdp);
00100       onRemoteSdpChanged(h, msg, *sdp);
00101    }
00102 }
00103 
00104 void 
00105 InviteSessionHandler::onReadyToSend(InviteSessionHandle, SipMessage& msg)
00106 {
00107    // default is to do nothing. this is for adornment   
00108 }
00109 
00110 void 
00111 InviteSessionHandler::onOfferRequestRejected(InviteSessionHandle, const SipMessage& msg)
00112 {
00113 }
00114 
00115 void 
00116 InviteSessionHandler::onConnectedConfirmed(InviteSessionHandle handle, const SipMessage& msg)
00117 {
00118 }
00119 
00120 void 
00121 InviteSessionHandler::onFlowTerminated(InviteSessionHandle)
00122 {
00123    InfoLog(<< "InviteSessionHandler::onFlowTerminated");
00124 }
00125 
00126 
00127 /* ====================================================================
00128  * The Vovida Software License, Version 1.0 
00129  * 
00130  * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
00131  * 
00132  * Redistribution and use in source and binary forms, with or without
00133  * modification, are permitted provided that the following conditions
00134  * are met:
00135  * 
00136  * 1. Redistributions of source code must retain the above copyright
00137  *    notice, this list of conditions and the following disclaimer.
00138  * 
00139  * 2. Redistributions in binary form must reproduce the above copyright
00140  *    notice, this list of conditions and the following disclaimer in
00141  *    the documentation and/or other materials provided with the
00142  *    distribution.
00143  * 
00144  * 3. The names "VOCAL", "Vovida Open Communication Application Library",
00145  *    and "Vovida Open Communication Application Library (VOCAL)" must
00146  *    not be used to endorse or promote products derived from this
00147  *    software without prior written permission. For written
00148  *    permission, please contact vocal@vovida.org.
00149  *
00150  * 4. Products derived from this software may not be called "VOCAL", nor
00151  *    may "VOCAL" appear in their name, without prior written
00152  *    permission of Vovida Networks, Inc.
00153  * 
00154  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
00155  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00156  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
00157  * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
00158  * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
00159  * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
00160  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00161  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00162  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00163  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00164  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00165  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00166  * DAMAGE.
00167  * 
00168  * ====================================================================
00169  * 
00170  * This software consists of voluntary contributions made by Vovida
00171  * Networks, Inc. and many individuals on behalf of Vovida Networks,
00172  * Inc.  For more information on Vovida Networks, Inc., please see
00173  * <http://www.vovida.org/>.
00174  *
00175  */