aboutsummaryrefslogtreecommitdiffstats
path: root/addons/ooh323c/src/ooh323ep.c
diff options
context:
space:
mode:
authormay <may@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-04 22:10:44 +0000
committermay <may@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-04 22:10:44 +0000
commit1303687410947c0e57fb1cb08881d7f86cb163f1 (patch)
treec8a21eb3b2896c7f5b558913cb7ea914b40a06ce /addons/ooh323c/src/ooh323ep.c
parentb30cbb1a915f84ad6e5ed037fce9ecbbd39d608d (diff)
Reworked chan_ooh323 channel module.
Many architectural and functional changes. Main changes are threading model chanes (many thread in ooh323 stack instead of one), modifications and improvements in signalling part, additional codecs support (726, speex), t38 mode support. This module tested and used in production environment. (closes issue #15285) Reported by: may213 Tested by: sles, c0w, OrNix Review: https://reviewboard.asterisk.org/r/324/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227898 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'addons/ooh323c/src/ooh323ep.c')
-rw-r--r--addons/ooh323c/src/ooh323ep.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/addons/ooh323c/src/ooh323ep.c b/addons/ooh323c/src/ooh323ep.c
index 93e2ec3a3..77c368b0b 100644
--- a/addons/ooh323c/src/ooh323ep.c
+++ b/addons/ooh323c/src/ooh323ep.c
@@ -13,6 +13,9 @@
* maintain this copyright notice.
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+
#include "ooh323ep.h"
#include "ootrace.h"
#include "ooCalls.h"
@@ -23,6 +26,10 @@
/** Global endpoint structure */
ooEndPoint gH323ep;
+ast_mutex_t monitorLock;
+ast_mutex_t callListLock;
+ast_mutex_t newCallLock;
+ast_mutex_t bindPortLock;
extern DList g_TimerList;
@@ -104,6 +111,10 @@ int ooH323EpInitialize
gH323ep.myCaps = NULL;
gH323ep.noOfCaps = 0;
gH323ep.callList = NULL;
+ ast_mutex_init(&monitorLock);
+ ast_mutex_init(&callListLock);
+ ast_mutex_init(&newCallLock);
+ ast_mutex_init(&bindPortLock);
gH323ep.dtmfmode = 0;
gH323ep.callingPartyNumber[0]='\0';
gH323ep.callMode = callMode;
@@ -135,6 +146,16 @@ EXTERN int ooH323EpSetAsGateway()
return OO_OK;
}
+EXTERN void ooH323EpSetVersionInfo(int t35cc, int t35ext, int manc, char* prodid, char* verid) {
+
+ if (t35cc) gH323ep.t35CountryCode = t35cc;
+ if (t35ext) gH323ep.t35Extension = t35ext;
+ if (manc) gH323ep.manufacturerCode = manc;
+ if (prodid != NULL && prodid[0]) gH323ep.productID = prodid;
+ if (verid != NULL && verid[0]) gH323ep.versionID = verid;
+}
+
+
int ooH323EpSetLocalAddress(const char* localip, int listenport)
{
@@ -316,6 +337,7 @@ int ooH323EpSetH323Callbacks(OOH323CALLBACKS h323Callbacks)
{
gH323ep.h323Callbacks.onNewCallCreated = h323Callbacks.onNewCallCreated;
gH323ep.h323Callbacks.onAlerting = h323Callbacks.onAlerting;
+ gH323ep.h323Callbacks.onProgress = h323Callbacks.onProgress;
gH323ep.h323Callbacks.onIncomingCall = h323Callbacks.onIncomingCall;
gH323ep.h323Callbacks.onOutgoingCall = h323Callbacks.onOutgoingCall;
gH323ep.h323Callbacks.onCallEstablished = h323Callbacks.onCallEstablished;
@@ -323,6 +345,7 @@ int ooH323EpSetH323Callbacks(OOH323CALLBACKS h323Callbacks)
gH323ep.h323Callbacks.onCallCleared = h323Callbacks.onCallCleared;
gH323ep.h323Callbacks.openLogicalChannels = h323Callbacks.openLogicalChannels;
gH323ep.h323Callbacks.onReceivedDTMF = h323Callbacks.onReceivedDTMF;
+ gH323ep.h323Callbacks.onModeChanged = h323Callbacks.onModeChanged;
return OO_OK;
}
@@ -364,6 +387,7 @@ int ooH323EpDestroy(void)
}
freeContext(&(gH323ep.ctxt));
+ freeContext(&(gH323ep.msgctxt));
OO_CLRFLAG(gH323ep.flags, OO_M_ENDPOINTCREATED);
}
@@ -443,6 +467,15 @@ int ooH323EpDisableH245Tunneling(void)
return OO_OK;
}
+int ooH323EpTryBeMaster(int m)
+{
+ if (m)
+ OO_SETFLAG(gH323ep.flags, OO_M_TRYBEMASTER);
+ else
+ OO_CLRFLAG(gH323ep.flags, OO_M_TRYBEMASTER);
+ return OO_OK;
+}
+
int ooH323EpSetTermType(int value)
{
gH323ep.termType = value;
@@ -626,6 +659,43 @@ int ooH323EpAddG7231Capability(int cap, int txframes, int rxframes,
stopTransmitChannel, FALSE);
}
+int ooH323EpAddG726Capability(int cap, int txframes, int rxframes,
+ OOBOOL silenceSuppression, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel)
+{
+ return ooCapabilityAddSimpleCapability(NULL, cap, txframes, rxframes,
+ silenceSuppression, dir, startReceiveChannel,
+ startTransmitChannel, stopReceiveChannel,
+ stopTransmitChannel, FALSE);
+}
+int ooH323EpAddAMRNBCapability(int cap, int txframes, int rxframes,
+ OOBOOL silenceSuppression, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel)
+{
+ return ooCapabilityAddSimpleCapability(NULL, cap, txframes, rxframes,
+ silenceSuppression, dir, startReceiveChannel,
+ startTransmitChannel, stopReceiveChannel,
+ stopTransmitChannel, FALSE);
+}
+int ooH323EpAddSpeexCapability(int cap, int txframes, int rxframes,
+ OOBOOL silenceSuppression, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel)
+{
+ return ooCapabilityAddSimpleCapability(NULL, cap, txframes, rxframes,
+ silenceSuppression, dir, startReceiveChannel,
+ startTransmitChannel, stopReceiveChannel,
+ stopTransmitChannel, FALSE);
+}
+
int ooH323EpAddGSMCapability(int cap, ASN1USINT framesPerPkt,
OOBOOL comfortNoise, OOBOOL scrambled, int dir,
cb_StartReceiveChannel startReceiveChannel,
@@ -659,6 +729,16 @@ int ooH323EpAddH263VideoCapability(int cap, unsigned sqcifMPI,
}
+int ooH323EpEnableDTMFCISCO(int dynamicRTPPayloadType)
+{
+ return ooCapabilityEnableDTMFCISCO(NULL, dynamicRTPPayloadType);
+}
+
+int ooH323EpDisableDTMFCISCO(void)
+{
+ return ooCapabilityDisableDTMFCISCO(NULL);
+}
+
int ooH323EpEnableDTMFRFC2833(int dynamicRTPPayloadType)
{
return ooCapabilityEnableDTMFRFC2833(NULL, dynamicRTPPayloadType);