summaryrefslogtreecommitdiffstats
path: root/bindings/_common/SipEvent.h
blob: 36278450a7d5da912aaf0bc2e18ebce1d0a22e4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
#ifndef TINYWRAP_SIPEVENT_H
#define TINYWRAP_SIPEVENT_H

#include "tinyWRAP_config.h"

#include "tinysip.h"
#include "Common.h"

class SipStack;

class SipSession;
class InviteSession;
class CallSession;
class MsrpSession;
class MessagingSession;
class InfoSession;
class OptionsSession;
class PublicationSession;
class RegistrationSession;
class SubscriptionSession;

class SipMessage;


/* ======================== SipEvent ========================*/
class TINYWRAP_API SipEvent
{
public:
#if !defined(SWIG)
    SipEvent(const tsip_event_t *sipevent);
#endif
    virtual ~SipEvent();

public:
    short getCode() const;
    const char* getPhrase() const;
    const SipSession* getBaseSession() const;
    const SipMessage* getSipMessage() const;
#if !defined(SWIG)
    const tsip_event_t * getWrappedEvent() {
        return sipevent;
    }
#endif
#if !defined(SWIG)
    SipStack* getStack()const;
#endif

protected:
    const tsip_event_t *sipevent;
    SipMessage* sipmessage;
};


/* ======================== DialogEvent ========================*/
class TINYWRAP_API DialogEvent: public SipEvent
{
public:
#if !defined(SWIG)
    DialogEvent(const tsip_event_t *sipevent);
#endif
    virtual ~DialogEvent();

public: /* Public API functions */
};

/* ======================== StackEvent ========================*/
class TINYWRAP_API StackEvent: public SipEvent
{
public:
#if !defined(SWIG)
    StackEvent(const tsip_event_t *sipevent);
#endif
    virtual ~StackEvent();

public: /* Public API functions */
};



/* ======================== InviteEvent ========================*/
class TINYWRAP_API InviteEvent: public SipEvent
{
public:
#if !defined(SWIG)
    InviteEvent(const tsip_event_t *sipevent);
#endif
    virtual ~InviteEvent();

public: /* Public API functions */
    tsip_invite_event_type_t getType() const;
    twrap_media_type_t getMediaType() const;
    const InviteSession* getSession() const;
    CallSession* takeCallSessionOwnership() const;
    MsrpSession* takeMsrpSessionOwnership() const;
};



/* ======================== MessagingEvent ========================*/
class TINYWRAP_API MessagingEvent: public SipEvent
{
public:
#if !defined(SWIG)
    MessagingEvent(const tsip_event_t *sipevent);
#endif
    virtual ~MessagingEvent();

public: /* Public API functions */
    tsip_message_event_type_t getType() const;
    const MessagingSession* getSession() const;
    MessagingSession* takeSessionOwnership() const;
};

/* ======================== InfoEvent ========================*/
class TINYWRAP_API InfoEvent: public SipEvent
{
public:
#if !defined(SWIG)
    InfoEvent(const tsip_event_t *sipevent);
#endif
    virtual ~InfoEvent();

public: /* Public API functions */
    tsip_info_event_type_t getType() const;
    const InfoSession* getSession() const;
    InfoSession* takeSessionOwnership() const;
};



/* ======================== OptionsEvent ========================*/
class TINYWRAP_API OptionsEvent: public SipEvent
{
public:
#if !defined(SWIG)
    OptionsEvent(const tsip_event_t *sipevent);
#endif
    virtual ~OptionsEvent();

public: /* Public API functions */
    tsip_options_event_type_t getType() const;
    const OptionsSession* getSession() const;
    OptionsSession* takeSessionOwnership() const;
};



/* ======================== PublicationEvent ========================*/
class TINYWRAP_API PublicationEvent: public SipEvent
{
public:
#if !defined(SWIG)
    PublicationEvent(const tsip_event_t *sipevent);
#endif
    virtual ~PublicationEvent();

public: /* Public API functions */
    tsip_publish_event_type_t getType() const;
    const PublicationSession* getSession() const;
    PublicationSession* takeSessionOwnership() const;
};



/* ======================== RegistrationEvent ========================*/
class TINYWRAP_API RegistrationEvent: public SipEvent
{
public:
#if !defined(SWIG)
    RegistrationEvent(const tsip_event_t *sipevent);
#endif
    virtual ~RegistrationEvent();

public: /* Public API functions */
    tsip_register_event_type_t getType() const;
    const RegistrationSession* getSession() const;
    RegistrationSession* takeSessionOwnership() const;

};


/* ======================== SubscriptionEvent ========================*/
class TINYWRAP_API SubscriptionEvent: public SipEvent
{
public:
#if !defined(SWIG)
    SubscriptionEvent(const tsip_event_t *sipevent);
#endif
    virtual ~SubscriptionEvent();

public: /* Public API functions */
    tsip_subscribe_event_type_t getType() const;
    const SubscriptionSession* getSession() const;
    SubscriptionSession* takeSessionOwnership() const;
};

#endif /* TINYWRAP_SIPEVENT_H */
OpenPOWER on IntegriCloud