reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
DialogEventStateManager.hxx
Go to the documentation of this file.
1#if !defined(RESIP_DialogEventStateManager_HXX)
2#define RESIP_DialogEventStateManager_HXX
3
9
10namespace resip
11{
12
18{
19public:
20 typedef std::vector<DialogEventInfo> DialogEventInfos;
21
24 virtual ~DialogEventStateManager() = default;
25
28
30 DialogEventInfos getDialogEventInfo(const Uri& entityUri, bool bMatchRemoteIdentityOnly = false) const;
31
32private:
34
35 void onTryingUas(Dialog& dialog, const SipMessage& invite);
36 void onTryingUac(DialogSet& dialogSet, const SipMessage& invite);
37 void onProceedingUac(const DialogSet& dialogSet, const SipMessage& response);
38
39 //?dcm? how is direction determined when the onEarly is the first use of
40 //this dialog?
41 void onEarly(const Dialog& dialog, InviteSessionHandle is);
42
43 void onConfirmed(const Dialog& dialog, InviteSessionHandle is);
44 void onTerminated(const Dialog& dialog, const SipMessage& msg, InviteSessionHandler::TerminatedReason reason);
45
46 void onTerminated(const DialogSet& dialogSet, const SipMessage& msg, InviteSessionHandler::TerminatedReason reason);
47
48
49 // order by DialogSet, such that the following ordering occurs
50 // DialogSetId remoteTag
51 // a null
52 // a 1
53 // a 2
54 // b 1
55 // b 2
56 class DialogIdComparator
57 {
58 public:
59 bool operator()(const DialogId& x, const DialogId& y) const
60 {
61 if (x.getDialogSetId() == y.getDialogSetId())
62 {
63 return (x.getRemoteTag() < y.getRemoteTag());
64 }
65 return (x.getDialogSetId() < y.getDialogSetId());
66 }
67 };
68
69 DialogEventInfo* findOrCreateDialogInfo(const Dialog& dialog);
70
71 void onDialogSetTerminatedImpl(const DialogSetId& dialogSetId, const SipMessage& msg, InviteSessionHandler::TerminatedReason reason);
72 TerminatedDialogEvent* onDialogTerminatedImpl(DialogEventInfo* eventInfo, InviteSessionHandler::TerminatedReason reason,
73 int responseCode = 0, Uri* remoteTarget = NULL);
74
75 static int getResponseCode(const SipMessage& msg);
76 static Uri* getFrontContact(const SipMessage& msg);
77
78private:
79
80 friend class DialogUsageManager;
81 friend class ServerInviteSession;
82 friend class ClientInviteSession;
83 friend class InviteSession;
84 friend class DialogSet;
85
86 // .jjg. we'll only have the DialogSetId if we aren't yet in the 'early' state;
87 // once we get to early, we'll remove the DialogSetId in favour of the DialogId.
88 // The comparator/key of the map must have an ordering so that a key can be
89 // constructed which points to the beginning of a dialogSet. This could be done by
90 // no remote tag being always, which might be the existing behaviour, but
91 // shouldn't be relied on.
92 std::map<DialogId, DialogEventInfo*, DialogIdComparator> mDialogIdToEventInfo;
93
94 DialogEventHandler* mDialogEventHandler;
95};
96
97}
98#endif
Implements the FSM for dialog state as spec'd in RFC 4235.
std::vector< DialogEventInfo > DialogEventInfos
DialogEventStateManager & operator=(const DialogEventStateManager &)=delete
DialogEventStateManager(const DialogEventStateManager &)=delete
DialogEventInfos getDialogEventInfo() const
DialogEventStateManager(DialogEventStateManager &&)=delete
DialogEventStateManager & operator=(DialogEventStateManager &&)=delete
virtual ~DialogEventStateManager()=default
const Data & getRemoteTag() const
Definition DialogId.cxx:111
const DialogSetId & getDialogSetId() const
Definition DialogId.cxx:93
dcm! – kill typedef std::list<DialogId> DialogIdSet;
Definition Dialog.hxx:29
TerminatedReason
called when an dialog enters the terminated state - this can happen after getting a BYE,...
Base class for class ClientInviteSession and class ServerInviteSession.
Represents a SIP message.
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
dcm! – add UnusedChecking(_enum) below;