sipxtacklib  Version 3.3
SipDialogMgr.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 // Author: Dan Petrie (dpetrie AT SIPez DOT com)
11 
12 #ifndef _SipDialogMgr_h_
13 #define _SipDialogMgr_h_
14 
15 // SYSTEM INCLUDES
16 
17 // APPLICATION INCLUDES
18 
19 #include <os/OsDefs.h>
20 #include <os/OsMutex.h>
21 #include <utl/UtlString.h>
22 #include <utl/UtlHashBag.h>
23 
24 // DEFINES
25 // MACROS
26 // EXTERNAL FUNCTIONS
27 // EXTERNAL VARIABLES
28 // CONSTANTS
29 // STRUCTS
30 // FORWARD DECLARATIONS
31 class SipMessage;
32 class SipDialog;
33 
34 // TYPEDEFS
35 
37 
43 {
44 /* //////////////////////////// PUBLIC //////////////////////////////////// */
45 public:
46 
47 /* ============================ CREATORS ================================== */
48 
50  SipDialogMgr();
51 
52 
54  virtual
55  ~SipDialogMgr();
56 
57 
58 /* ============================ MANIPULATORS ============================== */
59 
61  UtlBoolean createDialog(const SipMessage& message,
62  UtlBoolean messageIsFromLocalSide,
63  const char* dialogHandle = NULL);
64 
66 
71  UtlBoolean updateDialog(const SipMessage& message,
72  const char* dialogHandle = NULL);
73 
75  UtlBoolean deleteDialog(const char* dialogHandle);
76 
77 
79 
81  UtlBoolean setNextLocalTransactionInfo(SipMessage& request,
82  const char* method = NULL,
83  const char* dialogHandle = NULL);
84 
85  /* ============================ ACCESSORS ================================= */
86 
88 
90  UtlBoolean getEarlyDialogHandleFor(const char* establishedDialogHandle,
91  UtlString& earlyDialogHandle);
92 
94  UtlBoolean getEstablishedDialogHandleFor(const char* earlyDialogHandle,
95  UtlString& establishedDialogHandle);
96 
98  int countDialogs() const;
99 
101  int toString(UtlString& dumpString);
102 
103 /* ============================ INQUIRY =================================== */
104 
106 
109  UtlBoolean earlyDialogExists(const char* earlyDialogHandle);
110 
112 
115  UtlBoolean earlyDialogExistsFor(const char* establishedDialogHandle);
116 
118 
122  UtlBoolean dialogExists(const char* dialogHandle);
123 
125  UtlBoolean isLastLocalTransaction(const SipMessage& message,
126  const char* dialogHandle = NULL);
127 
129 
132  UtlBoolean isNewRemoteTransaction(const SipMessage& sipMessage);
133 
134 /* //////////////////////////// PROTECTED ///////////////////////////////// */
135 protected:
136 
137 /* //////////////////////////// PRIVATE /////////////////////////////////// */
138 private:
140  SipDialogMgr(const SipDialogMgr& rSipDialogMgr);
141 
143  SipDialogMgr& operator=(const SipDialogMgr& rhs);
144 
146 
148  SipDialog* findDialog(UtlString& dialogHandle,
149  UtlBoolean ifHandleEstablishedFindEarlyDialog,
150  UtlBoolean ifHandleEarlyFindEstablishedDialog);
151 
153 
155  SipDialog* findDialog(UtlString& callId,
156  UtlString& localTag,
157  UtlString& remoteTag,
158  UtlBoolean ifHandleEstablishedFindEarlyDialog,
159  UtlBoolean ifHandleEarlyFindEstablishedDialog);
160 
162  void lock();
163 
165  void unlock();
166 
167  OsMutex mDialogMgrMutex;
168  UtlHashBag mDialogs;
169 };
170 
171 /* ============================ INLINE METHODS ============================ */
172 
173 #endif // _SipDialogMgr_h_
SipDialogMgr()
Default Dialog constructor.
Definition: SipDialogMgr.cpp:32
UtlBoolean isLastLocalTransaction(const SipMessage &message, const char *dialogHandle=NULL)
Checks to see if the given message matches the last local transaction.
Definition: SipDialogMgr.cpp:336
UtlBoolean earlyDialogExists(const char *earlyDialogHandle)
Is there an early dialog that matches this early dialogHandle.
Definition: SipDialogMgr.cpp:267
UtlBoolean earlyDialogExistsFor(const char *establishedDialogHandle)
Is there an early dialog that matches this established dialogHandle.
Definition: SipDialogMgr.cpp:290
Specialization of HttpMessage to contain and manipulate SIP messages.
Definition: SipMessage.h:343
virtual ~SipDialogMgr()
Destructor.
Definition: SipDialogMgr.cpp:46
int countDialogs() const
Get a count of the SipDialogs.
Definition: SipDialogMgr.cpp:236
UtlBoolean deleteDialog(const char *dialogHandle)
Delete the dialog for the given dialog handle.
Definition: SipDialogMgr.cpp:467
UtlBoolean updateDialog(const SipMessage &message, const char *dialogHandle=NULL)
Update the dialog information for the given message.
Definition: SipDialogMgr.cpp:100
UtlBoolean getEarlyDialogHandleFor(const char *establishedDialogHandle, UtlString &earlyDialogHandle)
Get the early dialog handle for the given established dialog handle.
Definition: SipDialogMgr.cpp:185
Class for refreshing SIP subscriptions and registrations.
Definition: SipDialogMgr.h:42
UtlBoolean setNextLocalTransactionInfo(SipMessage &request, const char *method=NULL, const char *dialogHandle=NULL)
Get the dialog related fields and set them in the given request.
Definition: SipDialogMgr.cpp:139
UtlBoolean createDialog(const SipMessage &message, UtlBoolean messageIsFromLocalSide, const char *dialogHandle=NULL)
Create a new dialog for the given SIP message.
Definition: SipDialogMgr.cpp:64
int toString(UtlString &dumpString)
Get dump string of dialogs.
Definition: SipDialogMgr.cpp:241
Class for containing SIP dialog state information.
Definition: SipDialog.h:61
UtlBoolean getEstablishedDialogHandleFor(const char *earlyDialogHandle, UtlString &establishedDialogHandle)
Get the established dialog for the given early dialog.
Definition: SipDialogMgr.cpp:209
UtlBoolean isNewRemoteTransaction(const SipMessage &sipMessage)
Check if the message is part of a new remote transaction.
Definition: SipDialogMgr.cpp:370
UtlBoolean dialogExists(const char *dialogHandle)
Is there a dialog that matches this dialogHandle.
Definition: SipDialogMgr.cpp:316

sipXtackLib home page