aboutsummaryrefslogtreecommitdiffstats
path: root/addons/ooh323c
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
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')
-rw-r--r--addons/ooh323c/src/context.c40
-rw-r--r--addons/ooh323c/src/decode.c5
-rw-r--r--addons/ooh323c/src/dlist.c3
-rw-r--r--addons/ooh323c/src/encode.c12
-rw-r--r--addons/ooh323c/src/errmgmt.c8
-rw-r--r--addons/ooh323c/src/eventHandler.c3
-rw-r--r--addons/ooh323c/src/eventHandler.h2
-rw-r--r--addons/ooh323c/src/h323/H235-SECURITY-MESSAGESDec.c18
-rw-r--r--addons/ooh323c/src/h323/H323-MESSAGESDec.c573
-rw-r--r--addons/ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROLDec.c1244
-rw-r--r--addons/ooh323c/src/memheap.c108
-rw-r--r--addons/ooh323c/src/memheap.h1
-rw-r--r--addons/ooh323c/src/ooCalls.c144
-rw-r--r--addons/ooh323c/src/ooCalls.h72
-rw-r--r--addons/ooh323c/src/ooCapability.c868
-rw-r--r--addons/ooh323c/src/ooCapability.h76
-rw-r--r--addons/ooh323c/src/ooCmdChannel.c245
-rw-r--r--addons/ooh323c/src/ooCmdChannel.h10
-rw-r--r--addons/ooh323c/src/ooCommon.h1
-rw-r--r--addons/ooh323c/src/ooDateTime.c1
-rw-r--r--addons/ooh323c/src/ooDateTime.h4
-rw-r--r--addons/ooh323c/src/ooGkClient.c446
-rw-r--r--addons/ooh323c/src/ooGkClient.h12
-rw-r--r--addons/ooh323c/src/ooLogChan.c26
-rw-r--r--addons/ooh323c/src/ooLogChan.h5
-rw-r--r--addons/ooh323c/src/ooSocket.c81
-rw-r--r--addons/ooh323c/src/ooSocket.h9
-rw-r--r--addons/ooh323c/src/ooStackCmds.c272
-rw-r--r--addons/ooh323c/src/ooStackCmds.h16
-rw-r--r--addons/ooh323c/src/ooTimer.c3
-rw-r--r--addons/ooh323c/src/ooUtils.c3
-rw-r--r--addons/ooh323c/src/ooasn1.h20
-rw-r--r--addons/ooh323c/src/oochannels.c618
-rw-r--r--addons/ooh323c/src/oochannels.h3
-rw-r--r--addons/ooh323c/src/ooh245.c786
-rw-r--r--addons/ooh323c/src/ooh245.h20
-rw-r--r--addons/ooh323c/src/ooh323.c646
-rw-r--r--addons/ooh323c/src/ooh323.h5
-rw-r--r--addons/ooh323c/src/ooh323ep.c80
-rw-r--r--addons/ooh323c/src/ooh323ep.h68
-rw-r--r--addons/ooh323c/src/ooports.c8
-rw-r--r--addons/ooh323c/src/ooq931.c619
-rw-r--r--addons/ooh323c/src/ooq931.h31
-rw-r--r--addons/ooh323c/src/ootrace.c11
-rw-r--r--addons/ooh323c/src/ootrace.h7
-rw-r--r--addons/ooh323c/src/ootypes.h13
-rw-r--r--addons/ooh323c/src/perutil.c3
-rw-r--r--addons/ooh323c/src/printHandler.c11
-rw-r--r--addons/ooh323c/src/printHandler.h6
-rw-r--r--addons/ooh323c/src/rtctype.c3
50 files changed, 5627 insertions, 1642 deletions
diff --git a/addons/ooh323c/src/context.c b/addons/ooh323c/src/context.c
index d243f88a0..f2dc1119b 100644
--- a/addons/ooh323c/src/context.c
+++ b/addons/ooh323c/src/context.c
@@ -13,9 +13,12 @@
* maintain this copyright notice.
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
#include "ooasn1.h"
#include <stdlib.h>
+#include <pthread.h>
int initContext (OOCTXT* pctxt)
{
@@ -25,6 +28,9 @@ int initContext (OOCTXT* pctxt)
pctxt->pMsgMemHeap = pctxt->pTypeMemHeap;
memHeapAddRef (&pctxt->pMsgMemHeap);
+
+ ast_mutex_init(&pctxt->pLock);
+
return ASN_OK;
}
@@ -55,7 +61,9 @@ int initContextBuffer
int initSubContext (OOCTXT* pctxt, OOCTXT* psrc)
{
+ /* ast_mutex_lock(&pctxt->pLock); */
int stat = ASN_OK;
+ ast_mutex_lock(&psrc->pLock);
memset (pctxt, 0, sizeof(OOCTXT));
pctxt->pTypeMemHeap = psrc->pTypeMemHeap;
memHeapAddRef (&pctxt->pTypeMemHeap);
@@ -65,12 +73,17 @@ int initSubContext (OOCTXT* pctxt, OOCTXT* psrc)
pctxt->buffer.dynamic = TRUE;
pctxt->buffer.byteIndex = 0;
pctxt->buffer.bitOffset = 8;
+
+ ast_mutex_unlock(&psrc->pLock);
+ /* ast_mutex_unlock(&pctxt->pLock); */
return stat;
}
void freeContext (OOCTXT* pctxt)
{
- ASN1BOOL saveBuf = (pctxt->flags & ASN1SAVEBUF) != 0;
+ ASN1BOOL saveBuf;
+ ast_mutex_lock(&pctxt->pLock);
+ saveBuf = (pctxt->flags & ASN1SAVEBUF) != 0;
if (pctxt->buffer.dynamic && pctxt->buffer.data) {
if (saveBuf) {
@@ -85,27 +98,38 @@ void freeContext (OOCTXT* pctxt)
memHeapRelease (&pctxt->pTypeMemHeap);
memHeapRelease (&pctxt->pMsgMemHeap);
+
+ ast_mutex_unlock(&pctxt->pLock);
+ ast_mutex_destroy(&pctxt->pLock);
}
void copyContext (OOCTXT* pdest, OOCTXT* psrc)
{
+ /* ast_mutex_lock(&pdest->pLock); ast_mutex_lock(&psrc->pLock); */
memcpy (&pdest->buffer, &psrc->buffer, sizeof(ASN1BUFFER));
pdest->flags = psrc->flags;
+ /* ast_mutex_unlock(&psrc->pLock); ast_mutex_unlock(&pdest->pLock); */
}
void setCtxtFlag (OOCTXT* pctxt, ASN1USINT mask)
{
+ ast_mutex_lock(&pctxt->pLock);
pctxt->flags |= mask;
+ ast_mutex_unlock(&pctxt->pLock);
}
void clearCtxtFlag (OOCTXT* pctxt, ASN1USINT mask)
{
+ ast_mutex_lock(&pctxt->pLock);
pctxt->flags &= ~mask;
+ ast_mutex_unlock(&pctxt->pLock);
}
int setPERBufferUsingCtxt (OOCTXT* pTarget, OOCTXT* pSource)
{
- int stat = initContextBuffer
+ int stat;
+ ast_mutex_lock(&pTarget->pLock); ast_mutex_lock(&pSource->pLock);
+ stat = initContextBuffer
(pTarget, pSource->buffer.data, pSource->buffer.size);
if (ASN_OK == stat) {
@@ -113,13 +137,17 @@ int setPERBufferUsingCtxt (OOCTXT* pTarget, OOCTXT* pSource)
pTarget->buffer.bitOffset = pSource->buffer.bitOffset;
}
+ ast_mutex_unlock(&pSource->pLock); ast_mutex_unlock(&pTarget->pLock);
return stat;
}
int setPERBuffer (OOCTXT* pctxt,
ASN1OCTET* bufaddr, ASN1UINT bufsiz, ASN1BOOL aligned)
{
- int stat = initContextBuffer (pctxt, bufaddr, bufsiz);
+ int stat;
+ ast_mutex_lock(&pctxt->pLock);
+ stat = initContextBuffer (pctxt, bufaddr, bufsiz);
+ ast_mutex_unlock(&pctxt->pLock);
if(stat != ASN_OK) return stat;
@@ -128,10 +156,12 @@ int setPERBuffer (OOCTXT* pctxt,
OOCTXT* newContext ()
{
- OOCTXT* pctxt = (OOCTXT*) ASN1CRTMALLOC0 (sizeof(OOCTXT));
+ /* OOCTXT* pctxt = (OOCTXT*) ASN1CRTMALLOC0 (sizeof(OOCTXT)); */
+ OOCTXT* pctxt = (OOCTXT*) malloc (sizeof(OOCTXT));
if (pctxt) {
if (initContext(pctxt) != ASN_OK) {
- ASN1CRTFREE0 (pctxt);
+ /* ASN1CRTFREE0 (pctxt); */
+ free(pctxt);
pctxt = 0;
}
pctxt->flags |= ASN1DYNCTXT;
diff --git a/addons/ooh323c/src/decode.c b/addons/ooh323c/src/decode.c
index d09247c94..c80a481ba 100644
--- a/addons/ooh323c/src/decode.c
+++ b/addons/ooh323c/src/decode.c
@@ -14,6 +14,9 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+
#include "ooasn1.h"
static int decode16BitConstrainedString
@@ -265,7 +268,7 @@ int decodeConsUInt8
ASN1UINT_MAX : upper - lower + 1;
if (lower != upper) {
- ASN1UINT range_bitcnt;
+ ASN1UINT range_bitcnt = 0;
/* If range is <= 255, bit-field case (10.5.7a) */
diff --git a/addons/ooh323c/src/dlist.c b/addons/ooh323c/src/dlist.c
index 52fc87d42..9a9bfbb4c 100644
--- a/addons/ooh323c/src/dlist.c
+++ b/addons/ooh323c/src/dlist.c
@@ -14,6 +14,9 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+
#include "ooasn1.h"
void dListInit (DList* pList)
diff --git a/addons/ooh323c/src/encode.c b/addons/ooh323c/src/encode.c
index 45e5916df..099e6e9ec 100644
--- a/addons/ooh323c/src/encode.c
+++ b/addons/ooh323c/src/encode.c
@@ -14,7 +14,10 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
#include <stdlib.h>
+
#include "ooasn1.h"
static int encode16BitConstrainedString
@@ -25,6 +28,11 @@ static int encodeNonNegBinInt (OOCTXT* pctxt, ASN1UINT value);
static int encodeUnconsLength (OOCTXT* pctxt, ASN1UINT value);
static int getIdentByteCount (ASN1UINT ident);
+int encodeBitsFromOctet (OOCTXT* pctxt, ASN1OCTET value, ASN1UINT nbits);
+int encodeGetMsgBitCnt (OOCTXT* pctxt);
+int encodeIdent (OOCTXT* pctxt, ASN1UINT ident);
+
+
int encodeBit (OOCTXT* pctxt, ASN1BOOL value)
{
int stat = ASN_OK;
@@ -129,7 +137,7 @@ int encodeBitsFromOctet (OOCTXT* pctxt, ASN1OCTET value, ASN1UINT nbits)
int lshift = pctxt->buffer.bitOffset;
int rshift = 8 - pctxt->buffer.bitOffset;
int stat = ASN_OK;
- ASN1OCTET mask;
+ ASN1OCTET mask = 0x0;
if (nbits == 0) return ASN_OK;
@@ -596,7 +604,7 @@ int encodebitsFromOctet (OOCTXT* pctxt, ASN1OCTET value, ASN1UINT nbits)
int lshift = pctxt->buffer.bitOffset;
int rshift = 8 - pctxt->buffer.bitOffset;
int stat = ASN_OK;
- ASN1OCTET mask;
+ ASN1OCTET mask = 0x0;
if (nbits == 0) return ASN_OK;
diff --git a/addons/ooh323c/src/errmgmt.c b/addons/ooh323c/src/errmgmt.c
index d41bad102..2b8c41feb 100644
--- a/addons/ooh323c/src/errmgmt.c
+++ b/addons/ooh323c/src/errmgmt.c
@@ -16,6 +16,8 @@
/* Error management functions */
+#include <asterisk.h>
+#include <asterisk/lock.h>
#include <stdlib.h>
#include "ooasn1.h"
@@ -86,7 +88,8 @@ int errAddStrParm (ASN1ErrInfo* pErrInfo, const char* errprm_p)
{
#if defined(_NO_THREADS) || !defined(_NO_MALLOC)
if (pErrInfo->parmcnt < ASN_K_MAXERRP) {
- char* tmpstr = (char*) ASN1CRTMALLOC0 (strlen(errprm_p)+1);
+ /* char* tmpstr = (char*) ASN1CRTMALLOC0 (strlen(errprm_p)+1); */
+ char* tmpstr = (char*) malloc (strlen(errprm_p)+1);
strcpy (tmpstr, errprm_p);
pErrInfo->parms[pErrInfo->parmcnt] = tmpstr;
pErrInfo->parmcnt++;
@@ -114,7 +117,8 @@ void errFreeParms (ASN1ErrInfo* pErrInfo)
int i;
for (i = 0; i < pErrInfo->parmcnt; i++)
- ASN1CRTFREE0 ((char*)pErrInfo->parms[i]);
+ /* ASN1CRTFREE0 ((char*)pErrInfo->parms[i]); */
+ free ((char*)pErrInfo->parms[i]);
#endif
pErrInfo->parmcnt = 0;
diff --git a/addons/ooh323c/src/eventHandler.c b/addons/ooh323c/src/eventHandler.c
index 7b15759a6..080117f97 100644
--- a/addons/ooh323c/src/eventHandler.c
+++ b/addons/ooh323c/src/eventHandler.c
@@ -14,6 +14,9 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+
#include "eventHandler.h"
void setEventHandler (OOCTXT* pctxt, EventHandler* pHandler)
diff --git a/addons/ooh323c/src/eventHandler.h b/addons/ooh323c/src/eventHandler.h
index 320a55b99..e5eff605b 100644
--- a/addons/ooh323c/src/eventHandler.h
+++ b/addons/ooh323c/src/eventHandler.h
@@ -166,7 +166,7 @@ typedef void (*CharStrValue16Bit) (ASN1UINT nchars, ASN116BITCHAR* data) ;
* @param - none
* @return - none
*/
-typedef void (*NullValue) () ;
+typedef void (*NullValue) (void) ;
/**
* This is a function pointer for a callback function which is invoked from
diff --git a/addons/ooh323c/src/h323/H235-SECURITY-MESSAGESDec.c b/addons/ooh323c/src/h323/H235-SECURITY-MESSAGESDec.c
index 897bf0eec..5ee406956 100644
--- a/addons/ooh323c/src/h323/H235-SECURITY-MESSAGESDec.c
+++ b/addons/ooh323c/src/h323/H235-SECURITY-MESSAGESDec.c
@@ -162,6 +162,8 @@ EXTERN int asn1PD_H235AuthenticationBES (OOCTXT* pctxt, H235AuthenticationBES* p
ASN1OpenType openType;
ASN1BOOL extbit;
+ extbit = 0;
+
/* extension bit */
DECODEBIT (pctxt, &extbit);
@@ -228,6 +230,8 @@ EXTERN int asn1PD_H235AuthenticationMechanism (OOCTXT* pctxt, H235Authentication
ASN1BOOL extbit;
OOCTXT lctxt;
+ extbit = 0;
+
/* extension bit */
DECODEBIT (pctxt, &extbit);
@@ -446,6 +450,8 @@ EXTERN int asn1PD_H235DHset (OOCTXT* pctxt, H235DHset* pvalue)
ASN1BOOL optbit;
ASN1BOOL extbit;
+ optbit = extbit = 0;
+
/* extension bit */
DECODEBIT (pctxt, &extbit);
@@ -524,6 +530,8 @@ EXTERN int asn1PD_H235TypedCertificate (OOCTXT* pctxt, H235TypedCertificate* pva
ASN1BOOL optbit;
ASN1BOOL extbit;
+ optbit = extbit = 0;
+
/* extension bit */
DECODEBIT (pctxt, &extbit);
@@ -663,6 +671,8 @@ EXTERN int asn1PD_H235ECpoint (OOCTXT* pctxt, H235ECpoint* pvalue)
ASN1BOOL optbit;
ASN1BOOL extbit;
+ optbit = extbit = 0;
+
/* extension bit */
DECODEBIT (pctxt, &extbit);
@@ -1003,6 +1013,8 @@ EXTERN int asn1PD_H235ECKASDH (OOCTXT* pctxt, H235ECKASDH* pvalue)
ASN1OpenType openType;
ASN1BOOL extbit;
+ extbit = 0;
+
/* extension bit */
DECODEBIT (pctxt, &extbit);
@@ -1076,6 +1088,8 @@ EXTERN int asn1PD_H235ClearToken (OOCTXT* pctxt, H235ClearToken* pvalue)
ASN1BOOL optbit;
ASN1BOOL extbit;
+ optbit = extbit = 0;
+
/* extension bit */
DECODEBIT (pctxt, &extbit);
@@ -1334,6 +1348,8 @@ EXTERN int asn1PD_H235Params (OOCTXT* pctxt, H235Params* pvalue)
ASN1BOOL optbit;
ASN1BOOL extbit;
+ optbit = extbit = 0;
+
/* extension bit */
DECODEBIT (pctxt, &extbit);
@@ -1698,6 +1714,8 @@ EXTERN int asn1PD_H235CryptoToken (OOCTXT* pctxt, H235CryptoToken* pvalue)
ASN1OpenType openType;
ASN1BOOL extbit;
+ extbit = 0;
+
/* extension bit */
DECODEBIT (pctxt, &extbit);
diff --git a/addons/ooh323c/src/h323/H323-MESSAGESDec.c b/addons/ooh323c/src/h323/H323-MESSAGESDec.c
index 2f8700b66..503d7965f 100644
--- a/addons/ooh323c/src/h323/H323-MESSAGESDec.c
+++ b/addons/ooh323c/src/h323/H323-MESSAGESDec.c
@@ -28,7 +28,7 @@ EXTERN int asn1PD_H225ScreeningIndicator (OOCTXT* pctxt, H225ScreeningIndicator*
{
int stat = ASN_OK;
ASN1UINT ui;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -307,7 +307,7 @@ EXTERN int asn1PD_H225GenericIdentifier (OOCTXT* pctxt, H225GenericIdentifier* p
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -532,7 +532,7 @@ EXTERN int asn1PD_H225TransportAddress_ipSourceRoute_routing (OOCTXT* pctxt, H22
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -599,8 +599,8 @@ EXTERN int asn1PD_H225TransportAddress_ipSourceRoute (OOCTXT* pctxt, H225Transpo
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -819,8 +819,8 @@ EXTERN int asn1PD_H225TransportAddress_ip6Address (OOCTXT* pctxt, H225TransportA
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -935,8 +935,8 @@ EXTERN int asn1PD_H225H221NonStandard (OOCTXT* pctxt, H225H221NonStandard* pvalu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1014,7 +1014,7 @@ EXTERN int asn1PD_H225NonStandardIdentifier (OOCTXT* pctxt, H225NonStandardIdent
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1116,7 +1116,7 @@ EXTERN int asn1PD_H225TransportAddress (OOCTXT* pctxt, H225TransportAddress* pva
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1250,7 +1250,7 @@ EXTERN int asn1PD_H225PublicTypeOfNumber (OOCTXT* pctxt, H225PublicTypeOfNumber*
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1390,7 +1390,7 @@ EXTERN int asn1PD_H225PrivateTypeOfNumber (OOCTXT* pctxt, H225PrivateTypeOfNumbe
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1530,7 +1530,7 @@ EXTERN int asn1PD_H225PartyNumber (OOCTXT* pctxt, H225PartyNumber* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1638,7 +1638,7 @@ EXTERN int asn1PD_H225ANSI_41_UIM_system_id (OOCTXT* pctxt, H225ANSI_41_UIM_syst
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1804,8 +1804,8 @@ EXTERN int asn1PD_H225ANSI_41_UIM (OOCTXT* pctxt, H225ANSI_41_UIM* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -2084,8 +2084,8 @@ EXTERN int asn1PD_H225GSM_UIM (OOCTXT* pctxt, H225GSM_UIM* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -2236,7 +2236,7 @@ EXTERN int asn1PD_H225MobileUIM (OOCTXT* pctxt, H225MobileUIM* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -2311,7 +2311,7 @@ EXTERN int asn1PD_H225AliasAddress (OOCTXT* pctxt, H225AliasAddress* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -2538,7 +2538,7 @@ EXTERN int asn1PD_H225Content (OOCTXT* pctxt, H225Content* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -2734,8 +2734,8 @@ EXTERN int asn1PD_H225EnumeratedParameter (OOCTXT* pctxt, H225EnumeratedParamete
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -2852,8 +2852,8 @@ EXTERN int asn1PD_H225GenericData (OOCTXT* pctxt, H225GenericData* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -3210,8 +3210,8 @@ EXTERN int asn1PD_H225VendorIdentifier (OOCTXT* pctxt, H225VendorIdentifier* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -3326,8 +3326,8 @@ EXTERN int asn1PD_H225GatekeeperInfo (OOCTXT* pctxt, H225GatekeeperInfo* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -3395,8 +3395,8 @@ EXTERN int asn1PD_H225DataRate (OOCTXT* pctxt, H225DataRate* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -3532,8 +3532,8 @@ EXTERN int asn1PD_H225SupportedPrefix (OOCTXT* pctxt, H225SupportedPrefix* pvalu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -3655,8 +3655,8 @@ EXTERN int asn1PD_H225H310Caps (OOCTXT* pctxt, H225H310Caps* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -3759,8 +3759,8 @@ EXTERN int asn1PD_H225H320Caps (OOCTXT* pctxt, H225H320Caps* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -3863,8 +3863,8 @@ EXTERN int asn1PD_H225H321Caps (OOCTXT* pctxt, H225H321Caps* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -3967,8 +3967,8 @@ EXTERN int asn1PD_H225H322Caps (OOCTXT* pctxt, H225H322Caps* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4071,8 +4071,8 @@ EXTERN int asn1PD_H225H323Caps (OOCTXT* pctxt, H225H323Caps* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4175,8 +4175,8 @@ EXTERN int asn1PD_H225H324Caps (OOCTXT* pctxt, H225H324Caps* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4279,8 +4279,8 @@ EXTERN int asn1PD_H225VoiceCaps (OOCTXT* pctxt, H225VoiceCaps* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4383,8 +4383,8 @@ EXTERN int asn1PD_H225T120OnlyCaps (OOCTXT* pctxt, H225T120OnlyCaps* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4486,8 +4486,8 @@ EXTERN int asn1PD_H225NonStandardProtocol (OOCTXT* pctxt, H225NonStandardProtoco
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4578,8 +4578,8 @@ EXTERN int asn1PD_H225T38FaxAnnexbOnlyCaps (OOCTXT* pctxt, H225T38FaxAnnexbOnlyC
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4688,8 +4688,8 @@ EXTERN int asn1PD_H225SIPCaps (OOCTXT* pctxt, H225SIPCaps* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4783,7 +4783,7 @@ EXTERN int asn1PD_H225SupportedProtocols (OOCTXT* pctxt, H225SupportedProtocols*
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -5037,8 +5037,8 @@ EXTERN int asn1PD_H225GatewayInfo (OOCTXT* pctxt, H225GatewayInfo* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5121,8 +5121,8 @@ EXTERN int asn1PD_H225McuInfo (OOCTXT* pctxt, H225McuInfo* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5213,8 +5213,8 @@ EXTERN int asn1PD_H225TerminalInfo (OOCTXT* pctxt, H225TerminalInfo* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5284,8 +5284,8 @@ EXTERN int asn1PD_H225TunnelledProtocolAlternateIdentifier (OOCTXT* pctxt, H225T
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5366,7 +5366,7 @@ EXTERN int asn1PD_H225TunnelledProtocol_id (OOCTXT* pctxt, H225TunnelledProtocol
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5439,8 +5439,8 @@ EXTERN int asn1PD_H225TunnelledProtocol (OOCTXT* pctxt, H225TunnelledProtocol* p
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5565,8 +5565,8 @@ EXTERN int asn1PD_H225EndpointType (OOCTXT* pctxt, H225EndpointType* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5788,7 +5788,7 @@ EXTERN int asn1PD_H225Setup_UUIE_conferenceGoal (OOCTXT* pctxt, H225Setup_UUIE_c
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -5897,8 +5897,8 @@ EXTERN int asn1PD_H225Q954Details (OOCTXT* pctxt, H225Q954Details* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5968,8 +5968,8 @@ EXTERN int asn1PD_H225QseriesOptions (OOCTXT* pctxt, H225QseriesOptions* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -6096,7 +6096,7 @@ EXTERN int asn1PD_H225CallType (OOCTXT* pctxt, H225CallType* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -6185,8 +6185,8 @@ EXTERN int asn1PD_H225CallIdentifier (OOCTXT* pctxt, H225CallIdentifier* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -6243,7 +6243,7 @@ EXTERN int asn1PD_H225SecurityServiceMode (OOCTXT* pctxt, H225SecurityServiceMod
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -6323,8 +6323,8 @@ EXTERN int asn1PD_H225SecurityCapabilities (OOCTXT* pctxt, H225SecurityCapabilit
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -6417,7 +6417,7 @@ EXTERN int asn1PD_H225H245Security (OOCTXT* pctxt, H225H245Security* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -6834,7 +6834,7 @@ EXTERN int asn1PD_H225CryptoH323Token (OOCTXT* pctxt, H225CryptoH323Token* pvalu
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7058,7 +7058,7 @@ EXTERN int asn1PD_H225ScnConnectionType (OOCTXT* pctxt, H225ScnConnectionType* p
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7178,7 +7178,7 @@ EXTERN int asn1PD_H225ScnConnectionAggregation (OOCTXT* pctxt, H225ScnConnection
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7289,8 +7289,8 @@ EXTERN int asn1PD_H225Setup_UUIE_connectionParameters (OOCTXT* pctxt, H225Setup_
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7402,7 +7402,7 @@ EXTERN int asn1PD_H225PresentationIndicator (OOCTXT* pctxt, H225PresentationIndi
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7478,7 +7478,7 @@ EXTERN int asn1PD_H225CallCreditServiceControl_billingMode (OOCTXT* pctxt, H225C
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7543,7 +7543,7 @@ EXTERN int asn1PD_H225CallCreditServiceControl_callStartingPoint (OOCTXT* pctxt,
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7611,8 +7611,8 @@ EXTERN int asn1PD_H225CallCreditServiceControl (OOCTXT* pctxt, H225CallCreditSer
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7740,7 +7740,7 @@ EXTERN int asn1PD_H225ServiceControlDescriptor (OOCTXT* pctxt, H225ServiceContro
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7836,7 +7836,7 @@ EXTERN int asn1PD_H225ServiceControlSession_reason (OOCTXT* pctxt, H225ServiceCo
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7914,8 +7914,8 @@ EXTERN int asn1PD_H225ServiceControlSession (OOCTXT* pctxt, H225ServiceControlSe
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8047,8 +8047,8 @@ EXTERN int asn1PD_H225CarrierInfo (OOCTXT* pctxt, H225CarrierInfo* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8135,8 +8135,8 @@ EXTERN int asn1PD_H225CallsAvailable (OOCTXT* pctxt, H225CallsAvailable* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8285,8 +8285,8 @@ EXTERN int asn1PD_H225CallCapacityInfo (OOCTXT* pctxt, H225CallCapacityInfo* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8517,8 +8517,8 @@ EXTERN int asn1PD_H225CallCapacity (OOCTXT* pctxt, H225CallCapacity* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8632,8 +8632,8 @@ EXTERN int asn1PD_H225CicInfo (OOCTXT* pctxt, H225CicInfo* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8735,8 +8735,8 @@ EXTERN int asn1PD_H225GroupID (OOCTXT* pctxt, H225GroupID* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8817,8 +8817,8 @@ EXTERN int asn1PD_H225CircuitIdentifier (OOCTXT* pctxt, H225CircuitIdentifier* p
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8967,8 +8967,8 @@ EXTERN int asn1PD_H225CircuitInfo (OOCTXT* pctxt, H225CircuitInfo* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -9141,8 +9141,8 @@ EXTERN int asn1PD_H225ExtendedAliasAddress (OOCTXT* pctxt, H225ExtendedAliasAddr
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -9278,8 +9278,8 @@ EXTERN int asn1PD_H225Setup_UUIE (OOCTXT* pctxt, H225Setup_UUIE* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -9833,8 +9833,8 @@ EXTERN int asn1PD_H225FeatureSet (OOCTXT* pctxt, H225FeatureSet* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -9941,8 +9941,8 @@ EXTERN int asn1PD_H225CallProceeding_UUIE (OOCTXT* pctxt, H225CallProceeding_UUI
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -10211,8 +10211,8 @@ EXTERN int asn1PD_H225Connect_UUIE (OOCTXT* pctxt, H225Connect_UUIE* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -10520,8 +10520,8 @@ EXTERN int asn1PD_H225Alerting_UUIE (OOCTXT* pctxt, H225Alerting_UUIE* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -10809,8 +10809,8 @@ EXTERN int asn1PD_H225Information_UUIE (OOCTXT* pctxt, H225Information_UUIE* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -10949,7 +10949,7 @@ EXTERN int asn1PD_H225SecurityErrors (OOCTXT* pctxt, H225SecurityErrors* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -11168,7 +11168,7 @@ EXTERN int asn1PD_H225ReleaseCompleteReason (OOCTXT* pctxt, H225ReleaseCompleteR
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -11504,8 +11504,8 @@ EXTERN int asn1PD_H225ReleaseComplete_UUIE (OOCTXT* pctxt, H225ReleaseComplete_U
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -11691,7 +11691,7 @@ EXTERN int asn1PD_H225FacilityReason (OOCTXT* pctxt, H225FacilityReason* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -11866,8 +11866,8 @@ EXTERN int asn1PD_H225ConferenceList (OOCTXT* pctxt, H225ConferenceList* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -12041,8 +12041,8 @@ EXTERN int asn1PD_H225Facility_UUIE (OOCTXT* pctxt, H225Facility_UUIE* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -12380,8 +12380,8 @@ EXTERN int asn1PD_H225Progress_UUIE (OOCTXT* pctxt, H225Progress_UUIE* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -12579,8 +12579,8 @@ EXTERN int asn1PD_H225Status_UUIE (OOCTXT* pctxt, H225Status_UUIE* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -12680,8 +12680,8 @@ EXTERN int asn1PD_H225StatusInquiry_UUIE (OOCTXT* pctxt, H225StatusInquiry_UUIE*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -12781,8 +12781,8 @@ EXTERN int asn1PD_H225SetupAcknowledge_UUIE (OOCTXT* pctxt, H225SetupAcknowledge
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -12882,8 +12882,8 @@ EXTERN int asn1PD_H225Notify_UUIE (OOCTXT* pctxt, H225Notify_UUIE* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -12981,7 +12981,7 @@ EXTERN int asn1PD_H225H323_UU_PDU_h323_message_body (OOCTXT* pctxt, H225H323_UU_
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -13312,8 +13312,8 @@ EXTERN int asn1PD_H225CallLinkage (OOCTXT* pctxt, H225CallLinkage* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13428,8 +13428,8 @@ EXTERN int asn1PD_H225H323_UU_PDU_tunnelledSignallingMessage (OOCTXT* pctxt, H22
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13529,8 +13529,8 @@ EXTERN int asn1PD_H225StimulusControl (OOCTXT* pctxt, H225StimulusControl* pvalu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13628,8 +13628,8 @@ EXTERN int asn1PD_H225H323_UU_PDU (OOCTXT* pctxt, H225H323_UU_PDU* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13818,8 +13818,8 @@ EXTERN int asn1PD_H225H323_UserInformation_user_data (OOCTXT* pctxt, H225H323_Us
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13888,8 +13888,8 @@ EXTERN int asn1PD_H225H323_UserInformation (OOCTXT* pctxt, H225H323_UserInformat
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13995,7 +13995,7 @@ EXTERN int asn1PD_H225AddressPattern (OOCTXT* pctxt, H225AddressPattern* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -14111,8 +14111,8 @@ EXTERN int asn1PD_H225AlternateTransportAddresses (OOCTXT* pctxt, H225AlternateT
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -14204,8 +14204,8 @@ EXTERN int asn1PD_H225Endpoint (OOCTXT* pctxt, H225Endpoint* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -14443,7 +14443,7 @@ EXTERN int asn1PD_H225UseSpecifiedTransport (OOCTXT* pctxt, H225UseSpecifiedTran
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -14530,8 +14530,8 @@ EXTERN int asn1PD_H225AlternateGK (OOCTXT* pctxt, H225AlternateGK* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -14672,8 +14672,8 @@ EXTERN int asn1PD_H225AltGKInfo (OOCTXT* pctxt, H225AltGKInfo* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -14740,7 +14740,7 @@ EXTERN int asn1PD_H225SecurityErrors2 (OOCTXT* pctxt, H225SecurityErrors2* pvalu
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -14849,7 +14849,7 @@ EXTERN int asn1PD_H225EncryptIntAlg (OOCTXT* pctxt, H225EncryptIntAlg* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -14919,7 +14919,7 @@ EXTERN int asn1PD_H225NonIsoIntegrityMechanism (OOCTXT* pctxt, H225NonIsoIntegri
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15013,7 +15013,7 @@ EXTERN int asn1PD_H225IntegrityMechanism (OOCTXT* pctxt, H225IntegrityMechanism*
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15143,8 +15143,8 @@ EXTERN int asn1PD_H225CapacityReportingCapability (OOCTXT* pctxt, H225CapacityRe
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15204,8 +15204,8 @@ EXTERN int asn1PD_H225CapacityReportingSpecification_when (OOCTXT* pctxt, H225Ca
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15287,8 +15287,8 @@ EXTERN int asn1PD_H225CapacityReportingSpecification (OOCTXT* pctxt, H225Capacit
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15347,8 +15347,8 @@ EXTERN int asn1PD_H225RasUsageInfoTypes (OOCTXT* pctxt, H225RasUsageInfoTypes* p
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15453,8 +15453,8 @@ EXTERN int asn1PD_H225RasUsageSpecification_when (OOCTXT* pctxt, H225RasUsageSpe
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15550,8 +15550,8 @@ EXTERN int asn1PD_H225RasUsageSpecification_callStartingPoint (OOCTXT* pctxt, H2
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15633,8 +15633,8 @@ EXTERN int asn1PD_H225RasUsageSpecification (OOCTXT* pctxt, H225RasUsageSpecific
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15720,8 +15720,8 @@ EXTERN int asn1PD_H225RasUsageInformation (OOCTXT* pctxt, H225RasUsageInformatio
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15824,7 +15824,7 @@ EXTERN int asn1PD_H225CallTerminationCause (OOCTXT* pctxt, H225CallTerminationCa
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15895,8 +15895,8 @@ EXTERN int asn1PD_H225TransportChannelInfo (OOCTXT* pctxt, H225TransportChannelI
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15978,8 +15978,8 @@ EXTERN int asn1PD_H225BandwidthDetails (OOCTXT* pctxt, H225BandwidthDetails* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16067,8 +16067,8 @@ EXTERN int asn1PD_H225CallCreditCapability (OOCTXT* pctxt, H225CallCreditCapabil
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16186,8 +16186,8 @@ EXTERN int asn1PD_H225RTPSession (OOCTXT* pctxt, H225RTPSession* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16498,8 +16498,8 @@ EXTERN int asn1PD_H225GatekeeperRequest (OOCTXT* pctxt, H225GatekeeperRequest* p
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16768,8 +16768,8 @@ EXTERN int asn1PD_H225GatekeeperConfirm (OOCTXT* pctxt, H225GatekeeperConfirm* p
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16988,7 +16988,7 @@ EXTERN int asn1PD_H225GatekeeperRejectReason (OOCTXT* pctxt, H225GatekeeperRejec
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -17133,8 +17133,8 @@ EXTERN int asn1PD_H225GatekeeperReject (OOCTXT* pctxt, H225GatekeeperReject* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -17398,8 +17398,8 @@ EXTERN int asn1PD_H225RegistrationRequest (OOCTXT* pctxt, H225RegistrationReques
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -17829,8 +17829,8 @@ EXTERN int asn1PD_H225RegistrationConfirm_preGrantedARQ (OOCTXT* pctxt, H225Regi
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -18026,8 +18026,8 @@ EXTERN int asn1PD_H225RegistrationConfirm (OOCTXT* pctxt, H225RegistrationConfir
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -18360,8 +18360,8 @@ EXTERN int asn1PD_H225RegistrationRejectReason_invalidTerminalAliases (OOCTXT* p
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -18455,7 +18455,7 @@ EXTERN int asn1PD_H225RegistrationRejectReason (OOCTXT* pctxt, H225RegistrationR
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -18714,8 +18714,8 @@ EXTERN int asn1PD_H225RegistrationReject (OOCTXT* pctxt, H225RegistrationReject*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -18900,7 +18900,7 @@ EXTERN int asn1PD_H225UnregRequestReason (OOCTXT* pctxt, H225UnregRequestReason*
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -19023,8 +19023,8 @@ EXTERN int asn1PD_H225UnregistrationRequest (OOCTXT* pctxt, H225UnregistrationRe
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -19261,8 +19261,8 @@ EXTERN int asn1PD_H225UnregistrationConfirm (OOCTXT* pctxt, H225UnregistrationCo
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -19393,7 +19393,7 @@ EXTERN int asn1PD_H225UnregRejectReason (OOCTXT* pctxt, H225UnregRejectReason* p
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -19516,8 +19516,8 @@ EXTERN int asn1PD_H225UnregistrationReject (OOCTXT* pctxt, H225UnregistrationRej
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -19668,7 +19668,7 @@ EXTERN int asn1PD_H225CallModel (OOCTXT* pctxt, H225CallModel* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -19733,7 +19733,7 @@ EXTERN int asn1PD_H225TransportQOS (OOCTXT* pctxt, H225TransportQOS* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -19812,8 +19812,8 @@ EXTERN int asn1PD_H225AdmissionRequest (OOCTXT* pctxt, H225AdmissionRequest* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -20273,8 +20273,8 @@ EXTERN int asn1PD_H225UUIEsRequested (OOCTXT* pctxt, H225UUIEsRequested* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -20513,8 +20513,8 @@ EXTERN int asn1PD_H225AdmissionConfirm (OOCTXT* pctxt, H225AdmissionConfirm* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -20931,7 +20931,7 @@ EXTERN int asn1PD_H225AdmissionRejectReason (OOCTXT* pctxt, H225AdmissionRejectR
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -21232,8 +21232,8 @@ EXTERN int asn1PD_H225AdmissionReject (OOCTXT* pctxt, H225AdmissionReject* pvalu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -21464,8 +21464,8 @@ EXTERN int asn1PD_H225BandwidthRequest (OOCTXT* pctxt, H225BandwidthRequest* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -21727,8 +21727,8 @@ EXTERN int asn1PD_H225BandwidthConfirm (OOCTXT* pctxt, H225BandwidthConfirm* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -21879,7 +21879,7 @@ EXTERN int asn1PD_H225BandRejectReason (OOCTXT* pctxt, H225BandRejectReason* pva
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -22024,8 +22024,8 @@ EXTERN int asn1PD_H225BandwidthReject (OOCTXT* pctxt, H225BandwidthReject* pvalu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -22185,7 +22185,7 @@ EXTERN int asn1PD_H225DisengageReason (OOCTXT* pctxt, H225DisengageReason* pvalu
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -22264,8 +22264,8 @@ EXTERN int asn1PD_H225DisengageRequest (OOCTXT* pctxt, H225DisengageRequest* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -22535,8 +22535,8 @@ EXTERN int asn1PD_H225DisengageConfirm (OOCTXT* pctxt, H225DisengageConfirm* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -22700,7 +22700,7 @@ EXTERN int asn1PD_H225DisengageRejectReason (OOCTXT* pctxt, H225DisengageRejectR
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -22801,8 +22801,8 @@ EXTERN int asn1PD_H225DisengageReject (OOCTXT* pctxt, H225DisengageReject* pvalu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -22956,8 +22956,8 @@ EXTERN int asn1PD_H225LocationRequest (OOCTXT* pctxt, H225LocationRequest* pvalu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -23258,8 +23258,8 @@ EXTERN int asn1PD_H225LocationConfirm (OOCTXT* pctxt, H225LocationConfirm* pvalu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -23552,7 +23552,7 @@ EXTERN int asn1PD_H225LocationRejectReason (OOCTXT* pctxt, H225LocationRejectRea
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -23787,8 +23787,8 @@ EXTERN int asn1PD_H225LocationReject (OOCTXT* pctxt, H225LocationReject* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -23964,8 +23964,8 @@ EXTERN int asn1PD_H225InfoRequest (OOCTXT* pctxt, H225InfoRequest* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -24396,8 +24396,8 @@ EXTERN int asn1PD_H225InfoRequestResponse_perCallInfo_element (OOCTXT* pctxt, H2
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -24727,7 +24727,7 @@ EXTERN int asn1PD_H225InfoRequestResponseStatus (OOCTXT* pctxt, H225InfoRequestR
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -24818,8 +24818,8 @@ EXTERN int asn1PD_H225InfoRequestResponse (OOCTXT* pctxt, H225InfoRequestRespons
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25063,8 +25063,8 @@ EXTERN int asn1PD_H225NonStandardMessage (OOCTXT* pctxt, H225NonStandardMessage*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25204,8 +25204,8 @@ EXTERN int asn1PD_H225UnknownMessageResponse (OOCTXT* pctxt, H225UnknownMessageR
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25325,8 +25325,8 @@ EXTERN int asn1PD_H225RequestInProgress (OOCTXT* pctxt, H225RequestInProgress* p
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25456,8 +25456,8 @@ EXTERN int asn1PD_H225ResourcesAvailableIndicate (OOCTXT* pctxt, H225ResourcesAv
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25648,8 +25648,8 @@ EXTERN int asn1PD_H225ResourcesAvailableConfirm (OOCTXT* pctxt, H225ResourcesAva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25800,8 +25800,8 @@ EXTERN int asn1PD_H225InfoRequestAck (OOCTXT* pctxt, H225InfoRequestAck* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25918,7 +25918,7 @@ EXTERN int asn1PD_H225InfoRequestNakReason (OOCTXT* pctxt, H225InfoRequestNakRea
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -26018,8 +26018,8 @@ EXTERN int asn1PD_H225InfoRequestNak (OOCTXT* pctxt, H225InfoRequestNak* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26161,8 +26161,8 @@ EXTERN int asn1PD_H225ServiceControlIndication_callSpecific (OOCTXT* pctxt, H225
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26240,8 +26240,8 @@ EXTERN int asn1PD_H225ServiceControlIndication (OOCTXT* pctxt, H225ServiceContro
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26423,7 +26423,8 @@ EXTERN int asn1PD_H225ServiceControlResponse_result (OOCTXT* pctxt, H225ServiceC
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
+ extbit = 0;
/* extension bit */
@@ -26523,8 +26524,8 @@ EXTERN int asn1PD_H225ServiceControlResponse (OOCTXT* pctxt, H225ServiceControlR
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26727,7 +26728,7 @@ EXTERN int asn1PD_H225RasMessage (OOCTXT* pctxt, H225RasMessage* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
diff --git a/addons/ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROLDec.c b/addons/ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROLDec.c
index 0ec58a82e..0875f689d 100644
--- a/addons/ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROLDec.c
+++ b/addons/ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROLDec.c
@@ -159,8 +159,8 @@ EXTERN int asn1PD_H245V42bis (OOCTXT* pctxt, H245V42bis* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -228,7 +228,7 @@ EXTERN int asn1PD_H245CompressionType (OOCTXT* pctxt, H245CompressionType* pvalu
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -284,7 +284,7 @@ EXTERN int asn1PD_H245DataProtocolCapability_v76wCompression (OOCTXT* pctxt, H24
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -366,7 +366,7 @@ EXTERN int asn1PD_H245DataProtocolCapability (OOCTXT* pctxt, H245DataProtocolCap
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -576,7 +576,7 @@ EXTERN int asn1PD_H245T38FaxRateManagement (OOCTXT* pctxt, H245T38FaxRateManagem
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -641,7 +641,7 @@ EXTERN int asn1PD_H245T38FaxUdpOptions_t38FaxUdpEC (OOCTXT* pctxt, H245T38FaxUdp
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -704,7 +704,7 @@ EXTERN int asn1PD_H245T38FaxUdpOptions_t38FaxUdpEC (OOCTXT* pctxt, H245T38FaxUdp
EXTERN int asn1PD_H245T38FaxUdpOptions (OOCTXT* pctxt, H245T38FaxUdpOptions* pvalue)
{
int stat = ASN_OK;
- ASN1BOOL optbit;
+ ASN1BOOL optbit = 0;
/* optional bits */
@@ -765,8 +765,8 @@ EXTERN int asn1PD_H245T38FaxTcpOptions (OOCTXT* pctxt, H245T38FaxTcpOptions* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -827,8 +827,8 @@ EXTERN int asn1PD_H245T38FaxProfile (OOCTXT* pctxt, H245T38FaxProfile* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -969,8 +969,8 @@ EXTERN int asn1PD_H245NonStandardMessage (OOCTXT* pctxt, H245NonStandardMessage*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1029,8 +1029,8 @@ EXTERN int asn1PD_H245MasterSlaveDetermination (OOCTXT* pctxt, H245MasterSlaveDe
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1117,8 +1117,8 @@ EXTERN int asn1PD_H245VCCapability_aal1 (OOCTXT* pctxt, H245VCCapability_aal1* p
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1258,8 +1258,8 @@ EXTERN int asn1PD_H245VCCapability_aal5 (OOCTXT* pctxt, H245VCCapability_aal5* p
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1410,8 +1410,8 @@ EXTERN int asn1PD_H245VCCapability_availableBitRates (OOCTXT* pctxt, H245VCCapab
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1492,7 +1492,7 @@ EXTERN int asn1PD_H245Q2931Address_address (OOCTXT* pctxt, H245Q2931Address_addr
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1587,8 +1587,8 @@ EXTERN int asn1PD_H245Q2931Address (OOCTXT* pctxt, H245Q2931Address* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1705,8 +1705,8 @@ EXTERN int asn1PD_H245VCCapability_aal1ViaGateway (OOCTXT* pctxt, H245VCCapabili
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -1856,8 +1856,8 @@ EXTERN int asn1PD_H245VCCapability (OOCTXT* pctxt, H245VCCapability* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -2035,8 +2035,8 @@ EXTERN int asn1PD_H245H222Capability (OOCTXT* pctxt, H245H222Capability* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -2105,8 +2105,8 @@ EXTERN int asn1PD_H245H223Capability_h223MultiplexTableCapability_enhanced (OOCT
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -2233,8 +2233,8 @@ EXTERN int asn1PD_H245H223Capability_mobileOperationTransmitCapability (OOCTXT*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -2335,8 +2335,8 @@ EXTERN int asn1PD_H245H223AnnexCCapability (OOCTXT* pctxt, H245H223AnnexCCapabil
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -2544,8 +2544,8 @@ EXTERN int asn1PD_H245H223Capability_mobileMultilinkFrameCapability (OOCTXT* pct
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -2616,8 +2616,8 @@ EXTERN int asn1PD_H245H223Capability (OOCTXT* pctxt, H245H223Capability* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -2891,8 +2891,8 @@ EXTERN int asn1PD_H245V75Capability (OOCTXT* pctxt, H245V75Capability* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -2952,8 +2952,8 @@ EXTERN int asn1PD_H245V76Capability (OOCTXT* pctxt, H245V76Capability* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -3152,8 +3152,8 @@ EXTERN int asn1PD_H245T84Profile_t84Restricted (OOCTXT* pctxt, H245T84Profile_t8
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -3556,7 +3556,7 @@ EXTERN int asn1PD_H245CapabilityIdentifier (OOCTXT* pctxt, H245CapabilityIdentif
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -3677,7 +3677,7 @@ EXTERN int asn1PD_H245ParameterIdentifier (OOCTXT* pctxt, H245ParameterIdentifie
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -3772,7 +3772,7 @@ EXTERN int asn1PD_H245ParameterValue (OOCTXT* pctxt, H245ParameterValue* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -3959,8 +3959,8 @@ EXTERN int asn1PD_H245GenericParameter (OOCTXT* pctxt, H245GenericParameter* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4090,8 +4090,8 @@ EXTERN int asn1PD_H245GenericCapability (OOCTXT* pctxt, H245GenericCapability* p
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4224,7 +4224,7 @@ EXTERN int asn1PD_H245DataApplicationCapability_application (OOCTXT* pctxt, H245
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -4458,8 +4458,8 @@ EXTERN int asn1PD_H245DataApplicationCapability (OOCTXT* pctxt, H245DataApplicat
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4572,8 +4572,8 @@ EXTERN int asn1PD_H245MediaDistributionCapability (OOCTXT* pctxt, H245MediaDistr
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4759,8 +4759,8 @@ EXTERN int asn1PD_H245MultipointCapability (OOCTXT* pctxt, H245MultipointCapabil
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4839,8 +4839,8 @@ EXTERN int asn1PD_H245H2250Capability_mcCapability (OOCTXT* pctxt, H245H2250Capa
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -4908,7 +4908,7 @@ EXTERN int asn1PD_H245RTPPayloadType_payloadDescriptor (OOCTXT* pctxt, H245RTPPa
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5002,8 +5002,8 @@ EXTERN int asn1PD_H245RTPPayloadType (OOCTXT* pctxt, H245RTPPayloadType* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5122,8 +5122,8 @@ EXTERN int asn1PD_H245MediaPacketizationCapability (OOCTXT* pctxt, H245MediaPack
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5208,7 +5208,7 @@ EXTERN int asn1PD_H245QOSMode (OOCTXT* pctxt, H245QOSMode* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5275,8 +5275,8 @@ EXTERN int asn1PD_H245RSVPParameters (OOCTXT* pctxt, H245RSVPParameters* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5419,8 +5419,8 @@ EXTERN int asn1PD_H245ATMParameters (OOCTXT* pctxt, H245ATMParameters* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5530,8 +5530,8 @@ EXTERN int asn1PD_H245QOSCapability (OOCTXT* pctxt, H245QOSCapability* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5667,8 +5667,8 @@ EXTERN int asn1PD_H245MediaTransportType_atm_AAL5_compressed (OOCTXT* pctxt, H24
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5726,7 +5726,7 @@ EXTERN int asn1PD_H245MediaTransportType (OOCTXT* pctxt, H245MediaTransportType*
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -5837,8 +5837,8 @@ EXTERN int asn1PD_H245MediaChannelCapability (OOCTXT* pctxt, H245MediaChannelCap
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -5946,8 +5946,8 @@ EXTERN int asn1PD_H245TransportCapability (OOCTXT* pctxt, H245TransportCapabilit
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -6077,8 +6077,8 @@ EXTERN int asn1PD_H245RTPH263VideoRedundancyFrameMapping (OOCTXT* pctxt, H245RTP
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -6185,7 +6185,7 @@ EXTERN int asn1PD_H245RTPH263VideoRedundancyEncoding_frameToThreadMapping (OOCTX
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -6288,8 +6288,8 @@ EXTERN int asn1PD_H245RTPH263VideoRedundancyEncoding (OOCTXT* pctxt, H245RTPH263
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -6384,7 +6384,7 @@ EXTERN int asn1PD_H245RedundancyEncodingMethod (OOCTXT* pctxt, H245RedundancyEnc
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -6525,8 +6525,8 @@ EXTERN int asn1PD_H245RedundancyEncodingCapability (OOCTXT* pctxt, H245Redundanc
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -6653,8 +6653,8 @@ EXTERN int asn1PD_H245H2250Capability (OOCTXT* pctxt, H245H2250Capability* pvalu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -6829,7 +6829,7 @@ EXTERN int asn1PD_H245MultiplexCapability (OOCTXT* pctxt, H245MultiplexCapabilit
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -6962,8 +6962,8 @@ EXTERN int asn1PD_H245H261VideoCapability (OOCTXT* pctxt, H245H261VideoCapabilit
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7102,8 +7102,8 @@ EXTERN int asn1PD_H245H262VideoCapability (OOCTXT* pctxt, H245H262VideoCapabilit
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7381,8 +7381,8 @@ EXTERN int asn1PD_H245TransparencyParameters (OOCTXT* pctxt, H245TransparencyPar
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7482,8 +7482,8 @@ EXTERN int asn1PD_H245RefPictureSelection_additionalPictureMemory (OOCTXT* pctxt
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7625,7 +7625,7 @@ EXTERN int asn1PD_H245RefPictureSelection_videoBackChannelSend (OOCTXT* pctxt, H
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7725,8 +7725,8 @@ EXTERN int asn1PD_H245RefPictureSelection_enhancedReferencePicSelect_subPictureR
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7806,8 +7806,8 @@ EXTERN int asn1PD_H245RefPictureSelection_enhancedReferencePicSelect (OOCTXT* pc
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7876,8 +7876,8 @@ EXTERN int asn1PD_H245RefPictureSelection (OOCTXT* pctxt, H245RefPictureSelectio
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -7987,8 +7987,8 @@ EXTERN int asn1PD_H245CustomPictureClockFrequency (OOCTXT* pctxt, H245CustomPict
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8177,8 +8177,8 @@ EXTERN int asn1PD_H245CustomPictureFormat_mPI_customPCF_element (OOCTXT* pctxt,
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8298,8 +8298,8 @@ EXTERN int asn1PD_H245CustomPictureFormat_mPI (OOCTXT* pctxt, H245CustomPictureF
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8416,8 +8416,8 @@ EXTERN int asn1PD_H245CustomPictureFormat_pixelAspectInformation_extendedPAR_ele
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8525,7 +8525,7 @@ EXTERN int asn1PD_H245CustomPictureFormat_pixelAspectInformation (OOCTXT* pctxt,
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8608,8 +8608,8 @@ EXTERN int asn1PD_H245CustomPictureFormat (OOCTXT* pctxt, H245CustomPictureForma
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8757,8 +8757,8 @@ EXTERN int asn1PD_H245H263Version3Options (OOCTXT* pctxt, H245H263Version3Option
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -8889,8 +8889,8 @@ EXTERN int asn1PD_H245H263ModeComboFlags (OOCTXT* pctxt, H245H263ModeComboFlags*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -9227,8 +9227,8 @@ EXTERN int asn1PD_H245H263VideoModeCombos (OOCTXT* pctxt, H245H263VideoModeCombo
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -9337,8 +9337,8 @@ EXTERN int asn1PD_H245H263Options (OOCTXT* pctxt, H245H263Options* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -9737,8 +9737,8 @@ EXTERN int asn1PD_H245EnhancementOptions (OOCTXT* pctxt, H245EnhancementOptions*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -10086,8 +10086,8 @@ EXTERN int asn1PD_H245BEnhancementParameters (OOCTXT* pctxt, H245BEnhancementPar
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -10196,8 +10196,8 @@ EXTERN int asn1PD_H245EnhancementLayerInfo (OOCTXT* pctxt, H245EnhancementLayerI
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -10304,8 +10304,8 @@ EXTERN int asn1PD_H245H263VideoCapability (OOCTXT* pctxt, H245H263VideoCapabilit
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -10631,8 +10631,8 @@ EXTERN int asn1PD_H245IS11172VideoCapability (OOCTXT* pctxt, H245IS11172VideoCap
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -10808,7 +10808,7 @@ EXTERN int asn1PD_H245VideoCapability (OOCTXT* pctxt, H245VideoCapability* pvalu
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -10973,8 +10973,8 @@ EXTERN int asn1PD_H245IS11172AudioCapability (OOCTXT* pctxt, H245IS11172AudioCap
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -11114,8 +11114,8 @@ EXTERN int asn1PD_H245IS13818AudioCapability (OOCTXT* pctxt, H245IS13818AudioCap
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -11375,8 +11375,8 @@ EXTERN int asn1PD_H245G7231AnnexCCapability_g723AnnexCAudioMode (OOCTXT* pctxt,
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -11486,8 +11486,8 @@ EXTERN int asn1PD_H245G7231AnnexCCapability (OOCTXT* pctxt, H245G7231AnnexCCapab
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -11575,8 +11575,8 @@ EXTERN int asn1PD_H245GSMAudioCapability (OOCTXT* pctxt, H245GSMAudioCapability*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -11656,8 +11656,8 @@ EXTERN int asn1PD_H245G729Extensions (OOCTXT* pctxt, H245G729Extensions* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -11796,8 +11796,8 @@ EXTERN int asn1PD_H245VBDCapability (OOCTXT* pctxt, H245VBDCapability* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -11858,8 +11858,8 @@ EXTERN int asn1PD_H245NoPTAudioTelephonyEventCapability (OOCTXT* pctxt, H245NoPT
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -11919,8 +11919,8 @@ EXTERN int asn1PD_H245NoPTAudioToneCapability (OOCTXT* pctxt, H245NoPTAudioToneC
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -11968,7 +11968,7 @@ EXTERN int asn1PD_H245AudioCapability (OOCTXT* pctxt, H245AudioCapability* pvalu
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -12335,8 +12335,8 @@ EXTERN int asn1PD_H245Capability_h233EncryptionReceiveCapability (OOCTXT* pctxt,
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -12441,8 +12441,8 @@ EXTERN int asn1PD_H245ConferenceCapability (OOCTXT* pctxt, H245ConferenceCapabil
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -12554,7 +12554,7 @@ EXTERN int asn1PD_H245MediaEncryptionAlgorithm (OOCTXT* pctxt, H245MediaEncrypti
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -12667,8 +12667,8 @@ EXTERN int asn1PD_H245AuthenticationCapability (OOCTXT* pctxt, H245Authenticatio
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -12760,8 +12760,8 @@ EXTERN int asn1PD_H245IntegrityCapability (OOCTXT* pctxt, H245IntegrityCapabilit
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -12829,8 +12829,8 @@ EXTERN int asn1PD_H245EncryptionAuthenticationAndIntegrity (OOCTXT* pctxt, H245E
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -12926,8 +12926,8 @@ EXTERN int asn1PD_H245H235SecurityCapability (OOCTXT* pctxt, H245H235SecurityCap
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13033,7 +13033,7 @@ EXTERN int asn1PD_H245UserInputCapability (OOCTXT* pctxt, H245UserInputCapabilit
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -13164,7 +13164,7 @@ EXTERN int asn1PD_H245MultiplexFormat (OOCTXT* pctxt, H245MultiplexFormat* pvalu
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13321,8 +13321,8 @@ EXTERN int asn1PD_H245MultiplexedStreamCapability (OOCTXT* pctxt, H245Multiplexe
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13409,8 +13409,8 @@ EXTERN int asn1PD_H245AudioTelephonyEventCapability (OOCTXT* pctxt, H245AudioTel
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13480,8 +13480,8 @@ EXTERN int asn1PD_H245AudioToneCapability (OOCTXT* pctxt, H245AudioToneCapabilit
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13541,8 +13541,8 @@ EXTERN int asn1PD_H245FECCapability_rfc2733_separateStream (OOCTXT* pctxt, H245F
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13612,8 +13612,8 @@ EXTERN int asn1PD_H245FECCapability_rfc2733 (OOCTXT* pctxt, H245FECCapability_rf
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13680,7 +13680,7 @@ EXTERN int asn1PD_H245FECCapability (OOCTXT* pctxt, H245FECCapability* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13778,8 +13778,8 @@ EXTERN int asn1PD_H245MultiplePayloadStreamCapability (OOCTXT* pctxt, H245Multip
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -13836,7 +13836,7 @@ EXTERN int asn1PD_H245Capability (OOCTXT* pctxt, H245Capability* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -14222,7 +14222,7 @@ EXTERN int asn1PD_H245Capability (OOCTXT* pctxt, H245Capability* pvalue)
EXTERN int asn1PD_H245CapabilityTableEntry (OOCTXT* pctxt, H245CapabilityTableEntry* pvalue)
{
int stat = ASN_OK;
- ASN1BOOL optbit;
+ ASN1BOOL optbit = 0;
/* optional bits */
@@ -14360,7 +14360,7 @@ EXTERN int asn1PD_H245CapabilityDescriptor_simultaneousCapabilities (OOCTXT* pct
EXTERN int asn1PD_H245CapabilityDescriptor (OOCTXT* pctxt, H245CapabilityDescriptor* pvalue)
{
int stat = ASN_OK;
- ASN1BOOL optbit;
+ ASN1BOOL optbit = 0;
/* optional bits */
@@ -14445,8 +14445,8 @@ EXTERN int asn1PD_H245TerminalCapabilitySet (OOCTXT* pctxt, H245TerminalCapabili
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -14576,7 +14576,7 @@ EXTERN int asn1PD_H245EncryptionMode (OOCTXT* pctxt, H245EncryptionMode* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -14645,8 +14645,8 @@ EXTERN int asn1PD_H245RedundancyEncodingElement (OOCTXT* pctxt, H245RedundancyEn
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -14770,8 +14770,8 @@ EXTERN int asn1PD_H245RedundancyEncoding_rtpRedundancyEncoding (OOCTXT* pctxt, H
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -14854,8 +14854,8 @@ EXTERN int asn1PD_H245RedundancyEncoding (OOCTXT* pctxt, H245RedundancyEncoding*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -14957,8 +14957,8 @@ EXTERN int asn1PD_H245MultiplePayloadStreamElement (OOCTXT* pctxt, H245MultipleP
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15082,8 +15082,8 @@ EXTERN int asn1PD_H245MultiplePayloadStream (OOCTXT* pctxt, H245MultiplePayloadS
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15142,8 +15142,8 @@ EXTERN int asn1PD_H245FECData_rfc2733_mode_separateStream_differentPort (OOCTXT*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15222,8 +15222,8 @@ EXTERN int asn1PD_H245FECData_rfc2733_mode_separateStream_samePort (OOCTXT* pctx
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15281,7 +15281,7 @@ EXTERN int asn1PD_H245FECData_rfc2733_mode_separateStream (OOCTXT* pctxt, H245FE
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15350,7 +15350,7 @@ EXTERN int asn1PD_H245FECData_rfc2733_mode (OOCTXT* pctxt, H245FECData_rfc2733_m
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15419,8 +15419,8 @@ EXTERN int asn1PD_H245FECData_rfc2733 (OOCTXT* pctxt, H245FECData_rfc2733* pvalu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15513,7 +15513,7 @@ EXTERN int asn1PD_H245H235Media_mediaType (OOCTXT* pctxt, H245H235Media_mediaTyp
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -15658,8 +15658,8 @@ EXTERN int asn1PD_H245H235Media (OOCTXT* pctxt, H245H235Media* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15727,8 +15727,8 @@ EXTERN int asn1PD_H245MultiplexedStreamParameter (OOCTXT* pctxt, H245Multiplexed
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -15795,7 +15795,7 @@ EXTERN int asn1PD_H245DataType (OOCTXT* pctxt, H245DataType* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -16003,8 +16003,8 @@ EXTERN int asn1PD_H245H222LogicalChannelParameters (OOCTXT* pctxt, H245H222Logic
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16154,7 +16154,7 @@ EXTERN int asn1PD_H245H223AL1MParameters_transferMode (OOCTXT* pctxt, H245H223AL
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16219,7 +16219,7 @@ EXTERN int asn1PD_H245H223AL1MParameters_headerFEC (OOCTXT* pctxt, H245H223AL1MP
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16284,7 +16284,7 @@ EXTERN int asn1PD_H245H223AL1MParameters_crcLength (OOCTXT* pctxt, H245H223AL1MP
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -16424,7 +16424,7 @@ EXTERN int asn1PD_H245H223AnnexCArqParameters_numberOfRetransmissions (OOCTXT* p
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16492,8 +16492,8 @@ EXTERN int asn1PD_H245H223AnnexCArqParameters (OOCTXT* pctxt, H245H223AnnexCArqP
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16560,7 +16560,7 @@ EXTERN int asn1PD_H245H223AL1MParameters_arqType (OOCTXT* pctxt, H245H223AL1MPar
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16643,8 +16643,8 @@ EXTERN int asn1PD_H245H223AL1MParameters (OOCTXT* pctxt, H245H223AL1MParameters*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16786,7 +16786,7 @@ EXTERN int asn1PD_H245H223AL2MParameters_headerFEC (OOCTXT* pctxt, H245H223AL2MP
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16853,8 +16853,8 @@ EXTERN int asn1PD_H245H223AL2MParameters (OOCTXT* pctxt, H245H223AL2MParameters*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16921,7 +16921,7 @@ EXTERN int asn1PD_H245H223AL3MParameters_headerFormat (OOCTXT* pctxt, H245H223AL
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -16986,7 +16986,7 @@ EXTERN int asn1PD_H245H223AL3MParameters_crcLength (OOCTXT* pctxt, H245H223AL3MP
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -17126,7 +17126,7 @@ EXTERN int asn1PD_H245H223AL3MParameters_arqType (OOCTXT* pctxt, H245H223AL3MPar
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -17209,8 +17209,8 @@ EXTERN int asn1PD_H245H223AL3MParameters (OOCTXT* pctxt, H245H223AL3MParameters*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -17333,7 +17333,7 @@ EXTERN int asn1PD_H245H223LogicalChannelParameters_adaptationLayerType (OOCTXT*
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -17496,8 +17496,8 @@ EXTERN int asn1PD_H245H223LogicalChannelParameters (OOCTXT* pctxt, H245H223Logic
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -17564,7 +17564,7 @@ EXTERN int asn1PD_H245CRCLength (OOCTXT* pctxt, H245CRCLength* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -17642,8 +17642,8 @@ EXTERN int asn1PD_H245V76HDLCParameters (OOCTXT* pctxt, H245V76HDLCParameters* p
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -17720,7 +17720,7 @@ EXTERN int asn1PD_H245V76LogicalChannelParameters_suspendResume (OOCTXT* pctxt,
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -17796,7 +17796,7 @@ EXTERN int asn1PD_H245V76LogicalChannelParameters_mode_eRM_recovery (OOCTXT* pct
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -17874,8 +17874,8 @@ EXTERN int asn1PD_H245V76LogicalChannelParameters_mode_eRM (OOCTXT* pctxt, H245V
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -17942,7 +17942,7 @@ EXTERN int asn1PD_H245V76LogicalChannelParameters_mode (OOCTXT* pctxt, H245V76Lo
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -18011,8 +18011,8 @@ EXTERN int asn1PD_H245V75Parameters (OOCTXT* pctxt, H245V75Parameters* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -18072,8 +18072,8 @@ EXTERN int asn1PD_H245V76LogicalChannelParameters (OOCTXT* pctxt, H245V76Logical
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -18192,8 +18192,8 @@ EXTERN int asn1PD_H245UnicastAddress_iPAddress (OOCTXT* pctxt, H245UnicastAddres
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -18331,8 +18331,8 @@ EXTERN int asn1PD_H245UnicastAddress_iPXAddress (OOCTXT* pctxt, H245UnicastAddre
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -18432,8 +18432,8 @@ EXTERN int asn1PD_H245UnicastAddress_iP6Address (OOCTXT* pctxt, H245UnicastAddre
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -18648,8 +18648,8 @@ EXTERN int asn1PD_H245UnicastAddress_iPSourceRouteAddress (OOCTXT* pctxt, H245Un
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -18757,7 +18757,7 @@ EXTERN int asn1PD_H245UnicastAddress (OOCTXT* pctxt, H245UnicastAddress* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -18925,8 +18925,8 @@ EXTERN int asn1PD_H245MulticastAddress_iPAddress (OOCTXT* pctxt, H245MulticastAd
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -19018,8 +19018,8 @@ EXTERN int asn1PD_H245MulticastAddress_iP6Address (OOCTXT* pctxt, H245MulticastA
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -19109,7 +19109,7 @@ EXTERN int asn1PD_H245MulticastAddress (OOCTXT* pctxt, H245MulticastAddress* pva
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -19213,7 +19213,7 @@ EXTERN int asn1PD_H245TransportAddress (OOCTXT* pctxt, H245TransportAddress* pva
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -19318,8 +19318,8 @@ EXTERN int asn1PD_H245TerminalLabel (OOCTXT* pctxt, H245TerminalLabel* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -19385,7 +19385,7 @@ EXTERN int asn1PD_H245H2250LogicalChannelParameters_mediaPacketization (OOCTXT*
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -19464,8 +19464,8 @@ EXTERN int asn1PD_H245H2250LogicalChannelParameters (OOCTXT* pctxt, H245H2250Log
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -19717,7 +19717,7 @@ EXTERN int asn1PD_H245OpenLogicalChannel_forwardLogicalChannelParameters_multipl
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -19835,8 +19835,8 @@ EXTERN int asn1PD_H245OpenLogicalChannel_forwardLogicalChannelParameters (OOCTXT
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -19955,7 +19955,7 @@ EXTERN int asn1PD_H245OpenLogicalChannel_reverseLogicalChannelParameters_multipl
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -20049,8 +20049,8 @@ EXTERN int asn1PD_H245OpenLogicalChannel_reverseLogicalChannelParameters (OOCTXT
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -20159,7 +20159,7 @@ EXTERN int asn1PD_H245NetworkAccessParameters_distribution (OOCTXT* pctxt, H245N
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -20227,7 +20227,7 @@ EXTERN int asn1PD_H245NetworkAccessParameters_networkAddress (OOCTXT* pctxt, H24
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -20333,7 +20333,7 @@ EXTERN int asn1PD_H245NetworkAccessParameters_t120SetupProcedure (OOCTXT* pctxt,
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -20412,8 +20412,8 @@ EXTERN int asn1PD_H245NetworkAccessParameters (OOCTXT* pctxt, H245NetworkAccessP
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -20561,8 +20561,8 @@ EXTERN int asn1PD_H245EscrowData (OOCTXT* pctxt, H245EscrowData* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -20672,8 +20672,8 @@ EXTERN int asn1PD_H245EncryptionSync (OOCTXT* pctxt, H245EncryptionSync* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -20778,8 +20778,8 @@ EXTERN int asn1PD_H245OpenLogicalChannel (OOCTXT* pctxt, H245OpenLogicalChannel*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -20942,7 +20942,7 @@ EXTERN int asn1PD_H245CloseLogicalChannel_reason (OOCTXT* pctxt, H245CloseLogica
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -21021,8 +21021,8 @@ EXTERN int asn1PD_H245CloseLogicalChannel (OOCTXT* pctxt, H245CloseLogicalChanne
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -21113,7 +21113,7 @@ EXTERN int asn1PD_H245RequestChannelClose_reason (OOCTXT* pctxt, H245RequestChan
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -21203,8 +21203,8 @@ EXTERN int asn1PD_H245RequestChannelClose (OOCTXT* pctxt, H245RequestChannelClos
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -21519,7 +21519,7 @@ EXTERN int asn1PD_H245MultiplexEntryDescriptor_elementList (OOCTXT* pctxt, H245M
EXTERN int asn1PD_H245MultiplexEntryDescriptor (OOCTXT* pctxt, H245MultiplexEntryDescriptor* pvalue)
{
int stat = ASN_OK;
- ASN1BOOL optbit;
+ ASN1BOOL optbit = 0;
/* optional bits */
@@ -21604,8 +21604,8 @@ EXTERN int asn1PD_H245MultiplexEntrySend (OOCTXT* pctxt, H245MultiplexEntrySend*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -21706,8 +21706,8 @@ EXTERN int asn1PD_H245RequestMultiplexEntry (OOCTXT* pctxt, H245RequestMultiplex
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -21811,8 +21811,8 @@ EXTERN int asn1PD_H245H261VideoMode (OOCTXT* pctxt, H245H261VideoMode* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -21889,7 +21889,7 @@ EXTERN int asn1PD_H245H262VideoMode_profileAndLevel (OOCTXT* pctxt, H245H262Vide
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -22055,8 +22055,8 @@ EXTERN int asn1PD_H245H262VideoMode (OOCTXT* pctxt, H245H262VideoMode* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -22207,7 +22207,7 @@ EXTERN int asn1PD_H245H263VideoMode_resolution (OOCTXT* pctxt, H245H263VideoMode
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -22328,8 +22328,8 @@ EXTERN int asn1PD_H245H263VideoMode (OOCTXT* pctxt, H245H263VideoMode* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -22488,8 +22488,8 @@ EXTERN int asn1PD_H245IS11172VideoMode (OOCTXT* pctxt, H245IS11172VideoMode* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -22641,7 +22641,7 @@ EXTERN int asn1PD_H245VideoMode (OOCTXT* pctxt, H245VideoMode* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -23008,8 +23008,8 @@ EXTERN int asn1PD_H245IS11172AudioMode (OOCTXT* pctxt, H245IS11172AudioMode* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -23374,8 +23374,8 @@ EXTERN int asn1PD_H245IS13818AudioMode (OOCTXT* pctxt, H245IS13818AudioMode* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -23482,8 +23482,8 @@ EXTERN int asn1PD_H245G7231AnnexCMode_g723AnnexCAudioMode (OOCTXT* pctxt, H245G7
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -23593,8 +23593,8 @@ EXTERN int asn1PD_H245G7231AnnexCMode (OOCTXT* pctxt, H245G7231AnnexCMode* pvalu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -23673,8 +23673,8 @@ EXTERN int asn1PD_H245VBDMode (OOCTXT* pctxt, H245VBDMode* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -23733,7 +23733,7 @@ EXTERN int asn1PD_H245AudioMode (OOCTXT* pctxt, H245AudioMode* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -24125,7 +24125,7 @@ EXTERN int asn1PD_H245DataMode_application (OOCTXT* pctxt, H245DataMode_applicat
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -24359,8 +24359,8 @@ EXTERN int asn1PD_H245DataMode (OOCTXT* pctxt, H245DataMode* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -24427,7 +24427,7 @@ EXTERN int asn1PD_H245H235Mode_mediaMode (OOCTXT* pctxt, H245H235Mode_mediaMode*
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -24524,8 +24524,8 @@ EXTERN int asn1PD_H245H235Mode (OOCTXT* pctxt, H245H235Mode* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -24591,7 +24591,7 @@ EXTERN int asn1PD_H245RedundancyEncodingDTModeElement_type (OOCTXT* pctxt, H245R
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -24714,8 +24714,8 @@ EXTERN int asn1PD_H245RedundancyEncodingDTModeElement (OOCTXT* pctxt, H245Redund
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -24818,8 +24818,8 @@ EXTERN int asn1PD_H245RedundancyEncodingDTMode (OOCTXT* pctxt, H245RedundancyEnc
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -24896,8 +24896,8 @@ EXTERN int asn1PD_H245MultiplePayloadStreamElementMode (OOCTXT* pctxt, H245Multi
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25002,8 +25002,8 @@ EXTERN int asn1PD_H245MultiplePayloadStreamMode (OOCTXT* pctxt, H245MultiplePayl
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25062,8 +25062,8 @@ EXTERN int asn1PD_H245FECMode_rfc2733Mode_mode_separateStream_differentPort (OOC
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25142,8 +25142,8 @@ EXTERN int asn1PD_H245FECMode_rfc2733Mode_mode_separateStream_samePort (OOCTXT*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25202,7 +25202,7 @@ EXTERN int asn1PD_H245FECMode_rfc2733Mode_mode_separateStream (OOCTXT* pctxt, H2
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25271,7 +25271,7 @@ EXTERN int asn1PD_H245FECMode_rfc2733Mode_mode (OOCTXT* pctxt, H245FECMode_rfc27
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25340,8 +25340,8 @@ EXTERN int asn1PD_H245FECMode_rfc2733Mode (OOCTXT* pctxt, H245FECMode_rfc2733Mod
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25398,7 +25398,7 @@ EXTERN int asn1PD_H245FECMode (OOCTXT* pctxt, H245FECMode* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25454,7 +25454,7 @@ EXTERN int asn1PD_H245ModeElementType (OOCTXT* pctxt, H245ModeElementType* pvalu
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -25669,7 +25669,7 @@ EXTERN int asn1PD_H245H223ModeParameters_adaptationLayerType (OOCTXT* pctxt, H24
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -25832,8 +25832,8 @@ EXTERN int asn1PD_H245H223ModeParameters (OOCTXT* pctxt, H245H223ModeParameters*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25900,7 +25900,7 @@ EXTERN int asn1PD_H245V76ModeParameters (OOCTXT* pctxt, H245V76ModeParameters* p
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -25965,7 +25965,7 @@ EXTERN int asn1PD_H245RedundancyEncodingMode_secondaryEncoding (OOCTXT* pctxt, H
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26036,8 +26036,8 @@ EXTERN int asn1PD_H245RedundancyEncodingMode (OOCTXT* pctxt, H245RedundancyEncod
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26114,8 +26114,8 @@ EXTERN int asn1PD_H245H2250ModeParameters (OOCTXT* pctxt, H245H2250ModeParameter
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26183,8 +26183,8 @@ EXTERN int asn1PD_H245MultiplexedStreamModeParameters (OOCTXT* pctxt, H245Multip
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26244,8 +26244,8 @@ EXTERN int asn1PD_H245ModeElement (OOCTXT* pctxt, H245ModeElement* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26458,8 +26458,8 @@ EXTERN int asn1PD_H245RequestMode (OOCTXT* pctxt, H245RequestMode* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26527,8 +26527,8 @@ EXTERN int asn1PD_H245RoundTripDelayRequest (OOCTXT* pctxt, H245RoundTripDelayRe
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26585,7 +26585,7 @@ EXTERN int asn1PD_H245MaintenanceLoopRequest_type (OOCTXT* pctxt, H245Maintenanc
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26663,8 +26663,8 @@ EXTERN int asn1PD_H245MaintenanceLoopRequest (OOCTXT* pctxt, H245MaintenanceLoop
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26723,8 +26723,8 @@ EXTERN int asn1PD_H245CommunicationModeRequest (OOCTXT* pctxt, H245Communication
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26775,8 +26775,8 @@ EXTERN int asn1PD_H245Criteria (OOCTXT* pctxt, H245Criteria* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26888,8 +26888,8 @@ EXTERN int asn1PD_H245ConferenceRequest_requestTerminalCertificate (OOCTXT* pctx
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -26984,7 +26984,7 @@ EXTERN int asn1PD_H245RemoteMCRequest (OOCTXT* pctxt, H245RemoteMCRequest* pvalu
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -27060,7 +27060,7 @@ EXTERN int asn1PD_H245ConferenceRequest (OOCTXT* pctxt, H245ConferenceRequest* p
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -27302,8 +27302,8 @@ EXTERN int asn1PD_H245MultilinkRequest_callInformation (OOCTXT* pctxt, H245Multi
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -27361,7 +27361,7 @@ EXTERN int asn1PD_H245DialingInformationNetworkType (OOCTXT* pctxt, H245DialingI
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -27503,8 +27503,8 @@ EXTERN int asn1PD_H245DialingInformationNumber (OOCTXT* pctxt, H245DialingInform
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -27634,7 +27634,7 @@ EXTERN int asn1PD_H245DialingInformation (OOCTXT* pctxt, H245DialingInformation*
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -27717,8 +27717,8 @@ EXTERN int asn1PD_H245MultilinkRequest_addConnection (OOCTXT* pctxt, H245Multili
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -27786,8 +27786,8 @@ EXTERN int asn1PD_H245ConnectionIdentifier (OOCTXT* pctxt, H245ConnectionIdentif
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -27857,8 +27857,8 @@ EXTERN int asn1PD_H245MultilinkRequest_removeConnection (OOCTXT* pctxt, H245Mult
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -27915,7 +27915,7 @@ EXTERN int asn1PD_H245MultilinkRequest_maximumHeaderInterval_requestType (OOCTXT
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -27983,8 +27983,8 @@ EXTERN int asn1PD_H245MultilinkRequest_maximumHeaderInterval (OOCTXT* pctxt, H24
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -28041,7 +28041,7 @@ EXTERN int asn1PD_H245MultilinkRequest (OOCTXT* pctxt, H245MultilinkRequest* pva
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -28168,8 +28168,8 @@ EXTERN int asn1PD_H245LogicalChannelRateRequest (OOCTXT* pctxt, H245LogicalChann
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -28244,7 +28244,7 @@ EXTERN int asn1PD_H245RequestMessage (OOCTXT* pctxt, H245RequestMessage* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -28538,8 +28538,8 @@ EXTERN int asn1PD_H245MasterSlaveDeterminationAck (OOCTXT* pctxt, H245MasterSlav
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -28596,7 +28596,7 @@ EXTERN int asn1PD_H245MasterSlaveDeterminationReject_cause (OOCTXT* pctxt, H245M
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -28652,8 +28652,8 @@ EXTERN int asn1PD_H245MasterSlaveDeterminationReject (OOCTXT* pctxt, H245MasterS
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -28712,8 +28712,8 @@ EXTERN int asn1PD_H245TerminalCapabilitySetAck (OOCTXT* pctxt, H245TerminalCapab
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -28815,7 +28815,7 @@ EXTERN int asn1PD_H245TerminalCapabilitySetReject_cause (OOCTXT* pctxt, H245Term
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -28906,8 +28906,8 @@ EXTERN int asn1PD_H245TerminalCapabilitySetReject (OOCTXT* pctxt, H245TerminalCa
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -28973,7 +28973,7 @@ EXTERN int asn1PD_H245OpenLogicalChannelAck_reverseLogicalChannelParameters_mult
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -29054,8 +29054,8 @@ EXTERN int asn1PD_H245OpenLogicalChannelAck_reverseLogicalChannelParameters (OOC
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -29171,8 +29171,8 @@ EXTERN int asn1PD_H245H2250LogicalChannelAckParameters (OOCTXT* pctxt, H245H2250
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -29332,7 +29332,7 @@ EXTERN int asn1PD_H245OpenLogicalChannelAck_forwardMultiplexAckParameters (OOCTX
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -29391,8 +29391,8 @@ EXTERN int asn1PD_H245OpenLogicalChannelAck (OOCTXT* pctxt, H245OpenLogicalChann
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -29512,7 +29512,7 @@ EXTERN int asn1PD_H245OpenLogicalChannelReject_cause (OOCTXT* pctxt, H245OpenLog
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -29720,8 +29720,8 @@ EXTERN int asn1PD_H245OpenLogicalChannelReject (OOCTXT* pctxt, H245OpenLogicalCh
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -29789,8 +29789,8 @@ EXTERN int asn1PD_H245CloseLogicalChannelAck (OOCTXT* pctxt, H245CloseLogicalCha
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -29849,8 +29849,8 @@ EXTERN int asn1PD_H245RequestChannelCloseAck (OOCTXT* pctxt, H245RequestChannelC
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -29907,7 +29907,7 @@ EXTERN int asn1PD_H245RequestChannelCloseReject_cause (OOCTXT* pctxt, H245Reques
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -29963,8 +29963,8 @@ EXTERN int asn1PD_H245RequestChannelCloseReject (OOCTXT* pctxt, H245RequestChann
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -30065,8 +30065,8 @@ EXTERN int asn1PD_H245MultiplexEntrySendAck (OOCTXT* pctxt, H245MultiplexEntrySe
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -30132,7 +30132,7 @@ EXTERN int asn1PD_H245MultiplexEntryRejectionDescriptions_cause (OOCTXT* pctxt,
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -30199,8 +30199,8 @@ EXTERN int asn1PD_H245MultiplexEntryRejectionDescriptions (OOCTXT* pctxt, H245Mu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -30308,8 +30308,8 @@ EXTERN int asn1PD_H245MultiplexEntrySendReject (OOCTXT* pctxt, H245MultiplexEntr
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -30410,8 +30410,8 @@ EXTERN int asn1PD_H245RequestMultiplexEntryAck (OOCTXT* pctxt, H245RequestMultip
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -30501,7 +30501,7 @@ EXTERN int asn1PD_H245RequestMultiplexEntryRejectionDescriptions_cause (OOCTXT*
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -30557,8 +30557,8 @@ EXTERN int asn1PD_H245RequestMultiplexEntryRejectionDescriptions (OOCTXT* pctxt,
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -30666,8 +30666,8 @@ EXTERN int asn1PD_H245RequestMultiplexEntryReject (OOCTXT* pctxt, H245RequestMul
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -30733,7 +30733,7 @@ EXTERN int asn1PD_H245RequestModeAck_response (OOCTXT* pctxt, H245RequestModeAck
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -30800,8 +30800,8 @@ EXTERN int asn1PD_H245RequestModeAck (OOCTXT* pctxt, H245RequestModeAck* pvalue)
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -30867,7 +30867,7 @@ EXTERN int asn1PD_H245RequestModeReject_cause (OOCTXT* pctxt, H245RequestModeRej
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -30945,8 +30945,8 @@ EXTERN int asn1PD_H245RequestModeReject (OOCTXT* pctxt, H245RequestModeReject* p
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -31014,8 +31014,8 @@ EXTERN int asn1PD_H245RoundTripDelayResponse (OOCTXT* pctxt, H245RoundTripDelayR
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -31072,7 +31072,7 @@ EXTERN int asn1PD_H245MaintenanceLoopAck_type (OOCTXT* pctxt, H245MaintenanceLoo
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -31150,8 +31150,8 @@ EXTERN int asn1PD_H245MaintenanceLoopAck (OOCTXT* pctxt, H245MaintenanceLoopAck*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -31208,7 +31208,7 @@ EXTERN int asn1PD_H245MaintenanceLoopReject_type (OOCTXT* pctxt, H245Maintenance
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -31284,7 +31284,7 @@ EXTERN int asn1PD_H245MaintenanceLoopReject_cause (OOCTXT* pctxt, H245Maintenanc
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -31340,8 +31340,8 @@ EXTERN int asn1PD_H245MaintenanceLoopReject (OOCTXT* pctxt, H245MaintenanceLoopR
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -31407,7 +31407,7 @@ EXTERN int asn1PD_H245CommunicationModeTableEntry_dataType (OOCTXT* pctxt, H245C
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -31493,8 +31493,8 @@ EXTERN int asn1PD_H245CommunicationModeTableEntry (OOCTXT* pctxt, H245Communicat
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -31764,7 +31764,7 @@ EXTERN int asn1PD_H245CommunicationModeResponse (OOCTXT* pctxt, H245Communicatio
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -31845,8 +31845,8 @@ EXTERN int asn1PD_H245ConferenceResponse_mCTerminalIDResponse (OOCTXT* pctxt, H2
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -31914,8 +31914,8 @@ EXTERN int asn1PD_H245ConferenceResponse_terminalIDResponse (OOCTXT* pctxt, H245
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32006,8 +32006,8 @@ EXTERN int asn1PD_H245ConferenceResponse_conferenceIDResponse (OOCTXT* pctxt, H2
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32098,8 +32098,8 @@ EXTERN int asn1PD_H245ConferenceResponse_passwordResponse (OOCTXT* pctxt, H245Co
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32205,7 +32205,7 @@ EXTERN int asn1PD_H245ConferenceResponse_makeMeChairResponse (OOCTXT* pctxt, H24
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32272,8 +32272,8 @@ EXTERN int asn1PD_H245ConferenceResponse_extensionAddressResponse (OOCTXT* pctxt
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32332,8 +32332,8 @@ EXTERN int asn1PD_H245ConferenceResponse_chairTokenOwnerResponse (OOCTXT* pctxt,
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32402,8 +32402,8 @@ EXTERN int asn1PD_H245ConferenceResponse_terminalCertificateResponse (OOCTXT* pc
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32486,7 +32486,7 @@ EXTERN int asn1PD_H245ConferenceResponse_broadcastMyLogicalChannelResponse (OOCT
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32551,7 +32551,7 @@ EXTERN int asn1PD_H245ConferenceResponse_makeTerminalBroadcasterResponse (OOCTXT
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32616,7 +32616,7 @@ EXTERN int asn1PD_H245ConferenceResponse_sendThisSourceResponse (OOCTXT* pctxt,
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32683,8 +32683,8 @@ EXTERN int asn1PD_H245TerminalInformation (OOCTXT* pctxt, H245TerminalInformatio
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32796,8 +32796,8 @@ EXTERN int asn1PD_H245RequestAllTerminalIDsResponse (OOCTXT* pctxt, H245RequestA
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32854,7 +32854,7 @@ EXTERN int asn1PD_H245RemoteMCResponse_reject (OOCTXT* pctxt, H245RemoteMCRespon
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32919,7 +32919,7 @@ EXTERN int asn1PD_H245RemoteMCResponse (OOCTXT* pctxt, H245RemoteMCResponse* pva
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -32986,7 +32986,7 @@ EXTERN int asn1PD_H245ConferenceResponse (OOCTXT* pctxt, H245ConferenceResponse*
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -33244,8 +33244,8 @@ EXTERN int asn1PD_H245MultilinkResponse_callInformation (OOCTXT* pctxt, H245Mult
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -33312,7 +33312,7 @@ EXTERN int asn1PD_H245MultilinkResponse_addConnection_responseCode_rejected (OOC
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -33377,7 +33377,7 @@ EXTERN int asn1PD_H245MultilinkResponse_addConnection_responseCode (OOCTXT* pctx
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -33446,8 +33446,8 @@ EXTERN int asn1PD_H245MultilinkResponse_addConnection (OOCTXT* pctxt, H245Multil
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -33515,8 +33515,8 @@ EXTERN int asn1PD_H245MultilinkResponse_removeConnection (OOCTXT* pctxt, H245Mul
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -33575,8 +33575,8 @@ EXTERN int asn1PD_H245MultilinkResponse_maximumHeaderInterval (OOCTXT* pctxt, H2
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -33634,7 +33634,7 @@ EXTERN int asn1PD_H245MultilinkResponse (OOCTXT* pctxt, H245MultilinkResponse* p
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -33744,8 +33744,8 @@ EXTERN int asn1PD_H245LogicalChannelRateAcknowledge (OOCTXT* pctxt, H245LogicalC
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -33820,7 +33820,7 @@ EXTERN int asn1PD_H245LogicalChannelRateRejectReason (OOCTXT* pctxt, H245Logical
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -33887,8 +33887,8 @@ EXTERN int asn1PD_H245LogicalChannelRateReject (OOCTXT* pctxt, H245LogicalChanne
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -33981,7 +33981,7 @@ EXTERN int asn1PD_H245ResponseMessage (OOCTXT* pctxt, H245ResponseMessage* pvalu
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -34347,8 +34347,8 @@ EXTERN int asn1PD_H245MaintenanceLoopOffCommand (OOCTXT* pctxt, H245MaintenanceL
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -34466,8 +34466,8 @@ EXTERN int asn1PD_H245SendTerminalCapabilitySet_specificRequest (OOCTXT* pctxt,
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -34557,7 +34557,7 @@ EXTERN int asn1PD_H245SendTerminalCapabilitySet (OOCTXT* pctxt, H245SendTerminal
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -34655,7 +34655,7 @@ EXTERN int asn1PD_H245EncryptionCommand (OOCTXT* pctxt, H245EncryptionCommand* p
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -34841,8 +34841,8 @@ EXTERN int asn1PD_H245FlowControlCommand (OOCTXT* pctxt, H245FlowControlCommand*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -34908,7 +34908,7 @@ EXTERN int asn1PD_H245EndSessionCommand_gstnOptions (OOCTXT* pctxt, H245EndSessi
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -35006,7 +35006,7 @@ EXTERN int asn1PD_H245EndSessionCommand_isdnOptions (OOCTXT* pctxt, H245EndSessi
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -35082,7 +35082,7 @@ EXTERN int asn1PD_H245EndSessionCommand (OOCTXT* pctxt, H245EndSessionCommand* p
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -35219,8 +35219,8 @@ EXTERN int asn1PD_H245MiscellaneousCommand_type_videoFastUpdateMB (OOCTXT* pctxt
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -35314,8 +35314,8 @@ EXTERN int asn1PD_H245KeyProtectionMethod (OOCTXT* pctxt, H245KeyProtectionMetho
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -35395,8 +35395,8 @@ EXTERN int asn1PD_H245EncryptionUpdateRequest (OOCTXT* pctxt, H245EncryptionUpda
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -35462,7 +35462,7 @@ EXTERN int asn1PD_H245MiscellaneousCommand_type_progressiveRefinementStart_repea
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -35551,8 +35551,8 @@ EXTERN int asn1PD_H245MiscellaneousCommand_type_progressiveRefinementStart (OOCT
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -35611,8 +35611,8 @@ EXTERN int asn1PD_H245MiscellaneousCommand_type_videoBadMBs (OOCTXT* pctxt, H245
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -35690,7 +35690,7 @@ EXTERN int asn1PD_H245PictureReference (OOCTXT* pctxt, H245PictureReference* pva
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -35803,8 +35803,8 @@ EXTERN int asn1PD_H245MiscellaneousCommand_type_lostPartialPicture (OOCTXT* pctx
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -35881,7 +35881,7 @@ EXTERN int asn1PD_H245MiscellaneousCommand_type (OOCTXT* pctxt, H245Miscellaneou
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -36208,8 +36208,8 @@ EXTERN int asn1PD_H245MiscellaneousCommand (OOCTXT* pctxt, H245MiscellaneousComm
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -36317,8 +36317,8 @@ EXTERN int asn1PD_H245CommunicationModeCommand (OOCTXT* pctxt, H245Communication
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -36400,8 +36400,8 @@ EXTERN int asn1PD_H245SubstituteConferenceIDCommand (OOCTXT* pctxt, H245Substitu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -36458,7 +36458,7 @@ EXTERN int asn1PD_H245ConferenceCommand (OOCTXT* pctxt, H245ConferenceCommand* p
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -36604,7 +36604,7 @@ EXTERN int asn1PD_H245H223MultiplexReconfiguration_h223ModeChange (OOCTXT* pctxt
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -36691,7 +36691,7 @@ EXTERN int asn1PD_H245H223MultiplexReconfiguration_h223AnnexADoubleFlag (OOCTXT*
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -36756,7 +36756,7 @@ EXTERN int asn1PD_H245H223MultiplexReconfiguration (OOCTXT* pctxt, H245H223Multi
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -36825,7 +36825,7 @@ EXTERN int asn1PD_H245NewATMVCCommand_aal_aal1_clockRecovery (OOCTXT* pctxt, H24
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -36901,7 +36901,7 @@ EXTERN int asn1PD_H245NewATMVCCommand_aal_aal1_errorCorrection (OOCTXT* pctxt, H
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -36990,8 +36990,8 @@ EXTERN int asn1PD_H245NewATMVCCommand_aal_aal1 (OOCTXT* pctxt, H245NewATMVCComma
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -37079,8 +37079,8 @@ EXTERN int asn1PD_H245NewATMVCCommand_aal_aal5 (OOCTXT* pctxt, H245NewATMVCComma
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -37148,7 +37148,7 @@ EXTERN int asn1PD_H245NewATMVCCommand_aal (OOCTXT* pctxt, H245NewATMVCCommand_aa
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -37217,7 +37217,7 @@ EXTERN int asn1PD_H245NewATMVCCommand_multiplex (OOCTXT* pctxt, H245NewATMVCComm
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -37293,7 +37293,7 @@ EXTERN int asn1PD_H245NewATMVCCommand_reverseParameters_multiplex (OOCTXT* pctxt
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -37371,8 +37371,8 @@ EXTERN int asn1PD_H245NewATMVCCommand_reverseParameters (OOCTXT* pctxt, H245NewA
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -37461,8 +37461,8 @@ EXTERN int asn1PD_H245NewATMVCCommand (OOCTXT* pctxt, H245NewATMVCCommand* pvalu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -37577,7 +37577,7 @@ EXTERN int asn1PD_H245MobileMultilinkReconfigurationCommand_status (OOCTXT* pctx
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -37644,8 +37644,8 @@ EXTERN int asn1PD_H245MobileMultilinkReconfigurationCommand (OOCTXT* pctxt, H245
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -37722,7 +37722,7 @@ EXTERN int asn1PD_H245CommandMessage (OOCTXT* pctxt, H245CommandMessage* pvalue)
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -37994,8 +37994,8 @@ EXTERN int asn1PD_H245MasterSlaveDeterminationRelease (OOCTXT* pctxt, H245Master
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -38045,8 +38045,8 @@ EXTERN int asn1PD_H245TerminalCapabilitySetRelease (OOCTXT* pctxt, H245TerminalC
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -38096,8 +38096,8 @@ EXTERN int asn1PD_H245OpenLogicalChannelConfirm (OOCTXT* pctxt, H245OpenLogicalC
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -38156,8 +38156,8 @@ EXTERN int asn1PD_H245RequestChannelCloseRelease (OOCTXT* pctxt, H245RequestChan
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -38249,8 +38249,8 @@ EXTERN int asn1PD_H245MultiplexEntrySendRelease (OOCTXT* pctxt, H245MultiplexEnt
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -38342,8 +38342,8 @@ EXTERN int asn1PD_H245RequestMultiplexEntryRelease (OOCTXT* pctxt, H245RequestMu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -38402,8 +38402,8 @@ EXTERN int asn1PD_H245RequestModeRelease (OOCTXT* pctxt, H245RequestModeRelease*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -38453,8 +38453,8 @@ EXTERN int asn1PD_H245MiscellaneousIndication_type_videoNotDecodedMBs (OOCTXT* p
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -38532,7 +38532,7 @@ EXTERN int asn1PD_H245MiscellaneousIndication_type (OOCTXT* pctxt, H245Miscellan
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -38723,8 +38723,8 @@ EXTERN int asn1PD_H245MiscellaneousIndication (OOCTXT* pctxt, H245MiscellaneousI
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -38849,8 +38849,8 @@ EXTERN int asn1PD_H245JitterIndication (OOCTXT* pctxt, H245JitterIndication* pva
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -38963,8 +38963,8 @@ EXTERN int asn1PD_H245H223SkewIndication (OOCTXT* pctxt, H245H223SkewIndication*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -39040,7 +39040,7 @@ EXTERN int asn1PD_H245NewATMVCIndication_aal_aal1_clockRecovery (OOCTXT* pctxt,
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -39116,7 +39116,7 @@ EXTERN int asn1PD_H245NewATMVCIndication_aal_aal1_errorCorrection (OOCTXT* pctxt
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -39205,8 +39205,8 @@ EXTERN int asn1PD_H245NewATMVCIndication_aal_aal1 (OOCTXT* pctxt, H245NewATMVCIn
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -39294,8 +39294,8 @@ EXTERN int asn1PD_H245NewATMVCIndication_aal_aal5 (OOCTXT* pctxt, H245NewATMVCIn
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -39363,7 +39363,7 @@ EXTERN int asn1PD_H245NewATMVCIndication_aal (OOCTXT* pctxt, H245NewATMVCIndicat
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -39432,7 +39432,7 @@ EXTERN int asn1PD_H245NewATMVCIndication_multiplex (OOCTXT* pctxt, H245NewATMVCI
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -39508,7 +39508,7 @@ EXTERN int asn1PD_H245NewATMVCIndication_reverseParameters_multiplex (OOCTXT* pc
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -39586,8 +39586,8 @@ EXTERN int asn1PD_H245NewATMVCIndication_reverseParameters (OOCTXT* pctxt, H245N
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -39677,8 +39677,8 @@ EXTERN int asn1PD_H245NewATMVCIndication (OOCTXT* pctxt, H245NewATMVCIndication*
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -39809,7 +39809,7 @@ EXTERN int asn1PD_H245UserInputIndication_userInputSupportIndication (OOCTXT* pc
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -39900,8 +39900,8 @@ EXTERN int asn1PD_H245UserInputIndication_signal_rtp (OOCTXT* pctxt, H245UserInp
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -39998,8 +39998,8 @@ EXTERN int asn1PD_H245UserInputIndication_signal (OOCTXT* pctxt, H245UserInputIn
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -40117,8 +40117,8 @@ EXTERN int asn1PD_H245UserInputIndication_signalUpdate_rtp (OOCTXT* pctxt, H245U
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -40177,8 +40177,8 @@ EXTERN int asn1PD_H245UserInputIndication_signalUpdate (OOCTXT* pctxt, H245UserI
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -40256,8 +40256,8 @@ EXTERN int asn1PD_H245UserInputIndication_extendedAlphanumeric (OOCTXT* pctxt, H
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -40333,7 +40333,7 @@ EXTERN int asn1PD_H245UserInputIndication (OOCTXT* pctxt, H245UserInputIndicatio
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -40464,8 +40464,8 @@ EXTERN int asn1PD_H245H2250MaximumSkewIndication (OOCTXT* pctxt, H245H2250Maximu
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -40543,8 +40543,8 @@ EXTERN int asn1PD_H245MCLocationIndication (OOCTXT* pctxt, H245MCLocationIndicat
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -40603,8 +40603,8 @@ EXTERN int asn1PD_H245TerminalYouAreSeeingInSubPictureNumber (OOCTXT* pctxt, H24
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -40673,8 +40673,8 @@ EXTERN int asn1PD_H245VideoIndicateCompose (OOCTXT* pctxt, H245VideoIndicateComp
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -40732,7 +40732,7 @@ EXTERN int asn1PD_H245ConferenceIndication (OOCTXT* pctxt, H245ConferenceIndicat
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -41001,8 +41001,8 @@ EXTERN int asn1PD_H245VendorIdentification (OOCTXT* pctxt, H245VendorIdentificat
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -41091,7 +41091,7 @@ EXTERN int asn1PD_H245FunctionNotSupported_cause (OOCTXT* pctxt, H245FunctionNot
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -41169,8 +41169,8 @@ EXTERN int asn1PD_H245FunctionNotSupported (OOCTXT* pctxt, H245FunctionNotSuppor
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -41248,8 +41248,8 @@ EXTERN int asn1PD_H245MultilinkIndication_crcDesired (OOCTXT* pctxt, H245Multili
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -41299,8 +41299,8 @@ EXTERN int asn1PD_H245MultilinkIndication_excessiveError (OOCTXT* pctxt, H245Mul
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -41357,7 +41357,7 @@ EXTERN int asn1PD_H245MultilinkIndication (OOCTXT* pctxt, H245MultilinkIndicatio
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -41441,8 +41441,8 @@ EXTERN int asn1PD_H245LogicalChannelRateRelease (OOCTXT* pctxt, H245LogicalChann
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -41595,8 +41595,8 @@ EXTERN int asn1PD_H245FlowControlIndication (OOCTXT* pctxt, H245FlowControlIndic
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -41664,8 +41664,8 @@ EXTERN int asn1PD_H245MobileMultilinkReconfigurationIndication (OOCTXT* pctxt, H
ASN1OpenType openType;
ASN1UINT bitcnt;
ASN1UINT i;
- ASN1BOOL optbit;
- ASN1BOOL extbit;
+ ASN1BOOL optbit = 0;
+ ASN1BOOL extbit = 0;
/* extension bit */
@@ -41733,7 +41733,7 @@ EXTERN int asn1PD_H245IndicationMessage (OOCTXT* pctxt, H245IndicationMessage* p
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
OOCTXT lctxt;
/* extension bit */
@@ -42084,7 +42084,7 @@ EXTERN int asn1PD_H245MultimediaSystemControlMessage (OOCTXT* pctxt, H245Multime
int stat = ASN_OK;
ASN1UINT ui;
ASN1OpenType openType;
- ASN1BOOL extbit;
+ ASN1BOOL extbit = 0;
/* extension bit */
diff --git a/addons/ooh323c/src/memheap.c b/addons/ooh323c/src/memheap.c
index 48040a7ef..d60b7a074 100644
--- a/addons/ooh323c/src/memheap.c
+++ b/addons/ooh323c/src/memheap.c
@@ -13,18 +13,12 @@
* maintain this copyright notice.
*
*****************************************************************************/
-
+#include <asterisk.h>
+#include <asterisk/lock.h>
#include <stdlib.h>
#include "memheap.h"
ASN1UINT g_defBlkSize = XM_K_MEMBLKSIZ;
-OSMallocFunc g_malloc_func = malloc;
-#ifndef _NO_REALLOC
-OSReallocFunc g_realloc_func = realloc;
-#else
-OSReallocFunc g_realloc_func = 0;
-#endif
-OSFreeFunc g_free_func = free;
static OSMemLink* memHeapAddBlock (OSMemLink** ppMemLink,
void* pMemBlk, int blockType);
@@ -172,6 +166,7 @@ void* memHeapAlloc (void** ppvMemHeap, int nbytes)
nunits = (((unsigned)(nbytes + 7)) >> 3);
pMemHeap = (OSMemHeap*) *ppvMemHeap;
+ ast_mutex_lock(&pMemHeap->pLock);
ppMemLink = &pMemHeap->phead;
/* if size is greater than 2**19, then allocate as RAW block */
@@ -181,17 +176,18 @@ void* memHeapAlloc (void** ppvMemHeap, int nbytes)
/* allocate raw block */
- data = g_malloc_func (nbytes);
+ data = malloc (nbytes);
if (data == NULL) {
return NULL;
}
pMemLink = memHeapAddBlock (ppMemLink, data, RTMEMMALLOC | RTMEMRAW);
if (pMemLink == 0) {
- g_free_func (data);
+ free (data);
return NULL;
}
/* save size of the RAW memory block behind the pMemLink */
*(int*)(((char*)pMemLink) + sizeof (OSMemLink)) = nbytes;
+ ast_mutex_unlock(&pMemHeap->pLock);
return data;
}
@@ -337,7 +333,7 @@ void* memHeapAlloc (void** ppvMemHeap, int nbytes)
((((ASN1UINT)dataUnits) * 8u) + sizeof (OSMemBlk));
}
- pmem = (ASN1OCTET*) g_malloc_func (allocSize + sizeof (OSMemLink));
+ pmem = (ASN1OCTET*) malloc (allocSize + sizeof (OSMemLink));
if (0 != pmem) {
OSMemElemDescr* pElem;
@@ -361,7 +357,8 @@ void* memHeapAlloc (void** ppvMemHeap, int nbytes)
if (memHeapAddBlock (ppMemLink, pMemBlk, RTMEMSTD | RTMEMLINK) == 0)
{
- g_free_func (pmem);
+ free (pmem);
+ ast_mutex_unlock(&pMemHeap->pLock);
return NULL;
}
@@ -374,8 +371,10 @@ void* memHeapAlloc (void** ppvMemHeap, int nbytes)
CHECKMEMELEM (pMemBlk, pElem);
CHECKMEMBLOCK (pMemHeap, pMemBlk);
}
- else
+ else {
+ ast_mutex_unlock(&pMemHeap->pLock);
return NULL;
+ }
}
RTMEMDIAG2 ("memHeapAlloc: pMemBlk = 0x%x\n", pMemBlk);
RTMEMDIAG2 ("memHeapAlloc: pMemBlk->free_x = %d\n", pMemBlk->free_x);
@@ -384,6 +383,7 @@ void* memHeapAlloc (void** ppvMemHeap, int nbytes)
RTMEMDIAG2 ("memHeapAlloc: mem_p = 0x%x\n", mem_p);
RTMEMDIAG2 ("memHeapAlloc: sizeof (short) = %d\n", sizeof(short));
+ ast_mutex_unlock(&pMemHeap->pLock);
return (mem_p);
}
@@ -407,6 +407,9 @@ void memHeapFreePtr (void** ppvMemHeap, void* mem_p)
if (mem_p == 0 || ppvMemHeap == 0 || *ppvMemHeap == 0) return;
pMemHeap = *(OSMemHeap**)ppvMemHeap;
+
+ ast_mutex_lock(&pMemHeap->pLock);
+
ppMemLink = &pMemHeap->phead;
/* look for chain of RAW blocks first */
@@ -434,13 +437,14 @@ void memHeapFreePtr (void** ppvMemHeap, void* mem_p)
if ((pMemLink->blockType & RTMEMLINK) &&
(pMemLink->blockType & RTMEMMALLOC))
{
- g_free_func (pMemLink);
+ free (pMemLink);
}
else {
if (pMemLink->blockType & RTMEMMALLOC)
- g_free_func (pMemLink->pMemBlk);
- g_free_func (pMemLink);
+ free (pMemLink->pMemBlk);
+ free (pMemLink);
}
+ ast_mutex_unlock(&pMemHeap->pLock);
return;
}
pPrevMemLink = pMemLink;
@@ -455,6 +459,7 @@ void memHeapFreePtr (void** ppvMemHeap, void* mem_p)
if (ISFREE (pElem)) { /* already freed! */
RTMEMDIAG2 ("memHeapFreePtr: "
"the element 0x%x is already freed!\n", pElem);
+ ast_mutex_unlock(&pMemHeap->pLock);
return;
}
@@ -548,11 +553,11 @@ void memHeapFreePtr (void** ppvMemHeap, void* mem_p)
FILLFREEMEM (pMemBlk->plink, sizeof (*pMemBlk->plink));
FILLFREEMEM (pMemBlk->data, (pMemBlk->nunits * 8u));
- g_free_func (pMemBlk->plink);
+ free (pMemBlk->plink);
if (!(blockType & RTMEMLINK)) {
FILLFREEMEM (pMemBlk, sizeof (*pMemBlk));
- g_free_func (pMemBlk);
+ free (pMemBlk);
}
RTMEMDIAG2 ("memHeapFreePtr: pMemBlk = 0x%x was freed\n",
pMemBlk);
@@ -642,6 +647,7 @@ void memHeapFreePtr (void** ppvMemHeap, void* mem_p)
CHECKMEMELEM (pMemBlk, pElem);
CHECKMEMBLOCK (pMemHeap, pMemBlk);
}
+ ast_mutex_unlock(&pMemHeap->pLock);
}
static void initNewFreeElement (OSMemBlk* pMemBlk,
@@ -741,26 +747,12 @@ void* memHeapRealloc (void** ppvMemHeap, void* mem_p, int nbytes_)
if ((pMemLink->blockType & RTMEMRAW) &&
pMemLink->pMemBlk == mem_p)
{
- if (pMemLink->blockType & RTMEMMALLOC)
- if (g_realloc_func != 0) {
- void *newMemBlk = g_realloc_func (pMemLink->pMemBlk, nbytes_);
- if (newMemBlk == 0)
- return 0;
- pMemLink->pMemBlk = newMemBlk;
- }
- else {
- /* use malloc/memcpy/free sequence instead of realloc */
- ASN1OCTET* newBuf;
- int oldSize = *(int*)(((char*)pMemLink) + sizeof (OSMemLink));
-
- if (oldSize == -1) return 0;
- newBuf = (ASN1OCTET*)g_malloc_func (nbytes_);
- if (newBuf == 0)
- return 0;
- memcpy (newBuf, pMemLink->pMemBlk, ASN1MIN (oldSize, nbytes_));
- free (pMemLink->pMemBlk);
- pMemLink->pMemBlk = newBuf;
- }
+ if (pMemLink->blockType & RTMEMMALLOC) {
+ void *newMemBlk = realloc (pMemLink->pMemBlk, nbytes_);
+ if (newMemBlk == 0)
+ return 0;
+ pMemLink->pMemBlk = newMemBlk;
+ }
else
return 0;
*(int*)(((char*)pMemLink) + sizeof (OSMemLink)) = nbytes_;
@@ -994,6 +986,8 @@ void memHeapFreeAll (void** ppvMemHeap)
if (ppvMemHeap == 0 || *ppvMemHeap == 0) return;
pMemHeap = *(OSMemHeap**)ppvMemHeap;
+ ast_mutex_lock(&pMemHeap->pLock);
+
pMemLink = pMemHeap->phead;
RTMEMDIAG2 ("memHeapFreeAll: pMemHeap = 0x%x\n", pMemHeap);
@@ -1045,10 +1039,11 @@ void memHeapFreeAll (void** ppvMemHeap)
if (((pMemLink2->blockType & RTMEMSTD) ||
(pMemLink2->blockType & RTMEMMALLOC)) &&
!(pMemLink2->blockType & RTMEMLINK))
- g_free_func (pMemLink2->pMemBlk);
- g_free_func (pMemLink2);
+ free (pMemLink2->pMemBlk);
+ free (pMemLink2);
}
}
+ ast_mutex_unlock(&pMemHeap->pLock);
}
/* increments internal refCnt. use memHeapRelease to decrement and release */
@@ -1058,7 +1053,9 @@ void memHeapAddRef (void** ppvMemHeap)
if (ppvMemHeap == 0 || *ppvMemHeap == 0) return;
pMemHeap = *(OSMemHeap**)ppvMemHeap;
+ ast_mutex_lock(&pMemHeap->pLock);
pMemHeap->refCnt++;
+ ast_mutex_unlock(&pMemHeap->pLock);
}
/* Frees all memory and heap structure as well (if was allocated) */
@@ -1106,6 +1103,9 @@ void* memHeapMarkSaved (void** ppvMemHeap, const void* mem_p,
return 0;
pMemHeap = *(OSMemHeap**)ppvMemHeap;
+
+ ast_mutex_lock(&pMemHeap->pLock);
+
pMemLink = pMemHeap->phead;
/* look for chain of RAW blocks first */
@@ -1128,6 +1128,8 @@ void* memHeapMarkSaved (void** ppvMemHeap, const void* mem_p,
if (ISFREE (pElem)) { /* already freed! */
RTMEMDIAG2 ("memHeapMarkSaved: the element 0x%x is "
"already free!\n", pElem);
+
+ ast_mutex_unlock(&pMemHeap->pLock);
return 0;
}
@@ -1147,12 +1149,15 @@ void* memHeapMarkSaved (void** ppvMemHeap, const void* mem_p,
nsaved = pMemBlk->nsaved;
}
else
+ ast_mutex_unlock(&pMemHeap->pLock);
return 0;
}
if (saved && nsaved > 0)
pMemLink->blockType |= RTMEMSAVED;
else if (nsaved == 0)
pMemLink->blockType &= (~RTMEMSAVED);
+
+ ast_mutex_unlock(&pMemHeap->pLock);
return pMemLink->pMemBlk;
}
@@ -1167,6 +1172,8 @@ void memHeapReset (void** ppvMemHeap)
if (ppvMemHeap == 0 || *ppvMemHeap == 0) return;
pMemHeap = *(OSMemHeap**)ppvMemHeap;
+ ast_mutex_lock(&pMemHeap->pLock);
+
pMemLink = pMemHeap->phead;
TRACEFREE (pMemHeap, "memHeapReset\n\n");
while (pMemLink) {
@@ -1190,6 +1197,7 @@ void memHeapReset (void** ppvMemHeap)
}
pMemLink = pMemLink->pnext;
}
+ ast_mutex_unlock(&pMemHeap->pLock);
}
/* add memory block to list */
@@ -1206,7 +1214,7 @@ static OSMemLink* memHeapAddBlock (OSMemLink** ppMemLink,
if (blockType & RTMEMLINK)
pMemLink = (OSMemLink*) (((ASN1OCTET*)pMemBlk) - sizeof (OSMemLink));
else {
- pMemLink = (OSMemLink*) g_malloc_func (
+ pMemLink = (OSMemLink*) malloc (
sizeof(OSMemLink) + sizeof (int));
if (pMemLink == 0) return 0;
/* An extra integer is necessary to save a size of a RAW memory block
@@ -1257,6 +1265,8 @@ int memHeapCheckPtr (void** ppvMemHeap, void* mem_p)
return 0;
pMemHeap = *(OSMemHeap**)ppvMemHeap;
+ ast_mutex_lock(&pMemHeap->pLock);
+
pMemLink = pMemHeap->phead;
for (; pMemLink != 0; pMemLink = pMemLink->pnext) {
@@ -1264,8 +1274,10 @@ int memHeapCheckPtr (void** ppvMemHeap, void* mem_p)
/* if RAW block, the pointer should be stored in pMemBlk */
- if (pMemLink->pMemBlk == mem_p)
+ if (pMemLink->pMemBlk == mem_p) {
+ ast_mutex_unlock(&pMemHeap->pLock);
return 1;
+ }
}
else {
OSMemBlk* pMemBlk = (OSMemBlk*)pMemLink->pMemBlk;
@@ -1281,12 +1293,16 @@ int memHeapCheckPtr (void** ppvMemHeap, void* mem_p)
for (; pElem != 0; pElem = GETNEXT (pElem)) {
void* curMem_p = (void*) pElem_data (pElem);
- if (curMem_p == mem_p && !ISFREE (pElem))
+ if (curMem_p == mem_p && !ISFREE (pElem)) {
+ ast_mutex_unlock(&pMemHeap->pLock);
return 1;
+ }
}
}
}
}
+
+ ast_mutex_unlock(&pMemHeap->pLock);
return 0;
}
@@ -1301,6 +1317,8 @@ void memHeapSetProperty (void** ppvMemHeap, ASN1UINT propId, void* pProp)
memHeapCreate (ppvMemHeap);
pMemHeap = *(OSMemHeap**)ppvMemHeap;
+ ast_mutex_lock(&pMemHeap->pLock);
+
switch (propId) {
case OSRTMH_PROPID_DEFBLKSIZE:
pMemHeap->defBlkSize = *(ASN1UINT*)pProp;
@@ -1312,6 +1330,7 @@ void memHeapSetProperty (void** ppvMemHeap, ASN1UINT propId, void* pProp)
pMemHeap->flags &= ((~(*(ASN1UINT*)pProp)) | RT_MH_INTERNALMASK);
break;
}
+ ast_mutex_unlock(&pMemHeap->pLock);
}
int memHeapCreate (void** ppvMemHeap)
@@ -1319,12 +1338,13 @@ int memHeapCreate (void** ppvMemHeap)
OSMemHeap* pMemHeap;
if (ppvMemHeap == 0) return ASN_E_INVPARAM;
- pMemHeap = (OSMemHeap*) g_malloc_func (sizeof (OSMemHeap));
+ pMemHeap = (OSMemHeap*) malloc (sizeof (OSMemHeap));
if (pMemHeap == NULL) return ASN_E_NOMEM;
memset (pMemHeap, 0, sizeof (OSMemHeap));
pMemHeap->defBlkSize = g_defBlkSize;
pMemHeap->refCnt = 1;
pMemHeap->flags = RT_MH_FREEHEAPDESC;
+ ast_mutex_init(&pMemHeap->pLock);
*ppvMemHeap = (void*)pMemHeap;
return ASN_OK;
}
diff --git a/addons/ooh323c/src/memheap.h b/addons/ooh323c/src/memheap.h
index b99f9dbc9..8cc36d902 100644
--- a/addons/ooh323c/src/memheap.h
+++ b/addons/ooh323c/src/memheap.h
@@ -50,6 +50,7 @@ typedef struct OSMemHeap {
ASN1UINT defBlkSize;
ASN1UINT refCnt;
ASN1UINT flags;
+ ast_mutex_t pLock;
} OSMemHeap;
/* see rtMemDefs.c file */
diff --git a/addons/ooh323c/src/ooCalls.c b/addons/ooh323c/src/ooCalls.c
index 33f584c5a..75450182e 100644
--- a/addons/ooh323c/src/ooCalls.c
+++ b/addons/ooh323c/src/ooCalls.c
@@ -14,6 +14,9 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+
#include "ootrace.h"
#include "ootypes.h"
#include "ooCalls.h"
@@ -28,11 +31,14 @@
/** Global endpoint structure */
extern OOH323EndPoint gH323ep;
+extern ast_mutex_t callListLock;
+extern ast_mutex_t newCallLock;
OOH323CallData* ooCreateCall(char* type, char*callToken)
{
OOH323CallData *call=NULL;
OOCTXT *pctxt=NULL;
+ OOCTXT *msgctxt=NULL;
pctxt = newContext();
if(!pctxt)
@@ -40,14 +46,26 @@ OOH323CallData* ooCreateCall(char* type, char*callToken)
OOTRACEERR1("ERROR:Failed to create OOCTXT for new call\n");
return NULL;
}
+ msgctxt = newContext();
+ if(!msgctxt)
+ {
+ OOTRACEERR1("ERROR:Failed to create OOCTXT for new call\n");
+ return NULL;
+ }
+ ast_mutex_lock(&newCallLock);
+ /* call = (OOH323CallData*)memAlloc(&gH323ep.ctxt, sizeof(OOH323CallData)); */
call = (OOH323CallData*)memAlloc(pctxt, sizeof(OOH323CallData));
+ ast_mutex_unlock(&newCallLock);
if(!call)
{
OOTRACEERR1("ERROR:Memory - ooCreateCall - call\n");
return NULL;
}
- /* memset(call, 0, sizeof(OOH323CallData));*/
+ memset(call, 0, sizeof(OOH323CallData));
+ ast_cond_init(&call->gkWait, NULL);
+ ast_mutex_init(&call->Lock);
call->pctxt = pctxt;
+ call->msgctxt = msgctxt;
call->callMode = gH323ep.callMode;
sprintf(call->callToken, "%s", callToken);
sprintf(call->callType, "%s", type);
@@ -80,6 +98,12 @@ OOH323CallData* ooCreateCall(char* type, char*callToken)
if (OO_TESTFLAG(gH323ep.flags, OO_M_MEDIAWAITFORCONN))
OO_SETFLAG (call->flags, OO_M_MEDIAWAITFORCONN);
+
+ call->fsSent = FALSE;
+
+// May 20090713. Fix it for Video session
+
+ OO_SETFLAG(call->flags, OO_M_AUDIOSESSION);
call->callState = OO_CALL_CREATED;
call->callEndReason = OO_REASON_UNKNOWN;
@@ -158,6 +182,8 @@ OOH323CallData* ooCreateCall(char* type, char*callToken)
int ooAddCallToList(OOH323CallData *call)
{
+ ast_mutex_lock(&callListLock);
+
if(!gH323ep.callList)
{
gH323ep.callList = call;
@@ -170,6 +196,9 @@ int ooAddCallToList(OOH323CallData *call)
gH323ep.callList->prev = call;
gH323ep.callList = call;
}
+
+ ast_mutex_unlock(&callListLock);
+
return OO_OK;
}
@@ -180,9 +209,16 @@ int ooEndCall(OOH323CallData *call)
ooGetCallStateText(call->callState), call->callType,
call->callToken);
+ if(call->callState == OO_CALL_REMOVED) {
+ OOTRACEINFO2("Call already removed %s\n",
+ call->callToken);
+ return OO_OK;
+ }
+
if(call->callState == OO_CALL_CLEARED)
{
ooCleanCall(call);
+ call->callState = OO_CALL_REMOVED;
return OO_OK;
}
@@ -230,6 +266,11 @@ int ooRemoveCallFromList (OOH323CallData *call)
if(!call)
return OO_OK;
+ ast_mutex_lock(&callListLock);
+
+ OOTRACEINFO3("Removing call %lx: %s\n", call, call->callToken);
+
+ if (!gH323ep.callList) return OO_OK;
if(call == gH323ep.callList)
{
if(!call->next)
@@ -244,6 +285,9 @@ int ooRemoveCallFromList (OOH323CallData *call)
if(call->next)
call->next->prev = call->prev;
}
+
+ ast_mutex_unlock(&callListLock);
+
return OO_OK;
}
@@ -258,7 +302,7 @@ int ooCleanCall(OOH323CallData *call)
/* First clean all the logical channels, if not already cleaned. */
if(call->logicalChans)
ooClearAllLogicalChannels(call);
-
+
/* Close H.245 connection, if not already closed */
if(call->h245SessionState != OO_H245SESSION_CLOSED)
ooCloseH245Connection(call);
@@ -314,9 +358,24 @@ int ooCleanCall(OOH323CallData *call)
gH323ep.h323Callbacks.onCallCleared(call);
}
- pctxt = call->pctxt;
+ if (call->rtpMask) {
+ ast_mutex_lock(&call->rtpMask->lock);
+ call->rtpMask->inuse--;
+ ast_mutex_unlock(&call->rtpMask->lock);
+ if ((call->rtpMask->inuse) == 0) {
+ regfree(&call->rtpMask->regex);
+ ast_mutex_destroy(&call->rtpMask->lock);
+ free(call->rtpMask);
+ }
+ }
+
+ pctxt = call->msgctxt;
freeContext(pctxt);
- ASN1CRTFREE0(pctxt);
+ free(pctxt);
+ call->msgctxt = NULL;
+/* May !!!! Fix it !! */
+ /* free(pctxt); */
+
return OO_OK;
}
@@ -489,6 +548,44 @@ int ooCallAddRemoteAliasDialedDigits
/* Used to override global end point capabilities and add call specific
capabilities */
+int ooCallAddG726Capability(OOH323CallData *call, int cap, int txframes,
+ int rxframes, OOBOOL silenceSuppression, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel)
+{
+ return ooCapabilityAddSimpleCapability(call, cap, txframes, rxframes,
+ silenceSuppression, dir, startReceiveChannel,
+ startTransmitChannel, stopReceiveChannel,
+ stopTransmitChannel, FALSE);
+}
+int ooCallAddAMRNBCapability(OOH323CallData *call, int cap, int txframes,
+ int rxframes, OOBOOL silenceSuppression, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel)
+{
+ return ooCapabilityAddSimpleCapability(call, cap, txframes, rxframes,
+ silenceSuppression, dir, startReceiveChannel,
+ startTransmitChannel, stopReceiveChannel,
+ stopTransmitChannel, FALSE);
+}
+
+int ooCallAddSpeexCapability(OOH323CallData *call, int cap, int txframes,
+ int rxframes, OOBOOL silenceSuppression, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel)
+{
+ return ooCapabilityAddSimpleCapability(call, cap, txframes, rxframes,
+ silenceSuppression, dir, startReceiveChannel,
+ startTransmitChannel, stopReceiveChannel,
+ stopTransmitChannel, FALSE);
+}
+
int ooCallAddG7231Capability(OOH323CallData *call, int cap, int txframes,
int rxframes, OOBOOL silenceSuppression, int dir,
cb_StartReceiveChannel startReceiveChannel,
@@ -596,6 +693,16 @@ int ooCallDisableDTMFRFC2833(OOH323CallData *call)
return ooCapabilityDisableDTMFRFC2833(call);
}
+int ooCallEnableDTMFCISCO(OOH323CallData *call, int dynamicRTPPayloadType)
+{
+ return ooCapabilityEnableDTMFCISCO(call, dynamicRTPPayloadType);
+}
+
+int ooCallDisableDTMFCISCO(OOH323CallData *call)
+{
+ return ooCapabilityDisableDTMFCISCO(call);
+}
+
int ooCallEnableDTMFH245Alphanumeric(OOH323CallData *call)
{
@@ -628,7 +735,7 @@ int ooCallDisableDTMFQ931Keypad(OOH323CallData *call)
}
-OOH323CallData* ooFindCallByToken(char *callToken)
+OOH323CallData* ooFindCallByToken(const char *callToken)
{
OOH323CallData *call;
if(!callToken)
@@ -636,9 +743,13 @@ OOH323CallData* ooFindCallByToken(char *callToken)
OOTRACEERR1("ERROR:Invalid call token passed - ooFindCallByToken\n");
return NULL;
}
+
+ ast_mutex_lock(&callListLock);
+
if(!gH323ep.callList)
{
OOTRACEERR1("ERROR: Empty calllist - ooFindCallByToken failed\n");
+ ast_mutex_unlock(&callListLock);
return NULL;
}
call = gH323ep.callList;
@@ -653,8 +764,14 @@ OOH323CallData* ooFindCallByToken(char *callToken)
if(!call)
{
OOTRACEERR2("ERROR:Call with token %s not found\n", callToken);
+ ast_mutex_unlock(&callListLock);
return NULL;
}
+
+ ast_mutex_unlock(&callListLock);
+
+ OOTRACEINFO3("INFO: FinCall returned %lx for call: %s\n", call, callToken);
+
return call;
}
@@ -750,6 +867,23 @@ unsigned ooCallGenerateSessionID
}
}
}
+ if(type == OO_CAP_TYPE_DATA)
+ {
+ if(!ooGetLogicalChannel(call, 3, dir))
+ {
+ sessionID = 3;
+ }
+ else{
+ if(call->masterSlaveState == OO_MasterSlave_Master)
+ sessionID = call->nextSessionID++;
+ else{
+ sessionID = 0; /* Will be assigned by remote */
+ OOTRACEDBGC4("Session id for %s channel of type data has to be "
+ "provided by remote.(%s, %s)\n", dir, call->callType,
+ call->callToken);
+ }
+ }
+ }
return sessionID;
}
diff --git a/addons/ooh323c/src/ooCalls.h b/addons/ooh323c/src/ooCalls.h
index 64d62d6e1..68dd3bfbd 100644
--- a/addons/ooh323c/src/ooCalls.h
+++ b/addons/ooh323c/src/ooCalls.h
@@ -22,6 +22,7 @@
#include "ooLogChan.h"
#include "ooCapability.h"
+#include <regex.h>
#ifdef __cplusplus
extern "C" {
@@ -54,6 +55,10 @@ extern "C" {
#define OO_M_DISABLEGK ASN1UINTCNT(0x01000000)
#define OO_M_MANUALRINGBACK ASN1UINTCNT(0x10000000)
+#define OO_M_TRYBEMASTER ASN1UINTCNT(0x00000010)
+#define OO_M_AUDIOSESSION ASN1UINTCNT(0x00000100)
+#define OO_M_DATASESSION ASN1UINTCNT(0x00000200)
+#define OO_M_T38SUPPORTED ASN1UINTCNT(0x00000400)
/**
* Call states.
@@ -67,7 +72,8 @@ typedef enum {
OO_CALL_CLEAR, /*!< Call marked for clearing */
OO_CALL_CLEAR_RELEASERECVD, /*!< Release command received. */
OO_CALL_CLEAR_RELEASESENT, /*!< Release sent */
- OO_CALL_CLEARED /*!< Call cleared */
+ OO_CALL_CLEARED, /*!< Call cleared */
+ OO_CALL_REMOVED /* call removed */
} OOCallState;
/**
@@ -128,6 +134,12 @@ typedef struct EXTERN FastStartResponse {
ASN1DynOctStr *elem;
} FastStartResponse;
+typedef struct OOH323Regex {
+ regex_t regex;
+ int inuse;
+ ast_mutex_t lock;
+} OOH323Regex;
+
/**
* This structure is used to maintain all information on an active call.
@@ -136,9 +148,19 @@ typedef struct EXTERN FastStartResponse {
*/
typedef struct OOH323CallData {
OOCTXT *pctxt;
+ OOCTXT *msgctxt;
+ pthread_t callThread;
+ ast_cond_t gkWait;
+ ast_mutex_t Lock;
+ OOBOOL Monitor;
+ OOBOOL fsSent;
+ OOSOCKET CmdChan;
+ OOSOCKET cmdSock;
+ ast_mutex_t* CmdChanLock;
char callToken[20]; /* ex: ooh323c_call_1 */
char callType[10]; /* incoming/outgoing */
OOCallMode callMode;
+ int transfercap;
ASN1USINT callReference;
char ourCallerId[256];
H225CallIdentifier callIdentifier;/* The call identifier for the active
@@ -149,9 +171,11 @@ typedef struct OOH323CallData {
ASN1UINT flags;
OOCallState callState;
OOCallClearReason callEndReason;
+ int q931cause;
unsigned h245ConnectionAttempts;
OOH245SessionState h245SessionState;
int dtmfmode;
+ int dtmfcodec;
OOMediaInfo *mediaInfo;
OOCallFwdData *pCallFwdData;
char localIP[20];/* Local IP address */
@@ -165,7 +189,8 @@ typedef struct OOH323CallData {
char *remoteDisplayName;
struct OOAliases *remoteAliases;
struct OOAliases *ourAliases; /*aliases used in the call for us */
- OOMasterSlaveState masterSlaveState; /*!< Master-Slave state */
+ OOMasterSlaveState masterSlaveState; /*!< Master-Slave state */
+ OOMSAckStatus msAckStatus; /* Master-Slave ack's status */
ASN1UINT statusDeterminationNumber;
OOCapExchangeState localTermCapState;
OOCapExchangeState remoteTermCapState;
@@ -185,7 +210,15 @@ typedef struct OOH323CallData {
unsigned nextSessionID; /* Note by default 1 is audio session, 2 is video and 3 is data, from 3 onwards master decides*/
DList timerList;
ASN1UINT msdRetries;
+ ASN1UINT8 requestSequence;
+ ASN1UINT reqFlags;
+ ASN1UINT t38sides;
+ H235TimeStamp alertingTime, connectTime, endTime; /* time data for gatekeeper */
FastStartResponse *pFastStartRes; /* fast start response */
+ struct OOH323Regex* rtpMask;
+ char rtpMaskStr[120];
+ char lastDTMF;
+ ASN1UINT nextDTMFstamp;
void *usrData; /*!<User can set this to user specific data*/
struct OOH323CallData* next;
struct OOH323CallData* prev;
@@ -278,6 +311,14 @@ typedef int (*cb_OnReceivedDTMF)
(struct OOH323CallData *call, const char *dtmf);
/**
+ * This callback function is triggered when dtmf is received over Q.931(keypad)
+ * or H.245(alphanumeric) or H.245(signal). This is not triggered when rfc
+ * 2833 based dtmf is received.
+ */
+typedef void (*cb_OnModeChanged)
+ (struct OOH323CallData *call, int isT38Mode);
+
+/**
* This structure holds all of the H.323 signaling callback function
* addresses.
* @see ooH323EpSetH323Callbacks
@@ -285,6 +326,7 @@ typedef int (*cb_OnReceivedDTMF)
typedef struct OOH323CALLBACKS {
cb_OnAlerting onNewCallCreated;
cb_OnAlerting onAlerting;
+ cb_OnAlerting onProgress;
cb_OnIncomingCall onIncomingCall;
cb_OnOutgoingCall onOutgoingCall;
cb_OnCallEstablished onCallEstablished;
@@ -292,6 +334,7 @@ typedef struct OOH323CALLBACKS {
cb_OnCallCleared onCallCleared;
cb_OpenLogicalChannels openLogicalChannels;
cb_OnReceivedDTMF onReceivedDTMF;
+ cb_OnModeChanged onModeChanged;
} OOH323CALLBACKS;
/**
@@ -717,7 +760,7 @@ EXTERN int ooCallDisableDTMFQ931Keypad(OOH323CallData *call);
*
* @return Pointer to the call if found, NULL otherwise.
*/
-EXTERN OOH323CallData* ooFindCallByToken(char *callToken);
+EXTERN OOH323CallData* ooFindCallByToken(const char *callToken);
/**
* This function is used to end a call. Based on what stage of clearance the
@@ -815,6 +858,29 @@ EXTERN const char* ooGetCallStateText (OOCallState callState);
* @}
*/
+int isRunning(char *callToken);
+
+int ooCallAddG726Capability(struct OOH323CallData *call, int cap, int txframes,
+ int rxframes, OOBOOL silenceSuppression, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel);
+int ooCallAddAMRNBCapability(struct OOH323CallData *call, int cap, int txframes,
+ int rxframes, OOBOOL silenceSuppression, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel);
+int ooCallAddSpeexCapability(struct OOH323CallData *call, int cap, int txframes,
+ int rxframes, OOBOOL silenceSuppression, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel);
+int ooCallEnableDTMFCISCO(struct OOH323CallData *call, int dynamicRTPPayloadType);
+int ooCallDisableDTMFCISCO(struct OOH323CallData *call);
+
#ifdef __cplusplus
}
#endif
diff --git a/addons/ooh323c/src/ooCapability.c b/addons/ooh323c/src/ooCapability.c
index aeecbee10..09dc3b95e 100644
--- a/addons/ooh323c/src/ooCapability.c
+++ b/addons/ooh323c/src/ooCapability.c
@@ -13,6 +13,9 @@
* maintain this copyright notice.
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+
#include "ooCapability.h"
#include "ootrace.h"
#include "ooCalls.h"
@@ -22,6 +25,7 @@
extern OOH323EndPoint gH323ep;
static int giDynamicRTPPayloadType = 101;
+static int gcDynamicRTPPayloadType = 121;
int ooCapabilityEnableDTMFRFC2833
(OOH323CallData *call, int dynamicRTPPayloadType)
@@ -30,16 +34,47 @@ int ooCapabilityEnableDTMFRFC2833
{
gH323ep.dtmfmode |= OO_CAP_DTMF_RFC2833;
OOTRACEINFO1("Enabled RFC2833 DTMF capability for end-point\n");
+ /*Dynamic RTP payload type range is from 96 - 127 */
+ if(dynamicRTPPayloadType >= 96 && dynamicRTPPayloadType <= 127)
+ giDynamicRTPPayloadType = dynamicRTPPayloadType;
}
else{
call->dtmfmode |= OO_CAP_DTMF_RFC2833;
OOTRACEINFO3("Enabled RFC2833 DTMF capability for (%s, %s) \n",
call->callType, call->callToken);
+ if(dynamicRTPPayloadType >= 96 && dynamicRTPPayloadType <= 127)
+ call->dtmfcodec = dynamicRTPPayloadType;
+ else
+ call->dtmfcodec = giDynamicRTPPayloadType;
}
- /*Dynamic RTP payload type range is from 96 - 127 */
+
+ return OO_OK;
+}
+
+int ooCapabilityEnableDTMFCISCO
+ (OOH323CallData *call, int dynamicRTPPayloadType)
+{
+ if(!call)
+ {
+ gH323ep.dtmfmode |= OO_CAP_DTMF_CISCO;
+ OOTRACEINFO1("Enabled RTP/CISCO DTMF capability for end-point\n");
+ /*Dynamic RTP payload type range is from 96 - 127 */
+ if(dynamicRTPPayloadType >= 96 && dynamicRTPPayloadType <= 127)
+ gcDynamicRTPPayloadType = dynamicRTPPayloadType;
+ else
+ call->dtmfcodec = dynamicRTPPayloadType;
+ }
+ else{
+ call->dtmfmode |= OO_CAP_DTMF_CISCO;
+ OOTRACEINFO3("Enabled RTP/CISCO DTMF capability for (%s, %s) \n",
+ call->callType, call->callToken);
if(dynamicRTPPayloadType >= 96 && dynamicRTPPayloadType <= 127)
- giDynamicRTPPayloadType = dynamicRTPPayloadType;
+ call->dtmfcodec = dynamicRTPPayloadType;
+ else
+ call->dtmfcodec = gcDynamicRTPPayloadType;
+ }
+
return OO_OK;
}
@@ -61,6 +96,21 @@ int ooCapabilityDisableDTMFRFC2833(OOH323CallData *call)
return OO_OK;
}
+int ooCapabilityDisableDTMFCISCO(OOH323CallData *call)
+{
+ if(!call){
+ gH323ep.dtmfmode ^= OO_CAP_DTMF_CISCO;
+ OOTRACEINFO1("Disabled RTP/CISCO DTMF capability for end-point\n");
+ }
+ else{
+ call->dtmfmode ^= OO_CAP_DTMF_CISCO;
+ OOTRACEINFO3("Disabled RTP/CISCO DTMF capability for (%s, %s)\n",
+ call->callType, call->callToken);
+ }
+
+ return OO_OK;
+}
+
int ooCapabilityEnableDTMFH245Alphanumeric(OOH323CallData *call)
{
if(!call){
@@ -335,8 +385,7 @@ int ooCapabilityAddH263VideoCapability_helper(ooCallData *call,
if(!call->ourCaps){
call->ourCaps = epCap;
ooResetCapPrefs(call);
- }
- else{
+ }else{
cur = call->ourCaps;
while(cur->next) cur = cur->next;
cur->next = epCap;
@@ -449,6 +498,20 @@ int ooCapabilityAddSimpleCapability
return OO_OK;
}
+int epCapIsPreferred(OOH323CallData *call, ooH323EpCapability *epCap)
+{
+ ooH323EpCapability *curCap = call->ourCaps;
+ while (curCap) {
+ if (curCap->capType == epCap->capType) {
+ if (curCap->cap == epCap->cap)
+ return 1;
+ else
+ return 0;
+ }
+ curCap = curCap->next;
+ }
+ return 0;
+}
int ooCapabilityAddGSMCapability(OOH323CallData *call, int cap,
unsigned framesPerPkt, OOBOOL comfortNoise,
@@ -544,6 +607,100 @@ int ooCapabilityAddGSMCapability(OOH323CallData *call, int cap,
return OO_OK;
}
+/* Used for T38 */
+int ooCapabilityAddT38Capability
+ (OOH323CallData *call, int cap, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel,
+ OOBOOL remote)
+{
+ ooH323EpCapability *epCap = NULL, *cur=NULL;
+ OOCapParams *params=NULL;
+ OOCTXT *pctxt=NULL;
+ if(!call) pctxt = &gH323ep.ctxt;
+ else pctxt = call->pctxt;
+
+ epCap = (ooH323EpCapability*)memAllocZ(pctxt, sizeof(ooH323EpCapability));
+ params = (OOCapParams*) memAlloc(pctxt, sizeof(OOCapParams));
+ memset(params, 0 , sizeof(OOCapParams));
+ if(!epCap || !params)
+ {
+ OOTRACEERR1("ERROR: Memory - ooCapabilityAddT38Capability - "
+ "epCap/params\n");
+ return OO_FAILED;
+ }
+
+ if(dir & OORXANDTX) {
+ epCap->dir = OORX;
+ epCap->dir |= OOTX;
+ }
+ else {
+ epCap->dir = dir;
+ }
+
+ epCap->cap = cap;
+ epCap->capType = OO_CAP_TYPE_DATA;
+ epCap->params = (void*)params;
+ epCap->startReceiveChannel = startReceiveChannel;
+ epCap->startTransmitChannel = startTransmitChannel;
+ epCap->stopReceiveChannel = stopReceiveChannel;
+ epCap->stopTransmitChannel = stopTransmitChannel;
+ epCap->next = NULL;
+
+ if(!call)
+ {
+ /* Add as local capability */
+ OOTRACEDBGC2("Adding endpoint capability %s. \n",
+ ooGetCapTypeText(epCap->cap));
+ if(!gH323ep.myCaps) {
+ gH323ep.myCaps = epCap;
+ }
+ else{
+ cur = gH323ep.myCaps;
+ while(cur->next) cur = cur->next;
+ cur->next = epCap;
+ }
+ ooAppendCapToCapPrefs(NULL, cap);
+ gH323ep.noOfCaps++;
+ }
+ else{
+ if(remote)
+ {
+ /* Add as remote capability */
+ if(!call->remoteCaps) {
+ call->remoteCaps = epCap;
+ }
+ else{
+ cur = call->remoteCaps;
+ while(cur->next) cur = cur->next;
+ cur->next = epCap;
+ }
+ call->t38sides |= 2;
+ }
+ else{
+ /* Add as our capability */
+ OOTRACEDBGC4("Adding call specific capability %s. (%s, %s)\n",
+ ooGetCapTypeText(epCap->cap), call->callType,
+ call->callToken);
+ if(!call->ourCaps){
+ call->ourCaps = epCap;
+ ooResetCapPrefs(call);
+ }
+ else{
+ cur = call->ourCaps;
+ while(cur->next) cur = cur->next;
+ cur->next = epCap;
+ }
+ ooAppendCapToCapPrefs(call, cap);
+ call->t38sides |= 1;
+ }
+ }
+
+ return OO_OK;
+}
+
@@ -609,12 +766,19 @@ struct H245AudioCapability* ooCapabilityCreateAudioCapability
case OO_G711ALAW56K:
case OO_G711ULAW64K:
case OO_G711ULAW56K:
- /*case OO_G726:*/
case OO_G728:
case OO_G729:
case OO_G729A:
+ case OO_G729B:
case OO_G7231:
return ooCapabilityCreateSimpleCapability(epCap, pctxt, dir);
+ case OO_G726:
+ case OO_G726AAL2:
+ case OO_AMRNB:
+ case OO_SPEEX:
+ return ooCapabilityCreateNonStandardCapability(epCap, pctxt, dir);
+ case OO_GSMHALFRATE:
+ case OO_GSMENHANCEDFULLRATE:
case OO_GSMFULLRATE:
return ooCapabilityCreateGSMFullRateCapability(epCap, pctxt, dir);
default:
@@ -626,9 +790,10 @@ struct H245AudioCapability* ooCapabilityCreateAudioCapability
-void* ooCapabilityCreateDTMFCapability(int cap, OOCTXT *pctxt)
+void* ooCapabilityCreateDTMFCapability(int cap, int dtmfcodec, OOCTXT *pctxt)
{
H245AudioTelephonyEventCapability *pATECap=NULL;
+ H245DataApplicationCapability *pCSDTMFCap=NULL;
H245UserInputCapability *userInput = NULL;
char *events=NULL;
switch(cap)
@@ -642,8 +807,9 @@ void* ooCapabilityCreateDTMFCapability(int cap, OOCTXT *pctxt)
return NULL;
}
memset(pATECap, 0, sizeof(H245AudioTelephonyEventCapability));
- pATECap->dynamicRTPPayloadType = giDynamicRTPPayloadType;
+ pATECap->dynamicRTPPayloadType = dtmfcodec;
events = (char*)memAlloc(pctxt, strlen("0-16")+1);
+ memset(events, 0, strlen("0-16")+1);
if(!events)
{
OOTRACEERR1("Error:Memory - ooCapabilityCreateDTMFCapability - events\n");
@@ -653,6 +819,40 @@ void* ooCapabilityCreateDTMFCapability(int cap, OOCTXT *pctxt)
strncpy(events, "0-16", strlen("0-16"));
pATECap->audioTelephoneEvent = events;
return pATECap;
+ case OO_CAP_DTMF_CISCO:
+ pCSDTMFCap = (H245DataApplicationCapability*)memAlloc(pctxt,
+ sizeof(H245DataApplicationCapability));
+ if(!pCSDTMFCap)
+ {
+ OOTRACEERR1("Error:Memory - ooCapabilityCreateDTMFCapability - pCSDTMFCap\n");
+ return NULL;
+ }
+ memset(pCSDTMFCap, 0, sizeof(H245DataApplicationCapability));
+ pCSDTMFCap->application.t = T_H245DataApplicationCapability_application_nonStandard;
+ if ( (pCSDTMFCap->application.u.nonStandard = (H245NonStandardParameter *)
+ memAllocZ(pctxt, sizeof(H245NonStandardParameter))) == NULL) {
+ OOTRACEERR1("Error:Memory-ooCapabilityCreateDTMFCapability-H245NonStandardParameter\n");
+ memFreePtr(pctxt, pCSDTMFCap);
+ return NULL;
+ }
+
+ pCSDTMFCap->application.u.nonStandard->nonStandardIdentifier.t=T_H245NonStandardIdentifier_h221NonStandard;
+ pCSDTMFCap->application.u.nonStandard->nonStandardIdentifier.u.h221NonStandard =
+ (H245NonStandardIdentifier_h221NonStandard *) memAllocZ(pctxt,
+ sizeof(H245NonStandardIdentifier_h221NonStandard));
+ if (!pCSDTMFCap->application.u.nonStandard->nonStandardIdentifier.u.h221NonStandard) {
+ OOTRACEERR1("Error:Memory-ooCapabilityCreateDTMFCapability-H245NonStandardParameter\n");
+ memFreePtr(pctxt, pCSDTMFCap);
+ return NULL;
+ }
+
+ pCSDTMFCap->application.u.nonStandard->data.data = (unsigned char*)"RtpDtmfRelay";
+ pCSDTMFCap->application.u.nonStandard->data.numocts = sizeof("RtpDtmfRelay")-1;
+ pCSDTMFCap->application.u.nonStandard->nonStandardIdentifier.u.h221NonStandard->t35CountryCode = 181;
+ pCSDTMFCap->application.u.nonStandard->nonStandardIdentifier.u.h221NonStandard->t35Extension = 0;
+ pCSDTMFCap->application.u.nonStandard->nonStandardIdentifier.u.h221NonStandard->manufacturerCode = 18;
+
+ return pCSDTMFCap;
case OO_CAP_DTMF_H245_alphanumeric:
userInput = (H245UserInputCapability*)memAllocZ(pctxt,
sizeof(H245UserInputCapability));
@@ -774,8 +974,16 @@ struct H245AudioCapability* ooCapabilityCreateGSMFullRateCapability
"pAudio/pGSMCap\n");
return NULL;
}
-
- pAudio->t = T_H245AudioCapability_gsmFullRate;
+ switch (epCap->cap) {
+ case OO_GSMHALFRATE:
+ pAudio->t = T_H245AudioCapability_gsmHalfRate;
+ break;
+ case OO_GSMENHANCEDFULLRATE:
+ pAudio->t = T_H245AudioCapability_gsmEnhancedFullRate;
+ break;
+ default:
+ pAudio->t = T_H245AudioCapability_gsmFullRate;
+ }
pAudio->u.gsmFullRate = pGSMCap;
if(dir & OORX)
pGSMCap->audioUnitSize = ((OOGSMCapParams*)epCap->params)->rxframes*OO_GSMFRAMESIZE;
@@ -840,13 +1048,6 @@ struct H245AudioCapability* ooCapabilityCreateSimpleCapability
else
pAudio->u.g711Ulaw64k = params->txframes;
return pAudio;
- /*case OO_G726:
- pAudio->t = T_H245AudioCapability_g726;
- if(dir & OORX)
- pAudio->u.g726 = params->rxframes;
- else
- pAudio->u.g726 = params->txframes;
- return pAudio;*/
case OO_G728:
pAudio->t = T_H245AudioCapability_g728;
if(dir & OORX)
@@ -868,6 +1069,13 @@ struct H245AudioCapability* ooCapabilityCreateSimpleCapability
else
pAudio->u.g729AnnexA = params->txframes;
return pAudio;
+ case OO_G729B:
+ pAudio->t = T_H245AudioCapability_g729wAnnexB;
+ if(dir & OORX)
+ pAudio->u.g729AnnexA = params->rxframes;
+ else
+ pAudio->u.g729AnnexA = params->txframes;
+ return pAudio;
case OO_G7231:
pAudio->t = T_H245AudioCapability_g7231;
pAudio->u.g7231 = (H245AudioCapability_g7231*)memAlloc(pctxt,
@@ -891,6 +1099,172 @@ struct H245AudioCapability* ooCapabilityCreateSimpleCapability
}
return NULL;
}
+/* This is used for g726, AMRNB, Speex */
+struct H245AudioCapability* ooCapabilityCreateNonStandardCapability
+ (ooH323EpCapability *epCap, OOCTXT* pctxt, int dir)
+{
+ H245AudioCapability *pAudio=NULL;
+ OOCapParams *params;
+ if(!epCap || !epCap->params)
+ {
+ OOTRACEERR1("Error:Invalid capability parameters to "
+ "ooCapabilityCreateSimpleCapability.\n");
+ return NULL;
+ }
+ params =(OOCapParams*)epCap->params;
+ pAudio = (H245AudioCapability*)memAlloc(pctxt,
+ sizeof(H245AudioCapability));
+ if(!pAudio)
+ {
+ OOTRACEERR1("ERROR:Memory - ooCapabilityCreateSimpleCapability - pAudio\n");
+ return NULL;
+ }
+
+
+ switch(epCap->cap)
+ {
+ case OO_AMRNB:
+ case OO_G726:
+ case OO_G726AAL2:
+ case OO_SPEEX:
+ pAudio->t = T_H245AudioCapability_nonStandard;
+ pAudio->u.nonStandard = (H245NonStandardParameter*)memAlloc(pctxt,
+ sizeof(H245NonStandardParameter));
+ if(!pAudio->u.nonStandard)
+ {
+ OOTRACEERR1("Error:Memory - ooCapabilityCreateSimpleCapability - g726\n");
+ memFreePtr(pctxt, pAudio);
+ return NULL;
+ }
+
+ pAudio->u.nonStandard->nonStandardIdentifier.t=T_H245NonStandardIdentifier_h221NonStandard;
+ pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard =
+ (H245NonStandardIdentifier_h221NonStandard *) memAlloc(pctxt,
+ sizeof(H245NonStandardIdentifier_h221NonStandard));
+ if (!pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard) {
+ OOTRACEERR2("Error:Memory - ooCapabilityCreateSimpleCapability - %d\n", epCap->cap);
+ memFreePtr(pctxt, pAudio);
+ return NULL;
+ }
+
+ pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard->t35CountryCode =
+ gH323ep.t35CountryCode;
+ pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard->t35Extension =
+ gH323ep.t35Extension;
+ pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard->manufacturerCode =
+ gH323ep.manufacturerCode;
+
+ switch (epCap->cap) {
+ case OO_G726:
+ pAudio->u.nonStandard->data.data = (unsigned char*)"G.726-32k";
+ pAudio->u.nonStandard->data.numocts = sizeof("G.726-32k")-1;
+ break;
+ case OO_G726AAL2:
+ pAudio->u.nonStandard->data.data = (unsigned char*)"G726r32";
+ pAudio->u.nonStandard->data.numocts = sizeof("G726r32")-1;
+ /* Cisco G726 */
+ pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard->t35CountryCode = 181;
+ pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard->t35Extension = 0;
+ pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard->manufacturerCode = 18;
+
+ break;
+ case OO_AMRNB:
+ pAudio->u.nonStandard->data.data = (unsigned char*)"AMRNB";
+ pAudio->u.nonStandard->data.numocts = sizeof("AMRNB")-1;
+ break;
+
+ case OO_SPEEX:
+ pAudio->u.nonStandard->data.data = (unsigned char*)"Speex";
+ pAudio->u.nonStandard->data.numocts = sizeof("Speex")-1;
+ /* Equivalence OpenH323 SpeexNB */
+ pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard->t35CountryCode = 9;
+ pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard->t35Extension = 0;
+ pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard->manufacturerCode = 61;
+
+ break;
+ }
+ return pAudio;
+
+ default:
+ OOTRACEERR2("ERROR: Don't know how to create audio capability %d\n",
+ epCap->cap);
+ }
+ return NULL;
+}
+
+/* Our t.38 params */
+
+struct H245DataMode_application* ooCreateT38ApplicationData
+ (OOCTXT* pctxt, H245DataMode_application *app)
+{
+ app->t = T_H245DataApplicationCapability_application_t38fax;
+ app->u.t38fax =
+ (H245DataMode_application_t38fax *) memAlloc(pctxt,
+ sizeof(H245DataMode_application_t38fax));
+ if (!app->u.t38fax) {
+ OOTRACEERR1("Error:Memory - ooCreateT38AppData\n");
+ return NULL;
+ }
+ memset(app->u.t38fax, 0, sizeof(H245DataApplicationCapability_application_t38fax));
+ app->u.t38fax->t38FaxProtocol.t = T_H245DataProtocolCapability_udp;
+ app->u.t38fax->t38FaxProfile.m.versionPresent = TRUE;
+ app->u.t38fax->t38FaxProfile.version = 0;
+ app->u.t38fax->t38FaxProfile.m.t38FaxRateManagementPresent = TRUE;
+ app->u.t38fax->t38FaxProfile.t38FaxRateManagement.t =
+ T_H245T38FaxRateManagement_transferredTCF;
+ app->u.t38fax->t38FaxProfile.m.t38FaxUdpOptionsPresent = TRUE;
+ app->u.t38fax->t38FaxProfile.t38FaxUdpOptions.m.t38FaxMaxBufferPresent = TRUE;
+ app->u.t38fax->t38FaxProfile.t38FaxUdpOptions.t38FaxMaxBuffer = 200;
+ app->u.t38fax->t38FaxProfile.t38FaxUdpOptions.m.t38FaxMaxDatagramPresent = TRUE;
+ app->u.t38fax->t38FaxProfile.t38FaxUdpOptions.t38FaxMaxDatagram = 72;
+ app->u.t38fax->t38FaxProfile.t38FaxUdpOptions.t38FaxUdpEC.t =
+ T_H245T38FaxUdpOptions_t38FaxUdpEC_t38UDPRedundancy;
+
+ return app;
+}
+
+/* This is used for T.38 */
+struct H245DataApplicationCapability* ooCapabilityCreateT38Capability
+ (ooH323EpCapability *epCap, OOCTXT* pctxt, int dir)
+{
+ H245DataApplicationCapability *pT38=NULL;
+ OOCapParams *params;
+ H245DataMode_application *pT38app;
+ if(!epCap || !epCap->params)
+ {
+ OOTRACEERR1("Error:Invalid capability parameters to "
+ "ooCapabilityCreateSimpleCapability.\n");
+ return NULL;
+ }
+ params =(OOCapParams*)epCap->params;
+ pT38 = (H245DataApplicationCapability*)memAlloc(pctxt,
+ sizeof(H245DataApplicationCapability));
+ if(!pT38)
+ {
+ OOTRACEERR1("ERROR:Memory - ooCapabilityCreateT38Capability - pT38\n");
+ return NULL;
+ }
+ memset(pT38, 0, sizeof(H245DataApplicationCapability));
+ pT38app = (void *)&pT38->application;
+
+ switch(epCap->cap)
+ {
+ case OO_T38:
+ pT38->maxBitRate = 144;
+ if (!ooCreateT38ApplicationData(pctxt, pT38app)) {
+ OOTRACEERR2("Error:Memory - ooCapabilityCreateT38Capability - %d\n", epCap->cap);
+ memFreePtr(pctxt, pT38);
+ return NULL;
+ }
+ return pT38;
+
+ default:
+ OOTRACEERR2("ERROR: Don't know how to create T38 capability %d\n",
+ epCap->cap);
+ }
+ return NULL;
+}
+
/* Used for g711 ulaw/alaw, g728, g729, g729a, g7231 */
ASN1BOOL ooCapabilityCheckCompatibility_Simple
@@ -935,10 +1309,15 @@ ASN1BOOL ooCapabilityCheckCompatibility_Simple
cap = OO_G729A;
noofframes = audioCap->u.g729AnnexA;
break;
+ case T_H245AudioCapability_g729wAnnexB:
+ cap = OO_G729B;
+ noofframes = audioCap->u.g729wAnnexB;
+ break;
case T_H245AudioCapability_g7231:
cap = OO_G7231;
noofframes = audioCap->u.g7231->maxAl_sduAudioFrames;
break;
+
default:
return FALSE;
}
@@ -978,6 +1357,57 @@ ASN1BOOL ooCapabilityCheckCompatibility_Simple
return FALSE;
}
+/* Used for g726, AMRNB */
+ASN1BOOL ooCapabilityCheckCompatibility_NonStandard
+ (OOH323CallData *call, ooH323EpCapability* epCap,
+ H245AudioCapability* audioCap, int dir)
+{
+ int cap;
+
+ OOTRACEDBGC2("Comparing channel with codec type: %d\n", audioCap->t);
+
+ if (audioCap->t == T_H245AudioCapability_nonStandard &&
+ audioCap->u.nonStandard &&
+ audioCap->u.nonStandard->nonStandardIdentifier.t ==
+ T_H245NonStandardIdentifier_h221NonStandard) {
+ switch (audioCap->u.nonStandard->data.numocts) {
+ case sizeof("G.726-32k")-1:
+ if (!strncmp((char *)audioCap->u.nonStandard->data.data, "G.726-32k",
+ audioCap->u.nonStandard->data.numocts))
+ cap = OO_G726;
+ else
+ return FALSE;
+ break;
+ case sizeof("G726r32")-1:
+ if (!strncmp((char *)audioCap->u.nonStandard->data.data, "G726r32",
+ audioCap->u.nonStandard->data.numocts))
+ cap = OO_G726AAL2;
+ else
+ return FALSE;
+ break;
+ case sizeof("AMRNB")-1: /* case sizeof("Speex")-1 */
+ if (!strncmp((char *)audioCap->u.nonStandard->data.data, "AMRNB",
+ audioCap->u.nonStandard->data.numocts))
+ cap = OO_AMRNB;
+ else if (!strncmp((char *)audioCap->u.nonStandard->data.data, "Speex",
+ audioCap->u.nonStandard->data.numocts))
+ cap = OO_SPEEX;
+ else
+ return FALSE;
+ break;
+ default:
+ return FALSE;
+ }
+ } else
+ return FALSE;
+
+ OOTRACEDBGC3("Comparing codecs: current=%d, requested=%d\n",
+ epCap->cap, cap);
+ if(cap != epCap->cap) { return FALSE; }
+
+ return TRUE;
+
+}
OOBOOL ooCapabilityCheckCompatibility_GSM
@@ -1003,6 +1433,8 @@ OOBOOL ooCapabilityCheckCompatibility_GSM
return FALSE;
}
+ if(cap != epCap->cap) { return FALSE; }
+
/* can we receive this capability */
if(dir & OORX)
{
@@ -1026,6 +1458,25 @@ OOBOOL ooCapabilityCheckCompatibility_GSM
}
+OOBOOL ooCapabilityCheckCompatibility_T38
+ (OOH323CallData *call, ooH323EpCapability* epCap,
+ H245DataApplicationCapability* t38Cap, int dir)
+{
+ unsigned cap = 0;
+ switch(t38Cap->application.t)
+ {
+ case T_H245DataApplicationCapability_application_t38fax:
+ cap = OO_T38;
+ break;
+ default:
+ return FALSE;
+ }
+
+ if(cap != epCap->cap) { return FALSE; }
+
+ return TRUE;
+}
+
OOBOOL ooCapabilityCheckCompatibility_H263Video
(struct OOH323CallData *call, ooH323EpCapability *epCap,
@@ -1202,8 +1653,13 @@ OOBOOL ooCapabilityCheckCompatibility_Audio
case T_H245AudioCapability_g728:
case T_H245AudioCapability_g729:
case T_H245AudioCapability_g729AnnexA:
+ case T_H245AudioCapability_g729wAnnexB:
case T_H245AudioCapability_g7231:
return ooCapabilityCheckCompatibility_Simple(call, epCap, audioCap, dir);
+ case T_H245AudioCapability_nonStandard:
+ return ooCapabilityCheckCompatibility_NonStandard(call, epCap, audioCap, dir);
+ case T_H245AudioCapability_gsmHalfRate:
+ case T_H245AudioCapability_gsmEnhancedFullRate:
case T_H245AudioCapability_gsmFullRate:
return ooCapabilityCheckCompatibility_GSM(call, epCap, audioCap, dir);
default:
@@ -1249,6 +1705,8 @@ OOBOOL ooCapabilityCheckCompatibility
dataType->u.videoData, dir);
break;
case T_H245DataType_data:
+ if(epCap->capType == OO_CAP_TYPE_DATA)
+ return ooCapabilityCheckCompatibility_T38(call, epCap, dataType->u.data, dir);
default:
OOTRACEDBGC3("ooCapabilityCheckCompatibility - Unsupported "
"capability. (%s, %s)\n", call->callType, call->callToken);
@@ -1280,10 +1738,10 @@ ASN1BOOL ooCheckCompatibility
case OO_G711ALAW56K:
case OO_G711ULAW64K:
case OO_G711ULAW56K:
- /*case OO_G726:*/
case OO_G728:
case OO_G729:
case OO_G729A:
+ case OO_G729B:
case OO_G7231:
if(((OOCapParams*)txCap->params)->txframes <=
((OOCapParams*)rxCap->params)->rxframes)
@@ -1485,10 +1943,15 @@ ooH323EpCapability* ooIsAudioDataTypeSimpleSupported
framesPerPkt = audioCap->u.g729AnnexA;
cap = OO_G729A;
break;
+ case T_H245AudioCapability_g729wAnnexB:
+ framesPerPkt = audioCap->u.g729wAnnexB;
+ cap = OO_G729B;
+ break;
case T_H245AudioCapability_g7231:
framesPerPkt = audioCap->u.g7231->maxAl_sduAudioFrames;
cap = OO_G7231;
break;
+
default:
return NULL;
}
@@ -1526,7 +1989,9 @@ ooH323EpCapability* ooIsAudioDataTypeSimpleSupported
{
if(((OOCapParams*)cur->params)->rxframes < framesPerPkt)
return NULL;
- else{
+ if(((OOCapParams*)cur->params)->rxframes > framesPerPkt)
+ ((OOCapParams*)cur->params)->rxframes = framesPerPkt;
+
OOTRACEDBGC4("We can receive Simple capability %s. (%s, %s)\n",
ooGetCapTypeText(cur->cap), call->callType,
call->callToken);
@@ -1555,7 +2020,6 @@ ooH323EpCapability* ooIsAudioDataTypeSimpleSupported
ooGetCapTypeText(cur->cap), call->callType,
call->callToken);
return epCap;
- }
}
/* Can we transmit compatible stream */
@@ -1601,6 +2065,145 @@ ooH323EpCapability* ooIsAudioDataTypeSimpleSupported
return NULL;
}
+/* used for g726, AMRNB */
+ooH323EpCapability* ooIsAudioDataTypeNonStandardSupported
+ (OOH323CallData *call, H245AudioCapability* audioCap, int dir)
+{
+ int cap;
+ ooH323EpCapability *cur=NULL, *epCap=NULL;
+ OOCapParams * params= NULL;
+
+ if (audioCap->t == T_H245AudioCapability_nonStandard &&
+ audioCap->u.nonStandard &&
+ audioCap->u.nonStandard->nonStandardIdentifier.t ==
+ T_H245NonStandardIdentifier_h221NonStandard) {
+ switch (audioCap->u.nonStandard->data.numocts) {
+ case sizeof("G.726-32k")-1:
+ if (!strncmp((char *)audioCap->u.nonStandard->data.data, "G.726-32k",
+ audioCap->u.nonStandard->data.numocts))
+ cap = OO_G726;
+ else
+ return NULL;
+ break;
+ case sizeof("G726r32")-1:
+ if (!strncmp((char *)audioCap->u.nonStandard->data.data, "G726r32",
+ audioCap->u.nonStandard->data.numocts))
+ cap = OO_G726AAL2;
+ else
+ return NULL;
+ break;
+ case sizeof("AMRNB")-1: /* sizeof("Speex") */
+ if (!strncmp((char *)audioCap->u.nonStandard->data.data, "AMRNB",
+ audioCap->u.nonStandard->data.numocts))
+ cap = OO_AMRNB;
+ else if (!strncmp((char *)audioCap->u.nonStandard->data.data, "Speex",
+ audioCap->u.nonStandard->data.numocts))
+ cap = OO_SPEEX;
+ else
+ return NULL;
+ break;
+ default:
+ return NULL;
+ }
+ } else
+ return NULL;
+
+ OOTRACEDBGC4("Determined Simple audio data type to be of type %s. Searching"
+ " for matching capability.(%s, %s)\n",
+ ooGetCapTypeText(cap), call->callType, call->callToken);
+
+ /* If we have call specific caps, we use them; otherwise use general
+ endpoint caps
+ */
+ if(call->ourCaps)
+ cur = call->ourCaps;
+ else
+ cur = gH323ep.myCaps;
+
+ while(cur)
+ {
+ OOTRACEDBGC4("Local cap being compared %s. (%s, %s)\n",
+ ooGetCapTypeText(cur->cap),call->callType, call->callToken);
+
+ if(cur->cap == cap && (cur->dir & dir))
+ break;
+ cur = cur->next;
+ }
+
+ if(!cur) return NULL;
+
+ OOTRACEDBGC4("Found matching simple audio capability type %s. Comparing"
+ " other parameters. (%s, %s)\n", ooGetCapTypeText(cap),
+ call->callType, call->callToken);
+
+ /* can we receive this capability */
+ if(dir & OORX)
+ {
+ OOTRACEDBGC4("We can receive Simple capability %s. (%s, %s)\n",
+ ooGetCapTypeText(cur->cap), call->callType,
+ call->callToken);
+ epCap = (ooH323EpCapability*)memAlloc(call->pctxt,
+ sizeof(ooH323EpCapability));
+ params=(OOCapParams*)memAlloc(call->pctxt,sizeof(OOCapParams));
+ if(!epCap || !params)
+ {
+ OOTRACEERR3("Error:Memory - ooIsAudioDataTypeSimpleSupported - "
+ "epCap/params (%s, %s)\n", call->callType,
+ call->callToken);
+ return NULL;
+ }
+ epCap->params = params;
+ epCap->cap = cur->cap;
+ epCap->dir = cur->dir;
+ epCap->capType = cur->capType;
+ epCap->startReceiveChannel = cur->startReceiveChannel;
+ epCap->startTransmitChannel= cur->startTransmitChannel;
+ epCap->stopReceiveChannel = cur->stopReceiveChannel;
+ epCap->stopTransmitChannel = cur->stopTransmitChannel;
+ epCap->next = NULL;
+ memcpy(epCap->params, cur->params, sizeof(OOCapParams));
+ OOTRACEDBGC4("Returning copy of matched receive capability %s. "
+ "(%s, %s)\n",
+ ooGetCapTypeText(cur->cap), call->callType,
+ call->callToken);
+ return epCap;
+ }
+
+ /* Can we transmit compatible stream */
+ if(dir & OOTX)
+ {
+ OOTRACEDBGC4("We can transmit Simple capability %s. (%s, %s)\n",
+ ooGetCapTypeText(cur->cap), call->callType,
+ call->callToken);
+ epCap = (ooH323EpCapability*)memAlloc(call->pctxt,
+ sizeof(ooH323EpCapability));
+ params =(OOCapParams*)memAlloc(call->pctxt,sizeof(OOCapParams));
+ if(!epCap || !params)
+ {
+ OOTRACEERR3("Error:Memory - ooIsAudioDataTypeSimpleSupported - "
+ "epCap/params (%s, %s)\n", call->callType,
+ call->callToken);
+ return NULL;
+ }
+ epCap->params = params;
+ epCap->cap = cur->cap;
+ epCap->dir = cur->dir;
+ epCap->capType = cur->capType;
+ epCap->startReceiveChannel = cur->startReceiveChannel;
+ epCap->startTransmitChannel= cur->startTransmitChannel;
+ epCap->stopReceiveChannel = cur->stopReceiveChannel;
+ epCap->stopTransmitChannel = cur->stopTransmitChannel;
+ epCap->next = NULL;
+ memcpy(epCap->params, cur->params, sizeof(OOCapParams));
+ OOTRACEDBGC4("Returning copy of matched transmit capability %s."
+ "(%s, %s)\n",
+ ooGetCapTypeText(cur->cap), call->callType,
+ call->callToken);
+ return epCap;
+ }
+ return NULL;
+}
+
ooH323EpCapability* ooIsAudioDataTypeSupported
@@ -1617,8 +2220,11 @@ ooH323EpCapability* ooIsAudioDataTypeSupported
case T_H245AudioCapability_g728:
case T_H245AudioCapability_g729:
case T_H245AudioCapability_g729AnnexA:
+ case T_H245AudioCapability_g729wAnnexB:
case T_H245AudioCapability_g7231:
return ooIsAudioDataTypeSimpleSupported(call, audioCap, dir);
+ case T_H245AudioCapability_nonStandard:
+ return ooIsAudioDataTypeNonStandardSupported(call, audioCap, dir);
case T_H245AudioCapability_gsmFullRate:
case T_H245AudioCapability_gsmHalfRate:
case T_H245AudioCapability_gsmEnhancedFullRate:
@@ -1628,6 +2234,110 @@ ooH323EpCapability* ooIsAudioDataTypeSupported
}
}
+ooH323EpCapability* ooIsT38Supported
+ (OOH323CallData *call, H245DataApplicationCapability* t38Cap, int dir)
+{
+ int cap = 0;
+ ooH323EpCapability *cur=NULL, *epCap=NULL;
+ OOCapParams *params= NULL;
+ /* Find similar capability */
+ switch(t38Cap->application.t)
+ {
+ case T_H245DataApplicationCapability_application_t38fax:
+ cap = OO_T38;
+ break;
+ default:
+ return NULL;
+ }
+
+ if(call->ourCaps)
+ cur = call->ourCaps;
+ else
+ cur = gH323ep.myCaps;
+
+ while(cur)
+ {
+ OOTRACEDBGC4("Local cap being compared %s. (%s, %s)\n",
+ ooGetCapTypeText(cur->cap),call->callType, call->callToken);
+
+ if(cur->cap == cap && (cur->dir & dir))
+ break;
+ cur = cur->next;
+ }
+
+ if(!cur) return NULL;
+
+ OOTRACEDBGC4("Found matching t38 capability type %s. Comparing"
+ " other parameters. (%s, %s)\n", ooGetCapTypeText(cap),
+ call->callType, call->callToken);
+
+ /* can we receive this capability */
+ if(dir & OORX)
+ {
+ OOTRACEDBGC4("We can receive Simple capability %s. (%s, %s)\n",
+ ooGetCapTypeText(cur->cap), call->callType,
+ call->callToken);
+ epCap = (ooH323EpCapability*)memAllocZ(call->pctxt,
+ sizeof(ooH323EpCapability));
+ params=(OOCapParams*)memAlloc(call->pctxt,sizeof(OOCapParams));
+ if(!epCap || !params)
+ {
+ OOTRACEERR3("Error:Memory - ooIsT38Supported - "
+ "epCap/params (%s, %s)\n", call->callType,
+ call->callToken);
+ return NULL;
+ }
+ epCap->params = params;
+ epCap->cap = cur->cap;
+ epCap->dir = cur->dir;
+ epCap->capType = cur->capType;
+ epCap->startReceiveChannel = cur->startReceiveChannel;
+ epCap->startTransmitChannel= cur->startTransmitChannel;
+ epCap->stopReceiveChannel = cur->stopReceiveChannel;
+ epCap->stopTransmitChannel = cur->stopTransmitChannel;
+ epCap->next = NULL;
+ memcpy(epCap->params, cur->params, sizeof(OOCapParams));
+ OOTRACEDBGC4("Returning copy of matched receive capability %s. "
+ "(%s, %s)\n",
+ ooGetCapTypeText(cur->cap), call->callType,
+ call->callToken);
+ return epCap;
+ }
+
+ /* Can we transmit compatible stream */
+ if(dir & OOTX)
+ {
+ OOTRACEDBGC4("We can transmit Simple capability %s. (%s, %s)\n",
+ ooGetCapTypeText(cur->cap), call->callType,
+ call->callToken);
+ epCap = (ooH323EpCapability*)memAlloc(call->pctxt,
+ sizeof(ooH323EpCapability));
+ params =(OOCapParams*)memAllocZ(call->pctxt,sizeof(OOCapParams));
+ if(!epCap || !params)
+ {
+ OOTRACEERR3("Error:Memory - ooIsAudioDataTypeSimpleSupported - "
+ "epCap/params (%s, %s)\n", call->callType,
+ call->callToken);
+ return NULL;
+ }
+ epCap->params = params;
+ epCap->cap = cur->cap;
+ epCap->dir = cur->dir;
+ epCap->capType = cur->capType;
+ epCap->startReceiveChannel = cur->startReceiveChannel;
+ epCap->startTransmitChannel= cur->startTransmitChannel;
+ epCap->stopReceiveChannel = cur->stopReceiveChannel;
+ epCap->stopTransmitChannel = cur->stopTransmitChannel;
+ epCap->next = NULL;
+ memcpy(epCap->params, cur->params, sizeof(OOCapParams));
+ OOTRACEDBGC4("Returning copy of matched transmit capability %s."
+ "(%s, %s)\n",
+ ooGetCapTypeText(cur->cap), call->callType,
+ call->callToken);
+ return epCap;
+ }
+ return NULL;
+}
ooH323EpCapability* ooIsVideoDataTypeH263Supported
(OOH323CallData *call, H245H263VideoCapability* pH263Cap, int dir,
@@ -1828,10 +2538,12 @@ ooH323EpCapability* ooIsDataTypeSupported
OOTRACEDBGC3("Looking for audio dataType support. (%s, %s)\n",
call->callType, call->callToken);
return ooIsAudioDataTypeSupported(call, data->u.audioData, dir);
+
case T_H245DataType_data:
- OOTRACEDBGC3("Data type not supported.(%s, %s)\n",
+ OOTRACEDBGC3("Looking for application data dataType support.(%s, %s)\n",
call->callType, call->callToken);
- return NULL;
+ return ooIsT38Supported(call, data->u.data, dir);
+
case T_H245DataType_encryptionData:
OOTRACEDBGC3("Encryption data type not supported.(%s, %s)\n",
call->callType, call->callToken);
@@ -1958,7 +2670,6 @@ int ooPreppendCapToCapPrefs(OOH323CallData *call, int cap)
return OO_OK;
}
-
int ooAddRemoteCapability(OOH323CallData *call, H245Capability *cap)
{
switch(cap->t)
@@ -1972,6 +2683,19 @@ int ooAddRemoteCapability(OOH323CallData *call, H245Capability *cap)
case T_H245Capability_receiveAndTransmitAudioCapability:
return ooAddRemoteAudioCapability(call,
cap->u.receiveAndTransmitAudioCapability, OORXTX);
+
+
+ case T_H245Capability_receiveDataApplicationCapability:
+ return ooAddRemoteDataApplicationCapability(call, cap->u.receiveDataApplicationCapability,
+ OORX);
+ case T_H245Capability_transmitDataApplicationCapability:
+ return ooAddRemoteDataApplicationCapability(call, cap->u.transmitDataApplicationCapability,
+ OOTX);
+ case T_H245Capability_receiveAndTransmitDataApplicationCapability:
+ return ooAddRemoteDataApplicationCapability(call,
+ cap->u.receiveAndTransmitDataApplicationCapability, OORXTX);
+
+
default:
OOTRACEDBGA3("Unsupported cap type encountered. Ignoring. (%s, %s)\n",
call->callType, call->callToken);
@@ -1979,6 +2703,23 @@ int ooAddRemoteCapability(OOH323CallData *call, H245Capability *cap)
return OO_OK;
}
+int ooAddRemoteDataApplicationCapability(OOH323CallData *call,
+ H245DataApplicationCapability *dataCap,
+ int dir)
+{
+ switch(dataCap->application.t)
+ {
+ case T_H245DataApplicationCapability_application_t38fax:
+ return ooCapabilityAddT38Capability(call, OO_T38,
+ dir, NULL, NULL, NULL, NULL,TRUE);
+ default:
+ OOTRACEDBGA1("Unsupported data capability type\n");
+
+ }
+ return OO_OK;
+}
+
+
int ooAddRemoteAudioCapability(OOH323CallData *call,
H245AudioCapability *audioCap,
int dir)
@@ -2034,6 +2775,44 @@ int ooAddRemoteAudioCapability(OOH323CallData *call,
return ooCapabilityAddSimpleCapability(call, OO_G726, txframes,
rxframes, FALSE, dir, NULL, NULL, NULL, NULL, TRUE);
*/
+ case T_H245AudioCapability_nonStandard:
+ if (audioCap->u.nonStandard &&
+ audioCap->u.nonStandard->nonStandardIdentifier.t ==
+ T_H245NonStandardIdentifier_h221NonStandard &&
+ audioCap->u.nonStandard->data.numocts == sizeof("G.726-32k")-1 &&
+ !strncmp((char *)audioCap->u.nonStandard->data.data, "G.726-32k",
+ audioCap->u.nonStandard->data.numocts))
+ return ooCapabilityAddSimpleCapability(call, OO_G726, 20,
+ 240, FALSE, dir, NULL, NULL, NULL, NULL, TRUE);
+
+ if (audioCap->u.nonStandard &&
+ audioCap->u.nonStandard->nonStandardIdentifier.t ==
+ T_H245NonStandardIdentifier_h221NonStandard &&
+ audioCap->u.nonStandard->data.numocts == sizeof("G726r32")-1 &&
+ !strncmp((char *)audioCap->u.nonStandard->data.data, "G726r32",
+ audioCap->u.nonStandard->data.numocts))
+ return ooCapabilityAddSimpleCapability(call, OO_G726AAL2, 20,
+ 240, FALSE, dir, NULL, NULL, NULL, NULL, TRUE);
+
+ if (audioCap->u.nonStandard &&
+ audioCap->u.nonStandard->nonStandardIdentifier.t ==
+ T_H245NonStandardIdentifier_h221NonStandard &&
+ audioCap->u.nonStandard->data.numocts == sizeof("AMRNB")-1 &&
+ !strncmp((char *)audioCap->u.nonStandard->data.data, "AMRNB",
+ audioCap->u.nonStandard->data.numocts))
+ return ooCapabilityAddSimpleCapability(call, OO_AMRNB, 4,
+ 4, FALSE, dir, NULL, NULL, NULL, NULL, TRUE);
+
+ if (audioCap->u.nonStandard &&
+ audioCap->u.nonStandard->nonStandardIdentifier.t ==
+ T_H245NonStandardIdentifier_h221NonStandard &&
+ audioCap->u.nonStandard->data.numocts == sizeof("Speex")-1 &&
+ !strncmp((char *)audioCap->u.nonStandard->data.data, "Speex",
+ audioCap->u.nonStandard->data.numocts))
+ return ooCapabilityAddSimpleCapability(call, OO_SPEEX, 4,
+ 4, FALSE, dir, NULL, NULL, NULL, NULL, TRUE);
+ break;
+
case T_H245AudioCapability_g728:
if(dir&OOTX) txframes = audioCap->u.g728;
else if(dir&OORX) rxframes = audioCap->u.g728;
@@ -2064,6 +2843,16 @@ int ooAddRemoteAudioCapability(OOH323CallData *call,
return ooCapabilityAddSimpleCapability(call, OO_G729A, txframes,
rxframes, FALSE, dir, NULL, NULL, NULL, NULL, TRUE);
+ case T_H245AudioCapability_g729wAnnexB:
+ if(dir&OOTX) txframes = audioCap->u.g729wAnnexB;
+ else if(dir&OORX) rxframes = audioCap->u.g729wAnnexB;
+ else{
+ txframes = audioCap->u.g729wAnnexB;
+ rxframes = audioCap->u.g729wAnnexB;
+ }
+ return ooCapabilityAddSimpleCapability(call, OO_G729B, txframes,
+ rxframes, FALSE, dir, NULL, NULL, NULL, NULL, TRUE);
+
case T_H245AudioCapability_g7231:
if(dir&OOTX) txframes = audioCap->u.g7231->maxAl_sduAudioFrames;
else if(dir&OORX) rxframes = audioCap->u.g7231->maxAl_sduAudioFrames;
@@ -2101,10 +2890,6 @@ int ooAddRemoteAudioCapability(OOH323CallData *call,
return OO_OK;
}
-
-
-
-
int ooCapabilityUpdateJointCapabilities
(OOH323CallData* call, H245Capability *cap)
{
@@ -2123,7 +2908,9 @@ int ooCapabilityUpdateJointCapabilities
OORX);
break;
case T_H245Capability_receiveAndTransmitAudioCapability:
- epCap = NULL;
+ epCap = ooIsAudioDataTypeSupported(call, cap->u.receiveAudioCapability, OOTX);
+ if (!epCap)
+ epCap = ooIsAudioDataTypeSupported(call, cap->u.transmitAudioCapability, OORX);
break;
case T_H245Capability_receiveVideoCapability:
return ooCapabilityUpdateJointCapabilitiesVideo(call,
@@ -2131,6 +2918,22 @@ int ooCapabilityUpdateJointCapabilities
case T_H245Capability_transmitVideoCapability:
return ooCapabilityUpdateJointCapabilitiesVideo(call,
cap->u.transmitVideoCapability, OORX);
+
+ case T_H245Capability_receiveDataApplicationCapability:
+ epCap= ooIsT38Supported(call, cap->u.receiveDataApplicationCapability,
+ OOTX);
+ break;
+ case T_H245Capability_transmitDataApplicationCapability:
+ epCap = ooIsT38Supported(call, cap->u.transmitDataApplicationCapability,
+ OORX);
+ break;
+ case T_H245Capability_receiveAndTransmitDataApplicationCapability:
+ epCap = ooIsT38Supported(call, cap->u.receiveAndTransmitDataApplicationCapability, OOTX);
+ if (!epCap)
+ epCap = ooIsT38Supported(call, cap->u.receiveAndTransmitDataApplicationCapability, OORX);
+ break;
+
+
case T_H245Capability_receiveUserInputCapability:
if((cap->u.receiveUserInputCapability->t ==
T_H245UserInputCapability_basicString) &&
@@ -2310,7 +3113,7 @@ const char* ooGetCapTypeText (OOCapabilities cap)
{
static const char *capTypes[]={
"unknown",
- "OO_NONSTANDARD",
+ "OO_G726",
"OO_G711ALAW64K",
"OO_G711ALAW56K",
"OO_G711ULAW64K",
@@ -2322,8 +3125,8 @@ const char* ooGetCapTypeText (OOCapabilities cap)
"OO_G728",
"OO_G729",
"OO_G729ANNEXA",
- "OO_IS11172AUDIO",
- "OO_IS13818AUDIO",
+ "OO_AMRNB",
+ "OO_G726AAL2",
"OO_G729WANNEXB",
"OO_G729ANNEXAWANNEXB",
"OO_G7231ANNEXC",
@@ -2332,7 +3135,7 @@ const char* ooGetCapTypeText (OOCapabilities cap)
"OO_GSMENHANCEDFULLRATE",
"OO_GENERICAUDIO",
"OO_G729EXTENSIONS",
- "OO_VBD",
+ "OO_SPEEX",
"OO_AUDIOTELEPHONYEVENT",
"OO_AUDIOTONE",
"OO_EXTELEM1",
@@ -2343,7 +3146,8 @@ const char* ooGetCapTypeText (OOCapabilities cap)
"OO_H263VIDEO",
"OO_IS11172VIDEO", /* mpeg */
"OO_GENERICVIDEO",
- "OO_EXTELEMVIDEO"
+ "OO_EXTELEMVIDEO",
+ "OO_T38" /* T.38 */
};
return ooUtilsGetText (cap, capTypes, OONUMBEROF(capTypes));
}
diff --git a/addons/ooh323c/src/ooCapability.h b/addons/ooh323c/src/ooCapability.h
index 75d0d563a..4e108cfd8 100644
--- a/addons/ooh323c/src/ooCapability.h
+++ b/addons/ooh323c/src/ooCapability.h
@@ -33,6 +33,7 @@
supported */
typedef enum OOCapabilities{
OO_CAP_AUDIO_BASE = 0,
+ OO_G726 = 1,
OO_G711ALAW64K = 2,
OO_G711ALAW56K = 3,
OO_G711ULAW64K = 4,
@@ -44,8 +45,13 @@ typedef enum OOCapabilities{
OO_G728 = 10,
OO_G729 = 11,
OO_G729A = 12,
+#if 0
OO_IS11172_AUDIO = 13,
OO_IS13818_AUDIO = 14,
+#else
+ OO_AMRNB = 13,
+ OO_G726AAL2 = 14,
+#endif
OO_G729B = 15,
OO_G729AB = 16,
OO_G7231C = 17,
@@ -54,7 +60,11 @@ typedef enum OOCapabilities{
OO_GSMENHANCEDFULLRATE = 20,
OO_GENERICAUDIO = 21,
OO_G729EXT = 22,
+#if 0
OO_AUDIO_VBD = 23,
+#else
+ OO_SPEEX = 23,
+#endif
OO_AUDIOTELEPHONYEVENT = 24,
OO_AUDIO_TONE = 25,
OO_EXTELEM1 = 26,
@@ -65,7 +75,8 @@ typedef enum OOCapabilities{
OO_H263VIDEO = 31,
OO_IS11172VIDEO = 32, /* mpeg */
OO_GENERICVIDEO = 33,
- OO_EXTELEMVIDEO = 34
+ OO_EXTELEMVIDEO = 34,
+ OO_T38 = 35
} OOCapabilities;
@@ -74,6 +85,7 @@ typedef enum OOCapabilities{
#define OO_CAP_DTMF_Q931 (1<<1)
#define OO_CAP_DTMF_H245_alphanumeric (1<<2)
#define OO_CAP_DTMF_H245_signal (1<<3)
+#define OO_CAP_DTMF_CISCO (1<<4)
/**
* This structure defines the preference order for capabilities.
@@ -548,7 +560,7 @@ struct H245VideoCapability* ooCapabilityCreateVideoCapability
* @return Pointer to the created DTMF capability, NULL in case of
* failure.
*/
-void * ooCapabilityCreateDTMFCapability(int cap, OOCTXT *pctxt);
+void * ooCapabilityCreateDTMFCapability(int cap, int dtmfcodec, OOCTXT *pctxt);
/**
@@ -579,6 +591,8 @@ struct H245AudioCapability* ooCapabilityCreateGSMFullRateCapability
*/
struct H245AudioCapability* ooCapabilityCreateSimpleCapability
(ooH323EpCapability *epCap, OOCTXT* pctxt, int dir);
+struct H245AudioCapability* ooCapabilityCreateNonStandardCapability
+ (ooH323EpCapability *epCap, OOCTXT* pctxt, int dir);
/**
@@ -651,6 +665,14 @@ ooH323EpCapability* ooIsVideoDataTypeH263Supported
ooH323EpCapability* ooIsDataTypeSupported
(struct OOH323CallData *call, H245DataType *data, int dir);
+/* fill t.38 application data */
+H245DataMode_application* ooCreateT38ApplicationData
+ (OOCTXT* pctxt, H245DataMode_application *app);
+
+H245DataApplicationCapability* ooCapabilityCreateT38Capability
+ (ooH323EpCapability *epCap, OOCTXT* pctxt, int dir);
+
+
/**
* This function is used to clear the capability preference order.
* @param call Handle to call, if capability preference order for call
@@ -714,6 +736,56 @@ EXTERN int ooPreppendCapToCapPrefs(struct OOH323CallData *call, int cap);
EXTERN const char* ooGetCapTypeText (OOCapabilities cap);
+EXTERN int epCapIsPreferred(struct OOH323CallData *call, ooH323EpCapability *epCap);
+
+/**/
+ASN1BOOL ooCapabilityCheckCompatibility_Simple
+ (struct OOH323CallData *call, ooH323EpCapability* epCap,
+ H245AudioCapability* audioCap, int dir);
+ASN1BOOL ooCapabilityCheckCompatibility_NonStandard
+ (struct OOH323CallData *call, ooH323EpCapability* epCap,
+ H245AudioCapability* audioCap, int dir);
+OOBOOL ooCapabilityCheckCompatibility_GSM
+ (struct OOH323CallData *call, ooH323EpCapability* epCap,
+ H245AudioCapability* audioCap, int dir);
+OOBOOL ooCapabilityCheckCompatibility_T38
+ (struct OOH323CallData *call, ooH323EpCapability* epCap,
+ H245DataApplicationCapability* t38Cap, int dir);
+OOBOOL ooCapabilityCheckCompatibility_H263Video
+ (struct OOH323CallData *call, ooH323EpCapability *epCap,
+ H245VideoCapability *pVideoCap, int dir);
+OOBOOL ooCapabilityCheckCompatibility_Audio
+ (struct OOH323CallData *call, ooH323EpCapability* epCap,
+ H245AudioCapability* audioCap, int dir);
+OOBOOL ooCapabilityCheckCompatibility_Video
+ (struct OOH323CallData *call, ooH323EpCapability* epCap,
+ H245VideoCapability* videoCap, int dir);
+ooH323EpCapability* ooIsAudioDataTypeGSMSupported
+ (struct OOH323CallData *call, H245AudioCapability* audioCap, int dir);
+ooH323EpCapability* ooIsAudioDataTypeSimpleSupported
+ (struct OOH323CallData *call, H245AudioCapability* audioCap, int dir);
+ooH323EpCapability* ooIsT38Supported
+ (struct OOH323CallData *call, H245DataApplicationCapability* t38Cap, int dir);
+ooH323EpCapability* ooIsAudioDataTypeNonStandardSupported
+ (struct OOH323CallData *call, H245AudioCapability* audioCap, int dir);
+int ooAddRemoteDataApplicationCapability(struct OOH323CallData *call,
+ H245DataApplicationCapability *dataCap,
+ int dir);
+int ooCapabilityEnableDTMFCISCO
+ (struct OOH323CallData *call, int dynamicRTPPayloadType);
+int ooCapabilityDisableDTMFCISCO(struct OOH323CallData *call);
+int ooCapabilityAddT38Capability
+ (struct OOH323CallData *call, int cap, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel,
+ OOBOOL remote);
+
+
+/**/
+
+
/**
* @}
*/
diff --git a/addons/ooh323c/src/ooCmdChannel.c b/addons/ooh323c/src/ooCmdChannel.c
index 8dfd01376..003a5df1b 100644
--- a/addons/ooh323c/src/ooCmdChannel.c
+++ b/addons/ooh323c/src/ooCmdChannel.c
@@ -14,6 +14,8 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
#include "ooStackCmds.h"
#include "ootrace.h"
#include "ooq931.h"
@@ -23,11 +25,12 @@
#include "ooCalls.h"
#include "ooCmdChannel.h"
+
/** Global endpoint structure */
extern OOH323EndPoint gH323ep;
OOSOCKET gCmdChan = 0;
-pthread_mutex_t gCmdChanLock;
+ast_mutex_t gCmdChanLock;
int ooCreateCmdConnection()
{
@@ -37,7 +40,7 @@ int ooCreateCmdConnection()
if ((ret = pipe(thePipe)) == -1) {
return OO_FAILED;
}
- pthread_mutex_init(&gCmdChanLock, NULL);
+ ast_mutex_init(&gCmdChanLock);
gH323ep.cmdSock = dup(thePipe[0]);
close(thePipe[0]);
@@ -46,6 +49,30 @@ int ooCreateCmdConnection()
return OO_OK;
}
+int ooCreateCallCmdConnection(OOH323CallData* call)
+{
+ int ret = 0;
+ int thePipe[2];
+
+ OOTRACEINFO2("INFO: create cmd connect for call: %lx\n", call);
+
+ call->CmdChanLock = malloc(sizeof(ast_mutex_t));
+ ast_mutex_init(call->CmdChanLock);
+
+
+ if ((ret = socketpair(PF_LOCAL, SOCK_STREAM, 0, thePipe)) == -1) {
+ ast_mutex_destroy(call->CmdChanLock);
+ free(call->CmdChanLock);
+ call->CmdChanLock = NULL;
+ return OO_FAILED;
+ }
+ ast_mutex_lock(call->CmdChanLock);
+ call->cmdSock = thePipe[0];
+ call->CmdChan = thePipe[1];
+ ast_mutex_unlock(call->CmdChanLock);
+ return OO_OK;
+}
+
int ooCloseCmdConnection()
{
@@ -53,7 +80,21 @@ int ooCloseCmdConnection()
gH323ep.cmdSock = 0;
close(gCmdChan);
gCmdChan = 0;
- pthread_mutex_destroy(&gCmdChanLock);
+ ast_mutex_destroy(&gCmdChanLock);
+
+ return OO_OK;
+}
+int ooCloseCallCmdConnection(OOH323CallData* call)
+{
+ ast_mutex_lock(call->CmdChanLock);
+ close(call->cmdSock);
+ call->cmdSock = 0;
+ close(call->CmdChan);
+ call->CmdChan = 0;
+ ast_mutex_unlock(call->CmdChanLock);
+ ast_mutex_destroy(call->CmdChanLock);
+ free(call->CmdChanLock);
+ call->CmdChanLock = NULL;
return OO_OK;
}
@@ -61,12 +102,47 @@ int ooCloseCmdConnection()
int ooWriteStackCommand(OOStackCommand *cmd)
{
- pthread_mutex_lock(&gCmdChanLock);
+ ast_mutex_lock(&gCmdChanLock);
if (write(gCmdChan, (char*)cmd, sizeof(OOStackCommand)) == -1) {
- pthread_mutex_unlock(&gCmdChanLock);
+ ast_mutex_unlock(&gCmdChanLock);
return OO_FAILED;
}
- pthread_mutex_unlock(&gCmdChanLock);
+ ast_mutex_unlock(&gCmdChanLock);
+
+ return OO_OK;
+}
+int ooWriteCallStackCommand(OOH323CallData* call, OOStackCommand *cmd)
+{
+ unsigned char buffer[MAXMSGLEN];
+ unsigned char* bPoint;
+
+ memcpy(buffer, cmd, sizeof(OOStackCommand));
+ bPoint = buffer + sizeof(OOStackCommand);
+ if (cmd->param1 && cmd->plen1 > 0) {
+ if (bPoint + cmd->plen1 >= buffer + MAXMSGLEN)
+ return OO_FAILED;
+ memcpy(bPoint, cmd->param1, cmd->plen1);
+ bPoint += cmd->plen1;
+ }
+ if (cmd->param2 && cmd->plen2 > 0) {
+ if (bPoint + cmd->plen2 >= buffer + MAXMSGLEN)
+ return OO_FAILED;
+ memcpy(bPoint, cmd->param2, cmd->plen2);
+ bPoint += cmd->plen2;
+ }
+ if (cmd->param3 && cmd->plen3 > 0) {
+ if (bPoint + cmd->plen3 >= buffer + MAXMSGLEN)
+ return OO_FAILED;
+ memcpy(bPoint, cmd->param3, cmd->plen3);
+ bPoint += cmd->plen3;
+ }
+
+ ast_mutex_lock(call->CmdChanLock);
+ if (write(call->CmdChan, buffer, bPoint - buffer) == -1) {
+ ast_mutex_unlock(call->CmdChanLock);
+ return OO_FAILED;
+ }
+ ast_mutex_unlock(call->CmdChanLock);
return OO_OK;
}
@@ -79,7 +155,9 @@ int ooReadAndProcessStackCommand()
int i, recvLen = 0;
OOStackCommand cmd;
memset(&cmd, 0, sizeof(OOStackCommand));
+ ast_mutex_lock(&gCmdChanLock);
recvLen = read(gH323ep.cmdSock, buffer, MAXMSGLEN);
+ ast_mutex_unlock(&gCmdChanLock);
if(recvLen <= 0)
{
OOTRACEERR1("Error:Failed to read CMD message\n");
@@ -104,8 +182,19 @@ int ooReadAndProcessStackCommand()
OOTRACEINFO2("Processing MakeCall command %s\n",
(char*)cmd.param2);
- ooH323MakeCall ((char*)cmd.param1, (char*)cmd.param2,
- (ooCallOptions*)cmd.param3);
+ ooH323NewCall ((char*)cmd.param2);
+ break;
+
+ case OO_CMD_MANUALPROGRESS:
+ pCall = ooFindCallByToken((char*)cmd.param1);
+ if(!pCall) {
+ OOTRACEINFO2("Call \"%s\" does not exist\n",
+ (char*)cmd.param1);
+ OOTRACEINFO1("Call migth be cleared/closed\n");
+ }
+ else {
+ ooSendProgress(ooFindCallByToken((char*)cmd.param1));
+ }
break;
case OO_CMD_MANUALRINGBACK:
@@ -147,10 +236,10 @@ int ooReadAndProcessStackCommand()
break;
case OO_CMD_HANGCALL:
- OOTRACEINFO2("Processing Hang call command %s\n",
- (char*)cmd.param1);
+ OOTRACEINFO3("Processing Hang call command %s with q931 cause %d\n",
+ (char*)cmd.param1, *(int *) cmd.param3);
ooH323HangCall((char*)cmd.param1,
- *(OOCallClearReason*)cmd.param2);
+ *(OOCallClearReason*)cmd.param2, *(int *) cmd.param3);
break;
case OO_CMD_SENDDIGIT:
@@ -190,4 +279,138 @@ int ooReadAndProcessStackCommand()
return OO_OK;
}
+int ooReadAndProcessCallStackCommand(OOH323CallData* call)
+{
+ unsigned char buffer[MAXMSGLEN];
+ unsigned char *bPoint;
+ int recvLen = 0;
+ OOStackCommand cmd;
+ memset(&cmd, 0, sizeof(OOStackCommand));
+ if (call->CmdChanLock) {
+ ast_mutex_lock(call->CmdChanLock);
+ recvLen = read(call->cmdSock, buffer, MAXMSGLEN);
+ ast_mutex_unlock(call->CmdChanLock);
+ } else {
+ recvLen = read(call->cmdSock, buffer, MAXMSGLEN);
+ }
+ if(recvLen <= 0)
+ {
+ OOTRACEERR1("Error:Failed to read CMD message\n");
+ return OO_FAILED;
+ }
+
+ bPoint = buffer;
+ while (bPoint < buffer + recvLen - sizeof(OOStackCommand)) {
+
+ memcpy(&cmd, bPoint, sizeof(OOStackCommand));
+ bPoint += sizeof(OOStackCommand);
+
+ if (cmd.plen1 > 0) {
+ cmd.param1 = malloc(cmd.plen1 + 1);
+ if (!cmd.param1)
+ return OO_FAILED;
+ memset(cmd.param1, 0, cmd.plen1 + 1);
+ memcpy(cmd.param1, bPoint, cmd.plen1);
+ bPoint += cmd.plen1;
+ }
+
+ if (cmd.plen2 > 0) {
+ cmd.param2 = malloc(cmd.plen2 + 1);
+ if (!cmd.param2)
+ return OO_FAILED;
+ memset(cmd.param2, 0, cmd.plen2 + 1);
+ memcpy(cmd.param2, bPoint, cmd.plen2);
+ bPoint += cmd.plen2;
+ }
+
+ if (cmd.plen3 > 0) {
+ cmd.param3 = malloc(cmd.plen3 + 1);
+ if (!cmd.param3)
+ return OO_FAILED;
+ memset(cmd.param3, 0, cmd.plen3 + 1);
+ memcpy(cmd.param3, bPoint, cmd.plen3);
+ bPoint += cmd.plen3;
+ }
+
+ if(cmd.type == OO_CMD_NOOP)
+ continue;
+
+ if(gH323ep.gkClient && gH323ep.gkClient->state != GkClientRegistered)
+ {
+ OOTRACEINFO1("Ignoring stack command as Gk Client is not registered"
+ " yet\n");
+ }
+ else {
+ switch(cmd.type) {
+ case OO_CMD_MAKECALL:
+ OOTRACEINFO2("Processing MakeCall command %s\n",
+ (char*)cmd.param2);
+
+ ooH323MakeCall ((char*)cmd.param1, (char*)cmd.param2,
+ (ooCallOptions*)cmd.param3);
+ break;
+
+ case OO_CMD_MANUALPROGRESS:
+ ooSendProgress(call);
+ break;
+
+ case OO_CMD_MANUALRINGBACK:
+ if(OO_TESTFLAG(gH323ep.flags, OO_M_MANUALRINGBACK))
+ {
+ ooSendAlerting(call);
+ if(OO_TESTFLAG(gH323ep.flags, OO_M_AUTOANSWER)) {
+ ooSendConnect(call);
+ }
+ }
+ break;
+
+ case OO_CMD_ANSCALL:
+ ooSendConnect(call);
+ break;
+
+ case OO_CMD_FWDCALL:
+ OOTRACEINFO3("Forwarding call %s to %s\n", (char*)cmd.param1,
+ (char*)cmd.param2);
+ ooH323ForwardCall((char*)cmd.param1, (char*)cmd.param2);
+ break;
+
+ case OO_CMD_HANGCALL:
+ OOTRACEINFO2("Processing Hang call command %s with q931 cause %d\n",
+ (char*)cmd.param1);
+ ooH323HangCall((char*)cmd.param1,
+ *(OOCallClearReason*)cmd.param2, *(int *) cmd.param3);
+ break;
+
+ case OO_CMD_SENDDIGIT:
+ if(call->jointDtmfMode & OO_CAP_DTMF_H245_alphanumeric) {
+ ooSendH245UserInputIndication_alphanumeric(
+ call, (const char*)cmd.param2);
+ }
+ else if(call->jointDtmfMode & OO_CAP_DTMF_H245_signal) {
+ ooSendH245UserInputIndication_signal(
+ call, (const char*)cmd.param2);
+ }
+ else {
+ ooQ931SendDTMFAsKeyPadIE(call, (const char*)cmd.param2);
+ }
+
+ break;
+
+ case OO_CMD_REQMODE:
+ OOTRACEINFO3("Processing RequestMode command %s, requested mode is %d\n",
+ (char *)cmd.param1, *(int *)cmd.param2);
+ ooSendRequestMode(call, *(int *)cmd.param2);
+ break;
+
+ default: OOTRACEERR1("ERROR:Unknown command\n");
+ }
+ }
+ if(cmd.param1) free(cmd.param1);
+ if(cmd.param2) free(cmd.param2);
+ if(cmd.param3) free(cmd.param3);
+ }
+
+
+ return OO_OK;
+}
diff --git a/addons/ooh323c/src/ooCmdChannel.h b/addons/ooh323c/src/ooCmdChannel.h
index cc1dfaa25..b0767acc7 100644
--- a/addons/ooh323c/src/ooCmdChannel.h
+++ b/addons/ooh323c/src/ooCmdChannel.h
@@ -51,7 +51,8 @@ extern "C" {
*
* @return OO_OK, on success; OO_FAILED, on failure
*/
-EXTERN int ooCreateCmdConnection();
+EXTERN int ooCreateCmdConnection(void);
+EXTERN int ooCreateCallCmdConnection(OOH323CallData*);
/**
* This function is used to close a command channel setup with the stack
@@ -59,7 +60,8 @@ EXTERN int ooCreateCmdConnection();
*
* @return OO_OK, on success; OO_FAILED, on failure
*/
-EXTERN int ooCloseCmdConnection();
+EXTERN int ooCloseCmdConnection(void);
+EXTERN int ooCloseCallCmdConnection(OOH323CallData*);
/**
@@ -69,6 +71,7 @@ EXTERN int ooCloseCmdConnection();
* @return OO_OK, on success; OO_FAILED, on failure
*/
EXTERN int ooWriteStackCommand(OOStackCommand *cmd);
+EXTERN int ooWriteCallStackCommand(OOH323CallData* call, OOStackCommand *cmd);
/**
* This function is used by stack thread to read and process stack commands
@@ -76,7 +79,8 @@ EXTERN int ooWriteStackCommand(OOStackCommand *cmd);
*
* @return OO_OK, on success; OO_FAILED, on failure
*/
-EXTERN int ooReadAndProcessStackCommand();
+EXTERN int ooReadAndProcessStackCommand(void);
+EXTERN int ooReadAndProcessCallStackCommand(OOH323CallData*);
/**
diff --git a/addons/ooh323c/src/ooCommon.h b/addons/ooh323c/src/ooCommon.h
index bb034c569..91df7428f 100644
--- a/addons/ooh323c/src/ooCommon.h
+++ b/addons/ooh323c/src/ooCommon.h
@@ -41,6 +41,7 @@
#include <unistd.h>
#include <arpa/inet.h>
#endif
+#include <semaphore.h>
/**
* @ingroup cruntime C Runtime Common Constant and Type Definitions.
diff --git a/addons/ooh323c/src/ooDateTime.c b/addons/ooh323c/src/ooDateTime.c
index af6faec65..0d7ee6811 100644
--- a/addons/ooh323c/src/ooDateTime.c
+++ b/addons/ooh323c/src/ooDateTime.c
@@ -15,6 +15,7 @@
*****************************************************************************/
#include "ooCommon.h"
+#include "ooDateTime.h"
#if defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__)
diff --git a/addons/ooh323c/src/ooDateTime.h b/addons/ooh323c/src/ooDateTime.h
index afcc9b308..b49c87230 100644
--- a/addons/ooh323c/src/ooDateTime.h
+++ b/addons/ooh323c/src/ooDateTime.h
@@ -48,6 +48,10 @@ EXTERN int ooGetTimeOfDay (struct timeval *tv, struct timezone *tz);
* @return Difference between two timevals in milliseconds.
*/
EXTERN long ooGetTimeDiff(struct timeval *tv1, struct timeval *tv2);
+
+EXTERN int ooGetTimeOfDay (struct timeval *tv, struct timezone *tz);
+EXTERN long ooGetTimeDiff(struct timeval *tv1, struct timeval *tv2);
+
#ifdef __cplusplus
}
#endif
diff --git a/addons/ooh323c/src/ooGkClient.c b/addons/ooh323c/src/ooGkClient.c
index 1a920e3a7..534f2205c 100644
--- a/addons/ooh323c/src/ooGkClient.c
+++ b/addons/ooh323c/src/ooGkClient.c
@@ -20,6 +20,9 @@
* This file contains functions to support RAS protocol.
*
*/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+
#include "ooGkClient.h"
#include "ootypes.h"
#include "ootrace.h"
@@ -58,6 +61,7 @@ int ooGkClientInit(enum RasGatekeeperMode eGkMode,
}
memset(pGkClient, 0, sizeof(ooGkClient));
+ ast_mutex_init(&pGkClient->Lock);
gH323ep.gkClient = pGkClient;
initContext(&(pGkClient->ctxt));
initContext(&(pGkClient->msgCtxt));
@@ -156,7 +160,7 @@ void ooGkClientPrintConfig(ooGkClient *pGkClient)
pGkClient->gkRasPort);
}
else if(pGkClient->gkMode == RasDiscoverGatekeeper) {
- OOTRACEINFO1("\tGatekeeper mode - UseSpecificGatekeeper\n");
+ OOTRACEINFO1("\tGatekeeper mode - RasDiscoverGatekeeper\n");
}
else {
OOTRACEERR1("Invalid GatekeeperMode\n");
@@ -177,6 +181,9 @@ int ooGkClientDestroy(void)
ooGkClientCloseChannel(gH323ep.gkClient);
freeContext(&gH323ep.gkClient->msgCtxt);
freeContext(&gH323ep.gkClient->ctxt);
+ ast_mutex_lock(&gH323ep.gkClient->Lock);
+ ast_mutex_unlock(&gH323ep.gkClient->Lock);
+ ast_mutex_destroy(&gH323ep.gkClient->Lock);
memFreePtr(&gH323ep.ctxt, gH323ep.gkClient);
gH323ep.gkClient = NULL;
}
@@ -194,14 +201,17 @@ int ooGkClientStart(ooGkClient *pGkClient)
return OO_FAILED;
}
+ ast_mutex_lock(&pGkClient->Lock);
pGkClient->discoveryComplete = FALSE;
iRet = ooGkClientSendGRQ(pGkClient);
if(iRet != OO_OK)
{
OOTRACEERR1("Error:Failed to send GRQ message\n");
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_OK;
}
@@ -236,6 +246,7 @@ int ooGkClientSetGkMode(ooGkClient *pGkClient, enum RasGatekeeperMode eGkMode,
else if(eGkMode == RasNoGatekeeper) {
OOTRACEINFO1("Gatekeeper Mode - RasNoGatekeeper\n");
}
+
return OO_OK;
}
@@ -361,6 +372,7 @@ int ooGkClientReceive(ooGkClient *pGkClient)
H225RasMessage *pRasMsg=NULL;
int iRet=OO_OK;
+ ast_mutex_lock(&pGkClient->Lock);
pctxt = &pGkClient->msgCtxt;
recvLen = ooSocketRecvFrom(pGkClient->rasSocket, recvBuf, 1024, remoteHost,
@@ -368,6 +380,7 @@ int ooGkClientReceive(ooGkClient *pGkClient)
if(recvLen <0)
{
OOTRACEERR1("Error:Failed to receive RAS message\n");
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
OOTRACEDBGA1("GkClient Received RAS Message\n");
@@ -380,6 +393,7 @@ int ooGkClientReceive(ooGkClient *pGkClient)
{
OOTRACEWARN3("WARN:Ignoring message received from unknown gatekeeper "
"%s:%d\n", remoteHost, iFromPort);
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_OK;
}
}
@@ -389,6 +403,7 @@ int ooGkClientReceive(ooGkClient *pGkClient)
OOTRACEERR1("Error:Failed to set PER buffer for RAS message decoding\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
pRasMsg = (H225RasMessage*)memAlloc(pctxt, sizeof(H225RasMessage));
@@ -397,6 +412,7 @@ int ooGkClientReceive(ooGkClient *pGkClient)
OOTRACEERR1("Error: Failed to allocate memory for RAS message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
#ifndef _COMPACT
@@ -425,8 +441,10 @@ int ooGkClientReceive(ooGkClient *pGkClient)
removeEventHandler(pctxt);
#endif
memReset(pctxt);
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
+ ast_mutex_unlock(&pGkClient->Lock);
return iRet;
}
@@ -546,6 +564,7 @@ int ooGkClientSendMsg(ooGkClient *pGkClient, H225RasMessage *pRasMsg)
ASN1OCTET msgBuf[MAXMSGLEN];
ASN1OCTET *msgPtr=NULL;
int iLen;
+
OOCTXT *pctxt = &pGkClient->msgCtxt;
setPERBuffer( pctxt, msgBuf, MAXMSGLEN, TRUE );
@@ -600,7 +619,7 @@ int ooGkClientSendGRQ(ooGkClient *pGkClient)
OOCTXT *pctxt = &pGkClient->msgCtxt;
ooGkClientTimerCb *cbData=NULL;
-
+ ast_mutex_lock(&pGkClient->Lock);
/* Allocate memory for RAS message */
pRasMsg = (H225RasMessage*)memAlloc(pctxt, sizeof(H225RasMessage));
@@ -608,6 +627,7 @@ int ooGkClientSendGRQ(ooGkClient *pGkClient)
{
OOTRACEERR1("Error: Memory allocation for GRQ RAS message failed\n");
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@@ -618,6 +638,7 @@ int ooGkClientSendGRQ(ooGkClient *pGkClient)
OOTRACEERR1("Error:Memory allocation for GRQ failed\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
memset(pGkReq, 0, sizeof(H225GatekeeperRequest));
@@ -640,6 +661,7 @@ int ooGkClientSendGRQ(ooGkClient *pGkClient)
"failed\n");
memReset(&pGkClient->msgCtxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@@ -669,6 +691,7 @@ int ooGkClientSendGRQ(ooGkClient *pGkClient)
OOTRACEERR1("Error Failed to fill alias information for GRQ message\n");
memReset(&pGkClient->msgCtxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
iRet = ooGkClientSendMsg(pGkClient, pRasMsg);
@@ -677,6 +700,7 @@ int ooGkClientSendGRQ(ooGkClient *pGkClient)
OOTRACEERR1("Error: Failed to send GRQ message\n");
memReset(&pGkClient->msgCtxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
OOTRACEINFO1("Sent GRQ message\n");
@@ -686,6 +710,7 @@ int ooGkClientSendGRQ(ooGkClient *pGkClient)
{
OOTRACEERR1("Error:Failed to allocate memory to GRQ timer callback\n");
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
cbData->timerType = OO_GRQ_TIMER;
@@ -697,8 +722,10 @@ int ooGkClientSendGRQ(ooGkClient *pGkClient)
OOTRACEERR1("Error:Unable to create GRQ timer.\n ");
memFreePtr(&pGkClient->ctxt, cbData);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_OK;
}
@@ -858,6 +885,10 @@ int ooGkClientSendRRQ(ooGkClient *pGkClient, ASN1BOOL keepAlive)
H225TransportAddress *pTransportAddress=NULL;
H225TransportAddress_ipAddress *pIpAddress=NULL;
ooGkClientTimerCb *cbData =NULL;
+ H225SupportedProtocols *pProtocol = NULL;
+ H225VoiceCaps *pVoiceCaps = NULL;
+
+ ast_mutex_lock(&pGkClient->Lock);
pctxt = &pGkClient->msgCtxt;
@@ -866,6 +897,7 @@ int ooGkClientSendRRQ(ooGkClient *pGkClient, ASN1BOOL keepAlive)
{
OOTRACEERR1("Error: Memory allocation for RRQ RAS message failed\n");
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@@ -876,6 +908,7 @@ int ooGkClientSendRRQ(ooGkClient *pGkClient, ASN1BOOL keepAlive)
OOTRACEERR1("Error:Memory allocation for RRQ failed\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
memset(pRegReq, 0, sizeof(H225RegistrationRequest));
@@ -895,6 +928,7 @@ int ooGkClientSendRRQ(ooGkClient *pGkClient, ASN1BOOL keepAlive)
"RRQ message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
pTransportAddress->t = T_H225TransportAddress_ipAddress;
@@ -920,6 +954,7 @@ int ooGkClientSendRRQ(ooGkClient *pGkClient, ASN1BOOL keepAlive)
"RRQ message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@@ -943,15 +978,44 @@ int ooGkClientSendRRQ(ooGkClient *pGkClient, ASN1BOOL keepAlive)
pRegReq->terminalType.m.vendorPresent=TRUE;
ooGkClientFillVendor(pGkClient, &pRegReq->terminalType.vendor );
-
+
+ if (gH323ep.isGateway) {
+ pRegReq->terminalType.gateway.m.protocolPresent = TRUE;
+ pProtocol = (H225SupportedProtocols*) memAlloc(pctxt,
+ sizeof(H225SupportedProtocols));
+ pVoiceCaps = (H225VoiceCaps*) memAlloc(pctxt, sizeof(H225VoiceCaps));
+ if(!pProtocol || !pVoiceCaps) {
+ OOTRACEERR1("Error:Failed to allocate memory for protocol info of "
+ "RRQ message\n");
+ memReset(pctxt);
+ pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
+ return OO_FAILED;
+ }
+
+ memset(pVoiceCaps, 0, sizeof(H225VoiceCaps));
+ memset(pProtocol, 0, sizeof(H225SupportedProtocols));
+
+ pVoiceCaps->m.supportedPrefixesPresent = TRUE;
+ ooPopulatePrefixList(pctxt, gH323ep.aliases, &pVoiceCaps->supportedPrefixes);
+
+ pProtocol->t = T_H225SupportedProtocols_voice;
+ pProtocol->u.voice = pVoiceCaps;
+
+ dListInit(&pRegReq->terminalType.gateway.protocol);
+ dListAppend(pctxt, &pRegReq->terminalType.gateway.protocol,
+ (void*)pProtocol);
+
+ }
+
pRegReq->m.terminalAliasPresent=TRUE;
if(OO_OK != ooPopulateAliasList(pctxt, gH323ep.aliases,
- &pRegReq->terminalAlias))
- {
- OOTRACEERR1("Error filling alias for RRQ\n");
- memReset(pctxt);
- pGkClient->state = GkClientFailed;
- return OO_FAILED;
+ &pRegReq->terminalAlias)) {
+ OOTRACEERR1("Error filling alias for RRQ\n");
+ memReset(pctxt);
+ pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
+ return OO_FAILED;
}
pRegReq->m.gatekeeperIdentifierPresent=TRUE;
@@ -964,6 +1028,7 @@ int ooGkClientSendRRQ(ooGkClient *pGkClient, ASN1BOOL keepAlive)
"message.\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
memcpy(pRegReq->gatekeeperIdentifier.data, pGkClient->gkId.data,
@@ -1008,6 +1073,7 @@ int ooGkClientSendRRQ(ooGkClient *pGkClient, ASN1BOOL keepAlive)
OOTRACEERR1("Error: Failed to allocate memory for EndpointIdentifier in RRQ \n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
}
@@ -1021,6 +1087,7 @@ int ooGkClientSendRRQ(ooGkClient *pGkClient, ASN1BOOL keepAlive)
OOTRACEERR1("Error: Failed to send RRQ message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
OOTRACEINFO1("Sent RRQ message \n");
@@ -1031,6 +1098,7 @@ int ooGkClientSendRRQ(ooGkClient *pGkClient, ASN1BOOL keepAlive)
{
OOTRACEERR1("Error:Failed to allocate memory to RRQ timer callback\n");
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
cbData->timerType = OO_RRQ_TIMER;
@@ -1042,9 +1110,11 @@ int ooGkClientSendRRQ(ooGkClient *pGkClient, ASN1BOOL keepAlive)
OOTRACEERR1("Error:Unable to create GRQ timer.\n ");
memFreePtr(&pGkClient->ctxt, cbData);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_OK;
}
@@ -1290,6 +1360,7 @@ int ooGkClientSendURQ(ooGkClient *pGkClient, ooAliases *aliases)
H225TransportAddress *pTransportAddress=NULL;
H225TransportAddress_ipAddress *pIpAddress=NULL;
+ ast_mutex_lock(&pGkClient->Lock);
pctxt = &pGkClient->msgCtxt;
OOTRACEDBGA1("Building Unregistration Request message\n");
@@ -1299,6 +1370,7 @@ int ooGkClientSendURQ(ooGkClient *pGkClient, ooAliases *aliases)
{
OOTRACEERR1("Error: Memory allocation for URQ RAS message failed\n");
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@@ -1309,6 +1381,7 @@ int ooGkClientSendURQ(ooGkClient *pGkClient, ooAliases *aliases)
OOTRACEERR1("Error:Memory allocation for URQ failed\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
memset(pUnregReq, 0, sizeof(H225UnregistrationRequest));
@@ -1332,6 +1405,7 @@ int ooGkClientSendURQ(ooGkClient *pGkClient, ooAliases *aliases)
"RRQ message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
pTransportAddress->t = T_H225TransportAddress_ipAddress;
@@ -1355,6 +1429,7 @@ int ooGkClientSendURQ(ooGkClient *pGkClient, ooAliases *aliases)
"message.\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
memcpy((void*)pUnregReq->endpointIdentifier.data,
@@ -1371,6 +1446,7 @@ int ooGkClientSendURQ(ooGkClient *pGkClient, ooAliases *aliases)
OOTRACEERR1("Error:Failed to allocate memory for GKID of URQ message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
memcpy((void*)pUnregReq->gatekeeperIdentifier.data,
@@ -1391,11 +1467,13 @@ int ooGkClientSendURQ(ooGkClient *pGkClient, ooAliases *aliases)
OOTRACEERR1("Error:Failed to send UnregistrationRequest message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
pGkClient->state = GkClientUnregistered;
OOTRACEINFO1("Unregistration Request message sent.\n");
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_OK;
}
@@ -1449,6 +1527,8 @@ int ooGkClientSendUnregistrationConfirm(ooGkClient *pGkClient, unsigned reqNo)
H225RasMessage *pRasMsg=NULL;
H225UnregistrationConfirm *pUCF=NULL;
+ ast_mutex_lock(&pGkClient->Lock);
+
pRasMsg = (H225RasMessage*)memAlloc(pctxt, sizeof(H225RasMessage));
pUCF = (H225UnregistrationConfirm*)memAlloc(pctxt,
sizeof(H225UnregistrationConfirm));
@@ -1456,6 +1536,7 @@ int ooGkClientSendUnregistrationConfirm(ooGkClient *pGkClient, unsigned reqNo)
{
OOTRACEERR1("Error: Memory allocation for UCF RAS message failed\n");
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
pRasMsg->t = T_H225RasMessage_unregistrationConfirm;
@@ -1470,11 +1551,13 @@ int ooGkClientSendUnregistrationConfirm(ooGkClient *pGkClient, unsigned reqNo)
OOTRACEERR1("Error:Failed to send UnregistrationConfirm message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
OOTRACEINFO1("Unregistration Confirm message sent for \n");
memReset(pctxt);
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_OK;
}
@@ -1496,6 +1579,8 @@ int ooGkClientSendAdmissionRequest
RasCallAdmissionInfo *pCallAdmInfo=NULL;
pctxt = &pGkClient->msgCtxt;
+ ast_mutex_lock(&pGkClient->Lock);
+
OOTRACEDBGA3("Building Admission Request for call (%s, %s)\n",
call->callType, call->callToken);
pRasMsg = (H225RasMessage*)memAlloc(pctxt, sizeof(H225RasMessage));
@@ -1504,6 +1589,7 @@ int ooGkClientSendAdmissionRequest
OOTRACEERR3("Error:Memory - ooGkClientSendAdmissionRequest - "
"pRasMsg(%s, %s)\n", call->callType, call->callToken);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
pRasMsg->t = T_H225RasMessage_admissionRequest;
@@ -1515,6 +1601,7 @@ int ooGkClientSendAdmissionRequest
"pAdmReq(%s, %s)\n", call->callType, call->callToken);
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
memset(pAdmReq, 0, sizeof(H225AdmissionRequest));
@@ -1533,6 +1620,7 @@ int ooGkClientSendAdmissionRequest
"Addresses of ARQ message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
ooSocketConvertIpToNwAddr(pGkClient->localRASIP, pIpAddressLocal->ip.data);
@@ -1597,6 +1685,7 @@ int ooGkClientSendAdmissionRequest
call->callToken);
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
memcpy((void*)pAdmReq->endpointIdentifier.data,
@@ -1633,6 +1722,7 @@ int ooGkClientSendAdmissionRequest
"ARQ message\n");
pGkClient->state = GkClientFailed;
memReset(pctxt);
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
}
@@ -1646,7 +1736,8 @@ int ooGkClientSendAdmissionRequest
{
OOTRACEERR1("Error:Failed to populate source aliases -ARQ message\n");
memReset(pctxt);
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
}
@@ -1684,6 +1775,7 @@ int ooGkClientSendAdmissionRequest
OOTRACEERR1("Error:Failed to allocate memory for GKID of ARQ message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
memcpy((void*)pAdmReq->gatekeeperIdentifier.data,
@@ -1704,6 +1796,7 @@ int ooGkClientSendAdmissionRequest
" Info entry\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@@ -1731,6 +1824,7 @@ int ooGkClientSendAdmissionRequest
OOTRACEERR1("Error:Failed to send AdmissionRequest message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
OOTRACEINFO3("Admission Request message sent for (%s, %s)\n",
@@ -1745,6 +1839,7 @@ int ooGkClientSendAdmissionRequest
OOTRACEERR1("Error:Failed to allocate memory for Regisration timer."
"\n");
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
cbData->timerType = OO_ARQ_TIMER;
@@ -1757,9 +1852,11 @@ int ooGkClientSendAdmissionRequest
OOTRACEERR1("Error:Unable to create ARQ timer.\n ");
memFreePtr(&pGkClient->ctxt, cbData);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_OK;
}
@@ -1850,8 +1947,12 @@ int ooGkClientHandleAdmissionConfirm
}
OOTRACEINFO3("Admission Confirm message received for (%s, %s)\n",
pCallAdmInfo->call->callType,
- pCallAdmInfo->call->callToken);
- ooH323CallAdmitted( pCallAdmInfo->call);
+ pCallAdmInfo->call->callToken);
+
+ pCallAdmInfo->call->callState = OO_CALL_CONNECTING;
+ ast_cond_signal(&pCallAdmInfo->call->gkWait);
+ /* ooH323CallAdmitted( pCallAdmInfo->call); */
+
dListRemove(&pGkClient->callsPendingList, pNode);
dListAppend(&pGkClient->ctxt, &pGkClient->callsAdmittedList,
pNode->data);
@@ -1874,9 +1975,10 @@ int ooGkClientHandleAdmissionReject
(ooGkClient *pGkClient, H225AdmissionReject *pAdmissionReject)
{
RasCallAdmissionInfo* pCallAdmInfo=NULL;
- unsigned int x;
- DListNode *pNode=NULL;
+ unsigned int x, y;
+ DListNode *pNode=NULL, *pNode1=NULL;
OOH323CallData *call=NULL;
+ OOTimer *pTimer = NULL;
/* Search call in pending calls list */
for(x=0 ; x<pGkClient->callsPendingList.count; x++)
@@ -1903,6 +2005,24 @@ int ooGkClientHandleAdmissionReject
memFreePtr(&pGkClient->ctxt, pNode);
}
+ /* Delete ARQ timer */
+ for(y=0; y<pGkClient->timerList.count; y++)
+ {
+ pNode1 = dListFindByIndex(&pGkClient->timerList, y);
+ pTimer = (OOTimer*)pNode1->data;
+ if(((ooGkClientTimerCb*)pTimer->cbData)->timerType & OO_ARQ_TIMER)
+ {
+ if(((ooGkClientTimerCb*)pTimer->cbData)->pAdmInfo ==
+ pCallAdmInfo)
+ {
+ memFreePtr(&pGkClient->ctxt, pTimer->cbData);
+ ooTimerDelete(&pGkClient->ctxt, &pGkClient->timerList,
+ pTimer);
+ OOTRACEDBGA1("Deleted ARQ Timer.\n");
+ break;
+ }
+ }
+ }
OOTRACEINFO4("Admission Reject message received with reason code %d for "
"(%s, %s)\n", pAdmissionReject->rejectReason.t, call->callType,
call->callToken);
@@ -1948,9 +2068,269 @@ int ooGkClientHandleAdmissionReject
break;
}
+ ast_cond_signal(&pCallAdmInfo->call->gkWait);
return OO_OK;
}
+
+int ooGkClientSendIRR
+ (ooGkClient *pGkClient, OOH323CallData *call)
+{
+ int iRet = 0;
+ H225RasMessage *pRasMsg=NULL;
+ OOCTXT* pctxt;
+ H225InfoRequestResponse *pIRR=NULL;
+ H225TransportAddress_ipAddress *pIpAddressLocal =NULL, *pIpRasAddress,
+ *pLocalAddr, *pRemoteAddr;
+ H225TransportAddress *pTransportAddress;
+ ooAliases *srcAliases=NULL;
+ H225InfoRequestResponse_perCallInfo_element *perCallInfo = NULL;
+ pctxt = &pGkClient->msgCtxt;
+
+ ast_mutex_lock(&pGkClient->Lock);
+
+ OOTRACEDBGA3("Building Info Request Resp for call (%s, %s)\n",
+ call->callType, call->callToken);
+ pRasMsg = (H225RasMessage*)memAlloc(pctxt, sizeof(H225RasMessage));
+ if(!pRasMsg)
+ {
+ OOTRACEERR3("Error:Memory - ooGkClientSendIRR - "
+ "pRasMsg(%s, %s)\n", call->callType, call->callToken);
+ pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
+ return OO_FAILED;
+ }
+ pRasMsg->t = T_H225RasMessage_infoRequestResponse;
+ pIRR = (H225InfoRequestResponse*) memAlloc(pctxt,
+ sizeof(H225InfoRequestResponse));
+ if(!pIRR)
+ {
+ OOTRACEERR3("Error:Memory - ooGkClientSendIRR - "
+ "pIRR(%s, %s)\n", call->callType, call->callToken);
+ memReset(pctxt);
+ pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
+ return OO_FAILED;
+ }
+ memset(pIRR, 0, sizeof(H225InfoRequestResponse));
+ pRasMsg->u.infoRequestResponse = pIRR;
+
+ /* Populate call signalling addresses */
+ pIpAddressLocal = (H225TransportAddress_ipAddress*)memAlloc(pctxt,
+ sizeof(H225TransportAddress_ipAddress));
+ pTransportAddress = (H225TransportAddress*) memAlloc(pctxt,
+ sizeof(H225TransportAddress));
+ if(!pIpAddressLocal || !pTransportAddress)
+ {
+ OOTRACEERR1("Error:Failed to allocate memory for Call Signalling "
+ "Addresses of IRR message\n");
+ memReset(pctxt);
+ pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
+ return OO_FAILED;
+ }
+ ooSocketConvertIpToNwAddr(pGkClient->localRASIP, pIpAddressLocal->ip.data);
+
+ pIpAddressLocal->ip.numocts = 4;
+ pIpAddressLocal->port = gH323ep.listenPort;
+
+ pTransportAddress->t = T_H225TransportAddress_ipAddress;
+ pTransportAddress->u.ipAddress = pIpAddressLocal;
+
+ dListInit(&pIRR->callSignalAddress);
+ dListAppend(pctxt, &pIRR->callSignalAddress,
+ (void*)pTransportAddress);
+
+ /* Populate seq number */
+ pIRR->requestSeqNum = pGkClient->requestSeqNum++;
+ if(!pIRR->requestSeqNum)
+ pIRR->requestSeqNum = pGkClient->requestSeqNum++;
+
+ pIpRasAddress = (H225TransportAddress_ipAddress*)memAlloc(pctxt,
+ sizeof(H225TransportAddress_ipAddress));
+ if(!pIpRasAddress)
+ {
+ OOTRACEERR1("Error: Memory allocation for Ras Address of IRR message "
+ "failed\n");
+ memReset(&pGkClient->msgCtxt);
+ pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
+ return OO_FAILED;
+ }
+
+ pIpRasAddress->ip.numocts = 4;
+ pIpRasAddress->port = pGkClient->localRASPort;
+ ooSocketConvertIpToNwAddr(pGkClient->localRASIP, pIpRasAddress->ip.data);
+
+ pIRR->rasAddress.u.ipAddress = pIpRasAddress;
+ pIRR->rasAddress.t=T_H225TransportAddress_ipAddress; /* IPv4 address */
+
+ /* Pose as gateway or terminal as per config */
+ if(gH323ep.isGateway)
+ pIRR->endpointType.m.gatewayPresent = TRUE;
+ else
+ pIRR->endpointType.m.terminalPresent = TRUE;
+
+ pIRR->endpointType.m.nonStandardDataPresent=FALSE;
+ pIRR->endpointType.m.vendorPresent=TRUE;
+ ooGkClientFillVendor(pGkClient, &pIRR->endpointType.vendor);
+
+ /* Populate Endpoint Identifier */
+ pIRR->endpointIdentifier.nchars = pGkClient->endpointId.nchars;
+ pIRR->endpointIdentifier.data = (ASN116BITCHAR*)memAlloc(pctxt,
+ sizeof(ASN116BITCHAR)*pGkClient->endpointId.nchars);
+ if(!pIRR->endpointIdentifier.data)
+ {
+ OOTRACEERR3("Error:Memory - ooGkClientSendIRR - "
+ "endpointIdentifier.data(%s, %s)\n", call->callType,
+ call->callToken);
+ memReset(pctxt);
+ pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
+ return OO_FAILED;
+ }
+ memcpy((void*)pIRR->endpointIdentifier.data,
+ (void*)pGkClient->endpointId.data,
+ sizeof(ASN116BITCHAR)*pGkClient->endpointId.nchars);
+
+
+ /* Populate call aliases */
+ if(call->ourAliases)
+ srcAliases = call->ourAliases;
+ else
+ srcAliases = gH323ep.aliases;
+
+ /* Populate Source Info */
+ if(srcAliases)
+ {
+ iRet = ooPopulateAliasList(&pGkClient->msgCtxt, srcAliases,
+ &pIRR->endpointAlias);
+ if(OO_OK != iRet)
+ {
+ OOTRACEERR1("Error:Failed to populate source aliases -ARQ message\n");
+ memReset(pctxt);
+ pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
+ return OO_FAILED;
+ }
+ }
+ pIRR->m.endpointAliasPresent = TRUE;
+
+ /* Populate need response & unsolicited */
+ pIRR->needResponse = FALSE;
+ pIRR->m.needResponsePresent = TRUE;
+ pIRR->unsolicited = TRUE;
+ pIRR->m.unsolicitedPresent = TRUE;
+
+ /* Populate perCallInfo */
+
+ pIRR->m.perCallInfoPresent = TRUE;
+
+ perCallInfo =
+ (H225InfoRequestResponse_perCallInfo_element *)memAlloc(pctxt,
+ sizeof(H225InfoRequestResponse_perCallInfo_element));
+ memset(perCallInfo, 0, sizeof(H225InfoRequestResponse_perCallInfo_element));
+
+ if(!perCallInfo)
+ {
+ OOTRACEERR3("Error:Memory - ooGkClientSendIRR - "
+ "perCallInfo for (%s, %s)\n", call->callType,
+ call->callToken);
+ memReset(pctxt);
+ pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
+ return OO_FAILED;
+ }
+
+ perCallInfo->m.originatorPresent = TRUE;
+ perCallInfo->originator = (!strcmp(call->callType, "incoming")) ? FALSE : TRUE;
+
+ pLocalAddr = (H225TransportAddress_ipAddress*)memAlloc(pctxt,
+ sizeof(H225TransportAddress_ipAddress));
+ pRemoteAddr = (H225TransportAddress_ipAddress*) memAlloc(pctxt,
+ sizeof(H225TransportAddress_ipAddress));
+ if(!pLocalAddr || !pRemoteAddr)
+ {
+ OOTRACEERR1("Error:Failed to allocate memory for Call Signalling "
+ "Addresses of IRR message\n");
+ memReset(pctxt);
+ pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
+ return OO_FAILED;
+ }
+ pLocalAddr->ip.numocts = 4;
+ ooSocketConvertIpToNwAddr(call->localIP, pLocalAddr->ip.data);
+ pLocalAddr->port = (call->pH225Channel->port) ? call->pH225Channel->port : gH323ep.listenPort;
+
+ pRemoteAddr->ip.numocts = 4;
+ ooSocketConvertIpToNwAddr(call->remoteIP, pRemoteAddr->ip.data);
+ pRemoteAddr->port = call->remotePort;
+
+ perCallInfo->callSignaling.m.sendAddressPresent = TRUE;
+ perCallInfo->callSignaling.sendAddress.t = T_H225TransportAddress_ipAddress;
+ perCallInfo->callSignaling.m.recvAddressPresent = TRUE;
+ perCallInfo->callSignaling.recvAddress.t = T_H225TransportAddress_ipAddress;
+
+ if (!strcmp(call->callType, "incoming")) {
+// terminator
+ perCallInfo->callSignaling.sendAddress.u.ipAddress = pRemoteAddr;
+ perCallInfo->callSignaling.recvAddress.u.ipAddress = pLocalAddr;
+ } else {
+// originator
+ perCallInfo->callSignaling.sendAddress.u.ipAddress = pLocalAddr;
+ perCallInfo->callSignaling.recvAddress.u.ipAddress = pRemoteAddr;
+ }
+
+ /* Populate call Reference */
+ perCallInfo->callReferenceValue = call->callReference;
+ /* populate conferenceID */
+ memcpy((void*)&perCallInfo->conferenceID, (void*)&call->confIdentifier,
+ sizeof(H225ConferenceIdentifier));
+ /* Populate call identifier */
+ perCallInfo->m.callIdentifierPresent = TRUE;
+ memcpy((void*)&perCallInfo->callIdentifier, (void*)&call->callIdentifier,
+ sizeof(H225CallIdentifier));
+ /* Populate call type & call model */
+ perCallInfo->callType.t = T_H225CallType_pointToPoint;
+ /* Add call model to message*/
+ if(OO_TESTFLAG(call->flags, OO_M_GKROUTED))
+ perCallInfo->callModel.t = T_H225CallModel_gatekeeperRouted;
+ else
+ perCallInfo->callModel.t = T_H225CallModel_direct;
+
+ /* Populate usage info */
+ if (call->alertingTime) {
+ perCallInfo->usageInformation.m.alertingTimePresent = TRUE;
+ perCallInfo->usageInformation.alertingTime = call->alertingTime;
+ }
+ if (call->connectTime) {
+ perCallInfo->usageInformation.m.connectTimePresent = TRUE;
+ perCallInfo->usageInformation.connectTime = call->connectTime;
+ }
+ perCallInfo->usageInformation.m.endTimePresent = FALSE;
+ perCallInfo->m.usageInformationPresent = TRUE;
+
+ dListInit(&pIRR->perCallInfo);
+ dListAppend(pctxt, &pIRR->perCallInfo,
+ (void*)perCallInfo);
+
+ iRet = ooGkClientSendMsg(pGkClient, pRasMsg);
+ if(iRet != OO_OK)
+ {
+ OOTRACEERR1("Error:Failed to send IRR message\n");
+ memReset(pctxt);
+ pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
+ return OO_FAILED;
+ }
+ OOTRACEINFO3("IRR message sent for (%s, %s)\n",
+ call->callType, call->callToken);
+ memReset(pctxt);
+
+ ast_mutex_unlock(&pGkClient->Lock);
+ return OO_OK;
+}
+
/**
* This function is invoked to request call disengage to gatekeeper.
*
@@ -1970,6 +2350,8 @@ int ooGkClientSendDisengageRequest(ooGkClient *pGkClient, OOH323CallData *call)
RasCallAdmissionInfo* pCallAdmInfo=NULL;
pctxt = &pGkClient->msgCtxt;
+ ast_mutex_lock(&pGkClient->Lock);
+
OOTRACEINFO3("Sending disengage Request for call. (%s, %s)\n",
call->callType, call->callToken);
@@ -1978,6 +2360,7 @@ int ooGkClientSendDisengageRequest(ooGkClient *pGkClient, OOH323CallData *call)
{
OOTRACEERR1("Error: Memory allocation for DRQ RAS message failed\n");
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@@ -1989,6 +2372,7 @@ int ooGkClientSendDisengageRequest(ooGkClient *pGkClient, OOH323CallData *call)
OOTRACEERR1("Error: Failed to allocate memory for DRQ message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@@ -2009,6 +2393,7 @@ int ooGkClientSendDisengageRequest(ooGkClient *pGkClient, OOH323CallData *call)
"message.\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
memcpy((void*)pDRQ->endpointIdentifier.data,
@@ -2040,6 +2425,7 @@ int ooGkClientSendDisengageRequest(ooGkClient *pGkClient, OOH323CallData *call)
OOTRACEERR1("Error:Failed to allocate memory for GKId in DRQ.\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
memcpy(pDRQ->gatekeeperIdentifier.data, pGkClient->gkId.data,
@@ -2055,11 +2441,30 @@ int ooGkClientSendDisengageRequest(ooGkClient *pGkClient, OOH323CallData *call)
OOTRACEERR1("Error: Failed to allocate memory for cause ie in DRQ.\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
pDRQ->terminationCause.u.releaseCompleteCauseIE->numocts =
strlen("Call Ended");
- strcpy(pDRQ->terminationCause.u.releaseCompleteCauseIE->data, "Call Ended");
+ strcpy((char *)pDRQ->terminationCause.u.releaseCompleteCauseIE->data, "Call Ended");
+
+ /* populate usage info */
+
+ /* Populate usage info */
+ if (call->alertingTime) {
+ pDRQ->usageInformation.m.alertingTimePresent = TRUE;
+ pDRQ->usageInformation.alertingTime = call->alertingTime;
+ }
+ if (call->connectTime) {
+ pDRQ->usageInformation.m.connectTimePresent = TRUE;
+ pDRQ->usageInformation.connectTime = call->connectTime;
+ }
+ pDRQ->usageInformation.m.endTimePresent = TRUE;
+ if (call->endTime)
+ pDRQ->usageInformation.endTime = call->endTime;
+ else
+ pDRQ->usageInformation.endTime = time(NULL);
+ pDRQ->m.usageInformationPresent = TRUE;
iRet = ooGkClientSendMsg(pGkClient, pRasMsg);
if(iRet != OO_OK)
@@ -2083,6 +2488,7 @@ int ooGkClientSendDisengageRequest(ooGkClient *pGkClient, OOH323CallData *call)
break;
}
}
+ ast_mutex_unlock(&pGkClient->Lock);
return iRet;
}
@@ -2174,6 +2580,9 @@ int ooGkClientARQTimerExpired(void* pdata)
OOTRACEDBGA1("Gatekeeper client ARQ timer expired.\n");
memFreePtr(&pGkClient->ctxt, cbData);
+ if(!pAdmInfo)
+ return OO_OK;
+
if(pAdmInfo->retries < OO_MAX_ARQ_RETRIES)
{
ret = ooGkClientSendAdmissionRequest(pGkClient, pAdmInfo->call, TRUE);
@@ -2199,6 +2608,8 @@ int ooGkClientCleanCall(ooGkClient *pGkClient, OOH323CallData *call)
ooGkClientTimerCb *cbData=NULL;
RasCallAdmissionInfo *pAdmInfo = NULL;
+ ast_mutex_lock(&pGkClient->Lock);
+
for(x=0; x<pGkClient->callsAdmittedList.count; x++)
{
@@ -2209,7 +2620,7 @@ int ooGkClientCleanCall(ooGkClient *pGkClient, OOH323CallData *call)
dListRemove(&pGkClient->callsAdmittedList, pNode);
memFreePtr(&pGkClient->ctxt, pAdmInfo);
memFreePtr(&pGkClient->ctxt, pNode);
- return OO_OK;
+ break;
}
}
@@ -2237,10 +2648,11 @@ int ooGkClientCleanCall(ooGkClient *pGkClient, OOH323CallData *call)
dListRemove(&pGkClient->callsPendingList, pNode);
memFreePtr(&pGkClient->ctxt, pAdmInfo);
memFreePtr(&pGkClient->ctxt, pNode);
- return OO_OK;
+ break;
}
}
+ ast_mutex_unlock(&pGkClient->Lock);
return OO_OK;
}
diff --git a/addons/ooh323c/src/ooGkClient.h b/addons/ooh323c/src/ooGkClient.h
index 662dae18d..c616c1137 100644
--- a/addons/ooh323c/src/ooGkClient.h
+++ b/addons/ooh323c/src/ooGkClient.h
@@ -47,7 +47,7 @@ extern "C" {
-#define MAX_IP_LEN 15
+#define MAX_IP_LEN 18
#define DEFAULT_GKPORT 1719
#define MULTICAST_GKADDRESS "224.0.1.41"
#define MULTICAST_GKPORT 1718
@@ -204,6 +204,7 @@ typedef struct ooGkClient{
ASN1UINT arqTimeout;
ASN1UINT drqTimeout;
enum OOGkClientState state;
+ ast_mutex_t Lock;
} ooGkClient;
struct OOAliases;
@@ -553,6 +554,15 @@ int ooGkClientSetCallbacks
* @}
*/
+int ooGkClientReInit(ooGkClient *pGkClient);
+void ooGkClientFillVendor
+ (ooGkClient *pGkClient, H225VendorIdentifier *pVendor );
+void ooGkClientPrintMessage
+ (ooGkClient *pGkClient, ASN1OCTET *msg, ASN1UINT len);
+int ooGkClientSendIRR
+ (ooGkClient *pGkClient, struct OOH323CallData *call);
+
+
#ifdef __cplusplus
}
#endif
diff --git a/addons/ooh323c/src/ooLogChan.c b/addons/ooh323c/src/ooLogChan.c
index 86c8844c7..dfd16c305 100644
--- a/addons/ooh323c/src/ooLogChan.c
+++ b/addons/ooh323c/src/ooLogChan.c
@@ -14,6 +14,9 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+
#include "ooCalls.h"
#include "ooh323ep.h"
@@ -187,7 +190,7 @@ OOLogicalChannel * ooFindLogicalChannel(OOH323CallData *call, int sessionID,
{
OOTRACEDBGC3("ooFindLogicalChannel, checking channel: %d:%s\n",
pChannel->sessionID, pChannel->dir);
- if(pChannel->sessionID == sessionID)
+ if(pChannel->sessionID == sessionID || pChannel->sessionID == 0)
{
if(!strcmp(pChannel->dir, dir))
{
@@ -230,6 +233,27 @@ OOLogicalChannel* ooGetLogicalChannel
return NULL;
}
+/* function is to get channel with particular direction */
+
+OOLogicalChannel* ooGetTransmitLogicalChannel
+ (OOH323CallData *call)
+{
+ OOLogicalChannel * pChannel = NULL;
+ pChannel = call->logicalChans;
+ while(pChannel)
+ {
+ OOTRACEINFO6("Listing logical channel %d cap %d state %d for (%s, %s)\n",
+ pChannel->channelNo, pChannel->chanCap->cap, pChannel->state,
+ call->callType, call->callToken);
+ if(!strcmp(pChannel->dir, "transmit") && pChannel->state != OO_LOGICALCHAN_IDLE &&
+ pChannel->state != OO_LOGICALCHAN_PROPOSEDFS)
+ return pChannel;
+ else
+ pChannel = pChannel->next;
+ }
+ return NULL;
+}
+
int ooClearAllLogicalChannels(OOH323CallData *call)
{
OOLogicalChannel * temp = NULL, *prev = NULL;
diff --git a/addons/ooh323c/src/ooLogChan.h b/addons/ooh323c/src/ooLogChan.h
index eeb0f772e..f480f1090 100644
--- a/addons/ooh323c/src/ooLogChan.h
+++ b/addons/ooh323c/src/ooLogChan.h
@@ -41,7 +41,8 @@ typedef enum {
OO_LOGICAL_CHAN_UNKNOWN,
OO_LOGICALCHAN_IDLE,
OO_LOGICALCHAN_PROPOSED,
- OO_LOGICALCHAN_ESTABLISHED
+ OO_LOGICALCHAN_ESTABLISHED,
+ OO_LOGICALCHAN_PROPOSEDFS
} OOLogicalChannelState;
/**
@@ -179,6 +180,8 @@ EXTERN OOLogicalChannel * ooFindLogicalChannelByOLC
EXTERN OOLogicalChannel * ooFindLogicalChannel
(struct OOH323CallData* call, int sessionID, char *dir, H245DataType* dataType);
+EXTERN OOLogicalChannel* ooGetTransmitLogicalChannel(struct OOH323CallData *call);
+
/**
* @}
*/
diff --git a/addons/ooh323c/src/ooSocket.c b/addons/ooh323c/src/ooSocket.c
index 181cf6792..590536550 100644
--- a/addons/ooh323c/src/ooSocket.c
+++ b/addons/ooh323c/src/ooSocket.c
@@ -13,6 +13,9 @@
* maintain this copyright notice.
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+#include <asterisk/network.h>
#include "ooSocket.h"
#include "ootrace.h"
@@ -177,7 +180,7 @@ int ooSocketsInit ()
defined(_HP_UX) || defined(__hpux) || defined(_HPUX_SOURCE)
typedef int OOSOCKLEN;
#else
-typedef size_t OOSOCKLEN;
+typedef socklen_t OOSOCKLEN;
#endif
int ooSocketCreate (OOSOCKET* psocket)
@@ -270,8 +273,10 @@ int ooSocketBind (OOSOCKET socket, OOIPADDR addr, int port)
if (bind (socket, (struct sockaddr *) (void*) &m_addr,
sizeof (m_addr)) == -1)
{
- perror ("bind");
- OOTRACEERR1("Error:Bind failed\n");
+ if (errno != EADDRINUSE) {
+ perror ("bind");
+ OOTRACEERR2("Error:Bind failed, error: %d\n", errno);
+ }
return ASN_E_INVSOCKET;
}
@@ -279,7 +284,7 @@ int ooSocketBind (OOSOCKET socket, OOIPADDR addr, int port)
}
-int ooSocketGetSockName(OOSOCKET socket, struct sockaddr_in *name, int *size)
+int ooSocketGetSockName(OOSOCKET socket, struct sockaddr_in *name, socklen_t *size)
{
int ret;
ret = getsockname(socket, (struct sockaddr*)name, size);
@@ -293,9 +298,10 @@ int ooSocketGetSockName(OOSOCKET socket, struct sockaddr_in *name, int *size)
int ooSocketGetIpAndPort(OOSOCKET socket, char *ip, int len, int *port)
{
- int ret=ASN_OK, size;
+ int ret=ASN_OK;
+ socklen_t size;
struct sockaddr_in addr;
- char *host=NULL;
+ const char *host=NULL;
size = sizeof(addr);
@@ -303,7 +309,7 @@ int ooSocketGetIpAndPort(OOSOCKET socket, char *ip, int len, int *port)
if(ret != 0)
return ASN_E_INVSOCKET;
- host = inet_ntoa(addr.sin_addr);
+ host = ast_inet_ntoa(addr.sin_addr);
if(host && strlen(host) < (unsigned)len)
strcpy(ip, host);
@@ -338,7 +344,7 @@ int ooSocketAccept (OOSOCKET socket, OOSOCKET *pNewSocket,
if (pNewSocket == 0) return ASN_E_INVPARAM;
*pNewSocket = accept (socket, (struct sockaddr *) (void*) &m_addr,
- (socklen_t *) &addr_length);
+ &addr_length);
if (*pNewSocket <= 0) return ASN_E_INVSOCKET;
if (destAddr != 0)
@@ -430,21 +436,21 @@ int ooSocketRecvFrom (OOSOCKET socket, ASN1OCTET* pbuf, ASN1UINT bufsize,
{
struct sockaddr_in m_addr;
int len, addrlen;
- char * host=NULL;
+ const char * host=NULL;
if (socket == OOSOCKET_INVALID) return ASN_E_INVSOCKET;
addrlen = sizeof(m_addr);
memset (&m_addr, 0, sizeof (m_addr));
if ((len = recvfrom (socket, (char*) pbuf, bufsize, 0,
- (struct sockaddr*)&m_addr, &addrlen)) == -1)
+ (struct sockaddr*)&m_addr, (socklen_t *) &addrlen)) == -1)
return ASN_E_INVSOCKET;
if(remoteport)
*remoteport = ntohs(m_addr.sin_port);
if(remotehost)
{
- host = inet_ntoa(m_addr.sin_addr);
+ host = ast_inet_ntoa(m_addr.sin_addr);
if(strlen(host) < (hostBufLen-1))
strcpy(remotehost, host);
else
@@ -466,24 +472,54 @@ int ooSocketSelect(int nfds, fd_set *readfds, fd_set *writefds,
return ret;
}
+int ooSocketPoll(struct pollfd *pfds, int nfds, int timeout)
+{
+ return poll(pfds, nfds, timeout);
+}
+
+int ooPDRead(struct pollfd *pfds, int nfds, int fd)
+{
+ int i;
+ for (i=0;i<nfds;i++)
+ if (pfds[i].fd == fd && (pfds[i].revents & POLLIN))
+ return 1;
+ return 0;
+}
+
+int ooPDWrite(struct pollfd *pfds, int nfds, int fd)
+{
+ int i;
+ for (i=0;i<nfds;i++)
+ if (pfds[i].fd == fd && (pfds[i].revents & POLLOUT))
+ return 1;
+ return 0;
+}
+
int ooGetLocalIPAddress(char * pIPAddrs)
{
int ret;
- struct hostent *phost;
+ struct hostent phost;
+ struct hostent* reshost;
+ int h_errnop;
struct in_addr addr;
char hostname[100];
+ char buf[2048];
if(pIPAddrs == NULL)
return -1; /* Need to find suitable return value */
ret = gethostname(hostname, 100);
if(ret == 0)
{
- phost = gethostbyname(hostname);
- if(phost == NULL)
+ if (!gethostbyname_r(hostname,
+ &phost, buf, sizeof(buf),
+ &reshost, &h_errnop)) {
+ if(reshost == NULL)
return -1; /* Need to define a return value if made part of rtsrc */
- memcpy(&addr, phost->h_addr_list[0], sizeof(struct in_addr));
- strcpy(pIPAddrs, inet_ntoa(addr));
-
+ memcpy(&addr, &phost.h_addr_list[0], sizeof(struct in_addr));
+ strcpy(pIPAddrs, (ast_inet_ntoa(addr) == NULL) ? "127.0.0.1" : ast_inet_ntoa(addr));
+ } else {
+ return -1;
+ }
}
else{
return -1;
@@ -504,7 +540,7 @@ int ooSocketStrToAddr (const char* pIPAddrStr, OOIPADDR* pIPAddr)
return ASN_OK;
}
-int ooSocketConvertIpToNwAddr(char *inetIp, char *netIp)
+int ooSocketConvertIpToNwAddr(char *inetIp, unsigned char *netIp)
{
struct sockaddr_in sin = {0};
@@ -608,10 +644,7 @@ int ooSocketGetInterfaceList(OOCTXT *pctxt, OOInterface **ifList)
int flags;
for (ifName = ifc.ifc_req; (void*)ifName < ifEndList; ifName++) {
char *pName=NULL;
- char addr[50];
-#ifdef ifr_netmask
- char mask[50];
-#endif
+ char addr[50], mask[50];
pIf = (struct OOInterface*)memAlloc(pctxt, sizeof(struct OOInterface));
pName = (char*)memAlloc(pctxt, strlen(ifName->ifr_name)+1);
@@ -653,7 +686,7 @@ int ooSocketGetInterfaceList(OOCTXT *pctxt, OOInterface **ifList)
memFreePtr(pctxt, pIf);
continue;
}
- strcpy(addr, inet_ntoa(((struct sockaddr_in*)&ifReq.ifr_addr)->sin_addr));
+ strcpy(addr, ast_inet_ntoa(((struct sockaddr_in*)&ifReq.ifr_addr)->sin_addr));
OOTRACEDBGA2("\tIP address is %s\n", addr);
pIf->addr = (char*)memAlloc(pctxt, strlen(addr)+1);
if(!pIf->addr)
@@ -676,7 +709,7 @@ int ooSocketGetInterfaceList(OOCTXT *pctxt, OOInterface **ifList)
memFreePtr(pctxt, pIf);
continue;
}
- strcpy(mask, inet_ntoa(((struct sockaddr_in *)&ifReq.ifr_netmask)->sin_addr));
+ strcpy(mask, ast_inet_ntoa(((struct sockaddr_in *)&ifReq.ifr_netmask)->sin_addr));
OOTRACEDBGA2("\tMask is %s\n", mask);
pIf->mask = (char*)memAlloc(pctxt, strlen(mask)+1);
if(!pIf->mask)
diff --git a/addons/ooh323c/src/ooSocket.h b/addons/ooh323c/src/ooSocket.h
index 6a28ef3ac..69d2c0c1c 100644
--- a/addons/ooh323c/src/ooSocket.h
+++ b/addons/ooh323c/src/ooSocket.h
@@ -331,6 +331,11 @@ EXTERN int ooSocketSendTo(OOSOCKET socket, const ASN1OCTET* pdata,
EXTERN int ooSocketSelect(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval * timeout);
+EXTERN int ooSocketPoll(struct pollfd *pfds, int nfds, int timeout);
+
+EXTERN int ooPDRead(struct pollfd *pfds, int nfds, int fd);
+EXTERN int ooPDWrite(struct pollfd *pfds, int nfds, int fd);
+
/**
* This function converts the string with IP address to a double word
* representation. The converted address may be used with the ::rtSocketBind
@@ -356,7 +361,7 @@ EXTERN int ooSocketStrToAddr (const char* pIPAddrStr, OOIPADDR* pIPAddr);
* @return Completion status of operation: 0 (ASN_OK) = success,
* negative return value is error.
*/
-EXTERN int ooSocketConvertIpToNwAddr(char *inetIp, char *netIp);
+EXTERN int ooSocketConvertIpToNwAddr(char *inetIp, unsigned char *netIp);
/**
* This function retrives the IP address of the local host.
@@ -370,7 +375,7 @@ EXTERN int ooGetLocalIPAddress(char * pIPAddrs);
EXTERN int ooSocketGetSockName(OOSOCKET socket, struct sockaddr_in *name,
- int *size);
+ socklen_t *size);
EXTERN long ooSocketHTONL(long val);
diff --git a/addons/ooh323c/src/ooStackCmds.c b/addons/ooh323c/src/ooStackCmds.c
index a75a33cb0..f09d33405 100644
--- a/addons/ooh323c/src/ooStackCmds.c
+++ b/addons/ooh323c/src/ooStackCmds.c
@@ -13,6 +13,8 @@
* maintain this copyright notice.
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
#include "ooStackCmds.h"
#include "ooh323ep.h"
@@ -20,18 +22,21 @@
#include "ooCmdChannel.h"
extern OOSOCKET gCmdChan;
+extern ast_mutex_t newCallLock;
+
+static int counter = 1;
int ooGenerateOutgoingCallToken (char *callToken, size_t size)
{
- static int counter = 1;
char aCallToken[200];
int ret = 0;
-
+ ast_mutex_lock(&newCallLock);
sprintf (aCallToken, "ooh323c_o_%d", counter++);
if (counter > OO_MAX_CALL_TOKEN)
counter = 1;
+ ast_mutex_unlock(&newCallLock);
if ((strlen(aCallToken)+1) < size)
strcpy (callToken, aCallToken);
@@ -42,6 +47,14 @@ int ooGenerateOutgoingCallToken (char *callToken, size_t size)
return ret;
}
+int isRunning(char *callToken) {
+ OOH323CallData *call;
+
+ if((call = ooFindCallByToken(callToken)))
+ if (call->Monitor)
+ return 1;
+ return 0;
+}
OOStkCmdStat ooMakeCall
(const char* dest, char* callToken, size_t bufsiz, ooCallOptions *opts)
@@ -108,18 +121,102 @@ OOStkCmdStat ooMakeCall
return OO_STKCMD_SUCCESS;
}
+OOStkCmdStat ooRunCall
+ (const char* dest, char* callToken, size_t bufsiz, ooCallOptions *opts)
+{
+ OOStackCommand cmd;
+ OOH323CallData *call;
+
+ if(!callToken)
+ {
+ return OO_STKCMD_INVALIDPARAM;
+ }
+
+ if(!(call = ooFindCallByToken(callToken))) {
+ return OO_STKCMD_INVALIDPARAM;
+ }
+
+ if(call->CmdChan == 0)
+ {
+ if(ooCreateCallCmdConnection(call) != OO_OK)
+ return OO_STKCMD_CONNECTIONERR;
+ }
+
+ if(!callToken)
+ return OO_STKCMD_INVALIDPARAM;
+
+
+ memset(&cmd, 0, sizeof(OOStackCommand));
+ cmd.type = OO_CMD_MAKECALL;
+ cmd.param1 = (void*) malloc(strlen(dest)+1);
+ if(!cmd.param1)
+ {
+ return OO_STKCMD_MEMERR;
+ }
+ strcpy((char*)cmd.param1, dest);
+ cmd.plen1 = strlen(dest);
+
+
+ cmd.param2 = (void*) malloc(strlen(callToken)+1);
+ if(!cmd.param2)
+ {
+ free(cmd.param1);
+ return OO_STKCMD_MEMERR;
+ }
+
+ strcpy((char*)cmd.param2, callToken);
+ cmd.plen2 = strlen(callToken);
+
+ if(!opts)
+ {
+ cmd.param3 = 0;
+ }
+ else {
+ cmd.param3 = (void*) malloc(sizeof(ooCallOptions));
+ if(!cmd.param3)
+ {
+ free(cmd.param1);
+ free(cmd.param2);
+ return OO_STKCMD_MEMERR;
+ }
+ memcpy((void*)cmd.param3, opts, sizeof(ooCallOptions));
+ cmd.plen3 = sizeof(ooCallOptions);
+ }
+
+ if(ooWriteCallStackCommand(call, &cmd) != OO_OK)
+ {
+ free(cmd.param1);
+ free(cmd.param2);
+ if(cmd.param3) free(cmd.param3);
+ return OO_STKCMD_WRITEERR;
+ }
+
+
+ free(cmd.param1);
+ free(cmd.param2);
+ if(cmd.param3) free(cmd.param3);
+
+ return OO_STKCMD_SUCCESS;
+}
+
OOStkCmdStat ooManualRingback(const char *callToken)
{
OOStackCommand cmd;
+ OOH323CallData *call;
+
if(!callToken)
{
return OO_STKCMD_INVALIDPARAM;
}
- if(gCmdChan == 0)
+ if(!(call = ooFindCallByToken(callToken))) {
+ return OO_STKCMD_INVALIDPARAM;
+ }
+
+ if(call->CmdChan == 0)
{
- if(ooCreateCmdConnection() != OO_OK)
+ if(ooCreateCallCmdConnection(call) != OO_OK)
return OO_STKCMD_CONNECTIONERR;
}
@@ -131,28 +228,77 @@ OOStkCmdStat ooManualRingback(const char *callToken)
return OO_STKCMD_MEMERR;
}
strcpy((char*)cmd.param1, callToken);
+ cmd.plen1 = strlen(callToken);
- if(ooWriteStackCommand(&cmd) != OO_OK)
+ if(ooWriteCallStackCommand(call,&cmd) != OO_OK)
{
free(cmd.param1);
return OO_STKCMD_WRITEERR;
}
+ free(cmd.param1);
+
+ return OO_STKCMD_SUCCESS;
+}
+
+OOStkCmdStat ooManualProgress(const char *callToken)
+{
+ OOStackCommand cmd;
+ OOH323CallData *call;
+
+ if(!callToken)
+ {
+ return OO_STKCMD_INVALIDPARAM;
+ }
+
+ if(!(call = ooFindCallByToken(callToken))) {
+ return OO_STKCMD_INVALIDPARAM;
+ }
+
+ if(call->CmdChan == 0)
+ {
+ if(ooCreateCallCmdConnection(call) != OO_OK)
+ return OO_STKCMD_CONNECTIONERR;
+ }
+
+ memset(&cmd, 0, sizeof(OOStackCommand));
+ cmd.type = OO_CMD_MANUALPROGRESS;
+ cmd.param1 = (void*) malloc(strlen(callToken)+1);
+ if(!cmd.param1)
+ {
+ return OO_STKCMD_MEMERR;
+ }
+ strcpy((char*)cmd.param1, callToken);
+ cmd.plen1 = strlen(callToken);
+
+ if(ooWriteCallStackCommand(call, &cmd) != OO_OK)
+ {
+ free(cmd.param1);
+ return OO_STKCMD_WRITEERR;
+ }
+
+ free(cmd.param1);
+
return OO_STKCMD_SUCCESS;
}
OOStkCmdStat ooAnswerCall(const char *callToken)
{
OOStackCommand cmd;
+ OOH323CallData *call;
if(!callToken)
{
return OO_STKCMD_INVALIDPARAM;
}
- if(gCmdChan == 0)
+ if(!(call = ooFindCallByToken(callToken))) {
+ return OO_STKCMD_INVALIDPARAM;
+ }
+
+ if(call->CmdChan == 0)
{
- if(ooCreateCmdConnection() != OO_OK)
+ if(ooCreateCallCmdConnection(call) != OO_OK)
return OO_STKCMD_CONNECTIONERR;
}
@@ -165,31 +311,38 @@ OOStkCmdStat ooAnswerCall(const char *callToken)
return OO_STKCMD_MEMERR;
}
strcpy((char*)cmd.param1, callToken);
-
- if(ooWriteStackCommand(&cmd) != OO_OK)
+ cmd.plen1 = strlen(callToken);
+
+ if(ooWriteCallStackCommand(call, &cmd) != OO_OK)
{
free(cmd.param1);
return OO_STKCMD_WRITEERR;
}
+ free(cmd.param1);
+
return OO_STKCMD_SUCCESS;
}
OOStkCmdStat ooForwardCall(const char* callToken, char *dest)
{
OOStackCommand cmd;
+ OOH323CallData *call;
if(!callToken || !dest)
{
return OO_STKCMD_INVALIDPARAM;
}
- if(gCmdChan == 0)
+ if(!(call = ooFindCallByToken(callToken))) {
+ return OO_STKCMD_INVALIDPARAM;
+ }
+
+ if(call->CmdChan == 0)
{
- if(ooCreateCmdConnection() != OO_OK)
+ if(ooCreateCallCmdConnection(call) != OO_OK)
return OO_STKCMD_CONNECTIONERR;
}
-
memset(&cmd, 0, sizeof(OOStackCommand));
cmd.type = OO_CMD_FWDCALL;
@@ -202,31 +355,41 @@ OOStkCmdStat ooForwardCall(const char* callToken, char *dest)
return OO_STKCMD_MEMERR;
}
strcpy((char*)cmd.param1, callToken);
+ cmd.plen1 = strlen(callToken);
strcpy((char*)cmd.param2, dest);
+ cmd.plen2 = strlen(dest);
- if(ooWriteStackCommand(&cmd) != OO_OK)
+ if(ooWriteCallStackCommand(call, &cmd) != OO_OK)
{
free(cmd.param1);
free(cmd.param2);
return OO_STKCMD_WRITEERR;
}
+ free(cmd.param1);
+ free(cmd.param2);
return OO_STKCMD_SUCCESS;
}
-OOStkCmdStat ooHangCall(const char* callToken, OOCallClearReason reason)
+OOStkCmdStat ooHangCall(const char* callToken, OOCallClearReason reason, int q931cause)
{
OOStackCommand cmd;
+ OOH323CallData *call;
+
if(!callToken)
{
return OO_STKCMD_INVALIDPARAM;
}
- if(gCmdChan == 0)
+ if(!(call = ooFindCallByToken(callToken))) {
+ return OO_STKCMD_INVALIDPARAM;
+ }
+
+ if(call->CmdChan == 0)
{
- if(ooCreateCmdConnection() != OO_OK)
+ if(ooCreateCallCmdConnection(call) != OO_OK)
return OO_STKCMD_CONNECTIONERR;
}
@@ -234,21 +397,31 @@ OOStkCmdStat ooHangCall(const char* callToken, OOCallClearReason reason)
cmd.type = OO_CMD_HANGCALL;
cmd.param1 = (void*) malloc(strlen(callToken)+1);
cmd.param2 = (void*) malloc(sizeof(OOCallClearReason));
- if(!cmd.param1 || !cmd.param2)
+ cmd.param3 = (void*) malloc(sizeof(int));
+ if(!cmd.param1 || !cmd.param2 || !cmd.param3)
{
if(cmd.param1) free(cmd.param1); /* Release memory */
if(cmd.param2) free(cmd.param2);
+ if(cmd.param3) free(cmd.param3);
return OO_STKCMD_MEMERR;
}
strcpy((char*)cmd.param1, callToken);
+ cmd.plen1 = strlen(callToken);
*((OOCallClearReason*)cmd.param2) = reason;
+ cmd.plen2 = sizeof(OOCallClearReason);
+ *(int *)cmd.param3 = q931cause;
+ cmd.plen3 = sizeof(int);
- if(ooWriteStackCommand(&cmd) != OO_OK)
+ if(ooWriteCallStackCommand(call, &cmd) != OO_OK)
{
free(cmd.param1);
free(cmd.param2);
+ free(cmd.param3);
return OO_STKCMD_WRITEERR;
}
+ free(cmd.param1);
+ free(cmd.param2);
+ free(cmd.param3);
return OO_STKCMD_SUCCESS;
}
@@ -276,15 +449,20 @@ OOStkCmdStat ooStopMonitor()
OOStkCmdStat ooSendDTMFDigit(const char *callToken, const char* dtmf)
{
OOStackCommand cmd;
+ OOH323CallData *call;
if(!callToken)
{
return OO_STKCMD_INVALIDPARAM;
}
- if(gCmdChan == 0)
+ if(!(call = ooFindCallByToken(callToken))) {
+ return OO_STKCMD_INVALIDPARAM;
+ }
+
+ if(call->CmdChan == 0)
{
- if(ooCreateCmdConnection() != OO_OK)
+ if(ooCreateCallCmdConnection(call) != OO_OK)
return OO_STKCMD_CONNECTIONERR;
}
@@ -300,14 +478,66 @@ OOStkCmdStat ooSendDTMFDigit(const char *callToken, const char* dtmf)
return OO_STKCMD_MEMERR;
}
strcpy((char*)cmd.param1, callToken);
+ cmd.plen1 = strlen(callToken);
strcpy((char*)cmd.param2, dtmf);
+ cmd.plen2 = strlen(dtmf);
- if(ooWriteStackCommand(&cmd) != OO_OK)
+ if(ooWriteCallStackCommand(call,&cmd) != OO_OK)
+ {
+ free(cmd.param1);
+ free(cmd.param2);
+ return OO_STKCMD_WRITEERR;
+ }
+ free(cmd.param1);
+ free(cmd.param2);
+
+ return OO_STKCMD_SUCCESS;
+}
+
+OOStkCmdStat ooRequestChangeMode(const char *callToken, int isT38Mode)
+{
+ OOStackCommand cmd;
+ OOH323CallData *call;
+
+ if(!callToken)
+ {
+ return OO_STKCMD_INVALIDPARAM;
+ }
+
+ if(!(call = ooFindCallByToken(callToken))) {
+ return OO_STKCMD_INVALIDPARAM;
+ }
+
+ if(call->CmdChan == 0)
+ {
+ if(ooCreateCallCmdConnection(call) != OO_OK)
+ return OO_STKCMD_CONNECTIONERR;
+ }
+
+ memset(&cmd, 0, sizeof(OOStackCommand));
+ cmd.type = OO_CMD_REQMODE;
+
+ cmd.param1 = (void*) malloc(strlen(callToken)+1);
+ cmd.param2 = (void*) malloc(sizeof(int));
+ if(!cmd.param1 || !cmd.param2)
+ {
+ if(cmd.param1) free(cmd.param1); /* Release memory */
+ if(cmd.param2) free(cmd.param2);
+ return OO_STKCMD_MEMERR;
+ }
+ strcpy((char*)cmd.param1, callToken);
+ cmd.plen1 = strlen(callToken);
+ *((int *) cmd.param2) = isT38Mode;
+ cmd.plen2 = sizeof(int);
+
+ if(ooWriteCallStackCommand(call,&cmd) != OO_OK)
{
free(cmd.param1);
free(cmd.param2);
return OO_STKCMD_WRITEERR;
}
+ free(cmd.param1);
+ free(cmd.param2);
return OO_STKCMD_SUCCESS;
}
diff --git a/addons/ooh323c/src/ooStackCmds.h b/addons/ooh323c/src/ooStackCmds.h
index 7ba9d7226..3fd1a8dab 100644
--- a/addons/ooh323c/src/ooStackCmds.h
+++ b/addons/ooh323c/src/ooStackCmds.h
@@ -65,7 +65,9 @@ typedef enum OOStackCmdID {
OO_CMD_HANGCALL, /*!< Terminate call */
OO_CMD_SENDDIGIT, /*!< Send dtmf */
OO_CMD_MANUALRINGBACK, /*!< Send Alerting - ringback */
- OO_CMD_STOPMONITOR /*!< Stop the event monitor */
+ OO_CMD_MANUALPROGRESS, /*!< Send progress */
+ OO_CMD_STOPMONITOR, /*!< Stop the event monitor */
+ OO_CMD_REQMODE /*!< Request new mode */
} OOStackCmdID;
@@ -76,8 +78,11 @@ typedef enum OOStackCmdID {
typedef struct OOStackCommand {
OOStackCmdID type;
void* param1;
+ int plen1;
void* param2;
+ int plen2;
void* param3;
+ int plen3;
} OOStackCommand;
#define ooCommand OOStackCommand;
@@ -105,6 +110,7 @@ EXTERN OOStkCmdStat ooMakeCall
* @return Returns OOStkCmdStat value indication success or failure.
*/
EXTERN OOStkCmdStat ooManualRingback(const char *callToken);
+EXTERN OOStkCmdStat ooManualProgress(const char *callToken);
/**
* This function is used to answer a call
@@ -131,7 +137,7 @@ EXTERN OOStkCmdStat ooForwardCall(const char* callToken, char *dest);
*
* @return Returns OOStkCmdStat value indication success or failure.
*/
-EXTERN OOStkCmdStat ooHangCall(const char* callToken, OOCallClearReason reason);
+EXTERN OOStkCmdStat ooHangCall(const char* callToken, OOCallClearReason reason, int q931cause);
/**
* This command function can be used by an user application to send a DTMF
@@ -164,6 +170,12 @@ EXTERN const char* ooGetStkCmdStatusCodeTxt(OOStkCmdStat stat);
* @}
*/
+EXTERN OOStkCmdStat ooRequestChangeMode(const char *callToken, int isT38Mode);
+
+EXTERN OOStkCmdStat ooRunCall(const char* dest, char* callToken, size_t bufsiz, ooCallOptions *opts);
+
+int ooGenerateOutgoingCallToken (char *callToken, size_t size);
+
#ifdef __cplusplus
}
#endif
diff --git a/addons/ooh323c/src/ooTimer.c b/addons/ooh323c/src/ooTimer.c
index c91ec9ee3..bd04715ff 100644
--- a/addons/ooh323c/src/ooTimer.c
+++ b/addons/ooh323c/src/ooTimer.c
@@ -14,6 +14,9 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+
#include "ooDateTime.h"
#include "ooTimer.h"
#include "ootrace.h"
diff --git a/addons/ooh323c/src/ooUtils.c b/addons/ooh323c/src/ooUtils.c
index 71b285f62..4c08e247c 100644
--- a/addons/ooh323c/src/ooUtils.c
+++ b/addons/ooh323c/src/ooUtils.c
@@ -14,7 +14,10 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
#include "ooUtils.h"
+#include <ctype.h>
const char* ooUtilsGetText (OOUINT32 idx, const char** table, size_t tabsiz)
{
diff --git a/addons/ooh323c/src/ooasn1.h b/addons/ooh323c/src/ooasn1.h
index 47219fac2..86a9b80c8 100644
--- a/addons/ooh323c/src/ooasn1.h
+++ b/addons/ooh323c/src/ooasn1.h
@@ -22,6 +22,9 @@
#ifndef _OOASN1_H_
#define _OOASN1_H_
+#include <asterisk.h>
+#include <asterisk/lock.h>
+
#include <limits.h>
#include <stdio.h>
#include <string.h>
@@ -406,6 +409,7 @@ typedef struct OOCTXT { /* context block */
struct EventHandler* pEventHandler; /* event handler object */
ASN1USINT flags; /* flag bits */
ASN1OCTET spare[2];
+ ast_mutex_t pLock;
} OOCTXT;
/* macros and function prototypes */
@@ -512,8 +516,8 @@ extern "C" {
#endif /* EXTERN */
#ifndef _NO_MALLOC
-#define ASN1CRTMALLOC0(nbytes) malloc(nbytes)
-#define ASN1CRTFREE0(ptr) free(ptr)
+/*#define ASN1CRTMALLOC0(nbytes) malloc(nbytes)
+#define ASN1CRTFREE0(ptr) free(ptr) */
#else
#ifdef _NO_THREADS
@@ -540,9 +544,15 @@ extern EXTERN OOCTXT g_ctxt;
#define DE_BIT(pctxt,pvalue) \
+((DE_INCRBITIDX (pctxt) != ASN_OK) ? ASN_E_ENDOFBUF : ( \
+((*(pvalue) = (((pctxt)->buffer.data[(pctxt)->buffer.byteIndex]) & \
+(1 << (pctxt)->buffer.bitOffset)) != 0), ASN_OK) ))
+/*
+#define DE_BIT(pctxt,pvalue) \
((DE_INCRBITIDX (pctxt) != ASN_OK) ? ASN_E_ENDOFBUF : ((pvalue) ? \
((*(pvalue) = (((pctxt)->buffer.data[(pctxt)->buffer.byteIndex]) & \
(1 << (pctxt)->buffer.bitOffset)) != 0), ASN_OK) : ASN_OK ))
+*/
#define encodeIA5String(pctxt,value,permCharSet) \
@@ -1004,9 +1014,15 @@ EXTERN void memSetStaticBuf (void* memHeapBuf, ASN1UINT blkSize);
((pctxt)->buffer.bitOffset = 7, ASN_OK)) : ASN_OK)
#define DECODEBIT(pctxt,pvalue) \
+((INCRBITIDX (pctxt) != ASN_OK) ? ASN_E_ENDOFBUF : ( \
+((*(pvalue) = (((pctxt)->buffer.data[(pctxt)->buffer.byteIndex]) & \
+(1 << (pctxt)->buffer.bitOffset)) != 0), ASN_OK) ))
+/*
+#define DECODEBIT(pctxt,pvalue) \
((INCRBITIDX (pctxt) != ASN_OK) ? ASN_E_ENDOFBUF : ((pvalue) ? \
((*(pvalue) = (((pctxt)->buffer.data[(pctxt)->buffer.byteIndex]) & \
(1 << (pctxt)->buffer.bitOffset)) != 0), ASN_OK) : ASN_OK ))
+*/
/*
#define SETCHARSET(csetvar, canset, abits, ubits) \
diff --git a/addons/ooh323c/src/oochannels.c b/addons/ooh323c/src/oochannels.c
index 8fe8c60cd..2988ff1b2 100644
--- a/addons/ooh323c/src/oochannels.c
+++ b/addons/ooh323c/src/oochannels.c
@@ -13,6 +13,8 @@
* maintain this copyright notice.
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
#include "ooports.h"
#include "oochannels.h"
@@ -30,13 +32,27 @@
#include "ooCmdChannel.h"
#include "ootypes.h"
+
/** Global endpoint structure */
extern OOH323EndPoint gH323ep;
+extern ast_mutex_t callListLock;
+extern ast_mutex_t monitorLock;
extern DList g_TimerList;
static OOBOOL gMonitor = FALSE;
+int ooSetCmdFDSETs(struct pollfd *pfds, int *nfds);
+int ooProcessCmdFDSETsAndTimers
+ (struct pollfd *pfds, int nfds, struct timeval *pToMin);
+int ooSetFDSETs(struct pollfd *pfds, int *nfds);
+int ooProcessFDSETsAndTimers
+ (struct pollfd* pfds, int nfds, struct timeval *pToMin);
+int ooProcessCallFDSETsAndTimers
+ (OOH323CallData *call, struct pollfd* pfds, int nfds, struct timeval *pToMin);
+int ooSetCallFDSETs(OOH323CallData* call, struct pollfd* pfds, int *nfds);
+
+
int ooCreateH245Listener(OOH323CallData *call)
{
@@ -60,7 +76,7 @@ int ooCreateH245Listener(OOH323CallData *call)
*(call->h245listenport) = ret;
call->h245listener = (OOSOCKET*)memAlloc(call->pctxt, sizeof(OOSOCKET));
*(call->h245listener) = channelSocket;
- ret = ooSocketListen(*(call->h245listener), 20);
+ ret = ooSocketListen(*(call->h245listener), 4096);
if(ret != ASN_OK)
{
OOTRACEERR3("Error:Unable to listen on H.245 socket (%s, %s)\n",
@@ -199,7 +215,7 @@ int ooSendH225Msg(OOH323CallData *call, Q931Message *msg)
"message(%s, %s)\n", call->callType, call->callToken);
return OO_FAILED;
}
- iRet = ooEncodeH225Message(call, msg, encodebuf, MAXMSGLEN);
+ iRet = ooEncodeH225Message(call, msg, (char *)encodebuf, MAXMSGLEN);
if(iRet != OO_OK)
{
OOTRACEERR3("Error:Failed to encode H225 message. (%s, %s)\n",
@@ -228,8 +244,9 @@ int ooSendH225Msg(OOH323CallData *call, Q931Message *msg)
int ooCreateH225Connection(OOH323CallData *call)
{
- int ret=0;
+ int ret=0, i;
OOSOCKET channelSocket=0;
+ for (i=0;i<3;i++) {
if((ret=ooSocketCreate (&channelSocket))!=ASN_OK)
{
OOTRACEERR3("Failed to create socket for transmit H2250 channel (%s, %s)"
@@ -314,19 +331,23 @@ int ooCreateH225Connection(OOH323CallData *call)
}
else
{
- OOTRACEERR3("ERROR:Failed to connect to remote destination for "
- "transmit H2250 channel(%s, %s)\n",call->callType,
- call->callToken);
+ OOTRACEERR5("ERROR:Failed to connect to remote destination for "
+ "transmit H2250 channel(%s, %s, %d, %s)\n",call->callType,
+ call->callToken, channelSocket, call->localIP);
+ close(channelSocket);
+
if(call->callState < OO_CALL_CLEAR)
{ /* No one is listening at remote end */
call->callState = OO_CALL_CLEAR;
call->callEndReason = OO_REASON_NOUSER;
}
- return OO_FAILED;
+ if (i>=2) return OO_FAILED; else continue;
}
return OO_FAILED;
- }
+ }
+ }
+ return OO_FAILED;
}
int ooCloseH225Connection (OOH323CallData *call)
@@ -364,7 +385,7 @@ int ooCreateH323Listener()
gH323ep.listener = (OOSOCKET*)memAlloc(&gH323ep.ctxt,sizeof(OOSOCKET));
*(gH323ep.listener) = channelSocket;
- ooSocketListen(channelSocket,20); /*listen on socket*/
+ ooSocketListen(channelSocket,2048); /*listen on socket*/
OOTRACEINFO1("H323 listener creation - successful\n");
return OO_OK;
}
@@ -399,6 +420,7 @@ int ooAcceptH225Connection()
return OO_FAILED;
}
+ ast_mutex_lock(&call->Lock);
call->pH225Channel = (OOH323Channel*)
memAllocZ (call->pctxt, sizeof(OOH323Channel));
@@ -422,13 +444,15 @@ int ooAcceptH225Connection()
call->callState = OO_CALL_CLEAR;
call->callEndReason = OO_REASON_TRANSPORTFAILURE;
}
+ ast_mutex_unlock(&call->Lock);
return OO_FAILED;
}
OOTRACEDBGA4("Using Local IP address %s for incoming call in multihomed "
"mode. (%s, %s)\n", call->localIP, call->callType,
call->callToken);
}
-
+
+ ast_mutex_unlock(&call->Lock);
return OO_OK;
}
@@ -475,81 +499,103 @@ int ooAcceptH245Connection(OOH323CallData *call)
}
-int ooSetFDSETs(fd_set *pReadfds, fd_set *pWritefds, int *nfds)
+int ooSetCmdFDSETs(struct pollfd *pfds, int *nfds)
{
- OOH323CallData *call=NULL;
+ if(gH323ep.cmdSock)
+ {
+ pfds[*nfds].fd = gH323ep.cmdSock;
+ pfds[*nfds].events = POLLIN;
+ (*nfds)++;
+ }
+
+ return OO_OK;
+
+}
+
+int ooProcessCmdFDSETsAndTimers
+ (struct pollfd *pfds, int nfds, struct timeval *pToMin)
+{
+ if(gH323ep.cmdSock) {
+ if(ooPDRead(pfds, nfds, gH323ep.cmdSock)) {
+ if(ooReadAndProcessStackCommand() != OO_OK) {
+ /* ooReadAndProcessStackCommand prints an error message */
+ return OO_FAILED;
+ }
+ }
+ }
+
+ return OO_OK;
+}
+
+
+int ooSetFDSETs(struct pollfd *pfds, int *nfds)
+{
if(gH323ep.gkClient && gH323ep.gkClient->rasSocket != 0)
{
- FD_SET(gH323ep.gkClient->rasSocket, pReadfds );
- if ( *nfds < (int)gH323ep.gkClient->rasSocket)
- *nfds = (int)gH323ep.gkClient->rasSocket;
+ pfds[*nfds].fd = gH323ep.gkClient->rasSocket;
+ pfds[*nfds].events = POLLIN;
+ (*nfds)++;
}
if(gH323ep.listener)
{
- FD_SET(*(gH323ep.listener), pReadfds);
- if(*nfds < (int)*(gH323ep.listener))
- *nfds = *((int*)gH323ep.listener);
+ pfds[*nfds].fd = *gH323ep.listener;
+ pfds[*nfds].events = POLLIN;
+ (*nfds)++;
}
- if(gH323ep.cmdSock)
- {
- FD_SET(gH323ep.cmdSock, pReadfds);
- if(*nfds < (int)gH323ep.cmdSock)
- *nfds = (int)gH323ep.cmdSock;
- }
+ return OO_OK;
+}
-
- if(gH323ep.callList)
- {
- call = gH323ep.callList;
- while(call)
- {
- if (0 != call->pH225Channel && 0 != call->pH225Channel->sock)
- {
- FD_SET (call->pH225Channel->sock, pReadfds);
- if (call->pH225Channel->outQueue.count > 0 ||
- (OO_TESTFLAG (call->flags, OO_M_TUNNELING) &&
- 0 != call->pH245Channel &&
- call->pH245Channel->outQueue.count>0))
- FD_SET (call->pH225Channel->sock, pWritefds);
- if(*nfds < (int)call->pH225Channel->sock)
- *nfds = call->pH225Channel->sock;
- }
+int ooSetCallFDSETs(OOH323CallData* call, struct pollfd* pfds, int *nfds)
+{
+
+ if(call) {
+
+ if(call->cmdSock && call->callState < OO_CALL_CLEAR) {
+ pfds[*nfds].fd = call->cmdSock;
+ pfds[*nfds].events = POLLIN;
+ (*nfds)++;
+ }
+
+ if (0 != call->pH225Channel && 0 != call->pH225Channel->sock) {
+ pfds[*nfds].fd = call->pH225Channel->sock;
+ pfds[*nfds].events = POLLIN;
+
+ if (call->pH225Channel->outQueue.count > 0 ||
+ (OO_TESTFLAG (call->flags, OO_M_TUNNELING) &&
+ 0 != call->pH245Channel &&
+ call->pH245Channel->outQueue.count>0))
+ pfds[*nfds].events |= POLLOUT;
+ (*nfds)++;
+
+ }
- if (0 != call->pH245Channel && call->pH245Channel->sock != 0)
- {
- FD_SET(call->pH245Channel->sock, pReadfds);
- if (call->pH245Channel->outQueue.count>0)
- FD_SET(call->pH245Channel->sock, pWritefds);
- if(*nfds < (int)call->pH245Channel->sock)
- *nfds = call->pH245Channel->sock;
- }
- else if(call->h245listener)
- {
- OOTRACEINFO3("H.245 Listerner socket being monitored "
- "(%s, %s)\n", call->callType, call->callToken);
- FD_SET(*(call->h245listener), pReadfds);
- if(*nfds < (int)*(call->h245listener))
- *nfds = *(call->h245listener);
- }
- call = call->next;
-
- }/* while(call) */
- }/*if(gH323ep.callList) */
+ if (0 != call->pH245Channel && call->pH245Channel->sock != 0) {
+ pfds[*nfds].fd = call->pH245Channel->sock;
+ pfds[*nfds].events = POLLIN;
+ if (call->pH245Channel->outQueue.count>0)
+ pfds[*nfds].events |= POLLOUT;
+ (*nfds)++;
+ }
+ else if(call->h245listener) {
+ OOTRACEINFO3("H.245 Listerner socket being monitored "
+ "(%s, %s)\n", call->callType, call->callToken);
+ pfds[*nfds].fd = *(call->h245listener);
+ pfds[*nfds].events = POLLIN;
+ (*nfds)++;
+ }
- if(*nfds != 0) *nfds = *nfds+1;
+ }
return OO_OK;
-
}
-
+
int ooProcessFDSETsAndTimers
- (fd_set *pReadfds, fd_set *pWritefds, struct timeval *pToMin)
+ (struct pollfd* pfds, int nfds, struct timeval *pToMin)
{
- OOH323CallData *call, *prev=NULL;
struct timeval toNext;
/* Process gatekeeper client timers */
@@ -576,20 +622,11 @@ int ooProcessFDSETsAndTimers
}
}
- if(gH323ep.cmdSock) {
- if(FD_ISSET(gH323ep.cmdSock, pReadfds)) {
- if(ooReadAndProcessStackCommand() != OO_OK) {
- /* ooReadAndProcessStackCommand prints an error message */
- return OO_FAILED;
- }
- }
- }
-
/* Manage ready descriptors after select */
if(0 != gH323ep.gkClient && 0 != gH323ep.gkClient->rasSocket)
{
- if(FD_ISSET( gH323ep.gkClient->rasSocket, pReadfds) )
+ if(ooPDRead(pfds, nfds, gH323ep.gkClient->rasSocket) )
{
ooGkClientReceive(gH323ep.gkClient);
if(gH323ep.gkClient->state == GkClientFailed ||
@@ -601,7 +638,7 @@ int ooProcessFDSETsAndTimers
if(gH323ep.listener)
{
- if(FD_ISSET(*(gH323ep.listener), pReadfds))
+ if(ooPDRead(pfds, nfds, *(gH323ep.listener)))
{
OOTRACEDBGA1("New connection at H225 receiver\n");
ooAcceptH225Connection();
@@ -609,102 +646,180 @@ int ooProcessFDSETsAndTimers
}
- if(gH323ep.callList)
- {
- call = gH323ep.callList;
- while(call)
- {
- ooTimerFireExpired(call->pctxt, &call->timerList);
- if (0 != call->pH225Channel && 0 != call->pH225Channel->sock)
- {
- if(FD_ISSET(call->pH225Channel->sock, pReadfds))
- {
- if(ooH2250Receive(call) != OO_OK)
- {
- OOTRACEERR3("ERROR:Failed ooH2250Receive - Clearing call "
- "(%s, %s)\n", call->callType, call->callToken);
- if(call->callState < OO_CALL_CLEAR)
- {
- call->callEndReason = OO_REASON_INVALIDMESSAGE;
- call->callState = OO_CALL_CLEAR;
- }
- }
- }
- }
+ return OO_OK;
+}
+int ooProcessCallFDSETsAndTimers
+ (OOH323CallData *call, struct pollfd* pfds, int nfds, struct timeval *pToMin)
+{
+ struct timeval toNext;
- if (0 != call->pH245Channel && 0 != call->pH245Channel->sock)
- {
- if(FD_ISSET(call->pH245Channel->sock, pReadfds))
- {
- ooH245Receive(call);
- }
- }
-
- if (0 != call->pH245Channel && 0 != call->pH245Channel->sock)
- {
- if(FD_ISSET(call->pH245Channel->sock, pWritefds))
- {
- if(call->pH245Channel->outQueue.count>0)
- ooSendMsg(call, OOH245MSG);
- }
- }
- else if(call->h245listener)
- {
- if(FD_ISSET(*(call->h245listener), pReadfds))
- {
- OOTRACEDBGC3("Incoming H.245 connection (%s, %s)\n",
- call->callType, call->callToken);
- ooAcceptH245Connection(call);
- }
- }
+ if(call)
+ {
- if (0 != call->pH225Channel && 0 != call->pH225Channel->sock)
- {
- if(FD_ISSET(call->pH225Channel->sock, pWritefds))
- {
- if(call->pH225Channel->outQueue.count>0)
- {
- OOTRACEDBGC3("Sending H225 message (%s, %s)\n",
- call->callType, call->callToken);
- ooSendMsg(call, OOQ931MSG);
- }
- if(call->pH245Channel &&
- call->pH245Channel->outQueue.count>0 &&
- OO_TESTFLAG (call->flags, OO_M_TUNNELING))
- {
- OOTRACEDBGC3("H245 message needs to be tunneled. "
- "(%s, %s)\n", call->callType,
+ if(call->cmdSock) {
+ if(ooPDRead(pfds, nfds, call->cmdSock)) {
+ ast_mutex_lock(&call->Lock);
+ if(ooReadAndProcessCallStackCommand(call) != OO_OK) {
+ /* ooReadAndProcessStackCommand prints an error message */
+ ast_mutex_unlock(&call->Lock);
+ return OO_FAILED;
+ }
+ ast_mutex_unlock(&call->Lock);
+ }
+ }
+
+ ooTimerFireExpired(call->pctxt, &call->timerList);
+ if (0 != call->pH225Channel && 0 != call->pH225Channel->sock)
+ {
+ if(ooPDRead(pfds, nfds, call->pH225Channel->sock))
+ {
+ if(ooH2250Receive(call) != OO_OK)
+ {
+ OOTRACEERR3("ERROR:Failed ooH2250Receive - Clearing call "
+ "(%s, %s)\n", call->callType, call->callToken);
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ }
+ }
+ }
+
+ if (0 != call->pH245Channel && 0 != call->pH245Channel->sock)
+ if(ooPDRead(pfds, nfds, call->pH245Channel->sock))
+ ooH245Receive(call);
+
+ if (0 != call->pH245Channel && 0 != call->pH245Channel->sock)
+ {
+ if(call->pH245Channel->outQueue.count>0)
+ {
+ if(ooPDWrite(pfds, nfds, call->pH245Channel->sock))
+ ooSendMsg(call, OOH245MSG);
+ }
+ }
+ else if(call->h245listener)
+ {
+ if(ooPDRead(pfds, nfds, *(call->h245listener)))
+ {
+ OOTRACEDBGC3("Incoming H.245 connection (%s, %s)\n",
+ call->callType, call->callToken);
+ ooAcceptH245Connection(call);
+ }
+ }
+
+ if (0 != call->pH225Channel && 0 != call->pH225Channel->sock)
+ {
+ if(ooPDWrite(pfds, nfds, call->pH225Channel->sock))
+ {
+ if(call->pH225Channel->outQueue.count>0)
+ {
+ OOTRACEDBGC3("Sending H225 message (%s, %s)\n",
+ call->callType, call->callToken);
+ ooSendMsg(call, OOQ931MSG);
+ }
+ if(call->pH245Channel &&
+ call->pH245Channel->outQueue.count>0 &&
+ OO_TESTFLAG (call->flags, OO_M_TUNNELING))
+ {
+ OOTRACEDBGC3("H245 message needs to be tunneled. "
+ "(%s, %s)\n", call->callType,
call->callToken);
- ooSendMsg(call, OOH245MSG);
- }
- }
- }
+ ooSendMsg(call, OOH245MSG);
+ }
+ }
+ }
- if(ooTimerNextTimeout(&call->timerList, &toNext))
- {
- if(ooCompareTimeouts(pToMin, &toNext) > 0)
- {
- pToMin->tv_sec = toNext.tv_sec;
- pToMin->tv_usec = toNext.tv_usec;
- }
- }
- prev = call;
- call = call->next;
- if(prev->callState >= OO_CALL_CLEAR)
- ooEndCall(prev);
- }/* while(call) */
- }/* if(gH323ep.callList) */
+ if(ooTimerNextTimeout(&call->timerList, &toNext))
+ {
+ if(ooCompareTimeouts(pToMin, &toNext) > 0)
+ {
+ pToMin->tv_sec = toNext.tv_sec;
+ pToMin->tv_usec = toNext.tv_usec;
+ }
+ }
+
+ if(call->callState >= OO_CALL_CLEAR && call->callState < OO_CALL_CLEARED) {
+ ast_mutex_lock(&call->Lock);
+ ooEndCall(call);
+ ast_mutex_unlock(&call->Lock);
+ } else if(call->callState == OO_CALL_CLEARED) {
+ ast_mutex_lock(&call->Lock);
+ ooEndCall(call);
+ ast_mutex_unlock(&call->Lock);
+ ooStopMonitorCallChannels(call);
+ }
+ }
return OO_OK;
}
+int ooMonitorCmdChannels()
+{
+ int ret=0, nfds=0;
+ struct timeval toMin;
+ struct pollfd pfds[1];
+
+ gMonitor = TRUE;
+
+ toMin.tv_sec = 3;
+ toMin.tv_usec = 0;
+
+ while(1)
+ {
+ nfds = 0;
+ ooSetCmdFDSETs(pfds, &nfds);
+
+ if(!gMonitor) {
+ OOTRACEINFO1("Ending Monitor thread\n");
+ break;
+ }
+
+
+ if(nfds == 0)
+#ifdef _WIN32
+ Sleep(10);
+#else
+ {
+ toMin.tv_sec = 0;
+ toMin.tv_usec = 10000;
+ ooSocketPoll(pfds, nfds, toMin.tv_usec / 1000);
+ }
+#endif
+ else
+ ret = ooSocketPoll(pfds, nfds, toMin.tv_sec * 1000 + toMin.tv_usec / 1000);
+
+ if(ret == -1)
+ {
+
+ OOTRACEERR1("Error in poll ...exiting\n");
+ exit(-1);
+ continue;
+ }
+
+ toMin.tv_sec = 2; /* 2 sec */
+ toMin.tv_usec = 100000; /* 100ms*/
+
+ ast_mutex_lock(&monitorLock);
+ if(ooProcessCmdFDSETsAndTimers(pfds, nfds, &toMin) != OO_OK)
+ {
+ /* ooStopMonitorCalls(); */
+ ast_mutex_unlock(&monitorLock);
+ continue;
+ }
+ ast_mutex_unlock(&monitorLock);
+
+ }/* while(1)*/
+ return OO_OK;
+}
+
int ooMonitorChannels()
{
int ret=0, nfds=0;
struct timeval toMin, toNext;
- fd_set readfds, writefds;
+ struct pollfd pfds[2];
gMonitor = TRUE;
@@ -723,10 +838,8 @@ int ooMonitorChannels()
while(1)
{
- FD_ZERO(&readfds);
- FD_ZERO(&writefds);
nfds = 0;
- ooSetFDSETs(&readfds, &writefds, &nfds);
+ ooSetFDSETs(pfds, &nfds);
if(!gMonitor) {
OOTRACEINFO1("Ending Monitor thread\n");
@@ -741,24 +854,24 @@ int ooMonitorChannels()
{
toMin.tv_sec = 0;
toMin.tv_usec = 10000;
- ooSocketSelect(1, 0, 0, 0, &toMin);
+ ooSocketPoll(pfds, nfds, toMin.tv_usec / 1000);
}
#endif
else
- ret = ooSocketSelect(nfds, &readfds, &writefds,
- NULL, &toMin);
+ ret = ooSocketPoll(pfds, nfds, toMin.tv_sec * 1000 + toMin.tv_usec / 1000);
if(ret == -1)
{
- OOTRACEERR1("Error in select ...exiting\n");
+ OOTRACEERR1("Error in poll ...exiting\n");
exit(-1);
}
- toMin.tv_sec = 0;
+ toMin.tv_sec = 2; /* 2 sec */
toMin.tv_usec = 100000; /* 100ms*/
/*This is for test application. Not part of actual stack */
+ ast_mutex_lock(&monitorLock);
ooTimerFireExpired(&gH323ep.ctxt, &g_TimerList);
if(ooTimerNextTimeout(&g_TimerList, &toNext))
{
@@ -769,13 +882,95 @@ int ooMonitorChannels()
}
}
- if(ooProcessFDSETsAndTimers(&readfds, &writefds, &toMin) != OO_OK)
+ if(ooProcessFDSETsAndTimers(pfds, nfds, &toMin) != OO_OK)
{
+ ast_mutex_unlock(&monitorLock);
ooStopMonitorCalls();
continue;
}
+ ast_mutex_unlock(&monitorLock);
+ }/* while(1)*/
+ return OO_OK;
+}
+int ooMonitorCallChannels(OOH323CallData *call)
+{
+ int ret=0, nfds=0, zeroloops = 0;
+#define MAX_ZERO_LOOP 1020
+ struct timeval toMin;
+ struct pollfd pfds[5];
+
+ OOCTXT* pctxt;
+
+ call->Monitor = TRUE;
+
+ toMin.tv_sec = 3;
+ toMin.tv_usec = 0;
+
+ while(1)
+ {
+ if(!call->Monitor) {
+ OOTRACEINFO1("Ending Call Monitor thread\n");
+ break;
+ }
+
+ nfds = 0;
+ ooSetCallFDSETs(call, pfds, &nfds);
+
+
+ if(nfds == 0)
+#ifdef _WIN32
+ Sleep(10);
+#else
+ {
+ if (zeroloops++ > MAX_ZERO_LOOP) {
+ ooCleanCall(call);
+ ooStopMonitorCallChannels(call);
+ break;
+ }
+ toMin.tv_sec = 0;
+ toMin.tv_usec = 10000;
+ ooSocketPoll(pfds, nfds, toMin.tv_usec / 1000);
+ }
+#endif
+ else
+ ret = ooSocketPoll(pfds, nfds, toMin.tv_sec * 1000 + toMin.tv_usec / 1000);
+
+ if(ret == -1)
+ {
+
+ OOTRACEERR2("Error in poll %d ...exiting\n", errno);
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEARED;
+ ooCleanCall(call);
+ ooStopMonitorCallChannels(call);
+ break;
+
+ }
+
+ toMin.tv_sec = 2; /* 2 sec */
+ toMin.tv_usec = 100000; /* 100ms*/
+ /*This is for test application. Not part of actual stack */
+
+ if(ooProcessCallFDSETsAndTimers(call, pfds, nfds, &toMin) != OO_OK)
+ {
+ ooStopMonitorCallChannels(call);
+ continue;
+ }
+
}/* while(1)*/
+
+ if (call->cmdSock)
+ ooCloseCallCmdConnection(call);
+
+ ast_mutex_lock(&call->Lock);
+ ast_mutex_unlock(&call->Lock);
+ ast_mutex_destroy(&call->Lock);
+ ast_cond_destroy(&call->gkWait);
+ pctxt = call->pctxt;
+ freeContext(pctxt);
+ free(pctxt);
+
return OO_OK;
}
@@ -785,9 +980,9 @@ int ooH2250Receive(OOH323CallData *call)
ASN1OCTET message[MAXMSGLEN], message1[MAXMSGLEN];
int len;
Q931Message *pmsg;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ OOCTXT *pctxt = call->pctxt;
+
struct timeval timeout;
- fd_set readfds;
pmsg = (Q931Message*)memAlloc(pctxt, sizeof(Q931Message));
@@ -795,7 +990,8 @@ int ooH2250Receive(OOH323CallData *call)
{
OOTRACEERR3("ERROR:Failed to allocate memory for incoming H.2250 message"
" (%s, %s)\n", call->callType, call->callToken);
- memReset(&gH323ep.msgctxt);
+ /* memReset(&gH323ep.msgctxt); */
+ memReset(call->pctxt);
return OO_FAILED;
}
memset(pmsg, 0, sizeof(Q931Message));
@@ -818,7 +1014,7 @@ int ooH2250Receive(OOH323CallData *call)
call->callState = OO_CALL_CLEARED;
}
- ooFreeQ931Message(pmsg);
+ ooFreeQ931Message(pctxt, pmsg);
return OO_OK;
}
OOTRACEDBGC3("Receiving H.2250 message (%s, %s)\n",
@@ -832,7 +1028,7 @@ int ooH2250Receive(OOH323CallData *call)
OOTRACEERR4("Error: Reading TPKT header for H225 message "
"recvLen= %d (%s, %s)\n", recvLen, call->callType,
call->callToken);
- ooFreeQ931Message(pmsg);
+ ooFreeQ931Message(pctxt, pmsg);
if(call->callState < OO_CALL_CLEAR)
{
call->callEndReason = OO_REASON_INVALIDMESSAGE;
@@ -848,6 +1044,21 @@ int ooH2250Receive(OOH323CallData *call)
/* Remaining message length is length - tpkt length */
len = len - 4;
+ if(len > MAXMSGLEN - 4)
+ {
+ OOTRACEERR4("Error: Invalid TPKT header for H225 message "
+ "Len = %d (%s, %s)\n", len, call->callType,
+ call->callToken);
+ ooCloseH225Connection(call);
+ ooFreeQ931Message(pctxt, pmsg);
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return OO_FAILED;
+ }
+
/* Now read actual Q931 message body. We should make sure that we
receive complete message as indicated by len. If we don't then there
is something wrong. The loop below receives message, then checks whether
@@ -857,24 +1068,24 @@ int ooH2250Receive(OOH323CallData *call)
*/
while(total < len)
{
+ struct pollfd pfds;
recvLen = ooSocketRecv (call->pH225Channel->sock, message1, len-total);
memcpy(message+total, message1, recvLen);
total = total + recvLen;
if(total == len) break; /* Complete message is received */
- FD_ZERO(&readfds);
- FD_SET(call->pH225Channel->sock, &readfds);
+ pfds.fd = call->pH225Channel->sock;
+ pfds.events = POLLIN;
timeout.tv_sec = 3;
timeout.tv_usec = 0;
- ret = ooSocketSelect(call->pH225Channel->sock+1, &readfds, NULL,
- NULL, &timeout);
+ ret = ooSocketPoll(&pfds, 1, timeout.tv_sec * 1000);
if(ret == -1)
{
OOTRACEERR3("Error in select while receiving H.2250 message - "
"clearing call (%s, %s)\n", call->callType,
call->callToken);
- ooFreeQ931Message(pmsg);
+ ooFreeQ931Message(pctxt, pmsg);
if(call->callState < OO_CALL_CLEAR)
{
call->callEndReason = OO_REASON_TRANSPORTFAILURE;
@@ -884,11 +1095,11 @@ int ooH2250Receive(OOH323CallData *call)
}
/* If remaining part of the message is not received in 3 seconds
exit */
- if(!FD_ISSET(call->pH225Channel->sock, &readfds))
+ if(!ooPDRead(&pfds, 1, call->pH225Channel->sock))
{
OOTRACEERR3("Error: Incomplete H.2250 message received - clearing "
"call (%s, %s)\n", call->callType, call->callToken);
- ooFreeQ931Message(pmsg);
+ ooFreeQ931Message(pctxt, pmsg);
if(call->callState < OO_CALL_CLEAR)
{
call->callEndReason = OO_REASON_INVALIDMESSAGE;
@@ -926,9 +1137,9 @@ int ooH245Receive(OOH323CallData *call)
ASN1OCTET message[MAXMSGLEN], message1[MAXMSGLEN];
ASN1BOOL aligned = TRUE;
H245Message *pmsg;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+ OOCTXT *pctxt = call->pctxt;
struct timeval timeout;
- fd_set readfds;
pmsg = (H245Message*)memAlloc(pctxt, sizeof(H245Message));
@@ -1009,18 +1220,33 @@ int ooH245Receive(OOH323CallData *call)
for remaining bytes of the message. If message is not received in 3
seconds, then we have a problem. Report an error and exit.
*/
+
+ if(len > MAXMSGLEN - 4)
+ {
+ OOTRACEERR4("Error: Invalid TPKT header length %d for H245 message (%s, %s)\n",
+ len, call->callType, call->callToken);
+ ooFreeH245Message(call, pmsg);
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return OO_FAILED;
+ }
+
while(total < len)
{
+ struct pollfd pfds;
recvLen = ooSocketRecv (call->pH245Channel->sock, message1, len-total);
memcpy(message+total, message1, recvLen);
total = total + recvLen;
if(total == len) break; /* Complete message is received */
- FD_ZERO(&readfds);
- FD_SET(call->pH245Channel->sock, &readfds);
+
+ pfds.fd = call->pH245Channel->sock;
+ pfds.events = POLLIN;
timeout.tv_sec = 3;
timeout.tv_usec = 0;
- ret = ooSocketSelect(call->pH245Channel->sock+1, &readfds, NULL,
- NULL, &timeout);
+ ret = ooSocketPoll(&pfds, 1, timeout.tv_sec * 1000);
if(ret == -1)
{
OOTRACEERR3("Error in select...H245 Receive-Clearing call (%s, %s)\n",
@@ -1035,7 +1261,7 @@ int ooH245Receive(OOH323CallData *call)
}
/* If remaining part of the message is not received in 3 seconds
exit */
- if(!FD_ISSET(call->pH245Channel->sock, &readfds))
+ if(!ooPDRead(&pfds, 1, call->pH245Channel->sock))
{
OOTRACEERR3("Error: Incomplete h245 message received (%s, %s)\n",
call->callType, call->callToken);
@@ -1352,8 +1578,8 @@ int ooOnSendMsg
return OO_FAILED;
}
- if(gH323ep.h323Callbacks.onOutgoingCall)
- gH323ep.h323Callbacks.onOutgoingCall(call);
+ /* if(gH323ep.h323Callbacks.onOutgoingCall)
+ gH323ep.h323Callbacks.onOutgoingCall(call); */
break;
case OOCallProceeding:
OOTRACEINFO3("Sent Message - CallProceeding (%s, %s)\n", call->callType,
@@ -1362,8 +1588,8 @@ int ooOnSendMsg
case OOAlert:
OOTRACEINFO3("Sent Message - Alerting (%s, %s) \n", call->callType,
call->callToken);
- if(gH323ep.h323Callbacks.onAlerting && call->callState < OO_CALL_CLEAR)
- gH323ep.h323Callbacks.onAlerting(call);
+ /* if(gH323ep.h323Callbacks.onAlerting && call->callState < OO_CALL_CLEAR)
+ gH323ep.h323Callbacks.onAlerting(call); */
break;
case OOConnect:
OOTRACEINFO3("Sent Message - Connect (%s, %s)\n", call->callType,
@@ -1383,6 +1609,8 @@ int ooOnSendMsg
gH323ep.gkClient->state == GkClientRegistered){
OOTRACEDBGA3("Sending DRQ after sending ReleaseComplete."
"(%s, %s)\n", call->callType, call->callToken);
+
+ call->endTime = (H235TimeStamp) time(NULL);
ooGkClientSendDisengageRequest(gH323ep.gkClient, call);
}
}
@@ -1702,6 +1930,12 @@ int ooOnSendMsg
return OO_OK;
}
+void ooStopMonitorCallChannels(OOH323CallData * call) {
+ if (call->Monitor)
+ call->Monitor = FALSE;
+ /* if (call->cmdSock)
+ ooCloseCallCmdConnection(call); */
+}
int ooStopMonitorCalls()
{
@@ -1771,7 +2005,7 @@ OOBOOL ooChannelsIsConnectionOK(OOH323CallData *call, OOSOCKET sock)
if(FD_ISSET(sock, &readfds))
{
char buf[2];
- if(ooSocketRecvPeek(sock, buf, 2) == 0)
+ if(ooSocketRecvPeek(sock, (ASN1OCTET*) buf, 2) == 0)
{
OOTRACEWARN3("Broken pipe detected. (%s, %s)", call->callType,
call->callToken);
diff --git a/addons/ooh323c/src/oochannels.h b/addons/ooh323c/src/oochannels.h
index 96befb567..76ce8ef30 100644
--- a/addons/ooh323c/src/oochannels.h
+++ b/addons/ooh323c/src/oochannels.h
@@ -130,6 +130,8 @@ EXTERN int ooCloseH245Connection(struct OOH323CallData *call);
*
*/
EXTERN int ooMonitorChannels(void);
+EXTERN int ooMonitorCmdChannels(void);
+EXTERN int ooMonitorCallChannels(OOH323CallData *);
/**
* This function is called to stop the monitor channels event loop.
@@ -138,6 +140,7 @@ EXTERN int ooMonitorChannels(void);
* @return OO_OK, on success. OO_FAILED, on failure
*/
EXTERN int ooStopMonitorCalls(void);
+EXTERN void ooStopMonitorCallChannels(OOH323CallData *);
/**
* This function is used to receive an H.2250 message received on a calls
diff --git a/addons/ooh323c/src/ooh245.c b/addons/ooh323c/src/ooh245.c
index 35d1fe1b0..034c3dd02 100644
--- a/addons/ooh323c/src/ooh245.c
+++ b/addons/ooh323c/src/ooh245.c
@@ -13,7 +13,8 @@
* maintain this copyright notice.
*
*****************************************************************************/
-
+#include <asterisk.h>
+#include <asterisk/lock.h>
#include "ooh245.h"
#include "ooCalls.h"
#include "printHandler.h"
@@ -34,9 +35,10 @@ static ASN1OBJID gh245ProtocolID = {
6, { 0, 0, 8, 245, 0, 8 }
};
-int ooCreateH245Message(H245Message **pph245msg, int type)
+int ooCreateH245Message(OOH323CallData* call, H245Message **pph245msg, int type)
{
- OOCTXT* pctxt = &gH323ep.msgctxt;
+ /* OOCTXT* pctxt = &gH323ep.msgctxt; */
+ OOCTXT* pctxt = call->msgctxt;
*pph245msg = (H245Message*) memAlloc (pctxt, sizeof(H245Message));
@@ -121,7 +123,8 @@ int ooFreeH245Message(OOH323CallData *call, H245Message *pmsg)
OOTRACEDBGC1("msgCtxt Reset?");
if (0 != pmsg) {
if(!OO_TESTFLAG (call->flags, OO_M_TUNNELING)){
- memReset (&gH323ep.msgctxt);
+ /* memReset (&gH323ep.msgctxt); */
+ memReset (call->msgctxt);
OOTRACEDBGC3(" Done (%s, %s)\n", call->callType, call->callToken);
return OO_OK;
}
@@ -166,7 +169,8 @@ int ooEncodeH245Message
int stat=0;
ASN1OCTET* encodePtr=NULL;
H245MultimediaSystemControlMessage *multimediaMsg;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+ OOCTXT *pctxt = call->msgctxt;
multimediaMsg = &(ph245Msg->h245Msg);
if(!msgbuf || size<200)
@@ -196,15 +200,17 @@ int ooEncodeH245Message
msgbuf[i++] = 0;
}
- setPERBuffer (pctxt, msgbuf+i, (size-i), TRUE);
+ setPERBuffer (pctxt, (unsigned char*) msgbuf+i, (size-i), TRUE);
- stat = asn1PE_H245MultimediaSystemControlMessage (&gH323ep.msgctxt,
+ /* stat = asn1PE_H245MultimediaSystemControlMessage (&gH323ep.msgctxt, */
+ stat = asn1PE_H245MultimediaSystemControlMessage (call->msgctxt,
multimediaMsg);
if (stat != ASN_OK) {
OOTRACEERR3 ("ERROR: H245 Message encoding failed (%s, %s)\n",
call->callType, call->callToken);
- OOTRACEERR1 (errGetText (&gH323ep.msgctxt));
+ /* OOTRACEERR1 (errGetText (&gH323ep.msgctxt)); */
+ OOTRACEERR1 (errGetText (call->msgctxt));
return OO_FAILED;
}
@@ -239,7 +245,7 @@ int ooSendH245Msg(OOH323CallData *call, H245Message *msg)
"message(%s, %s)\n", call->callType, call->callToken);
return OO_FAILED;
}
- iRet = ooEncodeH245Message(call, msg, encodebuf, MAXMSGLEN);
+ iRet = ooEncodeH245Message(call, msg, (char*) encodebuf, MAXMSGLEN);
if(iRet != OO_OK)
{
@@ -317,15 +323,16 @@ int ooSendTermCapMsg(OOH323CallData *call)
ooH323EpCapability *epCap=NULL;
H245TerminalCapabilitySet *termCap=NULL;
H245AudioCapability *audioCap=NULL;
+ H245DataApplicationCapability *t38Cap, *rtdCap = NULL;
H245AudioTelephonyEventCapability *ateCap=NULL;
H245UserInputCapability *userInputCap = NULL;
H245CapabilityTableEntry *entry=NULL;
- H245AlternativeCapabilitySet *altSet=NULL;
+ H245AlternativeCapabilitySet *altSetAudio=NULL, *altSetVideo=NULL, *altSetDtmf=NULL;
H245CapabilityDescriptor *capDesc=NULL;
H245Message *ph245msg=NULL;
H245VideoCapability *videoCap=NULL;
- int i=0, j=0, k=0;
+ int i=0,k=0;
if(call->localTermCapState == OO_LocalTermCapSetSent)
{
OOTRACEINFO3("TerminalCapabilitySet exchange procedure already in "
@@ -333,7 +340,7 @@ int ooSendTermCapMsg(OOH323CallData *call)
return OO_OK;
}
- ret = ooCreateH245Message(&ph245msg,
+ ret = ooCreateH245Message(call, &ph245msg,
T_H245MultimediaSystemControlMessage_request);
if(ret == OO_FAILED)
@@ -345,7 +352,8 @@ int ooSendTermCapMsg(OOH323CallData *call)
/* Set request type as TerminalCapabilitySet */
request = ph245msg->h245Msg.u.request;
- pctxt = &gH323ep.msgctxt;
+ /* pctxt = &gH323ep.msgctxt; */
+ pctxt = call->msgctxt;
ph245msg->msgType = OOTerminalCapabilitySet;
memset(request, 0, sizeof(H245RequestMessage));
if(request == NULL)
@@ -366,6 +374,24 @@ int ooSendTermCapMsg(OOH323CallData *call)
termCap->sequenceNumber = ++(call->localTermCapSeqNo);
termCap->protocolIdentifier = gh245ProtocolID; /* protocol id */
+ /* Initialize alternate sets */
+ altSetAudio = (H245AlternativeCapabilitySet*)
+ memAlloc(pctxt, sizeof(H245AlternativeCapabilitySet));
+ altSetVideo = (H245AlternativeCapabilitySet*)
+ memAlloc(pctxt, sizeof(H245AlternativeCapabilitySet));
+ altSetDtmf = (H245AlternativeCapabilitySet*)
+ memAlloc(pctxt, sizeof(H245AlternativeCapabilitySet));
+ if(!altSetAudio || !altSetVideo || !altSetDtmf)
+ {
+ OOTRACEERR3("Error:Memory - ooSendTermCapMsg - altSet."
+ "(%s, %s)\n", call->callType, call->callToken);
+ return OO_FAILED;
+ }
+ memset(altSetDtmf, 0, sizeof(H245AlternativeCapabilitySet));
+ memset(altSetVideo, 0, sizeof(H245AlternativeCapabilitySet));
+ memset(altSetAudio, 0, sizeof(H245AlternativeCapabilitySet));
+
+
/* Add audio Capabilities */
dListInit(&(termCap->capabilityTable));
@@ -450,6 +476,82 @@ int ooSendTermCapMsg(OOH323CallData *call)
}
entry->capabilityTableEntryNumber = i+1;
dListAppend(pctxt , &(termCap->capabilityTable), entry);
+ altSetAudio->elem[altSetAudio->n] = i+1;
+ altSetAudio->n++;
+ i++;
+ }
+ else if(epCap->capType == OO_CAP_TYPE_DATA)
+ {
+
+ /* Create t.38 capability. If capability supports receive, we only
+ add it as receive capability in TCS. However, if it supports only
+ transmit, we add it as transmit capability in TCS.
+ */
+ if((epCap->dir & OORX) && !(epCap->dir & OOTX))
+ {
+
+ OOTRACEDBGC3("Sending receive capability t38 in TCS.(%s, %s)\n",
+ call->callType, call->callToken);
+
+ t38Cap = ooCapabilityCreateT38Capability(epCap, pctxt, OORX);
+ if(!t38Cap)
+ {
+ OOTRACEWARN3("WARN:Failed to create t38 capability for"
+ "%s, %s\n",
+ call->callType, call->callToken);
+ continue;
+ }
+ }
+ else if((epCap->dir & OOTX) && !(epCap->dir & OORX))
+ {
+ OOTRACEDBGC3("Sending transmit capability t38 in TCS.(%s, %s)\n",
+ call->callType, call->callToken);
+ t38Cap = ooCapabilityCreateT38Capability(epCap, pctxt, OOTX);
+ if(!t38Cap)
+ {
+ OOTRACEWARN3("WARN:Failed to create capability t38 "
+ "(%s, %s)\n",
+ call->callType, call->callToken);
+ continue;
+ }
+ }
+ else{
+ OOTRACEDBGC3("Sending transmit&recevie capability t38 in TCS.(%s, %s)\n",
+ call->callType, call->callToken);
+ t38Cap = ooCapabilityCreateT38Capability(epCap, pctxt, OOTX&OORX);
+ if(!t38Cap)
+ {
+ OOTRACEWARN3("WARN:Failed to create capability t38 "
+ "(%s, %s)\n",
+ call->callType, call->callToken);
+ continue;
+ }
+ }
+ /* Add Capabilities to Capability Table */
+ entry = (H245CapabilityTableEntry*) memAlloc(pctxt,
+ sizeof(H245CapabilityTableEntry));
+ if(!entry)
+ {
+ OOTRACEERR3("Error:Memory - ooSendTermCapMsg - entry(audio Cap)."
+ "(%s, %s)\n", call->callType, call->callToken);
+ return OO_FAILED;
+ }
+ memset(entry, 0, sizeof(H245CapabilityTableEntry));
+ entry->m.capabilityPresent = 1;
+ if((epCap->dir & OORX) && (epCap->dir & OOTX)) {
+ entry->capability.t = T_H245Capability_receiveAndTransmitDataApplicationCapability;
+ entry->capability.u.receiveAndTransmitDataApplicationCapability = t38Cap;
+ } else if((epCap->dir & OORX)) {
+ entry->capability.t = T_H245Capability_receiveDataApplicationCapability;
+ entry->capability.u.receiveDataApplicationCapability = t38Cap;
+ }else{
+ entry->capability.t = T_H245Capability_transmitDataApplicationCapability;
+ entry->capability.u.transmitDataApplicationCapability = t38Cap;
+ }
+ entry->capabilityTableEntryNumber = i+1;
+ dListAppend(pctxt , &(termCap->capabilityTable), entry);
+ altSetAudio->elem[altSetAudio->n] = i+1;
+ altSetAudio->n++;
i++;
}
else if(epCap->capType == OO_CAP_TYPE_VIDEO)
@@ -508,6 +610,8 @@ int ooSendTermCapMsg(OOH323CallData *call)
}
entry->capabilityTableEntryNumber = i+1;
dListAppend(pctxt , &(termCap->capabilityTable), entry);
+ altSetVideo->elem[altSetVideo->n] = i+1;
+ altSetVideo->n++;
i++;
}
}
@@ -515,7 +619,7 @@ int ooSendTermCapMsg(OOH323CallData *call)
if(call->dtmfmode & OO_CAP_DTMF_RFC2833)
{
ateCap = (H245AudioTelephonyEventCapability*)
- ooCapabilityCreateDTMFCapability(OO_CAP_DTMF_RFC2833, pctxt);
+ ooCapabilityCreateDTMFCapability(OO_CAP_DTMF_RFC2833, call->dtmfcodec, pctxt);
if(!ateCap)
{
OOTRACEWARN3("WARN:Failed to add RFC2833 cap to TCS(%s, %s)\n",
@@ -541,6 +645,44 @@ int ooSendTermCapMsg(OOH323CallData *call)
entry->capabilityTableEntryNumber = i+1;
dListAppend(pctxt , &(termCap->capabilityTable), entry);
+ altSetDtmf->elem[altSetDtmf->n] = i+1;
+ altSetDtmf->n++;
+
+ i++;
+ }
+ }
+
+ if(call->dtmfmode & OO_CAP_DTMF_CISCO)
+ {
+ rtdCap = (H245DataApplicationCapability*)
+ ooCapabilityCreateDTMFCapability(OO_CAP_DTMF_CISCO, call->dtmfcodec, pctxt);
+ if(!rtdCap)
+ {
+ OOTRACEWARN3("WARN:Failed to add RTP/CISCO DTMF cap to TCS(%s, %s)\n",
+ call->callType, call->callToken);
+ }
+ else {
+ entry = (H245CapabilityTableEntry*) memAlloc(pctxt,
+ sizeof(H245CapabilityTableEntry));
+ if(!entry)
+ {
+ OOTRACEERR3("Error:Failed to allocate memory for new capability "
+ "table entry. (%s, %s)\n", call->callType,
+ call->callToken);
+ ooFreeH245Message(call, ph245msg);
+ return OO_FAILED;
+ }
+
+ memset(entry, 0, sizeof(H245CapabilityTableEntry));
+ entry->m.capabilityPresent = 1;
+
+ entry->capability.t = T_H245Capability_receiveDataApplicationCapability;
+ entry->capability.u.receiveDataApplicationCapability = rtdCap;
+
+ entry->capabilityTableEntryNumber = i+1;
+ dListAppend(pctxt , &(termCap->capabilityTable), entry);
+ altSetDtmf->elem[altSetDtmf->n] = i+1;
+ altSetDtmf->n++;
i++;
}
@@ -549,7 +691,7 @@ int ooSendTermCapMsg(OOH323CallData *call)
if(call->dtmfmode & OO_CAP_DTMF_H245_alphanumeric)
{
userInputCap = (H245UserInputCapability*)ooCapabilityCreateDTMFCapability
- (OO_CAP_DTMF_H245_alphanumeric, pctxt);
+ (OO_CAP_DTMF_H245_alphanumeric, 0, pctxt);
if(!userInputCap)
{
OOTRACEWARN3("WARN:Failed to add H245(alphanumeric) cap to "
@@ -575,6 +717,8 @@ int ooSendTermCapMsg(OOH323CallData *call)
entry->capabilityTableEntryNumber = i+1;
dListAppend(pctxt , &(termCap->capabilityTable), entry);
+ altSetDtmf->elem[altSetDtmf->n] = i+1;
+ altSetDtmf->n++;
i++;
}
@@ -583,7 +727,7 @@ int ooSendTermCapMsg(OOH323CallData *call)
if(call->dtmfmode & OO_CAP_DTMF_H245_signal)
{
userInputCap = (H245UserInputCapability*)ooCapabilityCreateDTMFCapability
- (OO_CAP_DTMF_H245_signal, pctxt);
+ (OO_CAP_DTMF_H245_signal, 0, pctxt);
if(!userInputCap)
{
OOTRACEWARN3("WARN:Failed to add H245(signal) cap to "
@@ -609,6 +753,8 @@ int ooSendTermCapMsg(OOH323CallData *call)
entry->capabilityTableEntryNumber = i+1;
dListAppend(pctxt , &(termCap->capabilityTable), entry);
+ altSetDtmf->elem[altSetDtmf->n] = i+1;
+ altSetDtmf->n++;
i++;
}
@@ -636,7 +782,7 @@ int ooSendTermCapMsg(OOH323CallData *call)
alternate capabilities set. Need a way for application
developer to specify the alternative capability sets.
*/
- for(j=0; j<i; j++)
+ /* for(j=0; j<i; j++)
{
altSet = (H245AlternativeCapabilitySet*)
memAlloc(pctxt, sizeof(H245AlternativeCapabilitySet));
@@ -645,7 +791,11 @@ int ooSendTermCapMsg(OOH323CallData *call)
altSet->elem[0] = j+1;
dListAppend(pctxt, &(capDesc->simultaneousCapabilities), altSet);
- }
+ } */
+
+ if (altSetAudio->n) dListAppend(pctxt, &(capDesc->simultaneousCapabilities), altSetAudio);
+ if (altSetVideo->n) dListAppend(pctxt, &(capDesc->simultaneousCapabilities), altSetVideo);
+ if (altSetDtmf->n) dListAppend(pctxt, &(capDesc->simultaneousCapabilities), altSetDtmf);
dListInit(&(termCap->capabilityDescriptors));
dListAppend(pctxt, &(termCap->capabilityDescriptors), capDesc);
@@ -695,7 +845,7 @@ int ooHandleMasterSlave(OOH323CallData *call, void * pmsg,
{
H245MasterSlaveDetermination *masterSlave;
H245MasterSlaveDeterminationAck *masterSlaveAck;
- ASN1UINT statusDeterminationNumber;
+ ASN1UINT statusDeterminationNumber, moduloDiff;
switch(msgType)
{
@@ -704,7 +854,16 @@ int ooHandleMasterSlave(OOH323CallData *call, void * pmsg,
call->callType, call->callToken);
masterSlave = (H245MasterSlaveDetermination*)pmsg;
-
+
+ if(call->masterSlaveState != OO_MasterSlave_DetermineSent &&
+ OO_TESTFLAG(gH323ep.flags, OO_M_TRYBEMASTER))
+ {
+ ooSendMasterSlaveDeterminationAck(call, "slave");
+ call->masterSlaveState = OO_MasterSlave_Master;
+ OOTRACEINFO3("MasterSlaveDetermination done - Master(%s, %s)\n",
+ call->callType, call->callToken);
+ return OO_OK;
+ }
if(masterSlave->terminalType < gH323ep.termType)
{
ooSendMasterSlaveDeterminationAck(call, "slave");
@@ -730,10 +889,17 @@ int ooHandleMasterSlave(OOH323CallData *call, void * pmsg,
if(call->masterSlaveState == OO_MasterSlave_DetermineSent)
statusDeterminationNumber = call->statusDeterminationNumber;
else
- statusDeterminationNumber = ooGenerateStatusDeterminationNumber();
+ if (OO_TESTFLAG(gH323ep.flags, OO_M_TRYBEMASTER))
+ statusDeterminationNumber = masterSlave->statusDeterminationNumber - 1;
+ else
+ statusDeterminationNumber = ooGenerateStatusDeterminationNumber();
+
+ moduloDiff = (masterSlave->statusDeterminationNumber - statusDeterminationNumber)
+ &0xffffff;
- if(masterSlave->statusDeterminationNumber <
- statusDeterminationNumber)
+ /* if(masterSlave->statusDeterminationNumber >
+ statusDeterminationNumber) */
+ if (moduloDiff < 0x800000 && moduloDiff != 0)
{
ooSendMasterSlaveDeterminationAck(call, "slave");
call->masterSlaveState = OO_MasterSlave_Master;
@@ -741,8 +907,9 @@ int ooHandleMasterSlave(OOH323CallData *call, void * pmsg,
call->callType, call->callToken);
return OO_OK;
}
- if(masterSlave->statusDeterminationNumber >
- statusDeterminationNumber)
+ /* if(masterSlave->statusDeterminationNumber <
+ statusDeterminationNumber) */
+ if (moduloDiff > 0x800000)
{
ooSendMasterSlaveDeterminationAck(call, "master");
call->masterSlaveState = OO_MasterSlave_Slave;
@@ -750,8 +917,9 @@ int ooHandleMasterSlave(OOH323CallData *call, void * pmsg,
call->callType, call->callToken);
return OO_OK;
}
- if(masterSlave->statusDeterminationNumber ==
- statusDeterminationNumber)
+ /* if(masterSlave->statusDeterminationNumber ==
+ statusDeterminationNumber) */
+ if (moduloDiff == 0 || moduloDiff == 0x800000)
{
ooSendMasterSlaveDeterminationReject (call);
@@ -780,6 +948,8 @@ int ooHandleMasterSlave(OOH323CallData *call, void * pmsg,
call->callType, call->callToken);
}
}
+
+ call->msAckStatus = OO_msAck_remoteReceived;
if(call->localTermCapState == OO_LocalTermCapSetAckRecvd &&
call->remoteTermCapState == OO_RemoteTermCapSetAckSent)
@@ -788,7 +958,7 @@ int ooHandleMasterSlave(OOH323CallData *call, void * pmsg,
if(gH323ep.h323Callbacks.openLogicalChannels)
gH323ep.h323Callbacks.openLogicalChannels(call);
else{
- if(!call->logicalChans)
+ if(!ooGetTransmitLogicalChannel(call))
ooOpenLogicalChannels(call);
}
#if 0
@@ -816,7 +986,8 @@ int ooSendMasterSlaveDetermination(OOH323CallData *call)
int ret;
H245Message* ph245msg=NULL;
H245RequestMessage *request;
- OOCTXT *pctxt=&gH323ep.msgctxt;
+ /* OOCTXT *pctxt=&gH323ep.msgctxt; */
+ OOCTXT *pctxt=call->msgctxt;
H245MasterSlaveDetermination* pMasterSlave;
/* Check whether Master Slave Determination already in progress */
@@ -827,7 +998,7 @@ int ooSendMasterSlaveDetermination(OOH323CallData *call)
return OO_OK;
}
- ret = ooCreateH245Message(&ph245msg,
+ ret = ooCreateH245Message(call, &ph245msg,
T_H245MultimediaSystemControlMessage_request);
if(ret != OO_OK)
{
@@ -873,9 +1044,10 @@ int ooSendMasterSlaveDeterminationAck(OOH323CallData* call,
int ret=0;
H245ResponseMessage * response=NULL;
H245Message *ph245msg=NULL;
- OOCTXT *pctxt=&gH323ep.msgctxt;
+ /* OOCTXT *pctxt=&gH323ep.msgctxt; */
+ OOCTXT *pctxt=call->msgctxt;
- ret = ooCreateH245Message(&ph245msg,
+ ret = ooCreateH245Message(call, &ph245msg,
T_H245MultimediaSystemControlMessage_response);
if(ret != OO_OK)
{
@@ -910,6 +1082,7 @@ int ooSendMasterSlaveDeterminationAck(OOH323CallData* call,
}
ooFreeH245Message(call, ph245msg);
+ call->msAckStatus = OO_msAck_localSent;
return ret;
}
@@ -918,10 +1091,11 @@ int ooSendMasterSlaveDeterminationReject (OOH323CallData* call)
int ret=0;
H245ResponseMessage* response=NULL;
H245Message *ph245msg=NULL;
- OOCTXT *pctxt=&gH323ep.msgctxt;
+ /* OOCTXT *pctxt=&gH323ep.msgctxt; */
+ OOCTXT *pctxt=call->msgctxt;
ret = ooCreateH245Message
- (&ph245msg, T_H245MultimediaSystemControlMessage_response);
+ (call, &ph245msg, T_H245MultimediaSystemControlMessage_response);
if (ret != OO_OK) {
OOTRACEERR3("Error:H245 message creation failed for - MasterSlave "
@@ -963,10 +1137,11 @@ int ooSendMasterSlaveDeterminationRelease(OOH323CallData * call)
int ret=0;
H245IndicationMessage* indication=NULL;
H245Message *ph245msg=NULL;
- OOCTXT *pctxt=&gH323ep.msgctxt;
+ /* OOCTXT *pctxt=&gH323ep.msgctxt; */
+ OOCTXT *pctxt=call->msgctxt;
ret = ooCreateH245Message
- (&ph245msg, T_H245MultimediaSystemControlMessage_indication);
+ (call, &ph245msg, T_H245MultimediaSystemControlMessage_indication);
if (ret != OO_OK) {
OOTRACEERR3("Error:H245 message creation failed for - MasterSlave "
@@ -1028,6 +1203,257 @@ int ooHandleMasterSlaveReject
return OO_OK;
}
+/* handling requestmode routines */
+
+int ooSendRequestModeAck(OOH323CallData* call,
+ H245SequenceNumber sequenceNumber)
+{
+ int ret=0;
+ H245ResponseMessage* response=NULL;
+ H245Message *ph245msg=NULL;
+ OOCTXT *pctxt=call->msgctxt;
+
+ ret = ooCreateH245Message(call, &ph245msg,
+ T_H245MultimediaSystemControlMessage_response);
+ if(ret != OO_OK)
+ {
+ OOTRACEERR3("Error:H245 message creation failed for - RequestMode "
+ "Ack (%s, %s)\n",call->callType,
+ call->callToken);
+ return OO_FAILED;
+ }
+ ph245msg->msgType = OORequestModeAck;
+ response = ph245msg->h245Msg.u.response;
+ memset(response, 0, sizeof(H245ResponseMessage));
+ response->t = T_H245ResponseMessage_requestModeAck;
+ response->u.requestModeAck = (H245RequestModeAck *)
+ ASN1MALLOC(pctxt, sizeof(H245RequestModeAck));
+ memset(response->u.requestModeAck, 0,
+ sizeof(H245RequestModeAck));
+
+ response->u.requestModeAck->sequenceNumber = sequenceNumber;
+ response->u.requestModeAck->response.t =
+ T_H245RequestModeAck_response_willTransmitMostPreferredMode;
+
+ OOTRACEDBGA3("Built RequestModeAck (%s, %s)\n",
+ call->callType, call->callToken);
+ ret = ooSendH245Msg(call, ph245msg);
+ if(ret != OO_OK)
+ {
+ OOTRACEERR3("Error:Failed to enqueue RequestModeAck message"
+ " to outbound queue. (%s, %s)\n", call->callType,
+ call->callToken);
+ }
+
+ ooFreeH245Message(call, ph245msg);
+ return ret;
+}
+
+int ooSendRequestModeReject(OOH323CallData* call,
+ H245SequenceNumber sequenceNumber)
+{
+ int ret=0;
+ H245ResponseMessage* response=NULL;
+ H245Message *ph245msg=NULL;
+ OOCTXT *pctxt=call->msgctxt;
+
+ ret = ooCreateH245Message(call, &ph245msg,
+ T_H245MultimediaSystemControlMessage_response);
+ if(ret != OO_OK)
+ {
+ OOTRACEERR3("Error:H245 message creation failed for - RequstMode "
+ "Reject (%s, %s)\n",call->callType,
+ call->callToken);
+ return OO_FAILED;
+ }
+ ph245msg->msgType = OORequestModeReject;
+ response = ph245msg->h245Msg.u.response;
+ memset(response, 0, sizeof(H245ResponseMessage));
+ response->t = T_H245ResponseMessage_requestModeReject;
+ response->u.requestModeReject = (H245RequestModeReject *)
+ ASN1MALLOC(pctxt, sizeof(H245RequestModeReject));
+ memset(response->u.requestModeReject, 0,
+ sizeof(H245RequestModeReject));
+
+ response->u.requestModeReject->sequenceNumber = sequenceNumber;
+ response->u.requestModeReject->cause.t =
+ T_H245RequestModeReject_cause_modeUnavailable;
+
+ OOTRACEDBGA3("Built RequestModeReject (%s, %s)\n",
+ call->callType, call->callToken);
+ ret = ooSendH245Msg(call, ph245msg);
+ if(ret != OO_OK)
+ {
+ OOTRACEERR3("Error:Failed to enqueue RequestModeReject message"
+ " to outbound queue. (%s, %s)\n", call->callType,
+ call->callToken);
+ }
+
+ ooFreeH245Message(call, ph245msg);
+ return ret;
+}
+
+int ooSendRequestMode(OOH323CallData* call,
+ int isT38Mode)
+{
+ int ret=0;
+ H245RequestMessage *request;
+ H245Message *ph245msg=NULL;
+ OOCTXT *pctxt=call->msgctxt;
+
+
+ H245ModeDescription pModeDesc;
+ H245ModeElement pModeElem;
+
+ if (isT38Mode && !OO_TESTFLAG(call->flags, OO_M_T38SUPPORTED)) /* t38 req but we dont support */
+ return OO_OK;
+
+ ret = ooCreateH245Message(call, &ph245msg,
+ T_H245MultimediaSystemControlMessage_request);
+ if(ret != OO_OK)
+ {
+ OOTRACEERR3("Error:H245 message creation failed for - RequstMode "
+ "(%s, %s)\n",call->callType,
+ call->callToken);
+ return OO_FAILED;
+ }
+ ph245msg->msgType = OORequestMode;
+ request = ph245msg->h245Msg.u.request;
+ memset(request, 0, sizeof(H245RequestMessage));
+ request->t = T_H245RequestMessage_requestMode;
+
+ request->u.requestMode = (H245RequestMode *)
+ ASN1MALLOC(pctxt, sizeof(H245RequestMode));
+ memset(request->u.requestMode, 0,
+ sizeof(H245RequestMode));
+
+ call->requestSequence++;
+ call->reqFlags = (isT38Mode) ? OO_M_DATASESSION : OO_M_AUDIOSESSION;
+
+ request->u.requestMode->sequenceNumber = call->requestSequence;
+ memset(&pModeElem, 0, sizeof(pModeElem));
+ memset(&pModeDesc, 0, sizeof(pModeDesc));
+ dListInit(&(request->u.requestMode->requestedModes));
+ dListInit(&pModeDesc);
+
+ if (isT38Mode) {
+
+ pModeElem.type.t = T_H245ModeElementType_dataMode;
+ pModeElem.type.u.dataMode = (H245DataMode *) memAllocZ(pctxt, sizeof(H245DataMode));
+ pModeElem.type.u.dataMode->bitRate = 144;
+ if (!ooCreateT38ApplicationData(pctxt,&(pModeElem.type.u.dataMode->application))) {
+ OOTRACEERR3("Error:Memory - ooCapabilityCreateT38Capability - (%s, %s)\n",
+ call->callType,
+ call->callToken);
+ }
+ } else {
+ pModeElem.type.t = T_H245ModeElementType_audioMode;
+ pModeElem.type.u.audioMode = (H245AudioMode *) memAllocZ(pctxt, sizeof(H245AudioMode));
+ pModeElem.type.u.audioMode->t = T_H245AudioMode_genericAudioMode;
+ pModeElem.type.u.audioMode->u.genericAudioMode = (H245GenericCapability *)
+ memAllocZ(pctxt, sizeof(H245GenericCapability));
+ pModeElem.type.u.audioMode->u.genericAudioMode->capabilityIdentifier.t =
+ T_H245CapabilityIdentifier_domainBased;
+ pModeElem.type.u.audioMode->u.genericAudioMode->capabilityIdentifier.u.domainBased =
+ "H.323";
+ pModeElem.type.u.audioMode->u.genericAudioMode->m.maxBitRatePresent = TRUE;
+ pModeElem.type.u.audioMode->u.genericAudioMode->maxBitRate = 144;
+ }
+
+ dListAppend(pctxt, &pModeDesc, &pModeElem);
+ dListAppend(pctxt, &(request->u.requestMode->requestedModes), &pModeDesc);
+
+ ret = ooSendH245Msg(call, ph245msg);
+ if(ret != OO_OK)
+ {
+ OOTRACEERR3("Error:Failed to enqueue RequestMode message"
+ " to outbound queue. (%s, %s)\n", call->callType,
+ call->callToken);
+ }
+
+ ooFreeH245Message(call, ph245msg);
+ return ret;
+}
+
+void ooOnReceivedRequestModeAck(OOH323CallData* call, H245RequestModeAck * requestModeAck)
+{
+ int t38mode;
+
+ if (!call->reqFlags) return;
+
+ if (OO_TESTFLAG(call->reqFlags, OO_M_AUDIOSESSION)) {
+ OO_SETFLAG(call->flags, OO_M_AUDIOSESSION);
+ OO_CLRFLAG(call->flags, OO_M_DATASESSION);
+ t38mode = 0;
+ } else {
+ OO_CLRFLAG(call->flags, OO_M_AUDIOSESSION);
+ OO_SETFLAG(call->flags, OO_M_DATASESSION);
+ t38mode = 1;
+ }
+
+ call->reqFlags = 0; /* don't handle duplicate ack packet */
+
+ ooCloseAllLogicalChannels(call, "transmit");
+ if(gH323ep.h323Callbacks.onModeChanged) {
+ OOTRACEDBGA3("Handle RequestModeAck: (%s, %s), calling "
+ "callback onModeChanged\n", call->callType, call->callToken);
+ gH323ep.h323Callbacks.onModeChanged(call, t38mode);
+ }
+}
+
+int ooHandleRequestMode(OOH323CallData* call,
+ H245RequestMode *requestMode)
+{
+
+ H245ModeDescription** pModeRef;
+ H245ModeElement** pModeElem;
+ H245ModeElementType* pMode;
+
+ pModeRef = (H245ModeDescription**)dListFindByIndex(&requestMode->requestedModes, 0);
+ pModeElem = (H245ModeElement **) dListFindByIndex(*pModeRef, 0);
+ pMode = &((*pModeElem)->type);
+ OOTRACEDBGA5("Handle RequestMode: "
+ " modetype: %d/%d for (%s, %s)\n", pMode->t, pMode->u.dataMode->application.t,
+ call->callType,
+ call->callToken);
+ switch (pMode->t) {
+ case T_H245ModeElementType_dataMode:
+ if (pMode->u.dataMode->application.t == T_H245DataMode_application_t38fax &&
+ OO_TESTFLAG(call->flags, OO_M_T38SUPPORTED)) {
+ if (ooSendRequestModeAck(call, requestMode->sequenceNumber) == OO_OK &&
+ OO_TESTFLAG(call->flags, OO_M_AUDIOSESSION)) {
+
+ OO_CLRFLAG(call->flags, OO_M_AUDIOSESSION);
+ OO_SETFLAG(call->flags, OO_M_DATASESSION);
+ if(gH323ep.h323Callbacks.onModeChanged) {
+ OOTRACEDBGA3("Handle RequestMode: (%s, %s), calling "
+ "callback onModeChanged\n", call->callType, call->callToken);
+ gH323ep.h323Callbacks.onModeChanged(call, 1);
+ }
+ }
+ } else {
+ ooSendRequestModeReject(call, requestMode->sequenceNumber);
+ }
+ break;
+ case T_H245ModeElementType_audioMode:
+ if (ooSendRequestModeAck(call, requestMode->sequenceNumber) == OO_OK &&
+ OO_TESTFLAG(call->flags, OO_M_DATASESSION)) {
+
+ OO_CLRFLAG(call->flags, OO_M_DATASESSION);
+ OO_SETFLAG(call->flags, OO_M_AUDIOSESSION);
+ if(gH323ep.h323Callbacks.onModeChanged) {
+ OOTRACEDBGA3("Handle RequestMode: (%s, %s), calling "
+ "callback onModeChanged\n", call->callType, call->callToken);
+ gH323ep.h323Callbacks.onModeChanged(call, 0);
+ }
+ }
+ break;
+ default:
+ ;
+ }
+ return OO_OK;
+
+}
int ooHandleOpenLogicalChannel(OOH323CallData* call,
H245OpenLogicalChannel *olc)
@@ -1062,14 +1488,8 @@ int ooHandleOpenLogicalChannel(OOH323CallData* call,
break;
case T_H245DataType_videoData:
case T_H245DataType_audioData:
- ooHandleOpenLogicalChannel_helper(call, olc);
- break;
case T_H245DataType_data:
- OOTRACEWARN3("Warn:Media channel data type "
- "'T_H245DataType_data' not supported (%s, %s)\n",
- call->callType, call->callToken);
- ooSendOpenLogicalChannelReject(call, olc->forwardLogicalChannelNumber,
- T_H245OpenLogicalChannelReject_cause_dataTypeNotSupported);
+ ooHandleOpenLogicalChannel_helper(call, olc);
break;
case T_H245DataType_encryptionData:
OOTRACEWARN3("Warn:Media channel data type "
@@ -1168,7 +1588,7 @@ int ooHandleOpenLogicalChannel_helper(OOH323CallData *call,
return OO_FAILED;
}
/* Generate an Ack for the open channel request */
- ret = ooCreateH245Message(&ph245msg,
+ ret = ooCreateH245Message(call, &ph245msg,
T_H245MultimediaSystemControlMessage_response);
if(ret != OO_OK)
{
@@ -1183,7 +1603,8 @@ int ooHandleOpenLogicalChannel_helper(OOH323CallData *call,
ph245msg->msgType = OOOpenLogicalChannelAck;
ph245msg->logicalChannelNo = olc->forwardLogicalChannelNumber;
response = ph245msg->h245Msg.u.response;
- pctxt = &gH323ep.msgctxt;
+ /* pctxt = &gH323ep.msgctxt; */
+ pctxt = call->msgctxt;
memset(response, 0, sizeof(H245ResponseMessage));
response->t = T_H245ResponseMessage_openLogicalChannelAck;
response->u.openLogicalChannelAck = (H245OpenLogicalChannelAck*)
@@ -1292,10 +1713,11 @@ int ooSendOpenLogicalChannelReject
int ret=0;
H245ResponseMessage* response=NULL;
H245Message *ph245msg=NULL;
- OOCTXT *pctxt=&gH323ep.msgctxt;
+ /* OOCTXT *pctxt=&gH323ep.msgctxt; */
+ OOCTXT *pctxt=call->msgctxt;
ret = ooCreateH245Message
- (&ph245msg, T_H245MultimediaSystemControlMessage_response);
+ (call, &ph245msg, T_H245MultimediaSystemControlMessage_response);
if (ret != OO_OK) {
OOTRACEERR3("Error:H245 message creation failed for - OpenLogicalChannel"
@@ -1346,12 +1768,13 @@ int ooOnReceivedOpenLogicalChannelAck(OOH323CallData *call,
H245OpenLogicalChannelAck *olcAck)
{
char remoteip[20];
+ regmatch_t pmatch[1];
ooLogicalChannel *pLogicalChannel;
H245H2250LogicalChannelAckParameters *h2250lcap;
H245UnicastAddress *unicastAddr;
H245UnicastAddress_iPAddress *iPAddress;
H245UnicastAddress *unicastAddr1;
- H245UnicastAddress_iPAddress *iPAddress1;
+ H245UnicastAddress_iPAddress *iPAddress1 = NULL;
if(!((olcAck->m.forwardMultiplexAckParametersPresent == 1) &&
(olcAck->forwardMultiplexAckParameters.t ==
@@ -1396,30 +1819,29 @@ int ooOnReceivedOpenLogicalChannelAck(OOH323CallData *call,
iPAddress->network.data[3]);
/* Extract media control channel address */
- if(h2250lcap->m.mediaControlChannelPresent != 1)
- {
- OOTRACEERR3("Error: Processing OpenLogicalChannelAck - Missing media "
- "control channel (%s, %s)\n", call->callType, call->callToken);
- return OO_FAILED;
- }
- if(h2250lcap->mediaControlChannel.t !=
+ if(h2250lcap->m.mediaControlChannelPresent == 1) {
+ if(h2250lcap->mediaControlChannel.t !=
T_H245TransportAddress_unicastAddress)
- {
- OOTRACEERR3("Error: Processing OpenLogicalChannelAck - media control "
+ {
+ OOTRACEERR3("Error: Processing OpenLogicalChannelAck - media control "
"channel addres type is not unicast (%s, %s)\n",
call->callType, call->callToken);
- return OO_FAILED;
- }
+ return OO_FAILED;
+ }
- unicastAddr1 = h2250lcap->mediaControlChannel.u.unicastAddress;
- if(unicastAddr1->t != T_H245UnicastAddress_iPAddress)
- {
- OOTRACEERR3("Error: Processing OpenLogicalChannelAck - media control "
+ unicastAddr1 = h2250lcap->mediaControlChannel.u.unicastAddress;
+ if(unicastAddr1->t != T_H245UnicastAddress_iPAddress) {
+ OOTRACEERR3("Error: Processing OpenLogicalChannelAck - media control "
"channel address type is not IP (%s, %s)\n", call->callType,
call->callToken);
- return OO_FAILED;
+ return OO_FAILED;
+ }
+
+ iPAddress1 = unicastAddr1->u.iPAddress;
+ } else {
+ OOTRACEDBGA3("Warning: Processing OpenLogicalChannelAck - Missing media "
+ "control channel (%s, %s)\n", call->callType, call->callToken);
}
- iPAddress1 = unicastAddr1->u.iPAddress;
/* Set remote destination address for rtp session */
// strcpy(call->remoteIP, remoteip);
@@ -1440,9 +1862,19 @@ int ooOnReceivedOpenLogicalChannelAck(OOH323CallData *call,
pLogicalChannel->sessionID = h2250lcap->sessionID;
/* Populate ports &ip for channel */
+
+ if (call->rtpMaskStr[0]) {
+ if (regexec(&call->rtpMask->regex, remoteip, 1, pmatch, 0)) {
+ OOTRACEERR5("ERROR:H245 Address is not matched with filter %s/%s"
+ "(%s, %s)\n", remoteip, call->rtpMaskStr, call->callType, call->callToken);
+ return OO_FAILED;
+ }
+ }
+
strcpy(pLogicalChannel->remoteIP, remoteip);
pLogicalChannel->remoteMediaPort = iPAddress->tsapIdentifier;
- pLogicalChannel->remoteMediaControlPort = iPAddress1->tsapIdentifier;
+ if (iPAddress1)
+ pLogicalChannel->remoteMediaControlPort = iPAddress1->tsapIdentifier;
if(pLogicalChannel->chanCap->startTransmitChannel)
{
@@ -1567,7 +1999,7 @@ int ooSendEndSessionCommand(OOH323CallData *call)
H245CommandMessage * command;
OOCTXT *pctxt;
H245Message *ph245msg=NULL;
- ret = ooCreateH245Message(&ph245msg,
+ ret = ooCreateH245Message(call, &ph245msg,
T_H245MultimediaSystemControlMessage_command);
if(ret != OO_OK)
{
@@ -1578,7 +2010,8 @@ int ooSendEndSessionCommand(OOH323CallData *call)
ph245msg->msgType = OOEndSessionCommand;
command = ph245msg->h245Msg.u.command;
- pctxt = &gH323ep.msgctxt;
+ /* pctxt = &gH323ep.msgctxt; */
+ pctxt = call->msgctxt;
memset(command, 0, sizeof(H245CommandMessage));
command->t = T_H245CommandMessage_endSessionCommand;
command->u.endSessionCommand = (H245EndSessionCommand*) ASN1MALLOC(pctxt,
@@ -1675,13 +2108,14 @@ int ooOnReceivedTerminalCapabilitySetAck(OOH323CallData* call)
if(call->remoteTermCapState != OO_RemoteTermCapSetAckSent)
return OO_OK;
- if(call->masterSlaveState == OO_MasterSlave_Master ||
- call->masterSlaveState == OO_MasterSlave_Slave)
+ if((call->masterSlaveState == OO_MasterSlave_Master ||
+ call->masterSlaveState == OO_MasterSlave_Slave) &&
+ (call->msAckStatus == OO_msAck_remoteReceived))
{
if(gH323ep.h323Callbacks.openLogicalChannels)
gH323ep.h323Callbacks.openLogicalChannels(call);
else{
- if(!call->logicalChans)
+ if(!ooGetTransmitLogicalChannel(call))
ooOpenLogicalChannels(call);
}
#if 0
@@ -1697,14 +2131,15 @@ int ooOnReceivedTerminalCapabilitySetAck(OOH323CallData* call)
return OO_OK;
}
-int ooCloseAllLogicalChannels(OOH323CallData *call)
+int ooCloseAllLogicalChannels(OOH323CallData *call, char* dir)
{
ooLogicalChannel *temp;
temp = call->logicalChans;
while(temp)
{
- if(temp->state == OO_LOGICALCHAN_ESTABLISHED)
+ if(temp->state == OO_LOGICALCHAN_ESTABLISHED &&
+ (dir == NULL || !strcmp(temp->dir,dir)))
{
/* Sending closelogicalchannel only for outgoing channels*/
if(!strcmp(temp->dir, "transmit"))
@@ -1728,7 +2163,7 @@ int ooSendCloseLogicalChannel(OOH323CallData *call, ooLogicalChannel *logicalCha
H245RequestMessage *request;
H245CloseLogicalChannel* clc;
- ret = ooCreateH245Message(&ph245msg,
+ ret = ooCreateH245Message(call, &ph245msg,
T_H245MultimediaSystemControlMessage_request);
if(ret != OO_OK)
{
@@ -1738,7 +2173,8 @@ int ooSendCloseLogicalChannel(OOH323CallData *call, ooLogicalChannel *logicalCha
}
ph245msg->msgType = OOCloseLogicalChannel;
ph245msg->logicalChannelNo = logicalChan->channelNo;
- pctxt = &gH323ep.msgctxt;
+ /* pctxt = &gH323ep.msgctxt; */
+ pctxt = call->msgctxt;
request = ph245msg->h245Msg.u.request;
request->t = T_H245RequestMessage_closeLogicalChannel;
@@ -1795,7 +2231,7 @@ int ooSendRequestCloseLogicalChannel(OOH323CallData *call,
H245RequestMessage *request;
H245RequestChannelClose *rclc;
- ret = ooCreateH245Message(&ph245msg,
+ ret = ooCreateH245Message(call, &ph245msg,
T_H245MultimediaSystemControlMessage_request);
if(ret != OO_OK)
{
@@ -1806,7 +2242,8 @@ int ooSendRequestCloseLogicalChannel(OOH323CallData *call,
}
ph245msg->msgType = OORequestChannelClose;
ph245msg->logicalChannelNo = logicalChan->channelNo;
- pctxt = &gH323ep.msgctxt;
+ /* pctxt = &gH323ep.msgctxt; */
+ pctxt = call->msgctxt;
request = ph245msg->h245Msg.u.request;
request->t = T_H245RequestMessage_requestChannelClose;
@@ -1848,7 +2285,7 @@ int ooSendRequestChannelCloseRelease(OOH323CallData *call, int channelNum)
OOCTXT *pctxt;
H245IndicationMessage *indication;
- ret = ooCreateH245Message(&ph245msg,
+ ret = ooCreateH245Message(call, &ph245msg,
T_H245MultimediaSystemControlMessage_indication);
if(ret != OO_OK)
{
@@ -1859,7 +2296,8 @@ int ooSendRequestChannelCloseRelease(OOH323CallData *call, int channelNum)
}
ph245msg->msgType = OORequestChannelCloseRelease;
ph245msg->logicalChannelNo = channelNum;
- pctxt = &gH323ep.msgctxt;
+ /* pctxt = &gH323ep.msgctxt; */
+ pctxt = call->msgctxt;
indication = ph245msg->h245Msg.u.indication;
indication->t = T_H245IndicationMessage_requestChannelCloseRelease;
indication->u.requestChannelCloseRelease = (H245RequestChannelCloseRelease*)
@@ -1919,7 +2357,7 @@ int ooOnReceivedRequestChannelClose(OOH323CallData *call,
return OO_FAILED;
}
}
- ret = ooCreateH245Message(&ph245msg,
+ ret = ooCreateH245Message(call, &ph245msg,
T_H245MultimediaSystemControlMessage_response);
if(ret != OO_OK)
{
@@ -1927,7 +2365,8 @@ int ooOnReceivedRequestChannelClose(OOH323CallData *call,
"failed (%s, %s)\n", call->callType, call->callToken);
return OO_FAILED;
}
- pctxt = &gH323ep.msgctxt;
+ /* pctxt = &gH323ep.msgctxt; */
+ pctxt = call->msgctxt;
ph245msg->msgType = OORequestChannelCloseAck;
ph245msg->logicalChannelNo = rclc->forwardLogicalChannelNumber;
response = ph245msg->h245Msg.u.response;
@@ -2055,7 +2494,7 @@ int ooOnReceivedCloseLogicalChannel(OOH323CallData *call,
return OO_FAILED;
}
- ret = ooCreateH245Message(&ph245msg,
+ ret = ooCreateH245Message(call, &ph245msg,
T_H245MultimediaSystemControlMessage_response);
if(ret != OO_OK)
{
@@ -2064,7 +2503,8 @@ int ooOnReceivedCloseLogicalChannel(OOH323CallData *call,
call->callToken);
return OO_FAILED;
}
- pctxt = &gH323ep.msgctxt;
+ /* pctxt = &gH323ep.msgctxt; */
+ pctxt = call->msgctxt;
ph245msg->msgType = OOCloseLogicalChannelAck;
ph245msg->logicalChannelNo = clc->forwardLogicalChannelNumber;
response = ph245msg->h245Msg.u.response;
@@ -2144,13 +2584,23 @@ int ooHandleH245Message(OOH323CallData *call, H245Message * pmsg)
case T_H245RequestMessage_openLogicalChannel:
ooHandleOpenLogicalChannel(call,
request->u.openLogicalChannel);
+ if(!ooGetTransmitLogicalChannel(call))
+ ooOpenLogicalChannels(call);
break;
+ case T_H245RequestMessage_requestMode:
+ OOTRACEINFO4("Received request mode - %d (%s, %s)\n",
+ request->u.requestMode->sequenceNumber, call->callType, call->callToken);
+ ooHandleRequestMode(call,
+ request->u.requestMode);
+ break;
case T_H245RequestMessage_closeLogicalChannel:
OOTRACEINFO4("Received close logical Channel - %d (%s, %s)\n",
request->u.closeLogicalChannel->forwardLogicalChannelNumber,
call->callType, call->callToken);
- ooOnReceivedCloseLogicalChannel(call,
- request->u.closeLogicalChannel);
+ if (ooOnReceivedCloseLogicalChannel(call,
+ request->u.closeLogicalChannel) == OO_OK) {
+ ooCloseAllLogicalChannels(call, NULL);
+ }
break;
case T_H245RequestMessage_requestChannelClose:
OOTRACEINFO4("Received RequestChannelClose - %d (%s, %s)\n",
@@ -2255,6 +2705,21 @@ int ooHandleH245Message(OOH323CallData *call, H245Message * pmsg)
call->callEndReason = OO_REASON_NOCOMMON_CAPABILITIES;
}
break;
+ case T_H245ResponseMessage_requestModeAck:
+ if (call->requestSequence == response->u.requestModeAck->sequenceNumber) {
+ /* response to our last request, process it */
+ ooOnReceivedRequestModeAck(call, response->u.requestModeAck);
+ }
+ break;
+ case T_H245ResponseMessage_requestModeReject:
+ OOTRACEDBGC3("Received requestModeReject, clearing call (%s, %s)\n",
+ call->callType, call->callToken);
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callState = OO_CALL_CLEAR;
+ call->callEndReason = OO_REASON_REMOTE_REJECTED;
+ }
+ break;
case T_H245ResponseMessage_openLogicalChannelAck:
for(i = 0; i<call->timerList.count; i++)
{
@@ -2319,6 +2784,8 @@ int ooHandleH245Message(OOH323CallData *call, H245Message * pmsg)
}
ooOnReceivedCloseChannelAck(call,
response->u.closeLogicalChannelAck);
+ if(!ooGetTransmitLogicalChannel(call))
+ ooOpenLogicalChannels(call);
break;
case T_H245ResponseMessage_requestChannelCloseAck:
OOTRACEINFO4("RequestChannelCloseAck received - %d (%s, %s)\n",
@@ -2408,6 +2875,24 @@ int ooOnReceivedUserInputIndication
}
else if((indication->t == T_H245UserInputIndication_signal) &&
(call->dtmfmode & OO_CAP_DTMF_H245_signal)) {
+ if(call->lastDTMF && indication->u.signal->signalType[0] == call->lastDTMF &&
+ call->nextDTMFstamp && indication->u.signal->m.rtpPresent &&
+ indication->u.signal->rtp.m.timestampPresent) {
+ if(call->nextDTMFstamp > indication->u.signal->rtp.timestamp) {
+ OOTRACEERR4("ERROR:Duplicate dtmf %c on ((%s, %s)\n", call->lastDTMF, call->callType,
+ call->callToken);
+ return OO_OK;
+ }
+ }
+ if (indication->u.signal->m.rtpPresent && indication->u.signal->rtp.m.timestampPresent &&
+ indication->u.signal->m.durationPresent) {
+ call->nextDTMFstamp = indication->u.signal->rtp.timestamp +
+ indication->u.signal->duration;
+ call->lastDTMF = indication->u.signal->signalType[0];
+ } else {
+ call->nextDTMFstamp = 0;
+ call->lastDTMF = 0;
+ }
if(gH323ep.h323Callbacks.onReceivedDTMF)
gH323ep.h323Callbacks.onReceivedDTMF(call,
indication->u.signal->signalType);
@@ -2427,7 +2912,7 @@ int ooOnReceivedTerminalCapabilitySet(OOH323CallData *call, H245Message *pmsg)
H245CapabilityTableEntry *capEntry = NULL;
tcs = pmsg->h245Msg.u.request->u.terminalCapabilitySet;
- if(call->remoteTermCapSeqNo >= tcs->sequenceNumber)
+ if(call->remoteTermCapSeqNo > tcs->sequenceNumber)
{
OOTRACEINFO4("Rejecting TermCapSet message with SeqNo %d, as already "
"acknowledged message with this SeqNo (%s, %s)\n",
@@ -2435,6 +2920,16 @@ int ooOnReceivedTerminalCapabilitySet(OOH323CallData *call, H245Message *pmsg)
ooSendTerminalCapabilitySetReject(call, tcs->sequenceNumber,
T_H245TerminalCapabilitySetReject_cause_unspecified);
return OO_OK;
+
+ } else {
+/* 20090924 */
+/* bogus soft-switch can send more than one request with cap set
+ if it goto to next choice. Right swith don't send but not all are right ;(
+ we can accept new capability set only. We must remember also that new join caps
+ will be previously joined caps with new cap set.
+ */
+ if(call->remoteTermCapSeqNo == tcs->sequenceNumber)
+ call->localTermCapState = OO_LocalTermCapExchange_Idle;
}
if(!tcs->m.capabilityTablePresent)
@@ -2474,6 +2969,10 @@ int ooOnReceivedTerminalCapabilitySet(OOH323CallData *call, H245Message *pmsg)
}
}
+ if (call->t38sides == 3) /* both side support t.38 */
+ OO_SETFLAG(call->flags, OO_M_T38SUPPORTED);
+ else
+ OO_CLRFLAG(call->flags, OO_M_T38SUPPORTED);
/* Update remoteTermCapSetState */
call->remoteTermCapState = OO_RemoteTermCapSetRecvd;
@@ -2507,7 +3006,7 @@ int ooOnReceivedTerminalCapabilitySet(OOH323CallData *call, H245Message *pmsg)
if(gH323ep.h323Callbacks.openLogicalChannels)
gH323ep.h323Callbacks.openLogicalChannels(call);
else{
- if(!call->logicalChans)
+ if(!ooGetTransmitLogicalChannel(call))
ooOpenLogicalChannels(call);
}
#if 0
@@ -2527,7 +3026,7 @@ int ooSendTerminalCapabilitySetReject
H245Message *ph245msg=NULL;
H245ResponseMessage * response=NULL;
OOCTXT *pctxt=NULL;
- int ret = ooCreateH245Message(&ph245msg,
+ int ret = ooCreateH245Message(call, &ph245msg,
T_H245MultimediaSystemControlMessage_response);
if(ret != OO_OK)
{
@@ -2538,7 +3037,8 @@ int ooSendTerminalCapabilitySetReject
ph245msg->msgType = OOTerminalCapabilitySetReject;
response = ph245msg->h245Msg.u.response;
memset(response, 0, sizeof(H245ResponseMessage));
- pctxt = &gH323ep.msgctxt;
+ /* pctxt = &gH323ep.msgctxt; */
+ pctxt = call->msgctxt;
response->t = T_H245ResponseMessage_terminalCapabilitySetReject;
response->u.terminalCapabilitySetReject = (H245TerminalCapabilitySetReject*)
@@ -2570,7 +3070,7 @@ int ooH245AcknowledgeTerminalCapabilitySet(OOH323CallData *call)
H245Message *ph245msg=NULL;
H245ResponseMessage * response=NULL;
OOCTXT *pctxt=NULL;
- int ret = ooCreateH245Message(&ph245msg,
+ int ret = ooCreateH245Message(call, &ph245msg,
T_H245MultimediaSystemControlMessage_response);
if(ret != OO_OK)
{
@@ -2581,7 +3081,8 @@ int ooH245AcknowledgeTerminalCapabilitySet(OOH323CallData *call)
ph245msg->msgType = OOTerminalCapabilitySetAck;
response = ph245msg->h245Msg.u.response;
memset(response, 0, sizeof(H245ResponseMessage));
- pctxt = &gH323ep.msgctxt;
+ /* pctxt = &gH323ep.msgctxt; */
+ pctxt = call->msgctxt;
response->t = T_H245ResponseMessage_terminalCapabilitySetAck;
response->u.terminalCapabilitySetAck = (H245TerminalCapabilitySetAck*)
@@ -2612,10 +3113,11 @@ int ooSendTerminalCapabilitySetRelease(OOH323CallData * call)
int ret=0;
H245IndicationMessage* indication=NULL;
H245Message *ph245msg=NULL;
- OOCTXT *pctxt=&gH323ep.msgctxt;
+ /* OOCTXT *pctxt=&gH323ep.msgctxt; */
+ OOCTXT *pctxt=call->msgctxt;
ret = ooCreateH245Message
- (&ph245msg, T_H245MultimediaSystemControlMessage_indication);
+ (call, &ph245msg, T_H245MultimediaSystemControlMessage_indication);
if (ret != OO_OK) {
OOTRACEERR3("Error:H245 message creation failed for - Terminal"
@@ -2662,10 +3164,11 @@ int ooSendH245UserInputIndication_alphanumeric
int ret=0;
H245IndicationMessage* indication=NULL;
H245Message *ph245msg=NULL;
- OOCTXT *pctxt=&gH323ep.msgctxt;
+ /* OOCTXT *pctxt=&gH323ep.msgctxt; */
+ OOCTXT *pctxt=call->msgctxt;
ret = ooCreateH245Message
- (&ph245msg, T_H245MultimediaSystemControlMessage_indication);
+ (call, &ph245msg, T_H245MultimediaSystemControlMessage_indication);
if (ret != OO_OK) {
OOTRACEERR3("Error:H245 message creation failed for - H245UserInput"
@@ -2721,10 +3224,11 @@ int ooSendH245UserInputIndication_signal
int ret=0;
H245IndicationMessage* indication=NULL;
H245Message *ph245msg=NULL;
- OOCTXT *pctxt=&gH323ep.msgctxt;
+ /* OOCTXT *pctxt=&gH323ep.msgctxt; */
+ OOCTXT *pctxt=call->msgctxt;
ret = ooCreateH245Message
- (&ph245msg, T_H245MultimediaSystemControlMessage_indication);
+ (call, &ph245msg, T_H245MultimediaSystemControlMessage_indication);
if (ret != OO_OK) {
OOTRACEERR3("Error:H245 message creation failed for - H245UserInput"
@@ -2788,21 +3292,20 @@ int ooOpenLogicalChannels(OOH323CallData *call)
if(gH323ep.callMode == OO_CALLMODE_AUDIOCALL ||
gH323ep.callMode == OO_CALLMODE_AUDIOTX)
{
- //if (!OO_TESTFLAG (call->flags, OO_M_AUDIOSESSION))
- //{
+ if (OO_TESTFLAG (call->flags, OO_M_AUDIOSESSION)) {
ret = ooOpenLogicalChannel(call, OO_CAP_TYPE_AUDIO);
- if(ret != OO_OK)
- {
- OOTRACEERR3("ERROR:Failed to open audio channels. Clearing call."
- "(%s, %s)\n", call->callType, call->callToken);
- if(call->callState < OO_CALL_CLEAR)
- {
- call->callEndReason = OO_REASON_LOCAL_CLEARED;
- call->callState = OO_CALL_CLEAR;
- }
- return ret;
- }
- // }
+ } else if (OO_TESTFLAG (call->flags, OO_M_DATASESSION)) {
+ ret = ooOpenLogicalChannel(call, OO_CAP_TYPE_DATA);
+ }
+ if(ret != OO_OK) {
+ OOTRACEERR3("ERROR:Failed to open audio/data channels. Clearing call."
+ "(%s, %s)\n", call->callType, call->callToken);
+ if (call->callState < OO_CALL_CLEAR) {
+ call->callEndReason = OO_REASON_LOCAL_CLEARED;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return ret;
+ }
}
if(gH323ep.callMode == OO_CALLMODE_VIDEOCALL)
@@ -2860,6 +3363,7 @@ int ooOpenLogicalChannel(OOH323CallData *call, enum OOCapType capType )
*/
OOTRACEINFO3("Looking for matching capabilities. (%s, %s)\n",
call->callType, call->callToken);
+/* May */
if(call->masterSlaveState == OO_MasterSlave_Master)
{
for(k=0; k<call->capPrefs.index; k++)
@@ -2899,7 +3403,7 @@ int ooOpenLogicalChannel(OOH323CallData *call, enum OOCapType capType )
}
}
- else if(call->masterSlaveState == OO_MasterSlave_Slave)
+ else
{
epCap = call->jointCaps;
@@ -2924,17 +3428,22 @@ int ooOpenLogicalChannel(OOH323CallData *call, enum OOCapType capType )
case OO_G711ALAW56K:
case OO_G711ULAW64K:
case OO_G711ULAW56K:
- /*case OO_G726:*/
+ case OO_G726:
+ case OO_G726AAL2:
+ case OO_AMRNB:
+ case OO_SPEEX:
case OO_G728:
case OO_G729:
case OO_G729A:
+ case OO_G729B:
case OO_G7231:
case OO_GSMFULLRATE:
+ case OO_GSMHALFRATE:
+ case OO_GSMENHANCEDFULLRATE:
case OO_H263VIDEO:
+ case OO_T38:
ooOpenChannel(call, epCap);
break;
- case OO_GSMHALFRATE:
- case OO_GSMENHANCEDFULLRATE:
default:
@@ -2953,6 +3462,7 @@ int ooOpenChannel(OOH323CallData* call, ooH323EpCapability *epCap)
H245OpenLogicalChannel_forwardLogicalChannelParameters *flcp = NULL;
H245AudioCapability *audioCap = NULL;
H245VideoCapability *videoCap = NULL;
+ H245DataApplicationCapability *t38Cap = NULL;
H245H2250LogicalChannelParameters *h2250lcp = NULL;
H245UnicastAddress *unicastAddrs = NULL;
H245UnicastAddress_iPAddress *iPAddress = NULL;
@@ -2963,7 +3473,7 @@ int ooOpenChannel(OOH323CallData* call, ooH323EpCapability *epCap)
ooGetCapTypeText(epCap->cap), call->callType,
call->callToken);
- ret = ooCreateH245Message(&ph245msg,
+ ret = ooCreateH245Message(call, &ph245msg,
T_H245MultimediaSystemControlMessage_request);
if(ret != OO_OK)
{
@@ -2980,7 +3490,8 @@ int ooOpenChannel(OOH323CallData* call, ooH323EpCapability *epCap)
call->logicalChanNoCur = call->logicalChanNoBase;
request = ph245msg->h245Msg.u.request;
- pctxt = &gH323ep.msgctxt;
+ /* pctxt = &gH323ep.msgctxt; */
+ pctxt = call->msgctxt;
memset(request, 0, sizeof(H245RequestMessage));
request->t = T_H245RequestMessage_openLogicalChannel;
@@ -3053,6 +3564,23 @@ int ooOpenChannel(OOH323CallData* call, ooH323EpCapability *epCap)
flcp->dataType.u.videoData = videoCap;
}
+ else if(epCap->capType == OO_CAP_TYPE_DATA)
+ {
+ flcp->dataType.t = T_H245DataType_data;
+ /* set audio capability for channel */
+ t38Cap = ooCapabilityCreateT38Capability(epCap,pctxt, OOTX);
+ if(!t38Cap)
+ {
+ OOTRACEERR4("Error:Failed to create duplicate T38 capability in "
+ "ooOpenChannel- %s (%s, %s)\n",
+ ooGetCapTypeText(epCap->cap), call->callType,
+ call->callToken);
+ ooFreeH245Message(call, ph245msg);
+ return OO_FAILED;
+ }
+
+ flcp->dataType.u.data = t38Cap;
+ }
else{
OOTRACEERR1("Error: Unhandled media type in ooOpenChannel\n");
return OO_FAILED;
@@ -3104,7 +3632,7 @@ int ooOpenChannel(OOH323CallData* call, ooH323EpCapability *epCap)
}
ooFreeH245Message(call, ph245msg);
- return ret;
+ return ret;
}
@@ -3362,7 +3890,7 @@ int ooBuildFastStartOLC
else {
/* Calling other ep, with SETUP message */
/* Call is "outgoing */
- pLogicalChannel->state = OO_LOGICALCHAN_PROPOSED;
+ pLogicalChannel->state = OO_LOGICALCHAN_PROPOSEDFS;
}
return OO_OK;
@@ -3447,13 +3975,20 @@ int ooCloseLogicalChannelTimerExpired(void *pdata)
int ooRequestChannelCloseTimerExpired(void *pdata)
{
int ret = 0;
+ ooLogicalChannel *pChannel = NULL;
ooTimerCallback *cbData = (ooTimerCallback*)pdata;
OOH323CallData *call = cbData->call;
- OOTRACEINFO3("OpenLogicalChannelTimer expired. (%s, %s)\n", call->callType,
+ OOTRACEINFO3("CloseLogicalChannelTimer expired. (%s, %s)\n", call->callType,
call->callToken);
- ooSendRequestChannelCloseRelease(call, cbData->channelNumber);
+ pChannel = ooFindLogicalChannelByLogicalChannelNo(call,
+ cbData->channelNumber);
+ if(pChannel)
+ ooSendRequestChannelCloseRelease(call, cbData->channelNumber);
+ else
+ return OO_OK;
+
ret = ooClearLogicalChannel(call, cbData->channelNumber);
if(ret != OO_OK)
@@ -3507,6 +4042,7 @@ int ooGetIpPortFromH245TransportAddress
{
H245UnicastAddress *unicastAddress = NULL;
H245UnicastAddress_iPAddress *ipAddress = NULL;
+ regmatch_t pmatch[1];
if(h245Address->t != T_H245TransportAddress_unicastAddress)
{
@@ -3530,6 +4066,14 @@ int ooGetIpPortFromH245TransportAddress
ipAddress->network.data[1],
ipAddress->network.data[2],
ipAddress->network.data[3]);
+ if (call->rtpMaskStr[0]) {
+ if (regexec(&call->rtpMask->regex, ip, 1, pmatch, 0)) {
+ OOTRACEERR5("ERROR:H245 Address is not matched with filter %s/%s"
+ "(%s, %s)\n", ip, call->rtpMaskStr, call->callType, call->callToken);
+ return OO_FAILED;
+ }
+ }
+
return OO_OK;
}
diff --git a/addons/ooh323c/src/ooh245.h b/addons/ooh323c/src/ooh245.h
index 10a8750a8..353441bde 100644
--- a/addons/ooh323c/src/ooh245.h
+++ b/addons/ooh323c/src/ooh245.h
@@ -69,7 +69,7 @@ typedef struct H245Message {
* @return Completion status of operation: 0 (OO_OK) = success,
* negative return value is error.
*/
-EXTERN int ooCreateH245Message(H245Message **msg, int type);
+EXTERN int ooCreateH245Message(OOH323CallData* call, H245Message **msg, int type);
/**
* Frees up the memory used by the H245 message.
@@ -123,7 +123,7 @@ EXTERN int ooSendTermCapMsg(struct OOH323CallData *call);
*
* @return Generated status determination number.
*/
-EXTERN ASN1UINT ooGenerateStatusDeterminationNumber();
+EXTERN ASN1UINT ooGenerateStatusDeterminationNumber(void);
/**
* This fuction is used to handle received MasterSlaveDetermination procedure
@@ -288,7 +288,7 @@ EXTERN int ooOnReceivedTerminalCapabilitySetAck(struct OOH323CallData* call);
*
* @return OO_OK, on success. OO_FAILED, on failure.
*/
-EXTERN int ooCloseAllLogicalChannels(struct OOH323CallData *call);
+EXTERN int ooCloseAllLogicalChannels(struct OOH323CallData *call, char* dir);
/**
@@ -550,6 +550,8 @@ int ooSendTerminalCapabilitySetReject
*/
int ooSendTerminalCapabilitySetRelease(struct OOH323CallData * call);
+int ooSendRequestMode(OOH323CallData* call, int isT38Mode);
+
/**
* This is an helper function used to extract ip address and port info from
@@ -629,6 +631,18 @@ int ooSessionTimerExpired(void *pdata);
/**
* @}
*/
+
+int ooHandleRequestMode(OOH323CallData* call,
+ H245RequestMode *requestMode);
+
+int ooSendRequestModeAck(OOH323CallData* call,
+ H245SequenceNumber sequenceNumber);
+
+int ooSendRequestModeReject(OOH323CallData* call,
+ H245SequenceNumber sequenceNumber);
+
+void ooOnReceivedRequestModeAck(OOH323CallData* call, H245RequestModeAck * requestModeAck);
+
#ifdef __cplusplus
}
#endif
diff --git a/addons/ooh323c/src/ooh323.c b/addons/ooh323c/src/ooh323.c
index 1cefa1d0b..038b1a0cd 100644
--- a/addons/ooh323c/src/ooh323.c
+++ b/addons/ooh323c/src/ooh323.c
@@ -14,6 +14,10 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+#include <time.h>
+
#include "ootypes.h"
#include "ooq931.h"
#include "ootrace.h"
@@ -29,6 +33,202 @@
/** Global endpoint structure */
extern OOH323EndPoint gH323ep;
+int ooHandleFastStart(OOH323CallData *call, H225Facility_UUIE *facility);
+int ooOnReceivedReleaseComplete(OOH323CallData *call, Q931Message *q931Msg);
+int ooOnReceivedCallProceeding(OOH323CallData *call, Q931Message *q931Msg);
+int ooOnReceivedAlerting(OOH323CallData *call, Q931Message *q931Msg);
+int ooOnReceivedProgress(OOH323CallData *call, Q931Message *q931Msg);
+
+int ooHandleFastStart(OOH323CallData *call, H225Facility_UUIE *facility)
+{
+ H245OpenLogicalChannel* olc;
+ ASN1OCTET msgbuf[MAXMSGLEN];
+ ooLogicalChannel * pChannel = NULL;
+ H245H2250LogicalChannelParameters * h2250lcp = NULL;
+ int i=0, ret=0;
+
+ /* Handle fast-start */
+ if(OO_TESTFLAG (call->flags, OO_M_FASTSTART))
+ {
+ if(facility->m.fastStartPresent)
+ {
+ /* For printing the decoded message to log, initialize handler. */
+ initializePrintHandler(&printHandler, "FastStart Elements");
+
+ /* Set print handler */
+ setEventHandler (call->pctxt, &printHandler);
+
+ for(i=0; i<(int)facility->fastStart.n; i++)
+ {
+ olc = NULL;
+
+ olc = (H245OpenLogicalChannel*)memAlloc(call->pctxt,
+ sizeof(H245OpenLogicalChannel));
+ if(!olc)
+ {
+ OOTRACEERR3("ERROR:Memory - ooHandleFastStart - olc"
+ "(%s, %s)\n", call->callType, call->callToken);
+ /*Mark call for clearing */
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_LOCAL_CLEARED;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return OO_FAILED;
+ }
+ memset(olc, 0, sizeof(H245OpenLogicalChannel));
+ memcpy(msgbuf, facility->fastStart.elem[i].data,
+ facility->fastStart.elem[i].numocts);
+ setPERBuffer(call->pctxt, msgbuf,
+ facility->fastStart.elem[i].numocts, 1);
+ ret = asn1PD_H245OpenLogicalChannel(call->pctxt, olc);
+ if(ret != ASN_OK)
+ {
+ OOTRACEERR3("ERROR:Failed to decode fast start olc element "
+ "(%s, %s)\n", call->callType, call->callToken);
+ /* Mark call for clearing */
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return OO_FAILED;
+ }
+
+ dListAppend(call->pctxt, &call->remoteFastStartOLCs, olc);
+
+ pChannel = ooFindLogicalChannelByOLC(call, olc);
+ if(!pChannel)
+ {
+ OOTRACEERR4("ERROR: Logical Channel %d not found, fast start. "
+ "(%s, %s)\n",
+ olc->forwardLogicalChannelNumber, call->callType,
+ call->callToken);
+ return OO_FAILED;
+ }
+ if(pChannel->channelNo != olc->forwardLogicalChannelNumber)
+ {
+ OOTRACEINFO5("Remote endpoint changed forwardLogicalChannel"
+ "Number from %d to %d (%s, %s)\n",
+ pChannel->channelNo,
+ olc->forwardLogicalChannelNumber, call->callType,
+ call->callToken);
+ pChannel->channelNo = olc->forwardLogicalChannelNumber;
+ }
+ if(!strcmp(pChannel->dir, "transmit"))
+ {
+
+ if(olc->forwardLogicalChannelParameters.multiplexParameters.t !=
+ T_H245OpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters)
+ {
+ OOTRACEERR4("ERROR:Unknown multiplex parameter type for "
+ "channel %d (%s, %s)\n",
+ olc->forwardLogicalChannelNumber, call->callType,
+ call->callToken);
+ continue;
+ }
+
+ /* Extract the remote media endpoint address */
+ h2250lcp = olc->forwardLogicalChannelParameters.multiplexParameters.u.h2250LogicalChannelParameters;
+ if(!h2250lcp)
+ {
+ OOTRACEERR3("ERROR:Invalid OLC received in fast start. No "
+ "forward Logical Channel Parameters found. "
+ "(%s, %s)\n", call->callType, call->callToken);
+ return OO_FAILED;
+ }
+ if(!h2250lcp->m.mediaChannelPresent)
+ {
+ OOTRACEERR3("ERROR:Invalid OLC received in fast start. No "
+ "reverse media channel information found."
+ "(%s, %s)\n", call->callType, call->callToken);
+ return OO_FAILED;
+ }
+ ret = ooGetIpPortFromH245TransportAddress(call,
+ &h2250lcp->mediaChannel, pChannel->remoteIP,
+ &pChannel->remoteMediaPort);
+
+ if(ret != OO_OK)
+ {
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ OOTRACEERR3("ERROR:Unsupported media channel address type "
+ "(%s, %s)\n", call->callType, call->callToken);
+ return OO_FAILED;
+ }
+
+ if(!pChannel->chanCap->startTransmitChannel)
+ {
+ OOTRACEERR3("ERROR:No callback registered to start transmit "
+ "channel (%s, %s)\n",call->callType,
+ call->callToken);
+ return OO_FAILED;
+ }
+ pChannel->chanCap->startTransmitChannel(call, pChannel);
+ }
+ /* Mark the current channel as established and close all other
+ logical channels with same session id and in same direction.
+ */
+ ooOnLogicalChannelEstablished(call, pChannel);
+ }
+ finishPrint();
+ removeEventHandler(call->pctxt);
+ OO_SETFLAG(call->flags, OO_M_FASTSTARTANSWERED);
+ }
+
+ }
+
+ if(facility->m.h245AddressPresent)
+ {
+ if (OO_TESTFLAG (call->flags, OO_M_TUNNELING))
+ {
+ OO_CLRFLAG (call->flags, OO_M_TUNNELING);
+ OOTRACEINFO3("Tunneling is disabled for call as H245 address is "
+ "provided in facility message (%s, %s)\n",
+ call->callType, call->callToken);
+ }
+ ret = ooH323GetIpPortFromH225TransportAddress(call,
+ &facility->h245Address, call->remoteIP,
+ &call->remoteH245Port);
+ if(ret != OO_OK)
+ {
+ OOTRACEERR3("Error: Unknown H245 address type in received "
+ "CallProceeding message (%s, %s)", call->callType,
+ call->callToken);
+ /* Mark call for clearing */
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return OO_FAILED;
+ }
+ if(call->remoteH245Port != 0 && !call->pH245Channel) {
+ /* Create an H.245 connection.
+ */
+ if(ooCreateH245Connection(call)== OO_FAILED)
+ {
+ OOTRACEERR3("Error: H.245 channel creation failed (%s, %s)\n",
+ call->callType, call->callToken);
+
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_TRANSPORTFAILURE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return OO_FAILED;
+ }
+ }
+ } else if (OO_TESTFLAG (call->flags, OO_M_TUNNELING)) {
+ ret =ooSendTCSandMSD(call);
+ if (ret != OO_OK)
+ return ret;
+ }
+ return OO_OK;
+}
int ooOnReceivedReleaseComplete(OOH323CallData *call, Q931Message *q931Msg)
{
@@ -93,6 +293,7 @@ int ooOnReceivedReleaseComplete(OOH323CallData *call, Q931Message *q931Msg)
if(call->callEndReason == OO_REASON_UNKNOWN)
call->callEndReason = ooGetCallClearReasonFromCauseAndReasonCode(cause,
reasonCode);
+ call->q931cause = cause;
#if 0
if (q931Msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent &&
q931Msg->userInfo->h323_uu_pdu.h245Tunneling &&
@@ -165,9 +366,9 @@ int ooOnReceivedSetup(OOH323CallData *call, Q931Message *q931Msg)
pDisplayIE = ooQ931GetIE(q931Msg, Q931DisplayIE);
if(pDisplayIE)
{
- call->remoteDisplayName = (ASN1OCTET*) memAlloc(call->pctxt,
+ call->remoteDisplayName = (char *) memAlloc(call->pctxt,
pDisplayIE->length*sizeof(ASN1OCTET)+1);
- strcpy(call->remoteDisplayName, pDisplayIE->data);
+ strcpy(call->remoteDisplayName, (char *)pDisplayIE->data);
}
/*Extract Remote Aliases, if present*/
if(setup->m.sourceAddressPresent)
@@ -501,6 +702,11 @@ int ooOnReceivedCallProceeding(OOH323CallData *call, Q931Message *q931Msg)
if(ret != OO_OK)
{
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEAR;
+ }
OOTRACEERR3("ERROR:Unsupported media channel address type "
"(%s, %s)\n", call->callType, call->callToken);
return OO_FAILED;
@@ -560,6 +766,26 @@ int ooOnReceivedCallProceeding(OOH323CallData *call, Q931Message *q931Msg)
}
return OO_FAILED;
}
+ if(call->remoteH245Port != 0 && !call->pH245Channel) {
+ /* Create an H.245 connection.
+ */
+ if(ooCreateH245Connection(call)== OO_FAILED)
+ {
+ OOTRACEERR3("Error: H.245 channel creation failed (%s, %s)\n",
+ call->callType, call->callToken);
+
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_TRANSPORTFAILURE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return OO_FAILED;
+ }
+ }
+ } else if (OO_TESTFLAG (call->flags, OO_M_TUNNELING)) {
+ ret =ooSendTCSandMSD(call);
+ if (ret != OO_OK)
+ return ret;
}
return OO_OK;
}
@@ -698,6 +924,234 @@ int ooOnReceivedAlerting(OOH323CallData *call, Q931Message *q931Msg)
if(ret != OO_OK)
{
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ OOTRACEERR3("ERROR:Unsupported media channel address type "
+ "(%s, %s)\n", call->callType, call->callToken);
+ return OO_FAILED;
+ }
+
+ if(!pChannel->chanCap->startTransmitChannel)
+ {
+ OOTRACEERR3("ERROR:No callback registered to start transmit "
+ "channel (%s, %s)\n",call->callType,
+ call->callToken);
+ return OO_FAILED;
+ }
+ pChannel->chanCap->startTransmitChannel(call, pChannel);
+ /* Mark the current channel as established and close all other
+ logical channels with same session id and in same direction.
+ */
+ ooOnLogicalChannelEstablished(call, pChannel);
+ }
+ }
+ finishPrint();
+ removeEventHandler(call->pctxt);
+ OO_SETFLAG(call->flags, OO_M_FASTSTARTANSWERED);
+ }
+
+ }
+
+ /* Retrieve the H.245 control channel address from the connect msg */
+ if(q931Msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent &&
+ q931Msg->userInfo->h323_uu_pdu.h245Tunneling &&
+ alerting->m.h245AddressPresent) {
+ OOTRACEINFO3("Tunneling and h245address provided."
+ "Giving preference to Tunneling (%s, %s)\n",
+ call->callType, call->callToken);
+ }
+ else if(alerting->m.h245AddressPresent)
+ {
+ if (OO_TESTFLAG (call->flags, OO_M_TUNNELING))
+ {
+ OO_CLRFLAG (call->flags, OO_M_TUNNELING);
+ OOTRACEINFO3("Tunneling is disabled for call as H245 address is "
+ "provided in Alerting message (%s, %s)\n",
+ call->callType, call->callToken);
+ }
+ ret = ooH323GetIpPortFromH225TransportAddress(call,
+ &alerting->h245Address, call->remoteIP,
+ &call->remoteH245Port);
+ if(ret != OO_OK)
+ {
+ OOTRACEERR3("Error: Unknown H245 address type in received "
+ "Alerting message (%s, %s)", call->callType,
+ call->callToken);
+ /* Mark call for clearing */
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return OO_FAILED;
+ }
+ if(call->remoteH245Port != 0 && !call->pH245Channel) {
+ /* Create an H.245 connection.
+ */
+ if(ooCreateH245Connection(call)== OO_FAILED)
+ {
+ OOTRACEERR3("Error: H.245 channel creation failed (%s, %s)\n",
+ call->callType, call->callToken);
+
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_TRANSPORTFAILURE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return OO_FAILED;
+ }
+ }
+ } else if (OO_TESTFLAG (call->flags, OO_M_TUNNELING)) {
+ ret =ooSendTCSandMSD(call);
+ if (ret != OO_OK)
+ return ret;
+ }
+
+
+ return OO_OK;
+}
+
+int ooOnReceivedProgress(OOH323CallData *call, Q931Message *q931Msg)
+{
+ H225Progress_UUIE *progress=NULL;
+ H245OpenLogicalChannel* olc;
+ ASN1OCTET msgbuf[MAXMSGLEN];
+ ooLogicalChannel * pChannel = NULL;
+ H245H2250LogicalChannelParameters * h2250lcp = NULL;
+ int i=0, ret=0;
+
+
+ if(!q931Msg->userInfo)
+ {
+ OOTRACEERR3("ERROR:No User-User IE in received Progress message."
+ " (%s, %s)\n", call->callType, call->callToken);
+ return OO_FAILED;
+ }
+ progress = q931Msg->userInfo->h323_uu_pdu.h323_message_body.u.progress;
+ if(progress == NULL)
+ {
+ OOTRACEERR3("Error: Received Progress message does not have "
+ "progress UUIE (%s, %s)\n", call->callType,
+ call->callToken);
+ /* Mark call for clearing */
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return OO_FAILED;
+ }
+ /*Handle fast-start */
+ if(OO_TESTFLAG (call->flags, OO_M_FASTSTART) &&
+ !OO_TESTFLAG(call->flags, OO_M_FASTSTARTANSWERED))
+ {
+ if(progress->m.fastStartPresent)
+ {
+ /* For printing the decoded message to log, initialize handler. */
+ initializePrintHandler(&printHandler, "FastStart Elements");
+
+ /* Set print handler */
+ setEventHandler (call->pctxt, &printHandler);
+
+ for(i=0; i<(int)progress->fastStart.n; i++)
+ {
+ olc = NULL;
+
+ olc = (H245OpenLogicalChannel*)memAlloc(call->pctxt,
+ sizeof(H245OpenLogicalChannel));
+ if(!olc)
+ {
+ OOTRACEERR3("ERROR:Memory - ooOnReceivedProgress - olc"
+ "(%s, %s)\n", call->callType, call->callToken);
+ /*Mark call for clearing */
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_LOCAL_CLEARED;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return OO_FAILED;
+ }
+ memset(olc, 0, sizeof(H245OpenLogicalChannel));
+ memcpy(msgbuf, progress->fastStart.elem[i].data,
+ progress->fastStart.elem[i].numocts);
+ setPERBuffer(call->pctxt, msgbuf,
+ progress->fastStart.elem[i].numocts, 1);
+ ret = asn1PD_H245OpenLogicalChannel(call->pctxt, olc);
+ if(ret != ASN_OK)
+ {
+ OOTRACEERR3("ERROR:Failed to decode fast start olc element "
+ "(%s, %s)\n", call->callType, call->callToken);
+ /* Mark call for clearing */
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return OO_FAILED;
+ }
+
+ dListAppend(call->pctxt, &call->remoteFastStartOLCs, olc);
+
+ pChannel = ooFindLogicalChannelByOLC(call, olc);
+ if(!pChannel)
+ {
+ OOTRACEERR4("ERROR: Logical Channel %d not found, fast start. "
+ "(%s, %s)\n",
+ olc->forwardLogicalChannelNumber, call->callType,
+ call->callToken);
+ return OO_FAILED;
+ }
+ if(pChannel->channelNo != olc->forwardLogicalChannelNumber)
+ {
+ OOTRACEINFO5("Remote endpoint changed forwardLogicalChannel"
+ "Number from %d to %d (%s, %s)\n",
+ pChannel->channelNo,
+ olc->forwardLogicalChannelNumber, call->callType,
+ call->callToken);
+ pChannel->channelNo = olc->forwardLogicalChannelNumber;
+ }
+ if(!strcmp(pChannel->dir, "transmit"))
+ {
+ if(olc->forwardLogicalChannelParameters.multiplexParameters.t !=
+ T_H245OpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters)
+ {
+ OOTRACEERR4("ERROR:Unknown multiplex parameter type for "
+ "channel %d (%s, %s)\n",
+ olc->forwardLogicalChannelNumber, call->callType,
+ call->callToken);
+ continue;
+ }
+
+ /* Extract the remote media endpoint address */
+ h2250lcp = olc->forwardLogicalChannelParameters.multiplexParameters.u.h2250LogicalChannelParameters;
+ if(!h2250lcp)
+ {
+ OOTRACEERR3("ERROR:Invalid OLC received in fast start. No "
+ "forward Logical Channel Parameters found. "
+ "(%s, %s)\n", call->callType, call->callToken);
+ return OO_FAILED;
+ }
+ if(!h2250lcp->m.mediaChannelPresent)
+ {
+ OOTRACEERR3("ERROR:Invalid OLC received in fast start. No "
+ "reverse media channel information found."
+ "(%s, %s)\n", call->callType, call->callToken);
+ return OO_FAILED;
+ }
+ ret = ooGetIpPortFromH245TransportAddress(call,
+ &h2250lcp->mediaChannel, pChannel->remoteIP,
+ &pChannel->remoteMediaPort);
+
+ if(ret != OO_OK)
+ {
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEAR;
+ }
OOTRACEERR3("ERROR:Unsupported media channel address type "
"(%s, %s)\n", call->callType, call->callToken);
return OO_FAILED;
@@ -727,27 +1181,27 @@ int ooOnReceivedAlerting(OOH323CallData *call, Q931Message *q931Msg)
/* Retrieve the H.245 control channel address from the connect msg */
if(q931Msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent &&
q931Msg->userInfo->h323_uu_pdu.h245Tunneling &&
- alerting->m.h245AddressPresent) {
+ progress->m.h245AddressPresent) {
OOTRACEINFO3("Tunneling and h245address provided."
"Giving preference to Tunneling (%s, %s)\n",
call->callType, call->callToken);
}
- else if(alerting->m.h245AddressPresent)
+ else if(progress->m.h245AddressPresent)
{
if (OO_TESTFLAG (call->flags, OO_M_TUNNELING))
{
OO_CLRFLAG (call->flags, OO_M_TUNNELING);
OOTRACEINFO3("Tunneling is disabled for call as H245 address is "
- "provided in Alerting message (%s, %s)\n",
+ "provided in Progress message (%s, %s)\n",
call->callType, call->callToken);
}
ret = ooH323GetIpPortFromH225TransportAddress(call,
- &alerting->h245Address, call->remoteIP,
+ &progress->h245Address, call->remoteIP,
&call->remoteH245Port);
if(ret != OO_OK)
{
OOTRACEERR3("Error: Unknown H245 address type in received "
- "Alerting message (%s, %s)", call->callType,
+ "Progress message (%s, %s)", call->callType,
call->callToken);
/* Mark call for clearing */
if(call->callState < OO_CALL_CLEAR)
@@ -757,7 +1211,28 @@ int ooOnReceivedAlerting(OOH323CallData *call, Q931Message *q931Msg)
}
return OO_FAILED;
}
+ if(call->remoteH245Port != 0 && !call->pH245Channel) {
+ /* Create an H.245 connection.
+ */
+ if(ooCreateH245Connection(call)== OO_FAILED)
+ {
+ OOTRACEERR3("Error: H.245 channel creation failed (%s, %s)\n",
+ call->callType, call->callToken);
+
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_TRANSPORTFAILURE;
+ call->callState = OO_CALL_CLEAR;
+ }
+ return OO_FAILED;
+ }
+ }
+ } else if (OO_TESTFLAG (call->flags, OO_M_TUNNELING)) {
+ ret =ooSendTCSandMSD(call);
+ if (ret != OO_OK)
+ return ret;
}
+
return OO_OK;
}
@@ -920,6 +1395,11 @@ int ooOnReceivedSignalConnect(OOH323CallData* call, Q931Message *q931Msg)
&pChannel->remoteMediaPort);
if(ret != OO_OK)
{
+ if(call->callState < OO_CALL_CLEAR)
+ {
+ call->callEndReason = OO_REASON_INVALIDMESSAGE;
+ call->callState = OO_CALL_CLEAR;
+ }
OOTRACEERR3("ERROR:Unsupported media channel address type "
"(%s, %s)\n", call->callType, call->callToken);
finishPrint();
@@ -979,7 +1459,7 @@ int ooOnReceivedSignalConnect(OOH323CallData* call, Q931Message *q931Msg)
}
}
- if(call->remoteH245Port != 0)
+ if(call->remoteH245Port != 0 && !call->pH245Channel)
{
/* Create an H.245 connection.
*/
@@ -1056,6 +1536,7 @@ int ooHandleH2250Message(OOH323CallData *call, Q931Message *q931Msg)
DListNode *pNode = NULL;
OOTimer *pTimer=NULL;
int type = q931Msg->messageType;
+ struct timespec ts;
switch(type)
{
case Q931SetupMsg: /* SETUP message is received */
@@ -1065,14 +1546,14 @@ int ooHandleH2250Message(OOH323CallData *call, Q931Message *q931Msg)
/* H225 message callback */
if(gH323ep.h225Callbacks.onReceivedSetup)
- gH323ep.h225Callbacks.onReceivedSetup(call, q931Msg);
+ ret = gH323ep.h225Callbacks.onReceivedSetup(call, q931Msg);
/* Free up the mem used by the received message, as it's processing
is done.
*/
- ooFreeQ931Message(q931Msg);
-
- ooSendCallProceeding(call);/* Send call proceeding message*/
+ if (ret == OO_OK) {
+
+ ooFreeQ931Message(call->msgctxt, q931Msg);
/* DISABLEGK is used to selectively disable gatekeeper use. For
incoming calls DISABLEGK can be set in onReceivedSetup callback by
@@ -1083,19 +1564,31 @@ int ooHandleH2250Message(OOH323CallData *call, Q931Message *q931Msg)
{
if(gH323ep.gkClient->state == GkClientRegistered)
{
+ call->callState = OO_CALL_WAITING_ADMISSION;
+ ast_mutex_lock(&call->Lock);
ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, call,
FALSE);
- call->callState = OO_CALL_WAITING_ADMISSION;
+ clock_gettime(CLOCK_REALTIME, &ts);
+ ts.tv_sec += 24;
+ ast_cond_timedwait(&call->gkWait, &call->Lock, &ts);
+ if (call->callState == OO_CALL_WAITING_ADMISSION)
+ call->callState = OO_CALL_CLEAR;
+ ast_mutex_unlock(&call->Lock);
+
}
- else{
+ else {
/* TODO: Should send Release complete with reject reason */
OOTRACEERR1("Error:Ignoring incoming call as not yet"
"registered with Gk\n");
+ call->callState = OO_CALL_CLEAR;
}
}
- else {
- ret = ooH323CallAdmitted (call);
- }
+ if (call->callState < OO_CALL_CLEAR) {
+ ooSendCallProceeding(call);/* Send call proceeding message*/
+ ret = ooH323CallAdmitted (call);
+ }
+
+ } /* end ret == OO_OK */
break;
@@ -1104,7 +1597,7 @@ int ooHandleH2250Message(OOH323CallData *call, Q931Message *q931Msg)
call->callType, call->callToken);
ooOnReceivedCallProceeding(call, q931Msg);
- ooFreeQ931Message(q931Msg);
+ ooFreeQ931Message(call->msgctxt, q931Msg);
break;
@@ -1112,11 +1605,24 @@ int ooHandleH2250Message(OOH323CallData *call, Q931Message *q931Msg)
OOTRACEINFO3("H.225 Alerting message received (%s, %s)\n",
call->callType, call->callToken);
+ call->alertingTime = (H235TimeStamp) time(NULL);
ooOnReceivedAlerting(call, q931Msg);
if(gH323ep.h323Callbacks.onAlerting && call->callState<OO_CALL_CLEAR)
gH323ep.h323Callbacks.onAlerting(call);
- ooFreeQ931Message(q931Msg);
+ ooFreeQ931Message(call->msgctxt, q931Msg);
+ break;
+
+
+ case Q931ProgressMsg:/* PROGRESS message received */
+ OOTRACEINFO3("H.225 Progress message received (%s, %s)\n",
+ call->callType, call->callToken);
+
+ ooOnReceivedProgress(call, q931Msg);
+
+ if(gH323ep.h323Callbacks.onProgress && call->callState<OO_CALL_CLEAR)
+ gH323ep.h323Callbacks.onProgress(call);
+ ooFreeQ931Message(call->msgctxt, q931Msg);
break;
@@ -1124,6 +1630,8 @@ int ooHandleH2250Message(OOH323CallData *call, Q931Message *q931Msg)
OOTRACEINFO3("H.225 Connect message received (%s, %s)\n",
call->callType, call->callToken);
+ call->connectTime = (H235TimeStamp) time(NULL);
+
/* Disable call establishment timer */
for(i = 0; i<call->timerList.count; i++)
{
@@ -1151,12 +1659,18 @@ int ooHandleH2250Message(OOH323CallData *call, Q931Message *q931Msg)
if(gH323ep.h323Callbacks.onCallEstablished)
gH323ep.h323Callbacks.onCallEstablished(call);
}
- ooFreeQ931Message(q931Msg);
+ ooFreeQ931Message(call->msgctxt, q931Msg);
+
+ if(gH323ep.gkClient && !OO_TESTFLAG(call->flags, OO_M_DISABLEGK)) {
+ if(gH323ep.gkClient->state == GkClientRegistered) {
+ ooGkClientSendIRR(gH323ep.gkClient, call);
+ }
+ }
break;
case Q931InformationMsg:
OOTRACEINFO3("H.225 Information msg received (%s, %s)\n",
call->callType, call->callToken);
- ooFreeQ931Message(q931Msg);
+ ooFreeQ931Message(call->msgctxt, q931Msg);
break;
@@ -1164,46 +1678,43 @@ int ooHandleH2250Message(OOH323CallData *call, Q931Message *q931Msg)
OOTRACEINFO3("H.225 Release Complete message received (%s, %s)\n",
call->callType, call->callToken);
+ call->endTime = (H235TimeStamp) time(NULL);
+
ooOnReceivedReleaseComplete(call, q931Msg);
- ooFreeQ931Message(q931Msg);
+ ooFreeQ931Message(call->msgctxt, q931Msg);
break;
case Q931FacilityMsg:
OOTRACEINFO3("H.225 Facility message Received (%s, %s)\n",
call->callType, call->callToken);
ooOnReceivedFacility(call, q931Msg);
- ooFreeQ931Message(q931Msg);
- break;
- case Q931ProgressMsg:
- OOTRACEINFO3("H.225 Progress message received (%s, %s)\n",
- call->callType, call->callToken);
- ooFreeQ931Message(q931Msg);
+ ooFreeQ931Message(call->msgctxt, q931Msg);
break;
case Q931StatusMsg:
OOTRACEINFO3("H.225 Status message received (%s, %s)\n",
call->callType, call->callToken);
- ooFreeQ931Message(q931Msg);
+ ooFreeQ931Message(call->msgctxt, q931Msg);
break;
case Q931StatusEnquiryMsg:
OOTRACEINFO3("H.225 Status Inquiry message Received (%s, %s)\n",
call->callType, call->callToken);
- ooFreeQ931Message(q931Msg);
+ ooFreeQ931Message(call->msgctxt, q931Msg);
break;
case Q931SetupAckMsg:
OOTRACEINFO3("H.225 Setup Ack message received (%s, %s)\n",
call->callType, call->callToken);
- ooFreeQ931Message(q931Msg);
+ ooFreeQ931Message(call->msgctxt, q931Msg);
break;
case Q931NotifyMsg:
OOTRACEINFO3("H.225 Notify message Received (%s, %s)\n",
call->callType, call->callToken);
- ooFreeQ931Message(q931Msg);
+ ooFreeQ931Message(call->msgctxt, q931Msg);
break;
default:
OOTRACEWARN3("Invalid H.225 message type received (%s, %s)\n",
call->callType, call->callToken);
- ooFreeQ931Message(q931Msg);
+ ooFreeQ931Message(call->msgctxt, q931Msg);
}
return ret;
}
@@ -1329,17 +1840,33 @@ int ooOnReceivedFacility(OOH323CallData *call, Q931Message * pQ931Msg)
return OO_OK;
}
}
+ else if(facility->reason.t == T_H225FacilityReason_forwardedElements)
+ {
+ OOTRACEINFO3("Handling fast start in forwardedElem facility for "
+ "(%s, %s)\n", call->callType, call->callToken);
+ /*start H.245 channel*/
+ ret = ooHandleFastStart(call, facility);
+ if(ret != OO_OK)
+ {
+ OOTRACEERR3("ERROR: Handling transportedInformation facility message "
+ "(%s, %s)\n", call->callType, call->callToken);
+ return ret;
+ }
+ }
else{
OOTRACEINFO3("Unhandled Facility reason type received (%s, %s)\n",
call->callType, call->callToken);
}
}
else{ /* Empty facility message Check for tunneling */
+ if (pH323UUPdu->h323_message_body.t ==
+ T_H225H323_UU_PDU_h323_message_body_empty) {
OOTRACEDBGB3("Handling tunneled messages in empty Facility message."
" (%s, %s)\n", call->callType, call->callToken);
ooHandleTunneledH245Messages(call, pH323UUPdu);
OOTRACEDBGB3("Finished handling tunneled messages in empty Facility "
"message. (%s, %s)\n", call->callType, call->callToken);
+ }
}
return OO_OK;
@@ -1396,7 +1923,7 @@ int ooHandleTunneledH245Messages
(OOH323CallData *call, H225H323_UU_PDU * pH323UUPdu)
{
H245Message *pmsg;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ OOCTXT *pctxt = call->msgctxt;
int ret=0,i=0;
OOTRACEDBGC3("Checking for tunneled H.245 messages (%s, %s)\n",
@@ -1608,6 +2135,53 @@ int ooH323RetrieveAliases
}
+int ooPopulatePrefixList(OOCTXT *pctxt, OOAliases *pAliases,
+ H225_SeqOfH225SupportedPrefix *pPrefixList )
+{
+ H225SupportedPrefix *pPrefixEntry=NULL;
+ OOAliases * pAlias=NULL;
+ ASN1BOOL bValid=FALSE;
+
+ dListInit(pPrefixList);
+ if(pAliases)
+ {
+ pAlias = pAliases;
+ while(pAlias)
+ {
+ pPrefixEntry = NULL;
+ switch(pAlias->type)
+ {
+ case T_H225AliasAddress_dialedDigits:
+ pPrefixEntry = (H225SupportedPrefix *)memAlloc(pctxt,
+ sizeof(H225SupportedPrefix));
+ if(!pPrefixEntry) {
+ OOTRACEERR1("ERROR:Memory - ooPopulatePrefixList - pAliasEntry\n");
+ return OO_FAILED;
+ }
+ pPrefixEntry->prefix.t = T_H225AliasAddress_dialedDigits;
+ pPrefixEntry->prefix.u.dialedDigits = (ASN1IA5String)memAlloc(pctxt,
+ strlen(pAlias->value)+1);
+ if(!pPrefixEntry->prefix.u.dialedDigits) {
+ OOTRACEERR1("ERROR:Memory - ooPopulatePrefixList - "
+ "dialedDigits\n");
+ memFreePtr(pctxt, pPrefixEntry);
+ return OO_FAILED;
+ }
+ strcpy((char*)pPrefixEntry->prefix.u.dialedDigits, pAlias->value);
+ bValid = TRUE;
+ break;
+ default:
+ bValid = FALSE;
+ }
+
+ if(bValid)
+ dListAppend( pctxt, pPrefixList, (void*)pPrefixEntry );
+
+ pAlias = pAlias->next;
+ }
+ }
+ return OO_OK;
+}
int ooPopulateAliasList(OOCTXT *pctxt, OOAliases *pAliases,
H225_SeqOfH225AliasAddress *pAliasList )
{
@@ -1622,6 +2196,10 @@ int ooPopulateAliasList(OOCTXT *pctxt, OOAliases *pAliases,
pAlias = pAliases;
while(pAlias)
{
+ if (pAlias->value[0] == 0) {
+ pAlias = pAlias->next;
+ continue;
+ }
pAliasEntry = (H225AliasAddress*)memAlloc(pctxt,
sizeof(H225AliasAddress));
if(!pAliasEntry)
diff --git a/addons/ooh323c/src/ooh323.h b/addons/ooh323c/src/ooh323.h
index 8c5a99434..187b099f4 100644
--- a/addons/ooh323c/src/ooh323.h
+++ b/addons/ooh323c/src/ooh323.h
@@ -122,6 +122,11 @@ EXTERN int ooH323RetrieveAliases
OOAliases **aliasList);
/**
+ */
+EXTERN int ooPopulatePrefixList(OOCTXT *pctxt, OOAliases *pAliases,
+ H225_SeqOfH225SupportedPrefix *pPrefixList );
+
+/**
* This is a helper function used to populate alias list using aliases.
* @param pctxt Pointer to OOCTXT structure which will be used for memory
* allocations.
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);
diff --git a/addons/ooh323c/src/ooh323ep.h b/addons/ooh323c/src/ooh323ep.h
index 9d80a1df1..0cb71a019 100644
--- a/addons/ooh323c/src/ooh323ep.h
+++ b/addons/ooh323c/src/ooh323ep.h
@@ -26,12 +26,12 @@
#include "ooq931.h"
#define DEFAULT_TRACEFILE "trace.log"
-#define DEFAULT_TERMTYPE 50
-#define DEFAULT_PRODUCTID "objsys"
+#define DEFAULT_TERMTYPE 60
+#define DEFAULT_PRODUCTID "ooh323"
#define DEFAULT_CALLERID "objsyscall"
-#define DEFAULT_T35COUNTRYCODE 1
+#define DEFAULT_T35COUNTRYCODE 184
#define DEFAULT_T35EXTENSION 0
-#define DEFAULT_MANUFACTURERCODE 71
+#define DEFAULT_MANUFACTURERCODE 39
#define DEFAULT_H245CONNECTION_RETRYTIMEOUT 2
#define DEFAULT_CALLESTB_TIMEOUT 60
#define DEFAULT_MSD_TIMEOUT 30
@@ -58,8 +58,8 @@ struct OOCapPrefs;
* @{
*/
/* Default port ranges */
-#define TCPPORTSSTART 12030 /*!< Starting TCP port number */
-#define TCPPORTSEND 12230 /*!< Ending TCP port number */
+#define TCPPORTSSTART 12000 /*!< Starting TCP port number */
+#define TCPPORTSEND 62230 /*!< Ending TCP port number */
#define UDPPORTSSTART 13030 /*!< Starting UDP port number */
#define UDPPORTSEND 13230 /*!< Ending UDP port number */
#define RTPPORTSSTART 14030 /*!< Starting RTP port number */
@@ -170,7 +170,10 @@ EXTERN int ooH323EpInitialize
*
* @return OO_OK, on success. OO_FAILED, on failure.
*/
-EXTERN int ooH323EpSetAsGateway();
+EXTERN int ooH323EpSetAsGateway(void);
+
+EXTERN void ooH323EpSetVersionInfo(int t35countrycode, int t35extensions, int manufacturer,
+ char* vendor, char* version);
/**
* This function is used to assign a local ip address to be used for call
@@ -340,7 +343,7 @@ EXTERN int ooH323EpDisableManualRingback(void);
*
* @return OO_OK, on success. OO_FAILED, on failure.
*/
-EXTERN int ooH323EpDisableMediaWaitForConnect(void);
+EXTERN int ooH323EpEnableMediaWaitForConnect(void);
/**
* This function is used to disable MediaWaitForConnect.
@@ -378,6 +381,13 @@ EXTERN int ooH323EpEnableH245Tunneling(void);
EXTERN int ooH323EpDisableH245Tunneling(void);
/**
+ * This function is used to setup/clear TryBeMaster flag
+ *
+ * @return OO_OK, on success. OO_FAILED, on failure.
+ */
+EXTERN int ooH323EpTryBeMaster(int);
+
+/**
* This function is used to enable GkRouted calls.
*
* @return OO_OK, on success. OO_FAILED, on failure.
@@ -589,28 +599,62 @@ EXTERN int ooH323EpDisableDTMFRFC2833(void);
* the endpoint.
* @return OO_OK, on success; OO_FAILED, on failure
*/
-EXTERN int ooH323EpEnableDTMFH245Alphanumeric();
+EXTERN int ooH323EpEnableDTMFH245Alphanumeric(void);
/**
* This function is used to disable the H245(alphanumeric) dtmf capability for
* the endpoint.
* @return OO_OK, on success; OO_FAILED, on failure
*/
-EXTERN int ooH323EpDisableDTMFH245Alphanumeric();
+EXTERN int ooH323EpDisableDTMFH245Alphanumeric(void);
/**
* This function is used to enable the H245(signal) dtmf capability for
* the endpoint.
* @return OO_OK, on success; OO_FAILED, on failure
*/
-EXTERN int ooH323EpEnableDTMFH245Signal();
+EXTERN int ooH323EpEnableDTMFH245Signal(void);
/**
* This function is used to disable the H245(signal) dtmf capability for
* the endpoint.
* @return OO_OK, on success; OO_FAILED, on failure
*/
-EXTERN int ooH323EpDisableDTMFH245Signal();
+EXTERN int ooH323EpDisableDTMFH245Signal(void);
+
+/**/
+EXTERN int ooH323EpSetTermType(int value);
+EXTERN int ooH323EpAddG726Capability(int cap, int txframes, int rxframes,
+ OOBOOL silenceSuppression, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel);
+EXTERN int ooH323EpAddAMRNBCapability(int cap, int txframes, int rxframes,
+ OOBOOL silenceSuppression, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel);
+EXTERN int ooH323EpAddAMRNBCapability(int cap, int txframes, int rxframes,
+ OOBOOL silenceSuppression, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel);
+EXTERN int ooH323EpAddSpeexCapability(int cap, int txframes, int rxframes,
+ OOBOOL silenceSuppression, int dir,
+ cb_StartReceiveChannel startReceiveChannel,
+ cb_StartTransmitChannel startTransmitChannel,
+ cb_StopReceiveChannel stopReceiveChannel,
+ cb_StopTransmitChannel stopTransmitChannel);
+EXTERN int ooH323EpEnableDTMFCISCO(int dynamicRTPPayloadType);
+EXTERN int ooH323EpDisableDTMFCISCO(void);
+
+EXTERN int ooH323EpEnableDTMFQ931Keypad(void);
+EXTERN int ooH323EpDisableDTMFQ931Keypad(void);
+
+/**/
/**
* This function is used to add callbacks to the gatekeeper client. If user
diff --git a/addons/ooh323c/src/ooports.c b/addons/ooh323c/src/ooports.c
index 3059404db..2b9cc09ff 100644
--- a/addons/ooh323c/src/ooports.c
+++ b/addons/ooh323c/src/ooports.c
@@ -14,6 +14,8 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
#include "ooports.h"
#include "ooh323ep.h"
@@ -21,6 +23,7 @@
/** Global endpoint structure */
extern OOH323EndPoint gH323ep;
+extern ast_mutex_t bindPortLock;
/* Get the next port of type TCP/UDP/RTP */
int ooGetNextPort (OOH323PortType type)
@@ -63,6 +66,8 @@ int ooBindPort (OOH323PortType type, OOSOCKET socket, char *ip)
int initialPort, bindPort, ret;
OOIPADDR ipAddrs;
+ ast_mutex_lock(&bindPortLock);
+
initialPort = ooGetNextPort (type);
bindPort = initialPort;
@@ -72,12 +77,13 @@ int ooBindPort (OOH323PortType type, OOSOCKET socket, char *ip)
{
if((ret=ooSocketBind(socket, ipAddrs, bindPort))==0)
{
+ ast_mutex_unlock(&bindPortLock);
return bindPort;
}
else
{
bindPort = ooGetNextPort (type);
- if (bindPort == initialPort) return OO_FAILED;
+ if (bindPort == initialPort) { ast_mutex_unlock(&bindPortLock); return OO_FAILED; }
}
}
}
diff --git a/addons/ooh323c/src/ooq931.c b/addons/ooh323c/src/ooq931.c
index e440b4c7b..8c8860b67 100644
--- a/addons/ooh323c/src/ooq931.c
+++ b/addons/ooh323c/src/ooq931.c
@@ -14,6 +14,10 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+#include <time.h>
+
#include "ooq931.h"
#include "ootrace.h"
#include "ooasn1.h"
@@ -30,9 +34,13 @@
#include <time.h>
#include <ctype.h>
+int ooSetFastStartResponse(OOH323CallData *pCall, Q931Message *pQ931msg,
+ ASN1UINT *fsCount, ASN1DynOctStr **fsElem);
+
/** Global endpoint structure */
extern OOH323EndPoint gH323ep;
+extern ast_mutex_t newCallLock;
static ASN1OBJID gProtocolID = {
6, { 0, 0, 8, 2250, 0, 4 }
@@ -44,7 +52,8 @@ EXTERN int ooQ931Decode
int offset, x;
int rv = ASN_OK;
char number[128];
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+ OOCTXT *pctxt = call->msgctxt;
dListInit (&msg->ies); /* clear information elements list */
@@ -166,7 +175,7 @@ EXTERN int ooQ931Decode
OOTRACEDBGB1(" }\n");
if(gH323ep.h323Callbacks.onReceivedDTMF)
{
- gH323ep.h323Callbacks.onReceivedDTMF(call, ie->data);
+ gH323ep.h323Callbacks.onReceivedDTMF(call, (char *)ie->data);
}
}
/* Extract calling party number TODO:Give respect to presentation and
@@ -229,7 +238,7 @@ EXTERN int ooQ931Decode
we just ignore notify message as of now as handling is optional for
end point*/
if(msg->messageType != Q931NotifyMsg)
- rv = ooDecodeUUIE(msg);
+ rv = ooDecodeUUIE(pctxt, msg);
return rv;
}
@@ -364,9 +373,9 @@ EXTERN void ooQ931Print (const Q931Message* q931msg) {
}
}
-int ooCreateQ931Message(Q931Message **q931msg, int msgType)
+int ooCreateQ931Message(OOCTXT* pctxt, Q931Message **q931msg, int msgType)
{
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
*q931msg = (Q931Message*)memAllocZ(pctxt, sizeof(Q931Message));
@@ -397,10 +406,12 @@ int ooGenerateCallToken (char *callToken, size_t size)
char aCallToken[200];
int ret = 0;
+ ast_mutex_lock(&newCallLock);
sprintf (aCallToken, "ooh323c_%d", counter++);
if (counter > OO_MAX_CALL_TOKEN)
counter = 1;
+ ast_mutex_unlock(&newCallLock);
if ((strlen(aCallToken)+1) < size)
strcpy (callToken, aCallToken);
@@ -479,24 +490,25 @@ int ooGenerateCallIdentifier(H225CallIdentifier *callid)
}
-int ooFreeQ931Message(Q931Message *q931Msg)
+int ooFreeQ931Message(OOCTXT* pctxt, Q931Message *q931Msg)
{
if(!q931Msg)
{
- memReset(&gH323ep.msgctxt);
+ /* memReset(&gH323ep.msgctxt); */
+ memReset(pctxt);
}
return OO_OK;
}
-int ooEncodeUUIE(Q931Message *q931msg)
+int ooEncodeUUIE(OOCTXT* pctxt, Q931Message *q931msg)
{
ASN1OCTET msgbuf[1024];
ASN1OCTET * msgptr=NULL;
int len;
ASN1BOOL aligned = TRUE;
Q931InformationElement* ie=NULL;
- OOCTXT *pctxt = &gH323ep.msgctxt;
- /* memset(msgbuf, 0, sizeof(msgbuf));*/
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+ memset(msgbuf, 0, sizeof(msgbuf));
if(!q931msg)
{
OOTRACEERR1("ERROR: Invalid Q931 message in add user-user IE\n");
@@ -547,14 +559,14 @@ int ooEncodeUUIE(Q931Message *q931msg)
return OO_OK;
}
-int ooDecodeUUIE(Q931Message *q931Msg)
+int ooDecodeUUIE(OOCTXT* pctxt, Q931Message *q931Msg)
{
DListNode* curNode;
unsigned int i;
ASN1BOOL aligned=TRUE;
int stat;
Q931InformationElement *ie;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
if(q931Msg ==NULL)
{
OOTRACEERR1("Error: ooDecodeUUIE failed - NULL q931 message\n");
@@ -566,7 +578,7 @@ int ooDecodeUUIE(Q931Message *q931Msg)
i++, curNode = curNode->next)
{
ie = (Q931InformationElement*) curNode->data;
- if(ie->discriminator == Q931UserUserIE)
+ if(ie && ie->discriminator == Q931UserUserIE)
break;
}
if(i == q931Msg->ies.count)
@@ -602,7 +614,8 @@ static void ooQ931PrintMessage
(OOH323CallData* call, ASN1OCTET *msgbuf, ASN1UINT msglen)
{
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+ OOCTXT *pctxt = call->msgctxt;
Q931Message q931Msg;
int ret;
@@ -650,7 +663,8 @@ int ooEncodeH225Message(OOH323CallData *call, Q931Message *pq931Msg,
else if(pq931Msg->messageType == Q931CallProceedingMsg){
msgbuf[i++] = OOCallProceeding;
}
- else if(pq931Msg->messageType == Q931AlertingMsg){
+ else if(pq931Msg->messageType == Q931AlertingMsg ||
+ pq931Msg->messageType == Q931ProgressMsg){
msgbuf[i++] = OOAlert;
}
else if(pq931Msg->messageType == Q931ReleaseCompleteMsg){
@@ -671,7 +685,7 @@ int ooEncodeH225Message(OOH323CallData *call, Q931Message *pq931Msg,
return OO_FAILED;
}
- stat = ooEncodeUUIE(pq931Msg);
+ stat = ooEncodeUUIE(call->msgctxt, pq931Msg);
if(stat != OO_OK)
{
OOTRACEERR3("Error:Failed to encode uuie. (%s, %s)\n", call->callType,
@@ -819,9 +833,9 @@ int ooEncodeH225Message(OOH323CallData *call, Q931Message *pq931Msg,
#ifndef _COMPACT
if(msgbuf[0] != OOFacility)
- ooQ931PrintMessage (call, msgbuf+5, len-4);
+ ooQ931PrintMessage (call, (unsigned char *)msgbuf+5, len-4);
else
- ooQ931PrintMessage (call, msgbuf+8, len-4);
+ ooQ931PrintMessage (call, (unsigned char *)msgbuf+8, len-4);
#endif
return OO_OK;
}
@@ -829,7 +843,8 @@ int ooEncodeH225Message(OOH323CallData *call, Q931Message *pq931Msg,
int ooSetFastStartResponse(OOH323CallData *pCall, Q931Message *pQ931msg,
ASN1UINT *fsCount, ASN1DynOctStr **fsElem)
{
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+ OOCTXT *pctxt = pCall->msgctxt;
int ret = 0, i=0, j=0, remoteMediaPort=0, remoteMediaControlPort = 0, dir=0;
char remoteMediaIP[20], remoteMediaControlIP[20];
DListNode *pNode = NULL;
@@ -859,22 +874,12 @@ int ooSetFastStartResponse(OOH323CallData *pCall, Q931Message *pQ931msg,
(*fsElem)[k].data = pData;
}
- /* free the stored fast start response */
- if(pQ931msg->messageType == Q931ConnectMsg) {
- for(k = 0; k < pCall->pFastStartRes->n; k ++) {
- memFreePtr(pCall->pctxt, pCall->pFastStartRes->elem[k].data);
- }
- memFreePtr(pCall->pctxt, pCall->pFastStartRes->elem);
- memFreePtr(pCall->pctxt, pCall->pFastStartRes);
- pCall->pFastStartRes = NULL;
- }
-
return ASN_OK;
}
/* If fast start supported and remote endpoint has sent faststart element */
- if(OO_TESTFLAG(gH323ep.flags, OO_M_FASTSTART) &&
+ if(OO_TESTFLAG(pCall->flags, OO_M_FASTSTART) &&
pCall->remoteFastStartOLCs.count>0)
{
pFS = (ASN1DynOctStr*)memAlloc(pctxt,
@@ -1063,7 +1068,7 @@ int ooSetFastStartResponse(OOH323CallData *pCall, Q931Message *pQ931msg,
}
- ooPrepareFastStartResponseOLC(pCall, olc, epCap, pctxt, dir);
+ ooBuildFastStartOLC(pCall, olc, epCap, pctxt, dir);
pChannel = ooFindLogicalChannelByLogicalChannelNo
(pCall, olc->forwardLogicalChannelNumber);
@@ -1115,7 +1120,7 @@ int ooSetFastStartResponse(OOH323CallData *pCall, Q931Message *pQ931msg,
{
OOTRACEERR3("ERROR:Encoding of olc failed for faststart "
"(%s, %s)\n", pCall->callType, pCall->callToken);
- ooFreeQ931Message(pQ931msg);
+ ooFreeQ931Message(pctxt, pQ931msg);
if(pCall->callState < OO_CALL_CLEAR)
{
pCall->callEndReason = OO_REASON_LOCAL_CLEARED;
@@ -1123,11 +1128,11 @@ int ooSetFastStartResponse(OOH323CallData *pCall, Q931Message *pQ931msg,
}
return OO_FAILED;
}
- pFS[j].data = encodeGetMsgPtr(pctxt, &(pFS[j].numocts));
+ pFS[j].data = (unsigned char *) encodeGetMsgPtr(pctxt, (int *)&(pFS[j].numocts));
/* start print call */
- setPERBuffer(pctxt, (char*)pFS[j].data, pFS[j].numocts, 1);
+ setPERBuffer(pctxt, (unsigned char*)pFS[j].data, pFS[j].numocts, 1);
initializePrintHandler(&printHandler, "FastStart Element");
setEventHandler (pctxt, &printHandler);
memset(&printOlc, 0, sizeof(printOlc));
@@ -1136,7 +1141,7 @@ int ooSetFastStartResponse(OOH323CallData *pCall, Q931Message *pQ931msg,
{
OOTRACEERR3("Error: Failed decoding FastStart Element (%s, %s)\n",
pCall->callType, pCall->callToken);
- ooFreeQ931Message(pQ931msg);
+ ooFreeQ931Message(pctxt, pQ931msg);
if(pCall->callState < OO_CALL_CLEAR)
{
pCall->callEndReason = OO_REASON_LOCAL_CLEARED;
@@ -1190,6 +1195,35 @@ int ooSetFastStartResponse(OOH323CallData *pCall, Q931Message *pQ931msg,
return ASN_OK;
}
+/*
+
+H225 CapSet/MS determination helper function
+
+*/
+
+int ooSendTCSandMSD(OOH323CallData *call)
+{
+ int ret;
+ if(call->localTermCapState == OO_LocalTermCapExchange_Idle) {
+ ret = ooSendTermCapMsg(call);
+ if(ret != OO_OK) {
+ OOTRACEERR3("ERROR:Sending Terminal capability message (%s, %s)\n",
+ call->callType, call->callToken);
+ return ret;
+ }
+ }
+ if(call->masterSlaveState == OO_MasterSlave_Idle) {
+ ret = ooSendMasterSlaveDetermination(call);
+ if(ret != OO_OK) {
+ OOTRACEERR3("ERROR:Sending Master-slave determination message "
+ "(%s, %s)\n", call->callType, call->callToken);
+ return ret;
+ }
+ }
+
+ return OO_OK;
+}
+
/*
@@ -1201,11 +1235,12 @@ int ooSendCallProceeding(OOH323CallData *call)
H225VendorIdentifier *vendor;
H225CallProceeding_UUIE *callProceeding;
Q931Message *q931msg=NULL;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+ OOCTXT *pctxt = call->msgctxt;
OOTRACEDBGC3("Building CallProceeding (%s, %s)\n", call->callType,
call->callToken);
- ret = ooCreateQ931Message(&q931msg, Q931CallProceedingMsg);
+ ret = ooCreateQ931Message(pctxt, &q931msg, Q931CallProceedingMsg);
if(ret != OO_OK)
{
OOTRACEERR1("Error: In allocating memory for - H225 Call "
@@ -1225,7 +1260,7 @@ int ooSendCallProceeding(OOH323CallData *call)
memset (q931msg->userInfo, 0, sizeof(H225H323_UserInformation));
q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1;
q931msg->userInfo->h323_uu_pdu.h245Tunneling =
- OO_TESTFLAG(gH323ep.flags, OO_M_TUNNELING);
+ OO_TESTFLAG(call->flags, OO_M_TUNNELING);
q931msg->userInfo->h323_uu_pdu.h323_message_body.t =
T_H225H323_UU_PDU_h323_message_body_callProceeding;
@@ -1264,7 +1299,7 @@ int ooSendCallProceeding(OOH323CallData *call)
vendor->m.productIdPresent = 1;
vendor->productId.numocts = ASN1MIN(strlen(gH323ep.productID),
sizeof(vendor->productId.data));
- strncpy(vendor->productId.data, gH323ep.productID,
+ strncpy((char *)vendor->productId.data, gH323ep.productID,
vendor->productId.numocts);
}
if(gH323ep.versionID)
@@ -1272,7 +1307,7 @@ int ooSendCallProceeding(OOH323CallData *call)
vendor->m.versionIdPresent = 1;
vendor->versionId.numocts = ASN1MIN(strlen(gH323ep.versionID),
sizeof(vendor->versionId.data));
- strncpy(vendor->versionId.data, gH323ep.versionID,
+ strncpy((char *)vendor->versionId.data, gH323ep.versionID,
vendor->versionId.numocts);
}
@@ -1288,7 +1323,8 @@ int ooSendCallProceeding(OOH323CallData *call)
OOTRACEERR3("Error:Failed to enqueue CallProceeding message to outbound queue.(%s, %s)\n", call->callType, call->callToken);
}
- memReset(&gH323ep.msgctxt);
+ /* memReset(&gH323ep.msgctxt); */
+ memReset(call->msgctxt);
return ret;
}
@@ -1299,9 +1335,10 @@ int ooSendAlerting(OOH323CallData *call)
H225Alerting_UUIE *alerting;
H225VendorIdentifier *vendor;
Q931Message *q931msg=NULL;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+ OOCTXT *pctxt = call->msgctxt;
- ret = ooCreateQ931Message(&q931msg, Q931AlertingMsg);
+ ret = ooCreateQ931Message(pctxt, &q931msg, Q931AlertingMsg);
if(ret != OO_OK)
{
OOTRACEERR1("Error: In allocating memory for - H225 "
@@ -1309,6 +1346,8 @@ int ooSendAlerting(OOH323CallData *call)
return OO_FAILED;
}
+ call->alertingTime = (H235TimeStamp) time(NULL);
+
q931msg->callReference = call->callReference;
q931msg->userInfo = (H225H323_UserInformation*)memAlloc(pctxt,
@@ -1320,7 +1359,7 @@ int ooSendAlerting(OOH323CallData *call)
}
memset (q931msg->userInfo, 0, sizeof(H225H323_UserInformation));
q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1;
- q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(gH323ep.flags,
+ q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(call->flags,
OO_M_TUNNELING);
q931msg->userInfo->h323_uu_pdu.h323_message_body.t =
T_H225H323_UU_PDU_h323_message_body_alerting;
@@ -1382,7 +1421,7 @@ int ooSendAlerting(OOH323CallData *call)
vendor->m.productIdPresent = 1;
vendor->productId.numocts = ASN1MIN(strlen(gH323ep.productID),
sizeof(vendor->productId.data));
- strncpy(vendor->productId.data, gH323ep.productID,
+ strncpy((char *)vendor->productId.data, gH323ep.productID,
vendor->productId.numocts);
}
if(gH323ep.versionID)
@@ -1390,7 +1429,7 @@ int ooSendAlerting(OOH323CallData *call)
vendor->m.versionIdPresent = 1;
vendor->versionId.numocts = ASN1MIN(strlen(gH323ep.versionID),
sizeof(vendor->versionId.data));
- strncpy(vendor->versionId.data, gH323ep.versionID,
+ strncpy((char *)vendor->versionId.data, gH323ep.versionID,
vendor->versionId.numocts);
}
@@ -1398,13 +1437,16 @@ int ooSendAlerting(OOH323CallData *call)
vendor->vendor.t35Extension = gH323ep.t35Extension;
vendor->vendor.manufacturerCode = gH323ep.manufacturerCode;
- ret = ooSetFastStartResponse(call, q931msg,
- &alerting->fastStart.n, &alerting->fastStart.elem);
- if(ret != ASN_OK) { return ret; }
- if(alerting->fastStart.n > 0) {
- alerting->m.fastStartPresent = TRUE;
- }
- else {
+ if (!call->fsSent) {
+ ret = ooSetFastStartResponse(call, q931msg,
+ &alerting->fastStart.n, &alerting->fastStart.elem);
+ if(ret != ASN_OK) { return ret; }
+ if(alerting->fastStart.n > 0) {
+ alerting->m.fastStartPresent = TRUE;
+ call->fsSent = TRUE;
+ } else
+ alerting->m.fastStartPresent = FALSE;
+ } else {
alerting->m.fastStartPresent = FALSE;
}
@@ -1416,22 +1458,159 @@ int ooSendAlerting(OOH323CallData *call)
OOTRACEERR3("Error: Failed to enqueue Alerting message to outbound queue. (%s, %s)\n", call->callType, call->callToken);
}
- memReset(&gH323ep.msgctxt);
+ ooSendTCSandMSD(call);
+ memReset (call->msgctxt);
+
+ return ret;
+}
+
+int ooSendProgress(OOH323CallData *call)
+{
+ int ret;
+ H225Progress_UUIE *progress;
+ H225VendorIdentifier *vendor;
+ Q931Message *q931msg=NULL;
+ H225TransportAddress_ipAddress *h245IpAddr;
+ OOCTXT *pctxt = call->msgctxt;
+
+ ret = ooCreateQ931Message(pctxt, &q931msg, Q931ProgressMsg);
+ if(ret != OO_OK)
+ {
+ OOTRACEERR1("Error: In allocating memory for - H225 "
+ "Alerting message\n");
+ return OO_FAILED;
+ }
+
+ q931msg->callReference = call->callReference;
+
+ q931msg->userInfo = (H225H323_UserInformation*)memAlloc(pctxt,
+ sizeof(H225H323_UserInformation));
+ if(!q931msg->userInfo)
+ {
+ OOTRACEERR1("ERROR:Memory - ooSendAlerting - userInfo\n");
+ return OO_FAILED;
+ }
+ memset (q931msg->userInfo, 0, sizeof(H225H323_UserInformation));
+ q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1;
+ q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(call->flags,
+ OO_M_TUNNELING);
+ q931msg->userInfo->h323_uu_pdu.h323_message_body.t =
+ T_H225H323_UU_PDU_h323_message_body_progress;
+
+ progress = (H225Progress_UUIE*)memAlloc(pctxt,
+ sizeof(H225Progress_UUIE));
+ if(!progress)
+ {
+ OOTRACEERR1("ERROR:Memory - ooSendProgress- alerting\n");
+ return OO_FAILED;
+ }
+ memset(progress, 0, sizeof(H225Progress_UUIE));
+ q931msg->userInfo->h323_uu_pdu.h323_message_body.u.progress = progress;
+ progress->m.multipleCallsPresent = 1;
+ progress->m.maintainConnectionPresent = 1;
+ progress->multipleCalls = FALSE;
+ progress->maintainConnection = FALSE;
+
+ progress->callIdentifier.guid.numocts =
+ call->callIdentifier.guid.numocts;
+ memcpy(progress->callIdentifier.guid.data,
+ call->callIdentifier.guid.data,
+ call->callIdentifier.guid.numocts);
+ progress->protocolIdentifier = gProtocolID;
+
+ /* Pose as Terminal or Gateway */
+ if(gH323ep.isGateway)
+ progress->destinationInfo.m.gatewayPresent = TRUE;
+ else
+ progress->destinationInfo.m.terminalPresent = TRUE;
+
+ progress->destinationInfo.m.vendorPresent = 1;
+ vendor = &progress->destinationInfo.vendor;
+ if(gH323ep.productID)
+ {
+ vendor->m.productIdPresent = 1;
+ vendor->productId.numocts = ASN1MIN(strlen(gH323ep.productID),
+ sizeof(vendor->productId.data));
+ strncpy((char *)vendor->productId.data, gH323ep.productID,
+ vendor->productId.numocts);
+ }
+ if(gH323ep.versionID)
+ {
+ vendor->m.versionIdPresent = 1;
+ vendor->versionId.numocts = ASN1MIN(strlen(gH323ep.versionID),
+ sizeof(vendor->versionId.data));
+ strncpy((char *)vendor->versionId.data, gH323ep.versionID,
+ vendor->versionId.numocts);
+ }
+
+ vendor->vendor.t35CountryCode = gH323ep.t35CountryCode;
+ vendor->vendor.t35Extension = gH323ep.t35Extension;
+ vendor->vendor.manufacturerCode = gH323ep.manufacturerCode;
+
+ if (!call->fsSent) {
+ ret = ooSetFastStartResponse(call, q931msg,
+ &progress->fastStart.n, &progress->fastStart.elem);
+ if(ret != ASN_OK) { return ret; }
+ if(progress->fastStart.n > 0) {
+ progress->m.fastStartPresent = TRUE;
+ call->fsSent = TRUE;
+ } else
+ progress->m.fastStartPresent = FALSE;
+ } else {
+ progress->m.fastStartPresent = FALSE;
+ }
+
+ /* Add h245 listener address. Do not add H245 listener address in case
+ of tunneling. */
+ if (/* (!OO_TESTFLAG(call->flags, OO_M_FASTSTART) ||
+ call->remoteFastStartOLCs.count == 0) && */
+ !OO_TESTFLAG (call->flags, OO_M_TUNNELING) &&
+ !call->h245listener && ooCreateH245Listener(call) == OO_OK)
+ {
+ progress->m.h245AddressPresent = TRUE;
+ progress->h245Address.t = T_H225TransportAddress_ipAddress;
+
+ h245IpAddr = (H225TransportAddress_ipAddress*)
+ memAllocZ (pctxt, sizeof(H225TransportAddress_ipAddress));
+ if(!h245IpAddr)
+ {
+ OOTRACEERR3("Error:Memory - ooAcceptCall - h245IpAddr"
+ "(%s, %s)\n", call->callType, call->callToken);
+ return OO_FAILED;
+ }
+ ooSocketConvertIpToNwAddr(call->localIP, h245IpAddr->ip.data);
+ h245IpAddr->ip.numocts=4;
+ h245IpAddr->port = *(call->h245listenport);
+ progress->h245Address.u.ipAddress = h245IpAddr;
+ }
+
+ OOTRACEDBGA3("Built Progress (%s, %s)\n", call->callType, call->callToken);
+
+ ret = ooSendH225Msg(call, q931msg);
+ if(ret != OO_OK)
+ {
+ OOTRACEERR3("Error: Failed to enqueue Alerting message to outbound queue. (%s, %s)\n", call->callType, call->callToken);
+ }
+
+ ooSendTCSandMSD(call);
+ memReset (call->msgctxt);
return ret;
}
-int ooSendFacility(OOH323CallData *call)
+int ooSendStartH245Facility(OOH323CallData *call)
{
int ret=0;
Q931Message *pQ931Msg = NULL;
H225Facility_UUIE *facility=NULL;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+ OOCTXT *pctxt = call->msgctxt;
+ H225TransportAddress_ipAddress *h245IpAddr;
OOTRACEDBGA3("Building Facility message (%s, %s)\n", call->callType,
call->callToken);
- ret = ooCreateQ931Message(&pQ931Msg, Q931FacilityMsg);
+ ret = ooCreateQ931Message(pctxt, &pQ931Msg, Q931FacilityMsg);
if(ret != OO_OK)
{
OOTRACEERR3
@@ -1479,7 +1658,29 @@ int ooSendFacility(OOH323CallData *call)
memcpy(facility->callIdentifier.guid.data,
call->callIdentifier.guid.data,
call->callIdentifier.guid.numocts);
- facility->reason.t = T_H225FacilityReason_transportedInformation;
+ facility->reason.t = T_H225FacilityReason_startH245;
+
+ if (!call->h245listener && ooCreateH245Listener(call) != OO_OK) {
+ OOTRACEERR3("Error:No H245Listener, can't send startH245 facility (%s, %s)\n",
+ call->callType, call->callToken);
+ return OO_FAILED;
+ }
+
+ facility->m.h245AddressPresent = TRUE;
+ facility->h245Address.t = T_H225TransportAddress_ipAddress;
+
+ h245IpAddr = (H225TransportAddress_ipAddress*)
+ memAllocZ (pctxt, sizeof(H225TransportAddress_ipAddress));
+ if(!h245IpAddr) {
+ OOTRACEERR3("Error:Memory - ooSendFacility - h245IpAddr"
+ "(%s, %s)\n", call->callType, call->callToken);
+ return OO_FAILED;
+ }
+ ooSocketConvertIpToNwAddr(call->localIP, h245IpAddr->ip.data);
+ h245IpAddr->ip.numocts=4;
+ h245IpAddr->port = *(call->h245listenport);
+ facility->h245Address.u.ipAddress = h245IpAddr;
+
OOTRACEDBGA3("Built Facility message to send (%s, %s)\n", call->callType,
call->callToken);
@@ -1490,7 +1691,8 @@ int ooSendFacility(OOH323CallData *call)
("Error:Failed to enqueue Facility message to outbound "
"queue.(%s, %s)\n", call->callType, call->callToken);
}
- memReset (&gH323ep.msgctxt);
+ /* memReset (&gH323ep.msgctxt); */
+ memReset (call->msgctxt);
return ret;
}
@@ -1502,10 +1704,11 @@ int ooSendReleaseComplete(OOH323CallData *call)
enum Q931CauseValues cause = Q931ErrorInCauseIE;
unsigned h225ReasonCode = T_H225ReleaseCompleteReason_undefinedReason;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+ OOCTXT *pctxt = call->msgctxt;
OOTRACEDBGA3("Building Release Complete message to send(%s, %s)\n",
call->callType, call->callToken);
- ret = ooCreateQ931Message(&q931msg, Q931ReleaseCompleteMsg);
+ ret = ooCreateQ931Message(pctxt, &q931msg, Q931ReleaseCompleteMsg);
if(ret != OO_OK)
{
OOTRACEERR3("Error: In ooCreateQ931Message - H225 Release Complete "
@@ -1539,7 +1742,7 @@ int ooSendReleaseComplete(OOH323CallData *call)
}
memset(releaseComplete, 0, sizeof(H225ReleaseComplete_UUIE));
q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1;
- q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(gH323ep.flags,
+ q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(call->flags,
OO_M_TUNNELING);
q931msg->userInfo->h323_uu_pdu.h323_message_body.t =
T_H225H323_UU_PDU_h323_message_body_releaseComplete;
@@ -1547,8 +1750,10 @@ int ooSendReleaseComplete(OOH323CallData *call)
/* Get cause value and h225 reason code corresponding to OOCallClearReason*/
ooQ931GetCauseAndReasonCodeFromCallClearReason(call->callEndReason,
&cause, &h225ReasonCode);
+ if (call->q931cause == 0)
+ call->q931cause = cause;
/* Set Cause IE */
- ooQ931SetCauseIE(q931msg, cause, 0, 0);
+ ooQ931SetCauseIE(pctxt, q931msg, call->q931cause, 0, 0);
/* Set H225 releaseComplete reasonCode */
releaseComplete->m.reasonPresent = TRUE;
@@ -1579,13 +1784,23 @@ int ooSendReleaseComplete(OOH323CallData *call)
OOTRACEERR3("Error:Failed to enqueue ReleaseComplete message to outbound"
" queue.(%s, %s)\n", call->callType, call->callToken);
}
- memReset(&gH323ep.msgctxt);
+ /* memReset(&gH323ep.msgctxt); */
+ memReset(call->msgctxt);
return ret;
}
int ooSendConnect(OOH323CallData *call)
{
+
+ call->connectTime = (H235TimeStamp) time(NULL);
+
+ if(gH323ep.gkClient && !OO_TESTFLAG(call->flags, OO_M_DISABLEGK)) {
+ if(gH323ep.gkClient->state == GkClientRegistered) {
+ ooGkClientSendIRR(gH323ep.gkClient, call);
+ }
+ }
+
ooAcceptCall(call);
return OO_OK;
}
@@ -1598,9 +1813,10 @@ int ooAcceptCall(OOH323CallData *call)
H225TransportAddress_ipAddress *h245IpAddr;
H225VendorIdentifier *vendor;
Q931Message *q931msg=NULL;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+ OOCTXT *pctxt = call->msgctxt;
- ret = ooCreateQ931Message(&q931msg, Q931ConnectMsg);
+ ret = ooCreateQ931Message(pctxt, &q931msg, Q931ConnectMsg);
if(ret != OO_OK)
{
OOTRACEERR1("Error: In allocating memory for - H225 "
@@ -1610,11 +1826,11 @@ int ooAcceptCall(OOH323CallData *call)
q931msg->callReference = call->callReference;
/* Set bearer capability */
- if(OO_OK != ooSetBearerCapabilityIE(q931msg, Q931CCITTStd,
- Q931TransferUnrestrictedDigital, Q931TransferPacketMode,
- Q931TransferRatePacketMode, Q931UserInfoLayer1G722G725))
- // Q931TransferSpeech, Q931TransferCircuitMode,
- // Q931TransferRate64Kbps, Q931UserInfoLayer1G711ULaw))
+ if(OO_OK != ooSetBearerCapabilityIE(pctxt, q931msg, Q931CCITTStd,
+ // Q931TransferUnrestrictedDigital, Q931TransferPacketMode,
+ // Q931TransferRatePacketMode, Q931UserInfoLayer1G722G725))
+ Q931TransferSpeech, Q931TransferCircuitMode,
+ Q931TransferRate64Kbps, Q931UserInfoLayer1G711ALaw))
{
OOTRACEERR3("Error: Failed to set bearer capability ie. (%s, %s)\n",
call->callType, call->callToken);
@@ -1708,7 +1924,7 @@ int ooAcceptCall(OOH323CallData *call)
vendor->m.productIdPresent = 1;
vendor->productId.numocts = ASN1MIN(strlen(gH323ep.productID),
sizeof(vendor->productId.data));
- strncpy(vendor->productId.data, gH323ep.productID,
+ strncpy((char *)vendor->productId.data, gH323ep.productID,
vendor->productId.numocts);
}
if(gH323ep.versionID)
@@ -1716,27 +1932,42 @@ int ooAcceptCall(OOH323CallData *call)
vendor->m.versionIdPresent = 1;
vendor->versionId.numocts = ASN1MIN(strlen(gH323ep.versionID),
sizeof(vendor->versionId.data));
- strncpy(vendor->versionId.data, gH323ep.versionID,
+ strncpy((char *)vendor->versionId.data, gH323ep.versionID,
vendor->versionId.numocts);
}
- ret = ooSetFastStartResponse(call, q931msg,
- &connect->fastStart.n, &connect->fastStart.elem);
- if(ret != ASN_OK) { return ret; }
- if(connect->fastStart.n > 0) {
- connect->m.fastStartPresent = TRUE;
- }
- else {
+ if (!call->fsSent) {
+ ret = ooSetFastStartResponse(call, q931msg,
+ &connect->fastStart.n, &connect->fastStart.elem);
+ if(ret != ASN_OK) { return ret; }
+ if(connect->fastStart.n > 0) {
+ connect->m.fastStartPresent = TRUE;
+ call->fsSent = TRUE;
+ } else
+ connect->m.fastStartPresent = FALSE;
+ } else {
connect->m.fastStartPresent = FALSE;
}
+ /* free the stored fast start response */
+ if(call->pFastStartRes) {
+ int k;
+ for(k = 0; k < call->pFastStartRes->n; k ++) {
+ memFreePtr(call->pctxt, call->pFastStartRes->elem[k].data);
+ }
+ memFreePtr(call->pctxt, call->pFastStartRes->elem);
+ memFreePtr(call->pctxt, call->pFastStartRes);
+ call->pFastStartRes = NULL;
+ }
+
+
/* Add h245 listener address. Do not add H245 listener address in case
of fast-start. */
- if ((!OO_TESTFLAG(call->flags, OO_M_FASTSTART) ||
- call->remoteFastStartOLCs.count == 0) &&
- !OO_TESTFLAG (call->flags, OO_M_TUNNELING))
+ if (/* (!OO_TESTFLAG(call->flags, OO_M_FASTSTART) ||
+ call->remoteFastStartOLCs.count == 0) && */
+ !OO_TESTFLAG (call->flags, OO_M_TUNNELING) &&
+ !call->h245listener && ooCreateH245Listener(call) == OO_OK)
{
- ooCreateH245Listener(call); /* First create an H.245 listener */
connect->m.h245AddressPresent = TRUE;
connect->h245Address.t = T_H225TransportAddress_ipAddress;
@@ -1765,31 +1996,13 @@ int ooAcceptCall(OOH323CallData *call)
if(ret != OO_OK)
{
OOTRACEERR3("Error:Failed to enqueue Connect message to outbound queue.(%s, %s)\n", call->callType, call->callToken);
- memReset(&gH323ep.msgctxt);
+ /* memReset(&gH323ep.msgctxt);*/
+ memReset(call->msgctxt);
return OO_FAILED;
}
- memReset(&gH323ep.msgctxt);
+ /* memReset(&gH323ep.msgctxt); */
+ memReset(call->msgctxt);
-#if 0
- if (OO_TESTFLAG (call->flags, OO_M_TUNNELING))
- {
- /* Start terminal capability exchange and master slave determination */
- ret = ooSendTermCapMsg(call);
- if(ret != OO_OK)
- {
- OOTRACEERR3("ERROR:Sending Terminal capability message (%s, %s)\n",
- call->callType, call->callToken);
- return ret;
- }
- ret = ooSendMasterSlaveDetermination(call);
- if(ret != OO_OK)
- {
- OOTRACEERR3("ERROR:Sending Master-slave determination message "
- "(%s, %s)\n", call->callType, call->callToken);
- return ret;
- }
- }
-#endif
return OO_OK;
}
@@ -1798,6 +2011,7 @@ int ooH323HandleCallFwdRequest(OOH323CallData *call)
OOH323CallData *fwdedCall=NULL;
OOCTXT *pctxt;
ooAliases *pNewAlias=NULL, *alias=NULL;
+ struct timespec ts;
int i=0, irand=0, ret = OO_OK;
/* Note: We keep same callToken, for new call which is going
to replace an existing call, thus treating it as a single call.*/
@@ -1852,15 +2066,42 @@ int ooH323HandleCallFwdRequest(OOH323CallData *call)
MakeCall command */
ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, fwdedCall, FALSE);
fwdedCall->callState = OO_CALL_WAITING_ADMISSION;
+ ast_mutex_lock(&fwdedCall->Lock);
+ clock_gettime(CLOCK_REALTIME, &ts);
+ ts.tv_sec += 24;
+ ast_cond_timedwait(&fwdedCall->gkWait, &fwdedCall->Lock, &ts);
+ if (fwdedCall->callState == OO_CALL_WAITING_ADMISSION) /* GK is not responding */
+ fwdedCall->callState = OO_CALL_CLEAR;
+ ast_mutex_unlock(&fwdedCall->Lock);
+
}
- else {
+ if (fwdedCall->callState < OO_CALL_CLEAR) {
+ ast_mutex_lock(&fwdedCall->Lock);
ret = ooH323CallAdmitted (fwdedCall);
+ ast_mutex_unlock(&fwdedCall->Lock);
}
return OO_OK;
}
+int ooH323NewCall(char *callToken) {
+ OOH323CallData* call;
+ if(!callToken)
+ {
+ OOTRACEERR1("ERROR: Invalid callToken parameter to make call\n");
+ return OO_FAILED;
+ }
+ call = ooCreateCall("outgoing", callToken);
+ if (!call)
+ {
+ OOTRACEERR1("ERROR: Can't create call %s\n");
+ return OO_FAILED;
+ }
+
+ return OO_OK;
+}
+
int ooH323MakeCall(char *dest, char *callToken, ooCallOptions *opts)
{
OOCTXT *pctxt;
@@ -1868,6 +2109,7 @@ int ooH323MakeCall(char *dest, char *callToken, ooCallOptions *opts)
int ret=0, i=0, irand=0;
char tmp[30]="\0";
char *ip=NULL, *port = NULL;
+ struct timespec ts;
if(!dest)
{
@@ -1880,7 +2122,14 @@ int ooH323MakeCall(char *dest, char *callToken, ooCallOptions *opts)
return OO_FAILED;
}
- call = ooCreateCall("outgoing", callToken);
+ /* call = ooCreateCall("outgoing", callToken); */
+ call = ooFindCallByToken(callToken);
+ if (!call)
+ {
+ OOTRACEERR1("ERROR: Can't create call %s\n");
+ return OO_FAILED;
+ }
+
pctxt = call->pctxt;
if(opts)
{
@@ -1900,10 +2149,11 @@ int ooH323MakeCall(char *dest, char *callToken, ooCallOptions *opts)
OO_CLRFLAG(call->flags, OO_M_DISABLEGK);
call->callMode = opts->callMode;
+ call->transfercap = opts->transfercap;
}
- ret = ooParseDestination(call, dest, tmp, 30, &call->remoteAliases);
+ ret = ooParseDestination(call, dest, tmp, 24, &call->remoteAliases);
if(ret != OO_OK)
{
OOTRACEERR2("Error: Failed to parse the destination string %s for "
@@ -1936,14 +2186,28 @@ int ooH323MakeCall(char *dest, char *callToken, ooCallOptions *opts)
{
/* No need to check registration status here as it is already checked for
MakeCall command */
- ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, call, FALSE);
- call->callState = OO_CALL_WAITING_ADMISSION;
- }
- else {
- /* Send as H225 message to calling endpoint */
- ret = ooH323CallAdmitted (call);
+
+ call->callState = OO_CALL_WAITING_ADMISSION;
+ ast_mutex_lock(&call->Lock);
+ ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, call, FALSE);
+ clock_gettime(CLOCK_REALTIME, &ts);
+ ts.tv_sec += 24;
+ ast_cond_timedwait(&call->gkWait, &call->Lock, &ts);
+ if (call->callState == OO_CALL_WAITING_ADMISSION)
+ call->callState = OO_CALL_CLEAR;
+ ast_mutex_unlock(&call->Lock);
+
}
+ /* Send as H225 message to calling endpoint */
+ ast_mutex_lock(&call->Lock);
+ if (call->callState < OO_CALL_CLEAR)
+ if ((ret = ooH323CallAdmitted (call)) != OO_OK) {
+ ast_mutex_unlock(&call->Lock);
+ return ret;
+ }
+ ast_mutex_unlock(&call->Lock);
+
return OO_OK;
}
@@ -1972,6 +2236,11 @@ int ooH323CallAdmitted(OOH323CallData *call)
}
return OO_FAILED;
}
+
+ if(gH323ep.h323Callbacks.onOutgoingCall) {
+ /* Outgoing call callback function */
+ gH323ep.h323Callbacks.onOutgoingCall(call);
+ }
ret = ooH323MakeCall_helper(call);
}
@@ -2012,9 +2281,10 @@ int ooH323MakeCall_helper(OOH323CallData *call)
ASN1BOOL aligned = 1;
ooAliases *pAlias = NULL;
- pctxt = &gH323ep.msgctxt;
+ /* pctxt = &gH323ep.msgctxt; */
+ pctxt = call->msgctxt;
- ret = ooCreateQ931Message(&q931msg, Q931SetupMsg);
+ ret = ooCreateQ931Message(pctxt, &q931msg, Q931SetupMsg);
if(ret != OO_OK)
{
OOTRACEERR1("ERROR:Failed to Create Q931 SETUP Message\n ");
@@ -2024,10 +2294,11 @@ int ooH323MakeCall_helper(OOH323CallData *call)
q931msg->callReference = call->callReference;
/* Set bearer capability */
- if(OO_OK != ooSetBearerCapabilityIE(q931msg, Q931CCITTStd,
- Q931TransferUnrestrictedDigital, Q931TransferPacketMode,
- Q931TransferRatePacketMode, Q931UserInfoLayer1G722G725))
-// Q931TransferRate64Kbps, Q931UserInfoLayer1G711ULaw))
+ if(OO_OK != ooSetBearerCapabilityIE(pctxt, q931msg, Q931CCITTStd,
+ // Q931TransferUnrestrictedDigital, Q931TransferPacketMode,
+ call->transfercap, Q931TransferCircuitMode,
+ // Q931TransferRatePacketMode, Q931UserInfoLayer1G722G725))
+ Q931TransferRate64Kbps, Q931UserInfoLayer1G711ALaw))
{
OOTRACEERR3("Error: Failed to set bearer capability ie.(%s, %s)\n",
call->callType, call->callToken);
@@ -2035,14 +2306,14 @@ int ooH323MakeCall_helper(OOH323CallData *call)
}
/* Set calling party number Q931 IE */
- if(call->callingPartyNumber)
- ooQ931SetCallingPartyNumberIE(q931msg,
+ if(call->callingPartyNumber && call->callingPartyNumber[0])
+ ooQ931SetCallingPartyNumberIE(pctxt, q931msg,
(const char*)call->callingPartyNumber, 1, 0, 0, 0);
/* Set called party number Q931 IE */
if(call->calledPartyNumber)
- ooQ931SetCalledPartyNumberIE(q931msg,
+ ooQ931SetCalledPartyNumberIE(pctxt, q931msg,
(const char*)call->calledPartyNumber, 1, 0);
else if(call->remoteAliases) {
pAlias = call->remoteAliases;
@@ -2063,7 +2334,7 @@ int ooH323MakeCall_helper(OOH323CallData *call)
return OO_FAILED;
}
strcpy(call->calledPartyNumber, pAlias->value);
- ooQ931SetCalledPartyNumberIE(q931msg,
+ ooQ931SetCalledPartyNumberIE(pctxt, q931msg,
(const char*)call->calledPartyNumber, 1, 0);
}
@@ -2208,7 +2479,7 @@ int ooH323MakeCall_helper(OOH323CallData *call)
setup->sourceCallSignalAddress.u.ipAddress = srcCallSignalIpAddress;
setup->m.sourceCallSignalAddressPresent=TRUE;
/* No fast start */
- if(!OO_TESTFLAG(gH323ep.flags, OO_M_FASTSTART))
+ if(!OO_TESTFLAG(call->flags, OO_M_FASTSTART))
{
setup->m.fastStartPresent = FALSE;
}
@@ -2257,7 +2528,10 @@ int ooH323MakeCall_helper(OOH323CallData *call)
continue;
}
+/* don't send t38/other data caps in fasstart olcs */
+ if (epCap->capType == OO_CAP_TYPE_DATA)
+ continue;
OOTRACEDBGC4("Building olcs with capability %s. (%s, %s)\n",
ooGetCapTypeText(epCap->cap), call->callType,
@@ -2270,7 +2544,7 @@ int ooH323MakeCall_helper(OOH323CallData *call)
{
OOTRACEERR3("ERROR:Memory - ooH323MakeCall_helper - olc(%s, %s)"
"\n", call->callType, call->callToken);
- ooFreeQ931Message(q931msg);
+ ooFreeQ931Message(pctxt, q931msg);
if(call->callState < OO_CALL_CLEAR)
{
call->callEndReason = OO_REASON_LOCAL_CLEARED;
@@ -2290,7 +2564,7 @@ int ooH323MakeCall_helper(OOH323CallData *call)
{
OOTRACEERR3("ERROR:Encoding of olc failed for faststart(%s, %s)"
"\n", call->callType, call->callToken);
- ooFreeQ931Message(q931msg);
+ ooFreeQ931Message(pctxt, q931msg);
if(call->callState < OO_CALL_CLEAR)
{
call->callEndReason = OO_REASON_LOCAL_CLEARED;
@@ -2298,11 +2572,11 @@ int ooH323MakeCall_helper(OOH323CallData *call)
}
return OO_FAILED;
}
- pFS[i].data = encodeGetMsgPtr(pctxt, &(pFS[i].numocts));
+ pFS[i].data = (unsigned char *)encodeGetMsgPtr(pctxt, (int *)&(pFS[i].numocts));
/* Dump faststart element in logfile for debugging purpose */
- setPERBuffer(pctxt, (char*)pFS[i].data, pFS[i].numocts, 1);
+ setPERBuffer(pctxt, (unsigned char*)pFS[i].data, pFS[i].numocts, 1);
initializePrintHandler(&printHandler, "FastStart Element");
setEventHandler (pctxt, &printHandler);
memset(&printOlc, 0, sizeof(printOlc));
@@ -2311,7 +2585,7 @@ int ooH323MakeCall_helper(OOH323CallData *call)
{
OOTRACEERR3("Error: Failed decoding FastStart Element."
"(%s, %s)\n", call->callType, call->callToken);
- ooFreeQ931Message(q931msg);
+ ooFreeQ931Message(pctxt, q931msg);
if(call->callState < OO_CALL_CLEAR)
{
call->callEndReason = OO_REASON_LOCAL_CLEARED;
@@ -2338,7 +2612,7 @@ int ooH323MakeCall_helper(OOH323CallData *call)
{
OOTRACEERR3("ERROR:Memory - ooH323MakeCall_helper - olc(%s, %s)"
"\n", call->callType, call->callToken);
- ooFreeQ931Message(q931msg);
+ ooFreeQ931Message(pctxt, q931msg);
if(call->callState < OO_CALL_CLEAR)
{
call->callEndReason = OO_REASON_LOCAL_CLEARED;
@@ -2358,7 +2632,7 @@ int ooH323MakeCall_helper(OOH323CallData *call)
{
OOTRACEERR3("ERROR:Encoding of olc failed for faststart(%s, %s)"
"\n", call->callType, call->callToken);
- ooFreeQ931Message(q931msg);
+ ooFreeQ931Message(pctxt, q931msg);
if(call->callState < OO_CALL_CLEAR)
{
call->callEndReason = OO_REASON_LOCAL_CLEARED;
@@ -2366,10 +2640,10 @@ int ooH323MakeCall_helper(OOH323CallData *call)
}
return OO_FAILED;
}
- pFS[i].data = encodeGetMsgPtr(pctxt, &(pFS[i].numocts));
+ pFS[i].data = (unsigned char *)encodeGetMsgPtr(pctxt, (int *)&(pFS[i].numocts));
/* Dump faststart element in logfile for debugging purpose */
- setPERBuffer(pctxt, (char*)pFS[i].data, pFS[i].numocts, 1);
+ setPERBuffer(pctxt, (unsigned char*)pFS[i].data, pFS[i].numocts, 1);
initializePrintHandler(&printHandler, "FastStart Element");
setEventHandler (pctxt, &printHandler);
memset(&printOlc, 0, sizeof(printOlc));
@@ -2378,7 +2652,7 @@ int ooH323MakeCall_helper(OOH323CallData *call)
{
OOTRACEERR3("Error: Failed decoding FastStart Element."
"(%s, %s)\n", call->callType, call->callToken);
- ooFreeQ931Message(q931msg);
+ ooFreeQ931Message(pctxt, q931msg);
if(call->callState < OO_CALL_CLEAR)
{
call->callEndReason = OO_REASON_LOCAL_CLEARED;
@@ -2442,8 +2716,10 @@ int ooH323MakeCall_helper(OOH323CallData *call)
/* For H.323 version 4 and higher, if fast connect, tunneling should be
supported.
*/
- if(OO_TESTFLAG(call->flags, OO_M_FASTSTART))
+ if(OO_TESTFLAG(call->flags, OO_M_FASTSTART)) {
q931msg->userInfo->h323_uu_pdu.h245Tunneling = TRUE;
+ OO_SETFLAG(call->flags, OO_M_TUNNELING);
+ }
OOTRACEDBGA3("Built SETUP message (%s, %s)\n", call->callType,
call->callToken);
@@ -2457,7 +2733,8 @@ int ooH323MakeCall_helper(OOH323CallData *call)
{
OOTRACEERR3("Error:Failed to enqueue SETUP message to outbound queue. (%s, %s)\n", call->callType, call->callToken);
}
- memReset(&gH323ep.msgctxt);
+ /* memReset(&gH323ep.msgctxt);*/
+ memReset(call->msgctxt);
return ret;
}
@@ -2469,9 +2746,10 @@ int ooQ931SendDTMFAsKeyPadIE(OOH323CallData *call, const char* data)
int ret;
H225Information_UUIE *information=NULL;
Q931Message *q931msg=NULL;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+ OOCTXT *pctxt = call->msgctxt;
- ret = ooCreateQ931Message(&q931msg, Q931InformationMsg);
+ ret = ooCreateQ931Message(pctxt, &q931msg, Q931InformationMsg);
if(ret != OO_OK)
{
OOTRACEERR3("Error: In allocating memory for - H225 Information message."
@@ -2487,11 +2765,12 @@ int ooQ931SendDTMFAsKeyPadIE(OOH323CallData *call, const char* data)
{
OOTRACEERR3("ERROR:Memory - ooQ931SendDTMFAsKeypadIE - userInfo"
"(%s, %s)\n", call->callType, call->callToken);
- memReset(&gH323ep.msgctxt);
+ /* memReset(&gH323ep.msgctxt); */
+ memReset(call->msgctxt);
return OO_FAILED;
}
q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1;
- q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(gH323ep.flags,
+ q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(call->flags,
OO_M_TUNNELING);
q931msg->userInfo->h323_uu_pdu.h323_message_body.t =
T_H225H323_UU_PDU_h323_message_body_information;
@@ -2502,7 +2781,8 @@ int ooQ931SendDTMFAsKeyPadIE(OOH323CallData *call, const char* data)
{
OOTRACEERR3("ERROR:Memory - ooQ931SendDTMFAsKeypadIE - information"
"(%s, %s)\n", call->callType, call->callToken);
- memReset(&gH323ep.msgctxt);
+ /* memReset(&gH323ep.msgctxt); */
+ memReset(call->msgctxt);
return OO_FAILED;
}
q931msg->userInfo->h323_uu_pdu.h323_message_body.u.information =
@@ -2516,12 +2796,13 @@ int ooQ931SendDTMFAsKeyPadIE(OOH323CallData *call, const char* data)
information->protocolIdentifier = gProtocolID;
/*Add keypad IE*/
- ret = ooQ931SetKeypadIE(q931msg, data);
+ ret = ooQ931SetKeypadIE(pctxt, q931msg, data);
if(ret != OO_OK)
{
OOTRACEERR3("Error:Creating keypad IE for (%s, %s)\n", call->callType,
call->callToken);
- memReset(&gH323ep.msgctxt);
+ /* memReset(&gH323ep.msgctxt); */
+ memReset(call->msgctxt);
return OO_FAILED;
}
@@ -2531,7 +2812,8 @@ int ooQ931SendDTMFAsKeyPadIE(OOH323CallData *call, const char* data)
OOTRACEERR3("Error:Failed to enqueue Information message to outbound "
"queue. (%s, %s)\n", call->callType, call->callToken);
}
- memReset(&gH323ep.msgctxt);
+ /* memReset(&gH323ep.msgctxt); */
+ memReset(call->msgctxt);
return ret;
@@ -2586,7 +2868,7 @@ int ooH323ForwardCall(char* callToken, char *dest)
strcpy(call->pCallFwdData->ip, ip);
}
- ret = ooCreateQ931Message(&pQ931Msg, Q931FacilityMsg);
+ ret = ooCreateQ931Message(pctxt, &pQ931Msg, Q931FacilityMsg);
if(ret != OO_OK)
{
OOTRACEERR3
@@ -2683,7 +2965,7 @@ int ooH323ForwardCall(char* callToken, char *dest)
return ret;
}
-int ooH323HangCall(char * callToken, OOCallClearReason reason)
+int ooH323HangCall(char * callToken, OOCallClearReason reason, int q931cause)
{
OOH323CallData *call;
@@ -2698,19 +2980,20 @@ int ooH323HangCall(char * callToken, OOCallClearReason reason)
if(call->callState < OO_CALL_CLEAR)
{
call->callEndReason = reason;
+ call->q931cause = q931cause;
call->callState = OO_CALL_CLEAR;
}
return OO_OK;
}
int ooSetBearerCapabilityIE
- (Q931Message *pmsg, enum Q931CodingStandard codingStandard,
+ (OOCTXT* pctxt, Q931Message *pmsg, enum Q931CodingStandard codingStandard,
enum Q931InformationTransferCapability capability,
enum Q931TransferMode transferMode, enum Q931TransferRate transferRate,
enum Q931UserInfoLayer1Protocol userInfoLayer1)
{
unsigned size = 3;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
if(pmsg->bearerCapabilityIE)
{
@@ -2738,10 +3021,10 @@ int ooSetBearerCapabilityIE
return OO_OK;
}
-int ooQ931SetKeypadIE(Q931Message *pmsg, const char* data)
+int ooQ931SetKeypadIE(OOCTXT* pctxt, Q931Message *pmsg, const char* data)
{
unsigned len = 0;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
len = strlen(data);
pmsg->keypadIE = (Q931InformationElement*)
@@ -2762,11 +3045,11 @@ int ooQ931SetKeypadIE(Q931Message *pmsg, const char* data)
int ooQ931SetCallingPartyNumberIE
- (Q931Message *pmsg, const char *number, unsigned plan, unsigned type,
+ (OOCTXT* pctxt, Q931Message *pmsg, const char *number, unsigned plan, unsigned type,
unsigned presentation, unsigned screening)
{
unsigned len = 0;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
if(pmsg->callingPartyNumberIE)
{
@@ -2793,10 +3076,10 @@ int ooQ931SetCallingPartyNumberIE
}
int ooQ931SetCalledPartyNumberIE
- (Q931Message *pmsg, const char *number, unsigned plan, unsigned type)
+ (OOCTXT* pctxt, Q931Message *pmsg, const char *number, unsigned plan, unsigned type)
{
unsigned len = 0;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
if(pmsg->calledPartyNumberIE)
{
@@ -2822,10 +3105,10 @@ int ooQ931SetCalledPartyNumberIE
}
int ooQ931SetCauseIE
- (Q931Message *pmsg, enum Q931CauseValues cause, unsigned coding,
+ (OOCTXT* pctxt, Q931Message *pmsg, enum Q931CauseValues cause, unsigned coding,
unsigned location)
{
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
if(pmsg->causeIE){
memFreePtr(pctxt, pmsg->causeIE);
@@ -2859,12 +3142,13 @@ int ooSendAsTunneledMessage(OOH323CallData *call, ASN1OCTET* msgbuf,
ASN1DynOctStr * elem;
int ret =0;
H225Facility_UUIE *facility=NULL;
- OOCTXT *pctxt = &gH323ep.msgctxt;
+ /* OOCTXT *pctxt = &gH323ep.msgctxt; */
+ OOCTXT *pctxt = call->msgctxt;
OOTRACEDBGA4("Building Facility message for tunneling %s (%s, %s)\n",
ooGetMsgTypeText(h245MsgType), call->callType, call->callToken);
- ret = ooCreateQ931Message(&pQ931Msg, Q931FacilityMsg);
+ ret = ooCreateQ931Message(pctxt, &pQ931Msg, Q931FacilityMsg);
if(ret != OO_OK)
{
OOTRACEERR3("ERROR: In allocating memory for facility message "
@@ -2880,7 +3164,8 @@ int ooSendAsTunneledMessage(OOH323CallData *call, ASN1OCTET* msgbuf,
{
OOTRACEERR3("ERROR:Memory - ooSendAsTunneledMessage - userInfo"
" (%s, %s)\n", call->callType, call->callToken);
- memReset(&gH323ep.msgctxt);
+ /* memReset(&gH323ep.msgctxt);*/
+ memReset(call->msgctxt);
return OO_FAILED;
}
memset (pQ931Msg->userInfo, 0, sizeof(H225H323_UserInformation));
@@ -2899,7 +3184,8 @@ int ooSendAsTunneledMessage(OOH323CallData *call, ASN1OCTET* msgbuf,
{
OOTRACEERR3("ERROR:Memory - ooSendAsTunneledMessage - facility (%s, %s)"
"\n", call->callType, call->callToken);
- memReset(&gH323ep.msgctxt);
+ /* memReset(&gH323ep.msgctxt); */
+ memReset(call->msgctxt);
return OO_FAILED;
}
@@ -2951,7 +3237,8 @@ int ooSendAsTunneledMessage(OOH323CallData *call, ASN1OCTET* msgbuf,
main received H225 message processing is finished. Rule. No reset when
tunneling
*/
- memFreePtr(&gH323ep.msgctxt, pQ931Msg);
+ /* memFreePtr(&gH323ep.msgctxt, pQ931Msg); */
+ memFreePtr(call->msgctxt, pQ931Msg);
return ret;
}
@@ -3378,7 +3665,11 @@ const char* ooGetMsgTypeText (int msgType)
"OORequestChannelCloseAck",
"OORequestChannelCloseReject",
"OORequestChannelCloseRelease",
- "OOEndSessionCommand"
+ "OOEndSessionCommand",
+ "OOUserInputIndication",
+ "OORequestModeAck",
+ "OORequestModeReject",
+ "OORequestMode"
};
int idx = msgType - OO_MSGTYPE_MIN;
return ooUtilsGetText (idx, msgTypeText, OONUMBEROF(msgTypeText));
diff --git a/addons/ooh323c/src/ooq931.h b/addons/ooh323c/src/ooq931.h
index a61ef8e6e..c70771b41 100644
--- a/addons/ooh323c/src/ooq931.h
+++ b/addons/ooh323c/src/ooq931.h
@@ -45,7 +45,7 @@ extern "C" {
#define OO_MAX_NUMBER_LENGTH 50
/* Maximum value for a call token identifier */
-#define OO_MAX_CALL_TOKEN 9999
+#define OO_MAX_CALL_TOKEN 999999
/* Q.931 packet must be at least 5 bytes long */
#define Q931_E_TOOSHORT (-1001)
@@ -346,7 +346,7 @@ EXTERN int ooQ931Decode
*
* @return OO_OK, on success. OO_FAILED, on failure.
*/
-EXTERN int ooDecodeUUIE(Q931Message *q931Msg);
+EXTERN int ooDecodeUUIE(OOCTXT* pctxt, Q931Message *q931Msg);
/**
* This function is used to encode the UUIE field of the Q931 message.
@@ -356,7 +356,7 @@ EXTERN int ooDecodeUUIE(Q931Message *q931Msg);
*
* @return OO_OK, on success. OO_FAILED, on failure.
*/
-EXTERN int ooEncodeUUIE(Q931Message *q931msg);
+EXTERN int ooEncodeUUIE(OOCTXT* pctxt, Q931Message *q931msg);
/**
* This function is invoked to retrieve an IE element from a Q931 message.
@@ -388,7 +388,7 @@ EXTERN void ooQ931Print (const Q931Message* q931msg);
*
* @return Completion status - 0 on success, -1 on failure
*/
-EXTERN int ooCreateQ931Message(Q931Message **msg, int msgType);
+EXTERN int ooCreateQ931Message(OOCTXT* pctxt, Q931Message **msg, int msgType);
/**
* This function is invoked to generate a unique call reference number.
@@ -414,7 +414,7 @@ EXTERN int ooGenerateCallIdentifier(H225CallIdentifier *callid);
*
* @return Completion status - 0 on success, -1 on failure
*/
-EXTERN int ooFreeQ931Message(Q931Message *q931Msg);
+EXTERN int ooFreeQ931Message(OOCTXT* pctxt, Q931Message *q931Msg);
/**
* This function is invoked to retrive the outgoing message buffer for
@@ -467,6 +467,8 @@ EXTERN int ooSendCallProceeding(struct OOH323CallData *call);
*/
EXTERN int ooSendAlerting(struct OOH323CallData *call);
+EXTERN int ooSendProgress(struct OOH323CallData *call);
+
/**
* This function is invoked to send Facility message.
*
@@ -549,7 +551,7 @@ EXTERN int ooH323ForwardCall(char* callToken, char *dest);
*
* @return OO_OK, on success. OO_FAILED, on failure.
*/
-EXTERN int ooH323HangCall(char * callToken, OOCallClearReason reason);
+EXTERN int ooH323HangCall(char * callToken, OOCallClearReason reason, int q931);
/**
@@ -648,7 +650,7 @@ int ooCallEstbTimerExpired(void *data);
*
* @return OO_OK on success, OO_FAILED, on failure.
*/
-EXTERN int ooQ931SetKeypadIE(Q931Message *pmsg, const char* data);
+EXTERN int ooQ931SetKeypadIE(OOCTXT* pctxt, Q931Message *pmsg, const char* data);
/**
* This function is used to add a bearer capability IE to a Q931 message.
@@ -663,7 +665,7 @@ EXTERN int ooQ931SetKeypadIE(Q931Message *pmsg, const char* data);
* @return OO_OK on success, OO_FAILED, on failure.
*/
EXTERN int ooSetBearerCapabilityIE
- (Q931Message *pmsg, enum Q931CodingStandard codingStandard,
+ (OOCTXT* pctxt, Q931Message *pmsg, enum Q931CodingStandard codingStandard,
enum Q931InformationTransferCapability capability,
enum Q931TransferMode transferMode, enum Q931TransferRate transferRate,
enum Q931UserInfoLayer1Protocol userInfoLayer1);
@@ -679,7 +681,7 @@ EXTERN int ooSetBearerCapabilityIE
* @return OO_OK, on success. OO_FAILED, on failure.
*/
EXTERN int ooQ931SetCalledPartyNumberIE
- (Q931Message *pmsg, const char *number, unsigned plan, unsigned type);
+ (OOCTXT *pctxt, Q931Message *pmsg, const char *number, unsigned plan, unsigned type);
/**
@@ -696,7 +698,7 @@ EXTERN int ooQ931SetCalledPartyNumberIE
* @return OO_OK, on success. OO_FAILED, on failure.
*/
EXTERN int ooQ931SetCallingPartyNumberIE
- (Q931Message *pmsg, const char *number, unsigned plan, unsigned type,
+ (OOCTXT* pctxt, Q931Message *pmsg, const char *number, unsigned plan, unsigned type,
unsigned presentation, unsigned screening);
/**
@@ -709,7 +711,7 @@ EXTERN int ooQ931SetCallingPartyNumberIE
* @return OO_OK, on success. OO_FAILED, on failure.
*/
EXTERN int ooQ931SetCauseIE
- (Q931Message *pmsg,enum Q931CauseValues cause, unsigned coding,
+ (OOCTXT *pctxt, Q931Message *pmsg,enum Q931CauseValues cause, unsigned coding,
unsigned location);
/**
@@ -756,6 +758,13 @@ EXTERN const char* ooGetMsgTypeText (int msgType);
*/
EXTERN const char* ooGetQ931CauseValueText (int val);
+EXTERN int ooH323NewCall(char *callToken);
+
+EXTERN char* ooQ931GetMessageTypeName(int messageType, char* buf);
+EXTERN char* ooQ931GetIEName(int number, char* buf);
+EXTERN int ooSendTCSandMSD(struct OOH323CallData *call);
+EXTERN int ooSendStartH245Facility(struct OOH323CallData *call);
+
/**
* @}
*/
diff --git a/addons/ooh323c/src/ootrace.c b/addons/ooh323c/src/ootrace.c
index 0fd5a68ed..ac71a3078 100644
--- a/addons/ooh323c/src/ootrace.c
+++ b/addons/ooh323c/src/ootrace.c
@@ -14,6 +14,8 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
@@ -37,8 +39,9 @@ void ooSetTraceThreshold(OOUINT32 traceLevel)
gs_traceLevel = traceLevel;
}
-void ooTrace(OOUINT32 traceLevel, const char * fmtspec, ...)
-{
+void ooTrace(OOUINT32 traceLevel, const char * fmtspec, ...) __attribute__((format(printf, 2, 3)));
+
+void ooTrace(OOUINT32 traceLevel, const char * fmtspec, ...) {
va_list arglist;
char logMessage[MAXLOGMSGLEN];
if(traceLevel > gs_traceLevel) return;
@@ -70,7 +73,7 @@ void ooTraceLogMessage(const char * logMessage)
#else
struct tm *ptime;
- char dateString[15];
+ char dateString[10];
time_t t = time(NULL);
ptime = localtime(&t);
strftime(timeString, 100, "%H:%M:%S", ptime);
@@ -100,7 +103,7 @@ void ooTraceLogMessage(const char * logMessage)
if(printDate)
{
printDate = 0;
- strftime(dateString, 15, "%m/%d/%Y", ptime);
+ strftime(dateString, 10, "%d", ptime);
fprintf(gH323ep.fptraceFile, "---------Date %s---------\n",
dateString);
}
diff --git a/addons/ooh323c/src/ootrace.h b/addons/ooh323c/src/ootrace.h
index 9678c8979..1f4e6c570 100644
--- a/addons/ooh323c/src/ootrace.h
+++ b/addons/ooh323c/src/ootrace.h
@@ -52,10 +52,11 @@
#define TRACELVL 1
#endif
-#define OOTRACEERR1(a) ooTrace(OOTRCLVLERR,"%s", a)
+#define OOTRACEERR1(a) ooTrace(OOTRCLVLERR,a)
#define OOTRACEERR2(a,b) ooTrace(OOTRCLVLERR,a,b)
#define OOTRACEERR3(a,b,c) ooTrace(OOTRCLVLERR,a,b,c)
#define OOTRACEERR4(a,b,c,d) ooTrace(OOTRCLVLERR,a,b,c,d)
+#define OOTRACEERR5(a,b,c,d,e) ooTrace(OOTRCLVLERR,a,b,c,d,e)
#define OOTRACEWARN1(a) ooTrace(OOTRCLVLWARN,a)
#define OOTRACEWARN2(a,b) ooTrace(OOTRCLVLWARN,a,b)
#define OOTRACEWARN3(a,b,c) ooTrace(OOTRCLVLWARN,a,b,c)
@@ -72,7 +73,7 @@
#define OOTRACEDBGA3(a,b,c) ooTrace(OOTRCLVLDBGA,a,b,c)
#define OOTRACEDBGA4(a,b,c,d) ooTrace(OOTRCLVLDBGA,a,b,c,d)
#define OOTRACEDBGA5(a,b,c,d,e) ooTrace(OOTRCLVLDBGA,a,b,c,d,e)
-#define OOTRACEDBGB1(a) ooTrace(OOTRCLVLDBGB,"%s",a)
+#define OOTRACEDBGB1(a) ooTrace(OOTRCLVLDBGB,a)
#define OOTRACEDBGB2(a,b) ooTrace(OOTRCLVLDBGB,a,b)
#define OOTRACEDBGB3(a,b,c) ooTrace(OOTRCLVLDBGB,a,b,c)
#define OOTRACEDBGB4(a,b,c,d) ooTrace(OOTRCLVLDBGB,a,b,c,d)
@@ -129,7 +130,7 @@ EXTERN void ooSetTraceThreshold(OOUINT32 traceLevel);
*
* @return - none
*/
-EXTERN void ooTrace(OOUINT32 traceLevel, const char * fmtspec, ...)__attribute__((format(printf, 2, 3)));
+EXTERN void ooTrace(OOUINT32 traceLevel, const char * fmtspec, ...);
/**
* Helper function for the trace function. This function performs actual
diff --git a/addons/ooh323c/src/ootypes.h b/addons/ooh323c/src/ootypes.h
index 51b97e41c..24bb6a2db 100644
--- a/addons/ooh323c/src/ootypes.h
+++ b/addons/ooh323c/src/ootypes.h
@@ -61,7 +61,7 @@
-#define OOH323C_VERSION "v0.8.3"
+#define OOH323C_VERSION "v0.8.3m"
#ifndef EXTERN
#ifdef MAKE_DLL
@@ -92,6 +92,11 @@ typedef enum OOMasterSlaveState {
OO_MasterSlave_Slave
} OOMasterSlaveState;
+typedef enum OOMSAckStatus {
+ OO_msAck_localSent,
+ OO_msAck_remoteReceived
+} OOMSAckStatus;
+
/**
* States defined for the capability exchange procedure.
*/
@@ -180,8 +185,11 @@ typedef enum OOCallClearReason {
#define OORequestChannelCloseRelease 128
#define OOEndSessionCommand 129
#define OOUserInputIndication 130
+#define OORequestModeAck 131
+#define OORequestModeReject 132
+#define OORequestMode 133
-#define OO_MSGTYPE_MAX 130
+#define OO_MSGTYPE_MAX 133
/* Timer types */
#define OO_CALLESTB_TIMER (1<<0)
@@ -238,6 +246,7 @@ typedef struct ooCallOptions {
OOBOOL tunneling; /*!< Use H.245 tunneling */
OOBOOL disableGk; /*!< Disable use of gatekeeper */
OOCallMode callMode; /*!< Type of channel to setup with FastStart */
+ int transfercap; /* q931 cap */
}ooCallOptions;
diff --git a/addons/ooh323c/src/perutil.c b/addons/ooh323c/src/perutil.c
index c3c7b3696..4d9a84eb5 100644
--- a/addons/ooh323c/src/perutil.c
+++ b/addons/ooh323c/src/perutil.c
@@ -14,6 +14,9 @@
*
*****************************************************************************/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+
#include "ooasn1.h"
#include "ooper.h"
diff --git a/addons/ooh323c/src/printHandler.c b/addons/ooh323c/src/printHandler.c
index 097aac877..47c511f96 100644
--- a/addons/ooh323c/src/printHandler.c
+++ b/addons/ooh323c/src/printHandler.c
@@ -17,10 +17,13 @@
the fields of an encoded PER message to stdout in a structured output
format..
*/
+#include <asterisk.h>
+#include <asterisk/lock.h>
+
#include <stdlib.h>
-#ifdef HAVE_MALLOC_H
+/* #ifdef HAVE_MALLOC_H
#include <malloc.h>
-#endif
+#endif */
#include "printHandler.h"
#include "ootypes.h"
#include "rtctype.h"
@@ -37,6 +40,10 @@ static const char* bitStrToString
static const char* octStrToString
(ASN1UINT numocts, const ASN1OCTET* data, char* buffer, size_t bufsiz);
+void printCharStr32BitValue (ASN1UINT nchars, ASN132BITCHAR* data);
+void ooPrintOIDValue (ASN1OBJID* pOID);
+void printRealValue (double value);
+
void initializePrintHandler(EventHandler *printHandler, char * varname)
{
printHandler->startElement = &printStartElement;
diff --git a/addons/ooh323c/src/printHandler.h b/addons/ooh323c/src/printHandler.h
index 30d87295d..73f225b1f 100644
--- a/addons/ooh323c/src/printHandler.h
+++ b/addons/ooh323c/src/printHandler.h
@@ -28,8 +28,8 @@
extern EventHandler printHandler;
void initializePrintHandler(EventHandler *printHandler, char * varname);
-void finishPrint();
-void indent ();
+void finishPrint(void);
+void indent (void);
void printStartElement (const char* name, int index );
void printEndElement (const char* name, int index );
void printBoolValue (ASN1BOOL value);
@@ -39,7 +39,7 @@ void printBitStrValue (ASN1UINT numbits, const ASN1OCTET* data);
void printOctStrValue (ASN1UINT numocts, const ASN1OCTET* data);
void printCharStrValue (const char* value);
void printCharStr16BitValue (ASN1UINT nchars, ASN116BITCHAR* data);
-void printNullValue ();
+void printNullValue (void);
void printOidValue (ASN1UINT numSubIds, ASN1UINT* pSubIds);
void printEnumValue (ASN1UINT value);
void printOpenTypeValue (ASN1UINT numocts, const ASN1OCTET* data);
diff --git a/addons/ooh323c/src/rtctype.c b/addons/ooh323c/src/rtctype.c
index 4ea7977f3..ea51bdbd3 100644
--- a/addons/ooh323c/src/rtctype.c
+++ b/addons/ooh323c/src/rtctype.c
@@ -16,6 +16,9 @@
/* Run-time ctype substitution */
+#include <asterisk.h>
+#include <asterisk/lock.h>
+
#include "ooasn1.h"
#include "rtctype.h"