sippdu.h

Go to the documentation of this file.
00001 /*
00002  * sippdu.h
00003  *
00004  * Session Initiation Protocol PDU support.
00005  *
00006  * Open Phone Abstraction Library (OPAL)
00007  * Formally known as the Open H323 project.
00008  *
00009  * Copyright (c) 2002 Equivalence Pty. Ltd.
00010  *
00011  * The contents of this file are subject to the Mozilla Public License
00012  * Version 1.0 (the "License"); you may not use this file except in
00013  * compliance with the License. You may obtain a copy of the License at
00014  * http://www.mozilla.org/MPL/
00015  *
00016  * Software distributed under the License is distributed on an "AS IS"
00017  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00018  * the License for the specific language governing rights and limitations
00019  * under the License.
00020  *
00021  * The Original Code is Open Phone Abstraction Library.
00022  *
00023  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00024  *
00025  * Contributor(s): ______________________________________.
00026  *
00027  * $Revision: 20930 $
00028  * $Author: rjongbloed $
00029  * $Date: 2008-09-11 11:46:06 +0000 (Thu, 11 Sep 2008) $
00030  */
00031 
00032 #ifndef __OPAL_SIPPDU_H
00033 #define __OPAL_SIPPDU_H
00034 
00035 #ifdef P_USE_PRAGMA
00036 #pragma interface
00037 #endif
00038 
00039 
00040 #include <ptclib/mime.h>
00041 #include <ptclib/url.h>
00042 #include <sip/sdp.h>
00043 #include <opal/rtpconn.h>
00044 
00045  
00046 class OpalTransport;
00047 class OpalTransportAddress;
00048 class OpalProductInfo;
00049 
00050 class SIPEndPoint;
00051 class SIPConnection;
00052 class SIP_PDU;
00053 
00054 
00056 // SIPURL
00057 
00063 class SIPURL : public PURL
00064 {
00065   PCLASSINFO(SIPURL, PURL);
00066   public:
00067     SIPURL();
00068 
00071     SIPURL(
00072       const char * cstr,    
00073       const char * defaultScheme = NULL 
00074     );
00075 
00078     SIPURL(
00079       const PString & str,  
00080       const char * defaultScheme = NULL 
00081     );
00082 
00090     SIPURL(
00091       const PString & name,
00092       const OpalTransportAddress & address,
00093       WORD listenerPort = 0
00094     );
00095 
00104     virtual Comparison Compare(
00105       const PObject & obj   
00106     ) const;
00107 
00111     PString AsQuotedString() const;
00112 
00115     PString GetDisplayName(PBoolean useDefault = PTrue) const;
00116     
00117     void SetDisplayName(const PString & str) 
00118       { displayName = str; }
00119 
00122     PString GetFieldParameters() const { return fieldParameters; }
00123 
00126     OpalTransportAddress GetHostAddress() const;
00127 
00128     enum UsageContext {
00129       ExternalURI,  
00130       RequestURI,   
00131       ToURI,        
00132       FromURI,      
00133       ContactURI,   
00134       RouteURI      
00135     };
00136 
00142     void Sanitise(
00143       UsageContext context  
00144     );
00145 
00151     PBoolean AdjustToDNS(
00152       PINDEX entry = 0  
00153     );
00154 
00155   protected:
00174     virtual PBoolean InternalParse(
00175       const char * cstr,
00176       const char * defaultScheme
00177     );
00178 
00179     PString displayName;
00180     PString fieldParameters;
00181 };
00182 
00183 
00185 // SIPMIMEInfo
00186 
00217 class SIPMIMEInfo : public PMIMEInfo
00218 {
00219   PCLASSINFO(SIPMIMEInfo, PMIMEInfo);
00220   public:
00221     SIPMIMEInfo(bool compactForm = false);
00222 
00223     virtual void PrintOn(ostream & strm) const;
00224     virtual void ReadFrom(istream & strm);
00225 
00226     void SetCompactForm(bool form) { compactForm = form; }
00227 
00228     PString GetContentType() const;
00229     void SetContentType(const PString & v);
00230 
00231     PString GetContentEncoding() const;
00232     void SetContentEncoding(const PString & v);
00233 
00234     PString GetFrom() const;
00235     void SetFrom(const PString & v);
00236 
00237     PString GetPAssertedIdentity() const;
00238     void SetPAssertedIdentity(const PString & v);
00239 
00240     PString GetPPreferredIdentity() const;
00241     void SetPPreferredIdentity(const PString & v);
00242 
00243     PString GetAccept() const;
00244     void SetAccept(const PString & v);
00245 
00246     PString GetAcceptEncoding() const;
00247     void SetAcceptEncoding(const PString & v);
00248 
00249     PString GetAcceptLanguage() const;
00250     void SetAcceptLanguage(const PString & v);
00251 
00252     PString GetAllow() const;
00253     void SetAllow(const PString & v);
00254 
00255     PString GetCallID() const;
00256     void SetCallID(const PString & v);
00257 
00258     PString GetContact() const;
00259     bool GetContacts(std::vector<SIPURL> & contacts) const;
00260     void SetContact(const PString & v);
00261     void SetContact(const SIPURL & url);
00262 
00263     PString GetSubject() const;
00264     void SetSubject(const PString & v);
00265 
00266     PString GetTo() const;
00267     void SetTo(const PString & v);
00268 
00269     PString GetVia() const;
00270     void SetVia(const PString & v);
00271 
00272     PStringList GetViaList() const;
00273     void SetViaList(const PStringList & v);
00274 
00275     PString GetReferTo() const;
00276     void SetReferTo(const PString & r);
00277 
00278     PString GetReferredBy() const;
00279     void SetReferredBy(const PString & r);
00280 
00281     PINDEX  GetContentLength() const;
00282     void SetContentLength(PINDEX v);
00283     PBoolean IsContentLengthPresent() const;
00284 
00285     PString GetCSeq() const;
00286     void SetCSeq(const PString & v);
00287 
00288     PString GetDate() const;
00289     void SetDate(const PString & v);
00290     void SetDate(const PTime & t);
00291     void SetDate(void); // set to current date
00292 
00293     unsigned GetExpires(unsigned dflt = UINT_MAX) const;// returns default value if not found
00294     void SetExpires(unsigned v);
00295 
00296     PINDEX GetMaxForwards() const;
00297     void SetMaxForwards(PINDEX v);
00298 
00299     PINDEX GetMinExpires() const;
00300     void SetMinExpires(PINDEX v);
00301 
00302     PString GetProxyAuthenticate() const;
00303     void SetProxyAuthenticate(const PString & v);
00304 
00305     PStringList GetRoute() const;
00306     void SetRoute(const PStringList & v);
00307 
00308     PStringList GetRecordRoute() const;
00309     void SetRecordRoute(const PStringList & v);
00310 
00311     unsigned GetCSeqIndex() const { return GetCSeq().AsUnsigned(); }
00312 
00313     PString GetSupported() const;
00314     void SetSupported(const PString & v);
00315 
00316     PString GetUnsupported() const;
00317     void SetUnsupported(const PString & v);
00318     
00319     PString GetEvent() const;
00320     void SetEvent(const PString & v);
00321     
00322     PString GetSubscriptionState() const;
00323     void SetSubscriptionState(const PString & v);
00324     
00325     PString GetUserAgent() const;
00326     void SetUserAgent(const PString & v);
00327 
00328     PString GetOrganization() const;
00329     void SetOrganization(const PString & v);
00330 
00331     void GetProductInfo(OpalProductInfo & info);
00332     void SetProductInfo(const PString & ua, const OpalProductInfo & info);
00333 
00334     PString GetWWWAuthenticate() const;
00335     void SetWWWAuthenticate(const PString & v);
00336 
00337     PString GetSIPIfMatch() const;
00338     void SetSIPIfMatch(const PString & v);
00339 
00340     PString GetSIPETag() const;
00341     void SetSIPETag(const PString & v);
00342 
00345     PString GetFieldParameter(
00346       const PString & fieldName,    
00347       const PString & paramName,    
00348       const PString & defaultValue = PString::Empty()  
00349     ) const { return ExtractFieldParameter((*this)(fieldName), paramName, defaultValue); }
00350 
00355     void SetFieldParameter(
00356       const PString & fieldName,    
00357       const PString & paramName,    
00358       const PString & newValue      
00359     ) { SetAt(fieldName, InsertFieldParameter((*this)(fieldName), paramName, newValue)); }
00360 
00363     static PString ExtractFieldParameter(
00364       const PString & fieldValue,   
00365       const PString & paramName,    
00366       const PString & defaultValue = PString::Empty()  
00367     );
00368 
00373     static PString InsertFieldParameter(
00374       const PString & fieldValue,   
00375       const PString & paramName,    
00376       const PString & newValue      
00377     );
00378 
00379   protected:
00382     PStringList GetRouteList(const char * name) const;
00383 
00387     void SetRouteList(const char * name, const PStringList & v);
00388 
00390     bool compactForm;
00391 };
00392 
00393 
00395 // SIPAuthentication
00396 
00397 class SIPAuthentication : public PObject
00398 {
00399   PCLASSINFO(SIPAuthentication, PObject);
00400   public:
00401     SIPAuthentication();
00402 
00403     virtual bool EquivalentTo(
00404       const SIPAuthentication & _oldAuth
00405     ) = 0;
00406 
00407     virtual PBoolean Parse(
00408       const PString & auth,
00409       PBoolean proxy
00410     ) = 0;
00411 
00412     virtual PBoolean Authorise(
00413       SIP_PDU & pdu
00414     ) const =  0;
00415 
00416     virtual PBoolean IsProxy() const               { return isProxy; }
00417 
00418     virtual PString GetUsername() const   { return username; }
00419     virtual PString GetPassword() const   { return password; }
00420     virtual PString GetAuthRealm() const  { return authRealm; }
00421 
00422     virtual void SetUsername(const PString & user) { username = user; }
00423     virtual void SetPassword(const PString & pass) { password = pass; }
00424     virtual void SetAuthRealm(const PString & r)   { authRealm = r; }
00425 
00426     PString GetAuthParam(const PString & auth, const char * name) const;
00427     PString AsHex(PMessageDigest5::Code & digest) const;
00428     PString AsHex(const PBYTEArray & data) const;
00429 
00430     static SIPAuthentication * ParseAuthenticationRequired(bool isProxy,
00431                                                 const PString & line,
00432                                                       PString & errorMsg);
00433 
00434   protected:
00435     PBoolean  isProxy;
00436 
00437     PString   username;
00438     PString   password;
00439     PString   authRealm;
00440 };
00441 
00442 typedef PFactory<SIPAuthentication> SIPAuthenticationFactory;
00443 
00445 
00446 class SIPDigestAuthentication : public SIPAuthentication
00447 {
00448   PCLASSINFO(SIPDigestAuthentication, SIPAuthentication);
00449   public:
00450     SIPDigestAuthentication();
00451 
00452     SIPDigestAuthentication & operator =(
00453       const SIPDigestAuthentication & auth
00454     );
00455 
00456     bool EquivalentTo(
00457       const SIPAuthentication & _oldAuth
00458     );
00459 
00460     PBoolean Parse(
00461       const PString & auth,
00462       PBoolean proxy
00463     );
00464 
00465     PBoolean Authorise(
00466       SIP_PDU & pdu
00467     ) const;
00468 
00469     enum Algorithm {
00470       Algorithm_MD5,
00471       NumAlgorithms
00472     };
00473     const PString & GetNonce() const       { return nonce; }
00474     Algorithm GetAlgorithm() const         { return algorithm; }
00475     const PString & GetOpaque() const      { return opaque; }
00476 
00477   protected:
00478     PString   nonce;
00479     Algorithm algorithm;
00480     PString   opaque;
00481 
00482     PBoolean qopAuth;
00483     PBoolean qopAuthInt;
00484     PString cnonce;
00485     mutable PAtomicInteger nonceCount;
00486 };
00487 
00489 // SIP_PDU
00490 
00496 class SIP_PDU : public PSafeObject
00497 {
00498   PCLASSINFO(SIP_PDU, PSafeObject);
00499   public:
00500     enum Methods {
00501       Method_INVITE,
00502       Method_ACK,
00503       Method_OPTIONS,
00504       Method_BYE,
00505       Method_CANCEL,
00506       Method_REGISTER,
00507       Method_SUBSCRIBE,
00508       Method_NOTIFY,
00509       Method_REFER,
00510       Method_MESSAGE,
00511       Method_INFO,
00512       Method_PING,
00513       Method_PUBLISH,
00514       NumMethods
00515     };
00516 
00517     enum StatusCodes {
00518       IllegalStatusCode,
00519       Local_TransportError,
00520       Local_BadTransportAddress,
00521 
00522       Information_Trying                  = 100,
00523       Information_Ringing                 = 180,
00524       Information_CallForwarded           = 181,
00525       Information_Queued                  = 182,
00526       Information_Session_Progress        = 183,
00527 
00528       Successful_OK                       = 200,
00529       Successful_Accepted                         = 202,
00530 
00531       Redirection_MultipleChoices         = 300,
00532       Redirection_MovedPermanently        = 301,
00533       Redirection_MovedTemporarily        = 302,
00534       Redirection_UseProxy                = 305,
00535       Redirection_AlternativeService      = 380,
00536 
00537       Failure_BadRequest                  = 400,
00538       Failure_UnAuthorised                = 401,
00539       Failure_PaymentRequired             = 402,
00540       Failure_Forbidden                   = 403,
00541       Failure_NotFound                    = 404,
00542       Failure_MethodNotAllowed            = 405,
00543       Failure_NotAcceptable               = 406,
00544       Failure_ProxyAuthenticationRequired = 407,
00545       Failure_RequestTimeout              = 408,
00546       Failure_Conflict                    = 409,
00547       Failure_Gone                        = 410,
00548       Failure_LengthRequired              = 411,
00549       Failure_RequestEntityTooLarge       = 413,
00550       Failure_RequestURITooLong           = 414,
00551       Failure_UnsupportedMediaType        = 415,
00552       Failure_UnsupportedURIScheme        = 416,
00553       Failure_BadExtension                = 420,
00554       Failure_ExtensionRequired           = 421,
00555       Failure_IntervalTooBrief            = 423,
00556       Failure_TemporarilyUnavailable      = 480,
00557       Failure_TransactionDoesNotExist     = 481,
00558       Failure_LoopDetected                = 482,
00559       Failure_TooManyHops                 = 483,
00560       Failure_AddressIncomplete           = 484,
00561       Failure_Ambiguous                   = 485,
00562       Failure_BusyHere                    = 486,
00563       Failure_RequestTerminated           = 487,
00564       Failure_NotAcceptableHere           = 488,
00565       Failure_BadEvent                    = 489,
00566       Failure_RequestPending              = 491,
00567       Failure_Undecipherable              = 493,
00568 
00569       Failure_InternalServerError         = 500,
00570       Failure_NotImplemented              = 501,
00571       Failure_BadGateway                  = 502,
00572       Failure_ServiceUnavailable          = 503,
00573       Failure_ServerTimeout               = 504,
00574       Failure_SIPVersionNotSupported      = 505,
00575       Failure_MessageTooLarge             = 513,
00576 
00577       GlobalFailure_BusyEverywhere        = 600,
00578       GlobalFailure_Decline               = 603,
00579       GlobalFailure_DoesNotExistAnywhere  = 604,
00580       GlobalFailure_NotAcceptable         = 606,
00581 
00582       MaxStatusCode                       = 699
00583     };
00584 
00585         static const char * GetStatusCodeDescription(int code);
00586     friend ostream & operator<<(ostream & strm, StatusCodes status);
00587 
00588     enum {
00589       MaxSize = 65535
00590     };
00591 
00592     SIP_PDU();
00593 
00596     SIP_PDU(
00597       Methods method,
00598       const SIPURL & dest,
00599       const PString & to,
00600       const PString & from,
00601       const PString & callID,
00602       unsigned cseq,
00603       const OpalTransportAddress & via
00604     );
00607     SIP_PDU(
00608       Methods method,
00609       SIPConnection & connection,
00610       const OpalTransport & transport
00611     );
00612 
00616     SIP_PDU(
00617       const SIP_PDU & request,
00618       StatusCodes code,
00619       const char * contact = NULL,
00620       const char * extra = NULL,
00621       const SDPSessionDescription * sdp = NULL
00622     );
00623     SIP_PDU(const SIP_PDU &);
00624     SIP_PDU & operator=(const SIP_PDU &);
00625     ~SIP_PDU();
00626 
00627     void PrintOn(
00628       ostream & strm
00629     ) const;
00630 
00631     void Construct(
00632       Methods method
00633     );
00634     void Construct(
00635       Methods method,
00636       const SIPURL & dest,
00637       const PString & to,
00638       const PString & from,
00639       const PString & callID,
00640       unsigned cseq,
00641       const OpalTransportAddress & via
00642     );
00643     void Construct(
00644       Methods method,
00645       SIPConnection & connection,
00646       const OpalTransport & transport
00647     );
00648 
00653     PBoolean SetRoute(const PStringList & routeSet);
00654 
00657     void SetAllow(unsigned bitmask);
00658 
00661     void AdjustVia(OpalTransport & transport);
00662     
00665     PBoolean Read(
00666       OpalTransport & transport
00667     );
00668 
00671     PBoolean Write(
00672       OpalTransport & transport,
00673       const OpalTransportAddress & remoteAddress = OpalTransportAddress()
00674     );
00675 
00678     bool SendResponse(
00679       OpalTransport & transport,
00680       StatusCodes code,
00681       const char * contact = NULL,
00682       const char * extra = NULL
00683     );
00684     bool SendResponse(
00685       OpalTransport & transport,
00686       SIP_PDU & response
00687     );
00688 
00692     PString Build();
00693 
00694     PString GetTransactionID() const;
00695 
00696     Methods GetMethod() const                { return method; }
00697     StatusCodes GetStatusCode () const       { return statusCode; }
00698     const SIPURL & GetURI() const            { return uri; }
00699     unsigned GetVersionMajor() const         { return versionMajor; }
00700     unsigned GetVersionMinor() const         { return versionMinor; }
00701     const PString & GetEntityBody() const    { return entityBody; }
00702           PString & GetEntityBody()          { return entityBody; }
00703     const PString & GetInfo() const          { return info; }
00704     const SIPMIMEInfo & GetMIME() const      { return mime; }
00705           SIPMIMEInfo & GetMIME()            { return mime; }
00706     void SetURI(const SIPURL & newuri)       { uri = newuri; }
00707     SDPSessionDescription * GetSDP();
00708 
00709   protected:
00710     Methods     method;                 // Request type, ==NumMethods for Response
00711     StatusCodes statusCode;
00712     SIPURL      uri;                    // display name & URI, no tag
00713     unsigned    versionMajor;
00714     unsigned    versionMinor;
00715     PString     info;
00716     SIPMIMEInfo mime;
00717     PString     entityBody;
00718 
00719     SDPSessionDescription * m_SDP;
00720 
00721     mutable PString transactionID;
00722 };
00723 
00724 
00725 PQUEUE(SIP_PDU_Queue, SIP_PDU);
00726 
00727 
00728 #if PTRACING
00729 ostream & operator<<(ostream & strm, SIP_PDU::Methods method);
00730 #endif
00731 
00732 
00734 // SIPTransaction
00735 
00746 class SIPTransaction : public SIP_PDU
00747 {
00748     PCLASSINFO(SIPTransaction, SIP_PDU);
00749   public:
00750     SIPTransaction(
00751       SIPEndPoint   & endpoint,
00752       OpalTransport & transport,
00753       const PTimeInterval & minRetryTime = PMaxTimeInterval, 
00754       const PTimeInterval & maxRetryTime = PMaxTimeInterval
00755     );
00759     SIPTransaction(
00760       SIPConnection & connection,
00761       OpalTransport & transport,
00762       Methods method = NumMethods
00763     );
00764     ~SIPTransaction();
00765 
00766     PBoolean Start();
00767     PBoolean IsInProgress() const { return state == Trying || state == Proceeding; }
00768     PBoolean IsFailed() const { return state > Terminated_Success; }
00769     PBoolean IsCompleted() const { return state >= Completed; }
00770     PBoolean IsCanceled() const { return state == Cancelling || state == Terminated_Cancelled || state == Terminated_Aborted; }
00771     PBoolean IsTerminated() const { return state >= Terminated_Success; }
00772 
00773     void WaitForCompletion();
00774     PBoolean Cancel();
00775     void Abort();
00776 
00777     virtual PBoolean OnReceivedResponse(SIP_PDU & response);
00778     virtual PBoolean OnCompleted(SIP_PDU & response);
00779 
00780     OpalTransport & GetTransport() const  { return transport; }
00781     SIPConnection * GetConnection() const { return connection; }
00782     PString         GetInterface() const { return localInterface; }
00783 
00784   protected:
00785     void Construct(
00786       const PTimeInterval & minRetryTime = PMaxTimeInterval,
00787       const PTimeInterval & maxRetryTime = PMaxTimeInterval
00788     );
00789     bool SendPDU(SIP_PDU & pdu);
00790     bool ResendCANCEL();
00791 
00792     PDECLARE_NOTIFIER(PTimer, SIPTransaction, OnRetry);
00793     PDECLARE_NOTIFIER(PTimer, SIPTransaction, OnTimeout);
00794 
00795     enum States {
00796       NotStarted,
00797       Trying,
00798       Aborting,
00799       Proceeding,
00800       Cancelling,
00801       Completed,
00802       Terminated_Success,
00803       Terminated_Timeout,
00804       Terminated_RetriesExceeded,
00805       Terminated_TransportError,
00806       Terminated_Cancelled,
00807       Terminated_Aborted,
00808       NumStates
00809     };
00810     virtual void SetTerminated(States newState);
00811 
00812     SIPEndPoint           & endpoint;
00813     OpalTransport         & transport;
00814     PSafePtr<SIPConnection> connection;
00815     PTimeInterval           retryTimeoutMin; 
00816     PTimeInterval           retryTimeoutMax; 
00817 
00818     States     state;
00819     unsigned   retry;
00820     PTimer     retryTimer;
00821     PTimer     completionTimer;
00822     PSyncPoint completed;
00823     PString    localInterface;
00824     OpalTransportAddress m_remoteAddress;
00825 };
00826 
00827 
00829 // SIPInvite
00830 
00836 class SIPInvite : public SIPTransaction
00837 {
00838     PCLASSINFO(SIPInvite, SIPTransaction);
00839   public:
00840     SIPInvite(
00841       SIPConnection & connection,
00842       OpalTransport & transport,
00843       OpalRTPSessionManager * sm
00844     );
00845 
00846     virtual PBoolean OnReceivedResponse(SIP_PDU & response);
00847 
00848     OpalRTPSessionManager & GetSessionManager() { return rtpSessions; }
00849 
00850   protected:
00851     OpalRTPSessionManager rtpSessions;
00852 };
00853 
00854 
00856 
00857 class SIPRegister : public SIPTransaction
00858 {
00859     PCLASSINFO(SIPRegister, SIPTransaction);
00860   public:
00861     struct Params {
00862       Params();
00863 
00864       PString       m_addressOfRecord;
00865       PString       m_registrarAddress;
00866       PString       m_contactAddress;
00867       PString       m_authID;
00868       PString       m_password;
00869       PString       m_realm;
00870       unsigned      m_expire;
00871       unsigned      m_restoreTime;
00872       PTimeInterval m_minRetryTime;
00873       PTimeInterval m_maxRetryTime;
00874     };
00875 
00876     SIPRegister(
00877       SIPEndPoint   & endpoint,
00878       OpalTransport & transport,
00879       const PStringList & routeSet,
00880       const PString & id,
00881       const Params & params
00882     );
00883 };
00884 
00885 
00887 
00888 class SIPSubscribe : public SIPTransaction
00889 {
00890     PCLASSINFO(SIPSubscribe, SIPTransaction);
00891   public:
00894     enum PredefinedPackages {
00895       MessageSummary,
00896       Presence,
00897       NumPredefinedPackages
00898     };
00899     static PredefinedPackages GetEventPackage(const PString & name);
00900     static PString GetEventPackageName(PredefinedPackages pkg);
00901 
00902     struct Params {
00903       Params(PredefinedPackages pkg = NumPredefinedPackages);
00904 
00905       PString       m_eventPackage;
00906       PString       m_mimeType;
00907       PString       m_targetAddress;
00908       PString       m_contactAddress;
00909       PString       m_authID;
00910       PString       m_password;
00911       PString       m_realm;
00912       unsigned      m_expire;
00913       unsigned      m_restoreTime;
00914       PTimeInterval m_minRetryTime;
00915       PTimeInterval m_maxRetryTime;
00916     };
00917 
00920     SIPSubscribe(
00921         SIPEndPoint & ep,
00922         OpalTransport & trans,
00923         const PStringList & routeSet,
00924         const PString & to,
00925         const PString & from,
00926         const PString & id,
00927         unsigned cseq,
00928         const Params & params
00929     );
00930 };
00931 
00932 
00934 
00935 class SIPPublish : public SIPTransaction
00936 {
00937     PCLASSINFO(SIPPublish, SIPTransaction);
00938   public:
00939     SIPPublish(
00940       SIPEndPoint & ep,
00941       OpalTransport & trans,
00942       const PStringList & routeSet,
00943       const SIPURL & targetAddress,
00944       const PString & id,
00945       const PString & sipIfMatch,
00946       const PString & body,
00947       unsigned expires
00948     );
00949 };
00950 
00951 
00953 
00954 class SIPRefer : public SIPTransaction
00955 {
00956   PCLASSINFO(SIPRefer, SIPTransaction);
00957   public:
00958     SIPRefer(
00959       SIPConnection & connection,
00960       OpalTransport & transport,
00961       const SIPURL & refer
00962     );
00963     SIPRefer(
00964       SIPConnection & connection,
00965       OpalTransport & transport,
00966       const SIPURL & refer,
00967       const SIPURL & referred_by
00968     );
00969   protected:
00970     void Construct(
00971       SIPConnection & connection,
00972       OpalTransport & transport,
00973       const SIPURL & refer,
00974       const SIPURL & referred_by
00975     );
00976 };
00977 
00978 
00980 
00981 /* This is not a generic NOTIFY PDU, but the minimal one
00982  * that gets sent when receiving a REFER
00983  */
00984 class SIPReferNotify : public SIPTransaction
00985 {
00986     PCLASSINFO(SIPReferNotify, SIPTransaction);
00987   public:
00988     SIPReferNotify(
00989       SIPConnection & connection,
00990       OpalTransport & transport,
00991       StatusCodes code
00992     );
00993 };
00994 
00995 
00997 
00998 /* This is a MESSAGE PDU, with a body
00999  */
01000 class SIPMessage : public SIPTransaction
01001 {
01002     PCLASSINFO(SIPMessage, SIPTransaction);
01003     
01004   public:
01005     SIPMessage(
01006                SIPEndPoint & ep,
01007                OpalTransport & trans,
01008                const SIPURL & to,
01009                const PStringList & routeSet,
01010                const PString & id,
01011                const PString & body
01012     );
01013 };
01014 
01015 
01017 
01018 /* This is the ACK request sent when receiving a response to an outgoing
01019  * INVITE.
01020  */
01021 class SIPAck : public SIP_PDU
01022 {
01023     PCLASSINFO(SIPAck, SIP_PDU);
01024   public:
01025     SIPAck(
01026       SIPTransaction & invite,
01027       SIP_PDU & response
01028     );
01029 };
01030 
01031 
01033 
01034 /* This is an OPTIONS request
01035  */
01036 class SIPOptions : public SIPTransaction
01037 {
01038     PCLASSINFO(SIPOptions, SIPTransaction);
01039     
01040   public:
01041     SIPOptions(
01042         SIPEndPoint & ep,
01043       OpalTransport & trans,
01044        const SIPURL & address
01045     );
01046 };
01047 
01048 
01050 
01051 /* This is a PING PDU, with a body
01052  */
01053 class SIPPing : public SIPTransaction
01054 {
01055   PCLASSINFO(SIPPing, SIPTransaction);
01056 
01057   public:
01058     SIPPing(
01059                SIPEndPoint & ep,
01060              OpalTransport & trans,
01061               const SIPURL & address,
01062               const PString & body = PString::Empty()
01063    );
01064 };
01065 
01066 
01067 #endif // __OPAL_SIPPDU_H
01068 
01069 
01070 // End of File ///////////////////////////////////////////////////////////////

Generated on Mon Sep 15 11:49:15 2008 for OPAL by  doxygen 1.5.1