-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathh323.channels.rtpbind.any.patch
More file actions
162 lines (151 loc) · 6.16 KB
/
Copy pathh323.channels.rtpbind.any.patch
File metadata and controls
162 lines (151 loc) · 6.16 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
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
diff -urN channels.orig/Makefile channels/Makefile
--- channels.orig/Makefile 2008-05-15 09:22:10.000000000 +0300
+++ channels/Makefile 2008-05-19 21:10:27.000000000 +0300
@@ -89,7 +89,7 @@
else
chan_h323.so: chan_h323.o h323/libchanh323.a
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
- $(CMD_PREFIX) $(CXX) $(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
+ $(CMD_PREFIX) $(CXX) $(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L/usr/lib -lcrypto -lssl -lexpat
endif
chan_misdn.o: ASTCFLAGS+=-Imisdn
diff -urN channels.orig/h323/ast_h323.cxx channels/h323/ast_h323.cxx
--- channels.orig/h323/ast_h323.cxx 2008-05-15 09:19:22.000000000 +0300
+++ channels/h323/ast_h323.cxx 2008-05-19 20:44:50.000000000 +0300
@@ -1834,17 +1834,32 @@
return TRUE;
}
+#ifdef NEED_RTP_QOS_PARAM
H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capability & capability,
H323Channel::Directions dir,
unsigned sessionID,
const H245_H2250LogicalChannelParameters * /*param*/,
RTP_QOS * /*param*/ )
+#else
+H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capability & capability,
+ H323Channel::Directions dir,
+ unsigned sessionID,
+ const H245_H2250LogicalChannelParameters * /*param*/);
+#endif
{
- /* Do not open tx channel when transmitter has been paused by empty TCS */
- if ((dir == H323Channel::IsTransmitter) && transmitterSidePaused)
- return NULL;
+ PIPSocket::Address externIpAddr;
+ WORD externPort;
- return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID);
+ GetControlChannel().GetLocalAddress().GetIpAndPort(externIpAddr, externPort);
+
+ if (h323debug){
+ cout << "\t-- Create RealTime logical channel: " << endl;
+ cout << "\t\t-- SessionID: " << sessionID << endl;
+ cout << "\t\t-- ExternalIpAddress: " << externIpAddr << endl;
+ cout << "\t\t-- ExternalPort: " << externPort << endl;
+ }
+
+ return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID, externIpAddr, externPort);
}
/** This callback function is invoked once upon creation of each
@@ -2114,8 +2129,10 @@
MyH323_ExternalRTPChannel::MyH323_ExternalRTPChannel(MyH323Connection & connection,
const H323Capability & capability,
Directions direction,
- unsigned id)
- : H323_ExternalRTPChannel::H323_ExternalRTPChannel(connection, capability, direction, id)
+ unsigned id,
+ const PIPSocket::Address & ip,
+ WORD dataPort)
+ : H323_ExternalRTPChannel::H323_ExternalRTPChannel(connection, capability, direction, id, ip, dataPort)
{
struct rtp_info *info;
@@ -2125,7 +2142,7 @@
cout << "\tERROR: on_external_rtp_create failure" << endl;
return;
} else {
- localIpAddr = info->addr;
+ localIpAddr = ip;
localPort = info->port;
/* tell the H.323 stack */
SetExternalAddress(H323TransportAddress(localIpAddr, localPort), H323TransportAddress(localIpAddr, localPort + 1));
@@ -2165,6 +2182,7 @@
cout << "\t\t-- remotePort: " << remotePort << endl;
cout << "\t\t-- ExternalIpAddress: " << localIpAddr << endl;
cout << "\t\t-- ExternalPort: " << localPort << endl;
+ cout << "\t\t-- PT: " << (int)payloadCode << endl;
}
/* Notify Asterisk of remote RTP information */
on_start_rtp_channel(connection.GetCallReference(), (const char *)remoteIpAddr.AsString(), remotePort,
@@ -2183,6 +2201,7 @@
if (h323debug) {
cout << " -- remoteIpAddress: " << remoteIpAddr << endl;
cout << " -- remotePort: " << remotePort << endl;
+ cout << " -- PT: " << (int)payloadCode << endl;
}
on_start_rtp_channel(connection.GetCallReference(), (const char *)remoteIpAddr.AsString(),
remotePort, (const char *)connection.GetCallToken(), (int)payloadCode);
@@ -2340,7 +2359,9 @@
H323ListenerTCP *tcpListener;
tcpListener = new H323ListenerTCP(*endPoint, interfaceAddress, (WORD)listenPort);
if (!endPoint->StartListener(tcpListener)) {
- cout << "ERROR: Could not open H.323 listener port on " << ((H323ListenerTCP *) tcpListener)->GetListenerPort() << endl;
+ cout << "ERROR: Could not open H.323 listener "
+ << ((H323ListenerTCP *) tcpListener)->GetTransportAddress() << endl;
+
delete tcpListener;
return 1;
}
@@ -2395,7 +2416,15 @@
void h323_show_tokens(void)
{
- cout << "Current call tokens: " << setprecision(2) << endPoint->GetAllConnections() << endl;
+ PStringStream sstr;
+ PStringList tokens = endPoint->GetAllConnections();
+ cout << "Current call tokens: " << endl;
+ for(PINDEX i = 0; i < tokens.GetSize(); i++){
+ PStringStream str;
+ str << setprecision(2) << tokens[i] << '\n';
+ sstr += str;
+ }
+ cout << sstr << endl;
}
/** Establish Gatekeeper communiations, if so configured,
diff -urN channels.orig/h323/ast_h323.h channels/h323/ast_h323.h
--- channels.orig/h323/ast_h323.h 2007-10-19 19:51:28.000000000 +0300
+++ channels/h323/ast_h323.h 2008-05-19 21:05:55.000000000 +0300
@@ -31,6 +31,10 @@
#define VERSION(a,b,c) ((a)*10000+(b)*100+(c))
+#if (VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) >= VERSION(1,13,4))
+#define NEED_RTP_QOS_PARAM 1
+#endif
+
class MyH323EndPoint : public H323EndPoint
{
PCLASSINFO(MyH323EndPoint, H323EndPoint);
@@ -60,11 +64,18 @@
public:
MyH323Connection(MyH323EndPoint &, unsigned, unsigned);
~MyH323Connection();
+#ifdef NEED_RTP_QOS_PARAM
H323Channel * CreateRealTimeLogicalChannel(const H323Capability &,
H323Channel::Directions,
unsigned,
const H245_H2250LogicalChannelParameters *,
RTP_QOS *);
+#else
+ H323Channel * CreateRealTimeLogicalChannel(const H323Capability &,
+ H323Channel::Directions,
+ unsigned,
+ const H245_H2250LogicalChannelParameters *);
+#endif
H323Connection::AnswerCallResponse OnAnswerCall(const PString &,
const H323SignalPDU &,
H323SignalPDU &);
@@ -136,7 +147,9 @@
MyH323Connection & connection,
const H323Capability & capability,
Directions direction,
- unsigned sessionID);
+ unsigned sessionID,
+ const PIPSocket::Address & ip,
+ WORD dataPort);
~MyH323_ExternalRTPChannel();