aboutsummaryrefslogtreecommitdiffstats
path: root/channels/h323/ast_h323.cpp
diff options
context:
space:
mode:
authorjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2003-08-25 18:34:10 +0000
committerjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2003-08-25 18:34:10 +0000
commit082653c9380180ec63428fa60b354ee35f6eb5e2 (patch)
tree2682488a58faea4bad1f634378dd7862cd0bd616 /channels/h323/ast_h323.cpp
parent0b371834dfe04b4378a6d2cfcf6384c63166d8a9 (diff)
sync any left over changes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1428 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/h323/ast_h323.cpp')
-rwxr-xr-xchannels/h323/ast_h323.cpp48
1 files changed, 31 insertions, 17 deletions
diff --git a/channels/h323/ast_h323.cpp b/channels/h323/ast_h323.cpp
index 84ea8f8be..f59d08684 100755
--- a/channels/h323/ast_h323.cpp
+++ b/channels/h323/ast_h323.cpp
@@ -23,6 +23,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
+ * Version Info: $Id$
*/
#include "ast_h323.h"
#include "h323t38.h"
@@ -601,21 +602,29 @@ H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capabilit
unsigned sessionID,
const H245_H2250LogicalChannelParameters * /*param*/)
{
- WORD port;
-
- /* Establish the Local (A side) IP Address */
- GetControlChannel().GetLocalAddress().GetIpAndPort(externalIpAddress, port);
+ struct rtp_info *info;
+ WORD port;
+
+ /* Determine the Local (A side) IP Address and port */
+ info = on_create_connection(GetCallReference());
- /* Notify Asterisk of the request and get the port */
- externalPort = on_create_connection(GetCallReference());
+// if (bridging) {
+// externalIpAddress = PIPSocket::Address(info->addr);
+// } else {
+ GetControlChannel().GetLocalAddress().GetIpAndPort(externalIpAddress, port);
+// }
+
+// externalIpAddress = PIPSocket::Address("192.168.1.50");
+ externalPort = info->port;
+
if (h323debug) {
cout << " =*= In CreateRealTimeLogicalChannel for call " << GetCallReference() << endl;
cout << " -- externalIpAddress: " << externalIpAddress << endl;
cout << " -- externalPort: " << externalPort << endl;
+ cout << " -- SessionID: " << sessionID << endl;
cout << " -- Direction: " << dir << endl;
}
-
return new H323_ExternalRTPChannel(*this, capability, dir, sessionID, externalIpAddress, externalPort);
}
@@ -1028,23 +1037,28 @@ int h323_show_codec(int fd, int argc, char *argv[])
/* alas, this doesn't work :( */
-void h323_native_bridge(const char *token, char *them, char *us)
+void h323_native_bridge(const char *token, char *them, char *capability)
{
H323Channel *channel;
- H323Connection *connection = endPoint->FindConnectionWithLock(token);
-
-
- cout << "Native Bridge: them [" << them << "] us [" << us << "]" << endl;
+ MyH323Connection *connection = (MyH323Connection *)endPoint->FindConnectionWithLock(token);
+ PString mode(capability);
+ if (!mode) {
+ return;
+ }
+
if (!connection){
- cout << "ERROR: No connection active.\n";
+ cout << "ERROR: No connection found, this is bad\n";
return;
}
- connection->Unlock();
- channel = connection->FindChannel(RTP_Session::DefaultAudioSessionID, TRUE);
- H323_ExternalRTPChannel *external = (H323_ExternalRTPChannel *)channel;
- external->SetExternalAddress(them, us); // data (RTP), control (Asterisk)
+ cout << "Native Bridge: them [" << them << "]" << endl;
+
+ channel = connection->FindChannel(connection->sessionId, TRUE);
+ connection->bridging = TRUE;
+ connection->CloseLogicalChannelNumber(channel->GetNumber());
+ connection->RequestModeChange(mode);
+ connection->Unlock();
return;
}