forked from YeeYoungHan/cppsipstack
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSipStackCallBack.h
More file actions
119 lines (105 loc) · 3.81 KB
/
Copy pathSipStackCallBack.h
File metadata and controls
119 lines (105 loc) · 3.81 KB
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
/*
* Copyright (C) 2012 Yee Young Han <websearch@naver.com> (http://blog.naver.com/websearch)
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _SIP_STACK_CALLBACK_H_
#define _SIP_STACK_CALLBACK_H_
#include "SipStackDefine.h"
/**
* @ingroup SipStack
* @brief SIP stack callback 인터페이스
*/
class ISipStackCallBack
{
public:
virtual ~ISipStackCallBack(){};
/**
* @ingroup SipStack
* @brief SIP 요청 메시지 수신 이벤트 핸들러
* @param iThreadId UDP 쓰레드 번호
* @param pclsMessage SIP 요청 메시지
* @returns SIP 요청 메시지를 처리하면 true 를 리턴하고 그렇지 않으면 false 를 리턴한다.
*/
virtual bool RecvRequest( int iThreadId, CSipMessage * pclsMessage ) = 0;
/**
* @ingroup SipStack
* @brief SIP 응답 메시지 수신 이벤트 핸들러
* @param iThreadId UDP 쓰레드 번호
* @param pclsMessage SIP 응답 메시지
* @returns SIP 응답 메시지를 처리하면 true 를 리턴하고 그렇지 않으면 false 를 리턴한다.
*/
virtual bool RecvResponse( int iThreadId, CSipMessage * pclsMessage ) = 0;
/**
* @ingroup SipStack
* @brief SIP 메시지 전송 timeout 이벤트 핸들러
* @param iThreadId UDP 쓰레드 번호
* @param pclsMessage SIP 응답 메시지
* @returns SIP 응답 메시지를 처리하면 true 를 리턴하고 그렇지 않으면 false 를 리턴한다.
*/
virtual bool SendTimeout( int iThreadId, CSipMessage * pclsMessage ) = 0;
/**
* @ingroup SipStack
* @brief TCP/TLS 세션 종료 이벤트 핸들러
* @param pszIp IP 주소
* @param iPort 포트 번호
* @param eTransport 프로토콜
*/
virtual void TcpSessionEnd( const char * pszIp, int iPort, ESipTransport eTransport ){};
/**
* @ingroup SipStack
* @brief SIP 메시지 수신 쓰레드가 종료됨을 알려주는 이벤트 핸들러
* @param iThreadId UDP 쓰레드 번호
*/
virtual void ThreadEnd( int iThreadId ){};
};
/**
* @ingroup SipStack
* @brief SIP stack 보안 callback 인터페이스
*/
class ISipStackSecurityCallBack
{
public:
virtual ~ISipStackSecurityCallBack(){};
/**
* @ingroup SipStack
* @brief SIP stack 에서 허용하는 SIP User Agent 인가?
* @param pszSipUserAgent SIP UserAgent 헤더
* @returns SIP stack 에서 허용하는 SIP User Agent 이면 true 를 리턴하고 그렇지 않으면 false 한다.
*/
virtual bool IsAllowUserAgent( const char * pszSipUserAgent ) = 0;
/**
* @ingroup SipStack
* @brief SIP stack 에서 허용하지 않는 SIP User Agent 인가?
* @param pszSipUserAgent SIP UserAgent 헤더
* @returns SIP stack 에서 허용하지 않는 SIP User Agent 이면 true 를 리턴하고 그렇지 않으면 false 한다.
*/
virtual bool IsDenyUserAgent( const char * pszSipUserAgent ) = 0;
/**
* @ingroup SipStack
* @brief SIP stack 에서 허용하는 IP 주소인가?
* @param pszIp 클라이언트 IP 주소
* @returns SIP stack 에서 허용하는 IP 주소이면 true 를 리턴하고 그렇지 않으면 false 를 리턴한다.
*/
virtual bool IsAllowIp( const char * pszIp ) = 0;
/**
* @ingroup SipStack
* @brief SIP stack 에서 허용하지 않는 IP 주소인가?
* @param pszIp 클라이언트 IP 주소
* @returns SIP stack 에서 허용하지 않는 IP 주소이면 true 를 리턴하고 그렇지 않으면 false 를 리턴한다.
*/
virtual bool IsDenyIp( const char * pszIp ) = 0;
};
#endif