OPAL  Version 3.18.8
sipim.h
Go to the documentation of this file.
1 /*
2  * sipim.h
3  *
4  * Support for SIP session mode IM
5  *
6  * Open Phone Abstraction Library (OPAL)
7  *
8  * Copyright (c) 2008 Post Increment
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Open Phone Abstraction Library.
21  *
22  * The Initial Developer of the Original Code is Post Increment
23  *
24  * Contributor(s): ______________________________________.
25  */
26 
27 #ifndef OPAL_IM_SIPIM_H
28 #define OPAL_IM_SIPIM_H
29 
30 #include <ptlib.h>
31 #include <opal_config.h>
32 
33 #if OPAL_HAS_SIPIM
34 
35 #include <opal/mediasession.h>
36 #include <sip/sippdu.h>
37 #include <im/im.h>
38 #include <im/rfc4103.h>
39 
40 
42 
62 {
63  public:
65 
66  virtual bool Open(bool byRemote);
67  virtual bool SendCompositionIndication(const CompositionInfo & info);
68 
69  static void OnMESSAGECompleted(
70  SIPEndPoint & endpoint,
71  const SIPMessage::Params & params,
73  );
74  static void OnReceivedMESSAGE(
75  SIPEndPoint & endpoint,
76  SIPConnection * connection,
77  SIP_PDU & pdu
78  );
79 
80  protected:
81  virtual MessageDisposition InternalSendOutsideCall(OpalIM & message);
82  virtual MessageDisposition InternalSendInsideCall(OpalIM & message);
83 
84  virtual MessageDisposition OnMessageReceived(const OpalIM & message);
85 
86  virtual MessageDisposition InternalOnCompositionIndication(const OpalIM & message);
87  virtual MessageDisposition InternalOnDisposition(const OpalIM & message);
88 
89  void PopulateParams(SIPMessage::Params & params, const OpalIM & message);
90 
91  PDECLARE_NOTIFIER(PTimer, OpalSIPIMContext, OnRxCompositionIdleTimer);
92  PDECLARE_NOTIFIER(PTimer, OpalSIPIMContext, OnTxCompositionIdleTimer);
93 
99  PTime m_lastActive;
100 };
101 
102 
104 
105 #endif // OPAL_HAS_SIPIM
106 
107 #endif // OPAL_IM_SIPIM_H
virtual MessageDisposition InternalSendOutsideCall(OpalIM &message)
virtual bool SendCompositionIndication(const CompositionInfo &info)
Definition: sipim.h:61
Definition: sippdu.h:1548
void PopulateParams(SIPMessage::Params &params, const OpalIM &message)
Definition: sipcon.h:131
Definition: sipep.h:52
virtual MessageDisposition InternalOnDisposition(const OpalIM &message)
StatusCodes
Definition: sippdu.h:544
Definition: sippdu.h:522
PDECLARE_NOTIFIER(PTimer, OpalSIPIMContext, OnRxCompositionIdleTimer)
static void OnReceivedMESSAGE(SIPEndPoint &endpoint, SIPConnection *connection, SIP_PDU &pdu)
Definition: im.h:75
PString m_rxCompositionState
Definition: sipim.h:94
virtual MessageDisposition InternalSendInsideCall(OpalIM &message)
virtual bool Open(bool byRemote)
PTimer m_rxCompositionIdleTimeout
Definition: sipim.h:95
virtual MessageDisposition InternalOnCompositionIndication(const OpalIM &message)
PTime m_lastActive
Definition: sipim.h:99
PSimpleTimer m_txCompositionRefreshTimeout
Definition: sipim.h:98
static void OnMESSAGECompleted(SIPEndPoint &endpoint, const SIPMessage::Params &params, SIP_PDU::StatusCodes reason)
PTimer m_txCompositionIdleTimeout
Definition: sipim.h:97
virtual MessageDisposition OnMessageReceived(const OpalIM &message)
PString m_txCompositionState
Definition: sipim.h:96
Definition: im.h:107
Definition: im.h:270