00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef OPAL_IM_SIPIM_H
00032 #define OPAL_IM_SIPIM_H
00033
00034 #include <ptlib.h>
00035 #include <opal/buildopts.h>
00036 #include <opal/rtpconn.h>
00037 #include <opal/manager.h>
00038 #include <opal/mediastrm.h>
00039 #include <opal/mediatype.h>
00040 #include <im/im.h>
00041 #include <sip/sdp.h>
00042
00043
00044 #if OPAL_HAS_SIPIM
00045
00046 class OpalSIPIMMediaType : public OpalIMMediaType
00047 {
00048 public:
00049 OpalSIPIMMediaType();
00050 virtual OpalMediaSession * CreateMediaSession(OpalConnection & conn, unsigned sessionID) const;
00051
00052 SDPMediaDescription * CreateSDPMediaDescription(const OpalTransportAddress & localAddress);
00053 };
00054
00056
00059 class OpalSIPIMMediaSession : public OpalMediaSession
00060 {
00061 PCLASSINFO(OpalSIPIMMediaSession, OpalMediaSession);
00062 public:
00063 OpalSIPIMMediaSession(OpalConnection & connection, unsigned sessionId);
00064 OpalSIPIMMediaSession(const OpalSIPIMMediaSession & _obj);
00065
00066 virtual bool Open() { return true; }
00067
00068 virtual void Close() { }
00069
00070 virtual PObject * Clone() const { return new OpalSIPIMMediaSession(*this); }
00071
00072 virtual bool IsActive() const { return true; }
00073
00074 virtual bool IsRTP() const { return false; }
00075
00076 virtual bool HasFailed() const { return false; }
00077
00078 virtual OpalTransportAddress GetLocalMediaAddress() const;
00079
00080 virtual void SetRemoteMediaAddress(const OpalTransportAddress &, const OpalMediaFormatList & );
00081
00082 virtual SDPMediaDescription * CreateSDPMediaDescription(
00083 const OpalTransportAddress & localAddress
00084 );
00085
00086 virtual OpalMediaStream * CreateMediaStream(
00087 const OpalMediaFormat & mediaFormat,
00088 unsigned sessionID,
00089 PBoolean isSource
00090 );
00091
00092 virtual PString GetCallID() const { return callId; }
00093
00094 protected:
00095 OpalTransportAddress transportAddress;
00096 PString localURL;
00097 PString remoteURL;
00098 PString callId;
00099 };
00100
00102
00103 class SIPEndPoint;
00104 class SIP_PDU;
00105 class SIPConnection;
00106
00107 class OpalSIPIMManager : public PObject
00108 {
00109 public:
00110 OpalSIPIMManager(SIPEndPoint & endpoint);
00111 void OnReceivedMessage(const SIP_PDU & pdu);
00112
00113 protected:
00114 SIPEndPoint & m_endpoint;
00115 PMutex m_mutex;
00116 };
00117
00118
00119
00121
00122 #endif // OPAL_HAS_SIPIM
00123
00124 #endif // OPAL_IM_SIPIM_H