mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
Mergeing in Paul Cadach's chan_h323 changes *holds breath*
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43281 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -63,7 +63,20 @@ clean::
|
||||
rm -f busy.h ringtone.h gentone
|
||||
$(MAKE) -C misdn clean
|
||||
|
||||
-include $(PWD)/Makefile.ast
|
||||
ifneq ($(wildcard h323/Makefile.ast),)
|
||||
include h323/Makefile.ast
|
||||
H323LDFLAGS += -Wl,--version-script=h323/noexport.map
|
||||
else
|
||||
h323/libchanh323.a h323/Makefile.ast:
|
||||
$(CMD_PREFIX) $(MAKE) -C h323
|
||||
$(CMD_PREFIX) rm -f ../main/asterisk
|
||||
$(CMD_PREFIX) echo "***************************************************************"
|
||||
$(CMD_PREFIX) echo
|
||||
$(CMD_PREFIX) echo "********** Re-run 'make' to pick up H.323 parameters **********"
|
||||
$(CMD_PREFIX) echo
|
||||
$(CMD_PREFIX) echo "***************************************************************"
|
||||
$(CMD_PREFIX) exit 1
|
||||
endif
|
||||
|
||||
$(eval $(call ast_make_final_host,gentone,gentone.c))
|
||||
gentone: LIBS+=-lm
|
||||
@@ -81,11 +94,13 @@ $(chan_iax2): iax2-parser.o iax2-provision.o
|
||||
chan_alsa.o: busy.h ringtone.h
|
||||
|
||||
ifeq ($(OSARCH),linux-gnu)
|
||||
chan_h323.so: chan_h323.o h323_module_interface.so h323/libchanh323.a h323/Makefile.ast
|
||||
$(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $^ h323/libchanh323.a $(H323LDLIBS) -lstdc++
|
||||
chan_h323.so: chan_h323.o h323/libchanh323.a h323/Makefile.ast
|
||||
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
|
||||
$(CMD_PREFIX) $(CXX) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS)
|
||||
else
|
||||
chan_h323.so: chan_h323.o h323_module_interface.so h323/libchanh323.a
|
||||
$(CC) $(SOLINK) -o $@ $^ h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
|
||||
chan_h323.so: chan_h323.o h323/libchanh323.a
|
||||
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
|
||||
$(CMD_PREFIX) $(CXX) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
|
||||
endif
|
||||
|
||||
chan_misdn.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\"
|
||||
|
2224
channels/chan_h323.c
2224
channels/chan_h323.c
File diff suppressed because it is too large
Load Diff
@@ -4,34 +4,50 @@
|
||||
# Make file for OpenH323 support layer
|
||||
#
|
||||
|
||||
.PHONY: Makefile.ast
|
||||
.PHONY: Makefile.ast clean
|
||||
|
||||
default:: opt
|
||||
|
||||
# Verify those options with main Makefile
|
||||
STDCCFLAGS += -DNDEBUG
|
||||
STDCCFLAGS += $(shell grep ^DEBUG_THREADS ../../Makefile | sed -e "s/^DEBUG_THREADS[ ]*=//" -e "s/\([^\#]*\)\#.*/\1/")
|
||||
STDCCFLAGS += -I../../include -include autoconfig.h
|
||||
STDCCFLAGS = -DNDEBUG
|
||||
STDCCFLAGS += -I../../include -include ../../include/asterisk/autoconfig.h
|
||||
STDCCFLAGS += -fPIC
|
||||
#OPTCCFLAGS +=
|
||||
CFLAGS += -pipe
|
||||
TARGET += libchanh323.a
|
||||
CFLAGS = -pipe
|
||||
TARGET = libchanh323.a
|
||||
TARGET += Makefile.ast
|
||||
SOURCES = ast_h323.cxx
|
||||
SOURCES = ast_h323.cxx compat_h323.cxx cisco-h225.cxx
|
||||
OBJDIR = .
|
||||
OBJS =
|
||||
|
||||
ifndef OPENH323DIR
|
||||
OPENH323DIR=$(HOME)/openh323
|
||||
OPENH323DIR=/usr/src/OpenH323/openh323
|
||||
endif
|
||||
|
||||
include $(OPENH323DIR)/openh323u.mak
|
||||
|
||||
$(SOURCES):: $(SOURCES:.cxx=.cpp)
|
||||
ln -f $< $@
|
||||
notrace::
|
||||
$(MAKE) NOTRACE=1 opt
|
||||
|
||||
define module_cxx_template
|
||||
$(1):: $(2)
|
||||
ln -f $(2) $(1)
|
||||
endef
|
||||
|
||||
$(foreach mod,$(SOURCES),$(eval $(call module_cxx_template,$(mod),$(mod:.cxx=.cpp))))
|
||||
#$(SOURCES):: $(SOURCES:.cxx=.cpp)
|
||||
# ln -f $(patsubst %.cxx, %.cpp, $@) $@
|
||||
|
||||
$(SOURCES):: Makefile ../../Makefile
|
||||
touch $(SOURCES)
|
||||
touch $@
|
||||
|
||||
libchanh323.a: $(OBJS)
|
||||
ar crv $@ $(OBJS)
|
||||
|
||||
cisco-h225.cpp:: cisco-h225.asn
|
||||
asnparser -m CISCO_H225 -c $<
|
||||
mv -f cisco-h225.cxx cisco-h225.cpp
|
||||
|
||||
Makefile.ast:
|
||||
@echo H323CFLAGS = $(STDCCFLAGS) $(OPTCCFLAGS) $(CFLAGS) >$@.tmp
|
||||
@echo H323LDFLAGS = $(CFLAGS) $(LDFLAGS) >>$@.tmp
|
||||
@@ -39,4 +55,4 @@ Makefile.ast:
|
||||
@if [ -r $@ ] && cmp -s $@ $@.tmp; then rm -f $@.tmp; else mv -f $@.tmp $@; fi
|
||||
|
||||
clean::
|
||||
rm -f ast_h323.cxx libchanh323.a Makefile.ast *.dep
|
||||
rm -f $(SOURCES) $(TARGET) $(OBJS) Makefile.ast *.dep
|
||||
|
@@ -4,13 +4,15 @@
|
||||
|
||||
First public release on November 10th, 2002
|
||||
|
||||
Dependancies: openssl-0.9.6b+
|
||||
openssl-devel-0.9.6b+
|
||||
expat-1.95+
|
||||
expat-dev-1.95+
|
||||
Dependancies (based on OpenH323/PWLib ones):
|
||||
openssl-0.9.6b+
|
||||
openssl-devel-0.9.6b+
|
||||
expat-1.95+
|
||||
expat-dev-1.95+
|
||||
|
||||
Tested with Open H.323 version v1.17.1, PWLib v1.9.0 and GCC v3.2.2. Usage of any
|
||||
other versions is not supported.
|
||||
Tested with Open H.323 version v1.18.0, PWLib v1.10.0 and GCC v3.2.2. Usage of any
|
||||
other (especially prior OpenH323 v1.17.3 and PWLib v1.9.2) versions is not
|
||||
supported.
|
||||
|
||||
NOTICE: Whatever you do, DO NOT USE distrubution specific installs
|
||||
of Open H.323 and PWLib. In fact, you should check to make sure
|
||||
|
@@ -2,11 +2,6 @@ The NuFone Network's Open H.323 Channel Driver for Asterisk
|
||||
|
||||
TODO:
|
||||
|
||||
- Fix Gatekeeper re-registration seg (HELP)
|
||||
|
||||
- Track down why calls to invalid extensions always
|
||||
get sent to 's' in context 'default'
|
||||
|
||||
- H.323 Native Bridging
|
||||
|
||||
- Gatekeeping support (started)
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -13,24 +13,27 @@
|
||||
* chan_h323 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 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* chan_h323 is distributed 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.
|
||||
* chan_h323 is distributed 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* Version Info: $Id$
|
||||
* Version Info: $Id$
|
||||
*/
|
||||
|
||||
#ifndef AST_H323_H
|
||||
#define AST_H323_H
|
||||
|
||||
#define VERSION(a,b,c) ((a)*10000+(b)*100+(c))
|
||||
|
||||
#if 0
|
||||
/** These need to be redefined here because the C++
|
||||
side of this driver is blind to the asterisk headers */
|
||||
side of this driver is blind to the asterisk headers */
|
||||
/*! G.723.1 compression */
|
||||
#define AST_FORMAT_G723_1 (1 << 0)
|
||||
/*! GSM compression */
|
||||
@@ -52,114 +55,149 @@
|
||||
/*! SpeeX Free Compression */
|
||||
#define AST_FORMAT_SPEEX (1 << 9)
|
||||
/*! ILBC Free Codec */
|
||||
#define AST_FORMAT_ILBC (1 << 10)
|
||||
#define AST_FORMAT_ILBC (1 << 10)
|
||||
#endif
|
||||
|
||||
/**This class describes the G.723.1 codec capability.
|
||||
*/
|
||||
class H323_G7231Capability : public H323AudioCapability
|
||||
{
|
||||
PCLASSINFO(H323_G7231Capability, H323AudioCapability);
|
||||
public:
|
||||
H323_G7231Capability(BOOL annexA = TRUE);
|
||||
Comparison Compare(const PObject & obj) const;
|
||||
PObject * Clone() const;
|
||||
virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
|
||||
unsigned GetSubType() const;
|
||||
PString GetFormatName() const;
|
||||
BOOL OnSendingPDU(H245_AudioCapability & pdu, unsigned packetSize) const;
|
||||
BOOL OnReceivedPDU(const H245_AudioCapability & pdu, unsigned & packetSize);
|
||||
protected:
|
||||
BOOL annexA;
|
||||
PCLASSINFO(H323_G7231Capability, H323AudioCapability);
|
||||
|
||||
public:
|
||||
H323_G7231Capability(BOOL annexA = TRUE);
|
||||
Comparison Compare(const PObject & obj) const;
|
||||
virtual PObject * Clone() const;
|
||||
virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
|
||||
virtual unsigned GetSubType() const;
|
||||
virtual PString GetFormatName() const;
|
||||
virtual BOOL OnSendingPDU(H245_AudioCapability & pdu, unsigned packetSize) const;
|
||||
virtual BOOL OnReceivedPDU(const H245_AudioCapability & pdu, unsigned & packetSize);
|
||||
|
||||
protected:
|
||||
BOOL annexA;
|
||||
};
|
||||
|
||||
/**This class describes the (fake) G729 codec capability.
|
||||
*/
|
||||
class AST_G729Capability : public H323AudioCapability
|
||||
{
|
||||
PCLASSINFO(AST_G729Capability, H323AudioCapability);
|
||||
PCLASSINFO(AST_G729Capability, H323AudioCapability);
|
||||
|
||||
public:
|
||||
AST_G729Capability();
|
||||
/* Create a copy of the object. */
|
||||
virtual PObject * Clone() const;
|
||||
public:
|
||||
AST_G729Capability();
|
||||
/* Create a copy of the object. */
|
||||
virtual PObject * Clone() const;
|
||||
|
||||
/* Create the codec instance, allocating resources as required. */
|
||||
virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
|
||||
/* Create the codec instance, allocating resources as required. */
|
||||
virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
|
||||
|
||||
/* Get the sub-type of the capability. This is a code dependent on the
|
||||
main type of the capability.
|
||||
/* Get the sub-type of the capability. This is a code dependent on the
|
||||
main type of the capability.
|
||||
|
||||
This returns one of the four possible combinations of mode and speed
|
||||
using the enum values of the protocol ASN H245_AudioCapability class. */
|
||||
virtual unsigned GetSubType() const;
|
||||
|
||||
/* Get the name of the media data format this class represents. */
|
||||
virtual PString GetFormatName() const;
|
||||
This returns one of the four possible combinations of mode and speed
|
||||
using the enum values of the protocol ASN H245_AudioCapability class. */
|
||||
virtual unsigned GetSubType() const;
|
||||
|
||||
/* Get the name of the media data format this class represents. */
|
||||
virtual PString GetFormatName() const;
|
||||
};
|
||||
|
||||
/* This class describes the VoiceAge G729A codec capability. */
|
||||
class AST_G729ACapability : public H323AudioCapability
|
||||
{
|
||||
PCLASSINFO(AST_G729ACapability, H323AudioCapability);
|
||||
PCLASSINFO(AST_G729ACapability, H323AudioCapability);
|
||||
|
||||
public:
|
||||
/* Create a new G.729A capability. */
|
||||
AST_G729ACapability();
|
||||
public:
|
||||
/* Create a new G.729A capability. */
|
||||
AST_G729ACapability();
|
||||
|
||||
/* Create a copy of the object. */
|
||||
virtual PObject * Clone() const;
|
||||
/* Create the codec instance, allocating resources as required. */
|
||||
virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
|
||||
/* Create a copy of the object. */
|
||||
virtual PObject * Clone() const;
|
||||
/* Create the codec instance, allocating resources as required. */
|
||||
virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
|
||||
|
||||
/* Get the sub-type of the capability. This is a code dependent on the
|
||||
main type of the capability.
|
||||
/* Get the sub-type of the capability. This is a code dependent on the
|
||||
main type of the capability.
|
||||
|
||||
This returns one of the four possible combinations of mode and speed
|
||||
using the enum values of the protocol ASN H245_AudioCapability class. */
|
||||
virtual unsigned GetSubType() const;
|
||||
This returns one of the four possible combinations of mode and speed
|
||||
using the enum values of the protocol ASN H245_AudioCapability class. */
|
||||
virtual unsigned GetSubType() const;
|
||||
|
||||
/* Get the name of the media data format this class represents. */
|
||||
virtual PString GetFormatName() const;
|
||||
/* Get the name of the media data format this class represents. */
|
||||
virtual PString GetFormatName() const;
|
||||
};
|
||||
|
||||
class MyH323EndPoint : public H323EndPoint {
|
||||
/* This class describes the GSM-06.10 codec capability. */
|
||||
class AST_GSM0610Capability : public H323AudioCapability
|
||||
{
|
||||
PCLASSINFO(AST_GSM0610Capability, H323AudioCapability);
|
||||
|
||||
public:
|
||||
/* Create a new GSM capability. */
|
||||
AST_GSM0610Capability(int comfortNoise = 0, int scrambled = 0);
|
||||
|
||||
/* Create a copy of the object. */
|
||||
virtual PObject * Clone() const;
|
||||
|
||||
/* Create the codec instance, allocating resources as required. */
|
||||
virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
|
||||
|
||||
/* Get the sub-type of the capability. This is a code dependent on the
|
||||
main type of the capability.
|
||||
|
||||
This returns one of the four possible combinations of mode and speed
|
||||
using the enum values of the protocol ASN H245_AudioCapability class. */
|
||||
virtual unsigned GetSubType() const;
|
||||
|
||||
/* Get the name of the media data format this class represents. */
|
||||
virtual PString GetFormatName() const;
|
||||
|
||||
BOOL OnSendingPDU(H245_AudioCapability & pdu, unsigned packetSize) const;
|
||||
BOOL OnReceivedPDU(const H245_AudioCapability & pdu, unsigned & packetSize);
|
||||
|
||||
protected:
|
||||
int comfortNoise;
|
||||
int scrambled;
|
||||
};
|
||||
|
||||
class MyH323EndPoint : public H323EndPoint
|
||||
{
|
||||
PCLASSINFO(MyH323EndPoint, H323EndPoint);
|
||||
|
||||
public:
|
||||
public:
|
||||
MyH323EndPoint();
|
||||
int MakeCall(const PString &, PString &, unsigned int *, call_options_t *opts);
|
||||
int MyMakeCall(const PString &, PString &, void *_callReference, void *_opts);
|
||||
BOOL ClearCall(const PString &, H323Connection::CallEndReason reason);
|
||||
BOOL ClearCall(const PString &);
|
||||
|
||||
void OnClosedLogicalChannel(H323Connection &, const H323Channel &);
|
||||
void OnConnectionEstablished(H323Connection &, const PString &);
|
||||
void OnConnectionCleared(H323Connection &, const PString &);
|
||||
H323Connection * CreateConnection(unsigned, void *);
|
||||
virtual H323Connection * CreateConnection(unsigned, void *, H323Transport *, H323SignalPDU *);
|
||||
void SendUserTone(const PString &, char);
|
||||
BOOL OnConnectionForwarded(H323Connection &, const PString &, const H323SignalPDU &);
|
||||
BOOL ForwardConnection(H323Connection &, const PString &, const H323SignalPDU &);
|
||||
void SetEndpointTypeInfo( H225_EndpointType & info ) const;
|
||||
void SetGateway(void);
|
||||
PStringArray SupportedPrefixes;
|
||||
void SetEndpointTypeInfo( H225_EndpointType & info ) const;
|
||||
void SetGateway(void);
|
||||
PStringArray SupportedPrefixes;
|
||||
};
|
||||
|
||||
class MyH323Connection : public H323Connection {
|
||||
|
||||
class MyH323Connection : public H323Connection
|
||||
{
|
||||
PCLASSINFO(MyH323Connection, H323Connection);
|
||||
|
||||
public:
|
||||
public:
|
||||
MyH323Connection(MyH323EndPoint &, unsigned, unsigned);
|
||||
~MyH323Connection();
|
||||
H323Channel * CreateRealTimeLogicalChannel(const H323Capability &,
|
||||
H323Channel::Directions,
|
||||
unsigned,
|
||||
const H245_H2250LogicalChannelParameters *,
|
||||
RTP_QOS *);
|
||||
H323Connection::AnswerCallResponse OnAnswerCall(const PString &,
|
||||
const H323SignalPDU &,
|
||||
H323SignalPDU &);
|
||||
H323Channel * CreateRealTimeLogicalChannel(const H323Capability &,
|
||||
H323Channel::Directions,
|
||||
unsigned,
|
||||
const H245_H2250LogicalChannelParameters *,
|
||||
RTP_QOS *);
|
||||
H323Connection::AnswerCallResponse OnAnswerCall(const PString &,
|
||||
const H323SignalPDU &,
|
||||
H323SignalPDU &);
|
||||
void OnReceivedReleaseComplete(const H323SignalPDU &);
|
||||
BOOL OnAlerting(const H323SignalPDU &, const PString &);
|
||||
BOOL OnSendReleaseComplete(H323SignalPDU &);
|
||||
@@ -167,46 +205,57 @@ class MyH323Connection : public H323Connection {
|
||||
BOOL OnReceivedFacility(const H323SignalPDU &);
|
||||
BOOL OnSendSignalSetup(H323SignalPDU &);
|
||||
BOOL OnStartLogicalChannel(H323Channel &);
|
||||
BOOL OnClosingLogicalChannel(H323Channel &);
|
||||
void SendUserInputTone(char, unsigned);
|
||||
void OnUserInputTone(char, unsigned, unsigned, unsigned);
|
||||
void OnUserInputString(const PString &value);
|
||||
BOOL OnClosingLogicalChannel(H323Channel &);
|
||||
virtual void SendUserInputTone(char tone, unsigned duration = 0, unsigned logicalChannel = 0, unsigned rtpTimestamp = 0);
|
||||
virtual void OnUserInputTone(char, unsigned, unsigned, unsigned);
|
||||
virtual void OnUserInputString(const PString &value);
|
||||
BOOL OnReceivedProgress(const H323SignalPDU &);
|
||||
void OnSendCapabilitySet(H245_TerminalCapabilitySet &);
|
||||
void OnSetLocalCapabilities();
|
||||
void SetCapabilities(int, int);
|
||||
void SetCapabilities(int, int, void *, int);
|
||||
BOOL OnReceivedCapabilitySet(const H323Capabilities &, const H245_MultiplexCapability *,
|
||||
H245_TerminalCapabilitySetReject &);
|
||||
H245_TerminalCapabilitySetReject &);
|
||||
void SetCause(int _cause) { cause = _cause; };
|
||||
virtual BOOL StartControlChannel(const H225_TransportAddress & h245Address);
|
||||
void SetCallOptions(void *opts, BOOL isIncoming);
|
||||
void SetCallDetails(void *callDetails, const H323SignalPDU &setupPDU, BOOL isIncoming);
|
||||
#ifdef TUNNELLING
|
||||
virtual BOOL HandleSignalPDU(H323SignalPDU &pdu);
|
||||
BOOL EmbedTunneledInfo(H323SignalPDU &pdu);
|
||||
#endif
|
||||
|
||||
PString sourceAliases;
|
||||
PString destAliases;
|
||||
PString sourceE164;
|
||||
PString destE164;
|
||||
PString rdnis;
|
||||
int redirect_reason;
|
||||
|
||||
WORD sessionId;
|
||||
BOOL bridging;
|
||||
BOOL bridging;
|
||||
#ifdef TUNNELLING
|
||||
int remoteTunnelOptions;
|
||||
int tunnelOptions;
|
||||
#endif
|
||||
|
||||
unsigned progressSetup;
|
||||
unsigned progressAlert;
|
||||
int cause;
|
||||
|
||||
RTP_DataFrame::PayloadTypes dtmfCodec;
|
||||
|
||||
PString ast_cid_num;
|
||||
PString ast_cid_name;
|
||||
int dtmfMode;
|
||||
};
|
||||
|
||||
class MyH323_ExternalRTPChannel : public H323_ExternalRTPChannel {
|
||||
class MyH323_ExternalRTPChannel : public H323_ExternalRTPChannel
|
||||
{
|
||||
PCLASSINFO(MyH323_ExternalRTPChannel, H323_ExternalRTPChannel);
|
||||
|
||||
PCLASSINFO(MyH323_ExternalRTPChannel, H323_ExternalRTPChannel);
|
||||
|
||||
public:
|
||||
public:
|
||||
MyH323_ExternalRTPChannel(
|
||||
MyH323Connection & connection,
|
||||
const H323Capability & capability,
|
||||
Directions direction,
|
||||
unsigned sessionID);
|
||||
MyH323Connection & connection,
|
||||
const H323Capability & capability,
|
||||
Directions direction,
|
||||
unsigned sessionID);
|
||||
|
||||
~MyH323_ExternalRTPChannel();
|
||||
|
||||
@@ -214,26 +263,29 @@ class MyH323_ExternalRTPChannel : public H323_ExternalRTPChannel {
|
||||
BOOL Start(void);
|
||||
BOOL OnReceivedAckPDU(const H245_H2250LogicalChannelAckParameters & param);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
BYTE payloadCode;
|
||||
|
||||
PIPSocket::Address localIpAddr;
|
||||
PIPSocket::Address remoteIpAddr;
|
||||
WORD localPort;
|
||||
WORD remotePort;
|
||||
};
|
||||
|
||||
/**
|
||||
* The MyProcess is a necessary descendant PProcess class so that the H323EndPoint
|
||||
* objected to be created from within that class. (Solves the who owns main() problem).
|
||||
*/
|
||||
class MyProcess : public PProcess {
|
||||
|
||||
PCLASSINFO(MyProcess, PProcess);
|
||||
|
||||
public:
|
||||
MyProcess();
|
||||
void Main();
|
||||
WORD localPort;
|
||||
WORD remotePort;
|
||||
};
|
||||
|
||||
/**
|
||||
* The MyProcess is a necessary descendant PProcess class so that the H323EndPoint
|
||||
* objected to be created from within that class. (Solves the who owns main() problem).
|
||||
*/
|
||||
class MyProcess : public PProcess
|
||||
{
|
||||
PCLASSINFO(MyProcess, PProcess);
|
||||
|
||||
public:
|
||||
MyProcess();
|
||||
~MyProcess();
|
||||
void Main();
|
||||
};
|
||||
|
||||
#include "compat_h323.h"
|
||||
|
||||
#endif /* !defined AST_H323_H */
|
||||
|
@@ -4,8 +4,8 @@
|
||||
* OpenH323 Channel Driver for ASTERISK PBX.
|
||||
* By Jeremy McNamara
|
||||
* For The NuFone Network
|
||||
*
|
||||
* This code has been derived from code created by
|
||||
*
|
||||
* This code has been derived from code created by
|
||||
* Michael Manousos and Mark Spencer
|
||||
*
|
||||
* This file is part of the chan_h323 driver for Asterisk
|
||||
@@ -13,29 +13,42 @@
|
||||
* chan_h323 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 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* chan_h323 is distributed 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.
|
||||
* chan_h323 is distributed 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* Version Info: $Id$
|
||||
*/
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
/*
|
||||
* Enable support for sending/reception of tunnelled Q.SIG messages and
|
||||
* some sort of IEs (especially RedirectingNumber) which Cisco CallManager
|
||||
* isn't like to pass in standard Q.931 message.
|
||||
*
|
||||
*/
|
||||
#define TUNNELLING
|
||||
|
||||
#define H323_TUNNEL_CISCO (1 << 0)
|
||||
#define H323_TUNNEL_QSIG (1 << 1)
|
||||
|
||||
/** call_option struct holds various bits
|
||||
* of information for each call */
|
||||
typedef struct call_options {
|
||||
char cid_num[80];
|
||||
char cid_name[80];
|
||||
int noFastStart;
|
||||
int noH245Tunneling;
|
||||
int noSilenceSuppression;
|
||||
char cid_rdnis[80];
|
||||
int redirect_reason;
|
||||
int fastStart;
|
||||
int h245Tunneling;
|
||||
int silenceSuppression;
|
||||
int progress_setup;
|
||||
int progress_alert;
|
||||
int progress_audio;
|
||||
@@ -44,57 +57,58 @@ typedef struct call_options {
|
||||
int capability;
|
||||
int bridge;
|
||||
int nat;
|
||||
int tunnelOptions;
|
||||
struct ast_codec_pref prefs;
|
||||
} call_options_t;
|
||||
|
||||
/* structure to hold the valid asterisk users */
|
||||
struct oh323_user {
|
||||
char name[80];
|
||||
ASTOBJ_COMPONENTS(struct oh323_user);
|
||||
// char name[80];
|
||||
char context[80];
|
||||
char secret[80];
|
||||
char callerid[80];
|
||||
char accountcode[AST_MAX_ACCOUNT_CODE];
|
||||
int amaflags;
|
||||
int host;
|
||||
struct sockaddr_in addr;
|
||||
struct ast_ha *ha;
|
||||
call_options_t options;
|
||||
struct oh323_user *next;
|
||||
};
|
||||
|
||||
/* structure to hold the valid asterisk peers
|
||||
/* structure to hold the valid asterisk peers
|
||||
All peers are registered to a GK if there is one */
|
||||
struct oh323_peer {
|
||||
char name[80];
|
||||
ASTOBJ_COMPONENTS(struct oh323_peer);
|
||||
char mailbox[80];
|
||||
int delme;
|
||||
struct sockaddr_in addr;
|
||||
struct ast_ha *ha;
|
||||
call_options_t options;
|
||||
struct oh323_peer *next;
|
||||
};
|
||||
|
||||
/* structure to hold the H.323 aliases which get registered to
|
||||
/* structure to hold the H.323 aliases which get registered to
|
||||
the H.323 endpoint and gatekeeper */
|
||||
struct oh323_alias {
|
||||
char name[80];
|
||||
ASTOBJ_COMPONENTS(struct oh323_alias);
|
||||
char e164[20]; /* tells a GK to route this E.164 to this alias */
|
||||
char prefix[500]; /* tells a GK this alias supports these prefixes */
|
||||
char secret[20]; /* the H.235 password to send to the GK for authentication */
|
||||
char context[80];
|
||||
struct oh323_alias *next;
|
||||
};
|
||||
|
||||
/** call_details struct call detail records
|
||||
to asterisk for processing and used for matching up
|
||||
/** call_details struct call detail records
|
||||
to asterisk for processing and used for matching up
|
||||
asterisk channels to acutal h.323 connections */
|
||||
typedef struct call_details {
|
||||
typedef struct call_details {
|
||||
unsigned int call_reference;
|
||||
char *call_token;
|
||||
char *call_token;
|
||||
char *call_source_aliases;
|
||||
char *call_dest_alias;
|
||||
char *call_source_name;
|
||||
char *call_source_e164;
|
||||
char *call_dest_e164;
|
||||
char *redirect_number;
|
||||
int redirect_reason;
|
||||
int presentation;
|
||||
int screening;
|
||||
char *sourceIp;
|
||||
@@ -107,18 +121,18 @@ typedef struct rtp_info {
|
||||
|
||||
/* This is a callback prototype function, called pass
|
||||
DTMF down the RTP. */
|
||||
typedef int (*send_digit_cb)(unsigned, char, const char *);
|
||||
extern send_digit_cb on_send_digit;
|
||||
typedef int (*receive_digit_cb)(unsigned, char, const char *, int);
|
||||
extern receive_digit_cb on_receive_digit;
|
||||
|
||||
/* This is a callback prototype function, called to collect
|
||||
the external RTP port from Asterisk. */
|
||||
typedef rtp_info_t *(*on_rtp_cb)(unsigned, const char *);
|
||||
extern on_rtp_cb on_external_rtp_create;
|
||||
extern on_rtp_cb on_external_rtp_create;
|
||||
|
||||
/* This is a callback prototype function, called to send
|
||||
the remote IP and RTP port from H.323 to Asterisk */
|
||||
the remote IP and RTP port from H.323 to Asterisk */
|
||||
typedef void (*start_rtp_cb)(unsigned int, const char *, int, const char *, int);
|
||||
extern start_rtp_cb on_start_rtp_channel;
|
||||
extern start_rtp_cb on_start_rtp_channel;
|
||||
|
||||
/* This is a callback that happens when call progress is
|
||||
* made, and handles inband progress */
|
||||
@@ -133,7 +147,7 @@ extern setup_incoming_cb on_incoming_call;
|
||||
/* This is a callback prototype function, called upon
|
||||
an outbound call. */
|
||||
typedef int (*setup_outbound_cb)(call_details_t *);
|
||||
extern setup_outbound_cb on_outgoing_call;
|
||||
extern setup_outbound_cb on_outgoing_call;
|
||||
|
||||
/* This is a callback prototype function, called when
|
||||
OnAlerting is invoked */
|
||||
@@ -151,7 +165,7 @@ typedef void (*clear_con_cb)(unsigned, const char *);
|
||||
extern clear_con_cb on_connection_cleared;
|
||||
|
||||
/* This is a callback prototype function, called when
|
||||
an H.323 call is answered */
|
||||
an H.323 call is answered */
|
||||
typedef int (*answer_call_cb)(unsigned, const char *);
|
||||
extern answer_call_cb on_answer_call;
|
||||
|
||||
@@ -167,6 +181,9 @@ extern hangup_cb on_hangup;
|
||||
typedef void (*setcapabilities_cb)(unsigned, const char *);
|
||||
extern setcapabilities_cb on_setcapabilities;
|
||||
|
||||
typedef void (*setpeercapabilities_cb)(unsigned, const char *, int);
|
||||
extern setpeercapabilities_cb on_setpeercapabilities;
|
||||
|
||||
/* debug flag */
|
||||
extern int h323debug;
|
||||
|
||||
@@ -179,30 +196,31 @@ extern int h323debug;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
void h323_gk_urq(void);
|
||||
void h323_end_point_create(void);
|
||||
void h323_end_process(void);
|
||||
int h323_end_point_exist(void);
|
||||
|
||||
|
||||
void h323_debug(int, unsigned);
|
||||
|
||||
/* callback function handler*/
|
||||
void h323_callback_register(setup_incoming_cb,
|
||||
setup_outbound_cb,
|
||||
on_rtp_cb,
|
||||
start_rtp_cb,
|
||||
clear_con_cb,
|
||||
chan_ringing_cb,
|
||||
con_established_cb,
|
||||
send_digit_cb,
|
||||
answer_call_cb,
|
||||
progress_cb,
|
||||
rfc2833_cb,
|
||||
hangup_cb,
|
||||
setcapabilities_cb);
|
||||
int h323_set_capabilities(const char *, int, int);
|
||||
void h323_callback_register(setup_incoming_cb,
|
||||
setup_outbound_cb,
|
||||
on_rtp_cb,
|
||||
start_rtp_cb,
|
||||
clear_con_cb,
|
||||
chan_ringing_cb,
|
||||
con_established_cb,
|
||||
receive_digit_cb,
|
||||
answer_call_cb,
|
||||
progress_cb,
|
||||
rfc2833_cb,
|
||||
hangup_cb,
|
||||
setcapabilities_cb,
|
||||
setpeercapabilities_cb);
|
||||
int h323_set_capabilities(const char *, int, int, struct ast_codec_pref *, int);
|
||||
int h323_set_alias(struct oh323_alias *);
|
||||
int h323_set_gk(int, char *, char *);
|
||||
void h323_set_id(char *);
|
||||
@@ -219,12 +237,12 @@ extern "C" {
|
||||
/* H323 create and destroy sessions */
|
||||
int h323_make_call(char *dest, call_details_t *cd, call_options_t *);
|
||||
int h323_clear_call(const char *, int cause);
|
||||
|
||||
|
||||
/* H.323 alerting and progress */
|
||||
int h323_send_alerting(const char *token);
|
||||
int h323_send_progress(const char *token);
|
||||
int h323_answering_call(const char *token, int);
|
||||
int h323_soft_hangup(const char *data);
|
||||
int h323_soft_hangup(const char *data);
|
||||
int h323_show_codec(int fd, int argc, char *argv[]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -1,149 +0,0 @@
|
||||
; The NuFone Network's
|
||||
; Open H.323 driver configuration
|
||||
;
|
||||
[general]
|
||||
port = 1720
|
||||
bindaddr = 1.2.3.4 ; this SHALL contain a single, valid IP address for this machine
|
||||
;tos=lowdelay
|
||||
;
|
||||
; You may specify a global default AMA flag for iaxtel calls. It must be
|
||||
; one of 'default', 'omit', 'billing', or 'documentation'. These flags
|
||||
; are used in the generation of call detail records.
|
||||
;
|
||||
;amaflags = default
|
||||
;
|
||||
; You may specify a default account for Call Detail Records in addition
|
||||
; to specifying on a per-user basis
|
||||
;
|
||||
;accountcode=lss0101
|
||||
;
|
||||
; You can fine tune codecs here using "allow" and "disallow" clauses
|
||||
; with specific codecs. Use "all" to represent all formats.
|
||||
;
|
||||
disallow=all
|
||||
;allow=all ; turns on all installed codecs
|
||||
;disallow=g723.1 ; Hm... Proprietary, don't use it...
|
||||
allow=gsm ; Always allow GSM, it's cool :)
|
||||
;
|
||||
; User-Input Mode (DTMF)
|
||||
;
|
||||
; valid entries are: rfc2833, inband
|
||||
; default is rfc2833
|
||||
;dtmfmode=rfc2833
|
||||
;
|
||||
; Default RTP Payload to send RFC2833 DTMF on. This is used to
|
||||
; interoperate with broken gateways which cannot successfully
|
||||
; negotiate a RFC2833 payload type in the TerminalCapabilitySet.
|
||||
;
|
||||
; You may also specify on either a per-peer or per-user basis below.
|
||||
;dtmfcodec=101
|
||||
;
|
||||
; Set the gatekeeper
|
||||
; DISCOVER - Find the Gk address using multicast
|
||||
; DISABLE - Disable the use of a GK
|
||||
; <IP address> or <Host name> - The acutal IP address or hostname of your GK
|
||||
;gatekeeper = DISABLE
|
||||
;
|
||||
;
|
||||
; Tell Asterisk whether or not to accept Gatekeeper
|
||||
; routed calls or not. Normally this should always
|
||||
; be set to yes, unless you want to have finer control
|
||||
; over which users are allowed access to Asterisk.
|
||||
; Default: YES
|
||||
;
|
||||
;AllowGKRouted = yes
|
||||
;
|
||||
; Optionally you can determine a user by Source IP versus its H.323 alias.
|
||||
; Default behavour is to determine user by H.323 alias.
|
||||
;UserByAlias=no
|
||||
;
|
||||
; Default context gets used in siutations where you are using
|
||||
; the GK routed model or no type=user was found. This gives you
|
||||
; the ability to either play an invalid message or to simply not
|
||||
; use user authentication at all.
|
||||
;
|
||||
;context=default
|
||||
;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
|
||||
; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a
|
||||
; H323 channel. Defaults to "no". An enabled jitterbuffer will
|
||||
; be used only if the sending side can create and the receiving
|
||||
; side can not accept jitter. The H323 channel can accept jitter,
|
||||
; thus an enabled jitterbuffer on the receive H323 side will only
|
||||
; be used if the sending side can create jitter and jbforce is
|
||||
; also set to yes.
|
||||
|
||||
; jbforce = no ; Forces the use of a jitterbuffer on the receive side of a H323
|
||||
; channel. Defaults to "no".
|
||||
|
||||
; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.
|
||||
|
||||
; jbresyncthreshold = 1000 ; Jump in the frame timestamps over which the jitterbuffer is
|
||||
; resynchronized. Useful to improve the quality of the voice, with
|
||||
; big jumps in/broken timestamps, usualy sent from exotic devices
|
||||
; and programs. Defaults to 1000.
|
||||
|
||||
; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a H323
|
||||
; channel. Two implementations are currenlty available - "fixed"
|
||||
; (with size always equals to jbmax-size) and "adaptive" (with
|
||||
; variable size, actually the new jb of IAX2). Defaults to fixed.
|
||||
|
||||
; jblog = no ; Enables jitterbuffer frame logging. Defaults to "no".
|
||||
;-----------------------------------------------------------------------------------
|
||||
;
|
||||
; H.323 Alias definitions
|
||||
;
|
||||
; Type 'h323' will register aliases to the endpoint
|
||||
; and Gatekeeper, if there is one.
|
||||
;
|
||||
; Example: if someone calls time@your.asterisk.box.com
|
||||
; Asterisk will send the call to the extension 'time'
|
||||
; in the context default
|
||||
;
|
||||
; [default]
|
||||
; exten => time,1,Answer
|
||||
; exten => time,2,Playback,current-time
|
||||
;
|
||||
; Keyword's 'prefix' and 'e164' are only make sense when
|
||||
; used with a gatekeeper. You can specify either a prefix
|
||||
; or E.164 this endpoint is responsible for terminating.
|
||||
;
|
||||
; Example: The H.323 alias 'det-gw' will tell the gatekeeper
|
||||
; to route any call with the prefix 1248 to this alias. Keyword
|
||||
; e164 is used when you want to specifiy a full telephone
|
||||
; number. So a call to the number 18102341212 would be
|
||||
; routed to the H.323 alias 'time'.
|
||||
;
|
||||
;[time]
|
||||
;type=h323
|
||||
;e164=18102341212
|
||||
;context=default
|
||||
;
|
||||
;[det-gw]
|
||||
;type=h323
|
||||
;prefix=1248,1313
|
||||
;context=detroit
|
||||
;
|
||||
;
|
||||
; Inbound H.323 calls from BillyBob would land in the incoming
|
||||
; context with a maximum of 4 concurrent incoming calls
|
||||
;
|
||||
;
|
||||
; Note: If keyword 'incominglimit' are omitted Asterisk will not
|
||||
; enforce any maximum number of concurrent calls.
|
||||
;
|
||||
;[BillyBob]
|
||||
;type=user
|
||||
;host=192.168.1.1
|
||||
;context=incoming
|
||||
;incominglimit=4
|
||||
;
|
||||
;
|
||||
; Outbound H.323 call to Larry using SlowStart
|
||||
;
|
||||
[Larry]
|
||||
type=peer
|
||||
host=192.168.2.1
|
||||
noFastStart=yes
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user