提交 e01c1022 authored 作者: Michael Jerris's avatar Michael Jerris

Add files for 5ess Dialect, numerous formatting and typo fixes. MODENDP-43 and MODENDP-44.

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@346 a93c3328-9c30-0410-af19-c9cd2b2d52af
上级 32e176c5
...@@ -61,6 +61,9 @@ $(SRC)/isdn/nationalStateTE.o \ ...@@ -61,6 +61,9 @@ $(SRC)/isdn/nationalStateTE.o \
$(SRC)/isdn/DMSmes.o \ $(SRC)/isdn/DMSmes.o \
$(SRC)/isdn/DMSStateNT.o \ $(SRC)/isdn/DMSStateNT.o \
$(SRC)/isdn/DMSStateTE.o \ $(SRC)/isdn/DMSStateTE.o \
$(SRC)/isdn/5ESSmes.o \
$(SRC)/isdn/5ESSStateNT.o \
$(SRC)/isdn/5ESSStateTE.o \
$(SRC)/isdn/Q932mes.o \ $(SRC)/isdn/Q932mes.o \
$(SRC)/zap_zt.o \ $(SRC)/zap_zt.o \
$(SRC)/zap_wanpipe.o $(SRC)/zap_wanpipe.o
...@@ -90,6 +93,8 @@ $(SRC)/include/zap_wanpipe.h \ ...@@ -90,6 +93,8 @@ $(SRC)/include/zap_wanpipe.h \
$(SRC)/include/zap_zt.h \ $(SRC)/include/zap_zt.h \
$(SRC)/isdn/include/mfifo.h \ $(SRC)/isdn/include/mfifo.h \
$(SRC)/isdn/include/national.h \ $(SRC)/isdn/include/national.h \
$(SRC)/isdn/include/DMS.h \
$(SRC)/isdn/include/5ESS.h \
$(SRC)/isdn/include/Q921.h \ $(SRC)/isdn/include/Q921.h \
$(SRC)/isdn/include/Q931.h \ $(SRC)/isdn/include/Q931.h \
$(SRC)/isdn/include/Q931ie.h \ $(SRC)/isdn/include/Q931ie.h \
...@@ -180,3 +185,4 @@ clean: mod_openzap-clean ...@@ -180,3 +185,4 @@ clean: mod_openzap-clean
rm -f $(SRC)/*.o $(SRC)/isdn/*.o $(MYLIB) *~ \#* testapp testcid testtones detect_tones detect_dtmf priserver testisdn testanalog rm -f $(SRC)/*.o $(SRC)/isdn/*.o $(MYLIB) *~ \#* testapp testcid testtones detect_tones detect_dtmf priserver testisdn testanalog
@if [ -f $(LIBPRI)/$(LIBPRIA) ] ; then cd $(LIBPRI) && make clean ; fi @if [ -f $(LIBPRI)/$(LIBPRIA) ] ; then cd $(LIBPRI) && make clean ; fi
...@@ -162,6 +162,10 @@ ...@@ -162,6 +162,10 @@
<Filter <Filter
Name="Header Files" Name="Header Files"
> >
<File
RelativePath="..\src\isdn\include\5ESS.h"
>
</File>
<File <File
RelativePath="..\src\isdn\include\DMS.h" RelativePath="..\src\isdn\include\DMS.h"
> >
...@@ -194,6 +198,18 @@ ...@@ -194,6 +198,18 @@
<Filter <Filter
Name="Source Files" Name="Source Files"
> >
<File
RelativePath="..\src\isdn\5ESSmes.c"
>
</File>
<File
RelativePath="..\src\isdn\5ESSStateNT.c"
>
</File>
<File
RelativePath="..\src\isdn\5ESSStateTE.c"
>
</File>
<File <File
RelativePath="..\src\isdn\DMSmes.c" RelativePath="..\src\isdn\DMSmes.c"
> >
......
差异被折叠。
差异被折叠。
差异被折叠。
/***************************************************************************** /*****************************************************************************
FileName: nationalStateTE.c FileName: DMSStateTE.c
Contents: National ISDN State Engine for TE (User Mode). Contents: DMS-100 ISDN State Engine for TE (User Mode).
The controlling state engine for Q.931 is the state engine The controlling state engine for Q.931 is the state engine
on the NT side. The state engine on the TE side is a slave on the NT side. The state engine on the TE side is a slave
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include "Q931.h" #include "Q931.h"
#include "national.h" #include "national.h"
#include "DMS.h" #include "DMS.h"
#include "5ESS.h"
/***************************************************************************** /*****************************************************************************
...@@ -50,7 +52,7 @@ ...@@ -50,7 +52,7 @@
The arrays are initialized with pointers to dummy functions and later The arrays are initialized with pointers to dummy functions and later
overrided with pointers to actual functions as new dialects are added. overrided with pointers to actual functions as new dialects are added.
The initial Q.931 will as an example define 2 dielects as it treats User The initial Q.931 will as an example define 2 dialects as it treats User
and Network mode as separate ISDN dialects. and Network mode as separate ISDN dialects.
The API messages Q931AddProc, Q931AddMes, Q931AddIE are used to initialize The API messages Q931AddProc, Q931AddMes, Q931AddIE are used to initialize
...@@ -80,7 +82,7 @@ Q931State Q931st[Q931MAXSTATE]; ...@@ -80,7 +82,7 @@ Q931State Q931st[Q931MAXSTATE];
*****************************************************************************/ *****************************************************************************/
L3INT Q931L4HeaderSpace={0}; /* header space to be ignoder/inserted */ L3INT Q931L4HeaderSpace = {0}; /* header space to be ignoder/inserted */
/* at head of each message. */ /* at head of each message. */
L3INT Q931L2HeaderSpace = {4}; /* Q921 header space, sapi, tei etc */ L3INT Q931L2HeaderSpace = {4}; /* Q921 header space, sapi, tei etc */
...@@ -128,7 +130,7 @@ void Q931SetL2HeaderSpace(L3INT space) ...@@ -128,7 +130,7 @@ void Q931SetL2HeaderSpace(L3INT space)
/***************************************************************************** /*****************************************************************************
Function: Q931 Function: Q931ProcDummy
Description: Dummy function for message processing. Description: Dummy function for message processing.
...@@ -140,7 +142,7 @@ L3INT Q931ProcDummy(Q931_TrunkInfo_t *pTrunk, L3UCHAR * b,L3INT c) ...@@ -140,7 +142,7 @@ L3INT Q931ProcDummy(Q931_TrunkInfo_t *pTrunk, L3UCHAR * b,L3INT c)
/***************************************************************************** /*****************************************************************************
Function: Q931 Function: Q931UmesDummy
Description: Dummy function for message processing Description: Dummy function for message processing
...@@ -152,7 +154,7 @@ L3INT Q931UmesDummy(Q931_TrunkInfo_t *pTrunk,L3UCHAR *IBuf, Q931mes_Generic *OBu ...@@ -152,7 +154,7 @@ L3INT Q931UmesDummy(Q931_TrunkInfo_t *pTrunk,L3UCHAR *IBuf, Q931mes_Generic *OBu
/***************************************************************************** /*****************************************************************************
Function: Q931 Function: Q931UieDummy
Description: Dummy function for message processing Description: Dummy function for message processing
...@@ -164,7 +166,7 @@ L3INT Q931UieDummy(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *pMsg, L3UCHAR * IB ...@@ -164,7 +166,7 @@ L3INT Q931UieDummy(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *pMsg, L3UCHAR * IB
/***************************************************************************** /*****************************************************************************
Function: Q931 Function: Q931PmesDummy
Description: Dummy function for message processing Description: Dummy function for message processing
...@@ -218,7 +220,7 @@ L3INT Q931ErrorDummy(void *priv, L3INT a, L3INT b, L3INT c) ...@@ -218,7 +220,7 @@ L3INT Q931ErrorDummy(void *priv, L3INT a, L3INT b, L3INT c)
Will set up the trunk array, channel Will set up the trunk array, channel
arrays and initialize Q931 function arrays before it finally arrays and initialize Q931 function arrays before it finally
set up EuroISDN processing with User as diealect 0 and set up EuroISDN processing with User as dialect 0 and
Network as dialect 1. Network as dialect 1.
Note: Initialization of other stacks should be inserted after Note: Initialization of other stacks should be inserted after
...@@ -235,15 +237,15 @@ void Q931Initialize() ...@@ -235,15 +237,15 @@ void Q931Initialize()
/* The user will only add the message handlers and IE handlers he need, */ /* The user will only add the message handlers and IE handlers he need, */
/* so we need to initialize every single entry to a default function */ /* so we need to initialize every single entry to a default function */
/* that will throw an appropriate error if they are ever called. */ /* that will throw an appropriate error if they are ever called. */
for(x=0;x< Q931MAXDLCT;x++) for(x=0; x < Q931MAXDLCT; x++)
{ {
for(y=0;y<Q931MAXMES;y++) for(y=0; y < Q931MAXMES; y++)
{ {
Q931Proc[x][y] = Q931ProcDummy; Q931Proc[x][y] = Q931ProcDummy;
Q931Umes[x][y] = Q931UmesDummy; Q931Umes[x][y] = Q931UmesDummy;
Q931Pmes[x][y] = Q931PmesDummy; Q931Pmes[x][y] = Q931PmesDummy;
} }
for(y=0;y<Q931MAXIE;y++) for(y=0; y < Q931MAXIE; y++)
{ {
Q931Pie[x][y] = Q931PieDummy; Q931Pie[x][y] = Q931PieDummy;
Q931Uie[x][y] = Q931UieDummy; Q931Uie[x][y] = Q931UieDummy;
...@@ -268,8 +270,14 @@ void Q931Initialize() ...@@ -268,8 +270,14 @@ void Q931Initialize()
if(Q931CreateDialectCB[Q931_Dialect_DMS + Q931_NT] == NULL) if(Q931CreateDialectCB[Q931_Dialect_DMS + Q931_NT] == NULL)
Q931AddDialect(Q931_Dialect_DMS + Q931_NT, DMSCreateNT); Q931AddDialect(Q931_Dialect_DMS + Q931_NT, DMSCreateNT);
if(Q931CreateDialectCB[Q931_Dialect_5ESS + Q931_TE] == NULL)
Q931AddDialect(Q931_Dialect_5ESS + Q931_TE, ATT5ESSCreateTE);
if(Q931CreateDialectCB[Q931_Dialect_5ESS + Q931_NT] == NULL)
Q931AddDialect(Q931_Dialect_5ESS + Q931_NT, ATT5ESSCreateNT);
/* The last step we do is to call the callbacks to create the dialects */ /* The last step we do is to call the callbacks to create the dialects */
for(x=0; x< Q931MAXDLCT; x++) for(x=0; x < Q931MAXDLCT; x++)
{ {
if(Q931CreateDialectCB[x] != NULL) if(Q931CreateDialectCB[x] != NULL)
{ {
...@@ -295,9 +303,9 @@ void Q931TimeTick(Q931_TrunkInfo_t *pTrunk, L3ULONG ms) ...@@ -295,9 +303,9 @@ void Q931TimeTick(Q931_TrunkInfo_t *pTrunk, L3ULONG ms)
(void)pTrunk; (void)pTrunk;
ms=ms; /* avoid warning for now. */ ms=ms; /* avoid warning for now. */
/* TODO: Loop through all active calls, check timers and call timour procs /* TODO: Loop through all active calls, check timers and call timout procs
* if timers are expired. * if timers are expired.
* Implement an function array so each dialect can deal with their own * Implement a function array so each dialect can deal with their own
* timeouts. * timeouts.
*/ */
} }
...@@ -312,7 +320,7 @@ void Q931TimeTick(Q931_TrunkInfo_t *pTrunk, L3ULONG ms) ...@@ -312,7 +320,7 @@ void Q931TimeTick(Q931_TrunkInfo_t *pTrunk, L3ULONG ms)
the message is processed and responded to. the message is processed and responded to.
The Q.931 message contains a static header that is The Q.931 message contains a static header that is
interpreated in his function. The rest is interpreted interpreted in this function. The rest is interpreted
in a sub function according to mestype. in a sub function according to mestype.
Parameters: pTrunk [IN] Ptr to trunk info. Parameters: pTrunk [IN] Ptr to trunk info.
...@@ -343,6 +351,8 @@ L3INT Q931Rx23(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT Size) ...@@ -343,6 +351,8 @@ L3INT Q931Rx23(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT Size)
m->MesType = Mes[IOff++]; m->MesType = Mes[IOff++];
/* Call table proc to unpack codec message */ /* Call table proc to unpack codec message */
/*debug */
/* printf("\n\nQ931Rx23- Dialect: %d, MsgType: %d\n",pTrunk->Dialect,m->MesType); */
RetCode = Q931Umes[pTrunk->Dialect][m->MesType](pTrunk, Mes, (Q931mes_Generic *)pTrunk->L3Buf, Q931L4HeaderSpace + IOff , Size - Q931L4HeaderSpace - IOff + 1); RetCode = Q931Umes[pTrunk->Dialect][m->MesType](pTrunk, Mes, (Q931mes_Generic *)pTrunk->L3Buf, Q931L4HeaderSpace + IOff , Size - Q931L4HeaderSpace - IOff + 1);
if(RetCode >= Q931E_NO_ERROR) if(RetCode >= Q931E_NO_ERROR)
...@@ -357,7 +367,7 @@ L3INT Q931Rx23(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT Size) ...@@ -357,7 +367,7 @@ L3INT Q931Rx23(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT Size)
Function: Q931Tx34 Function: Q931Tx34
Description: Called from the stac to send a message to layer 4. Description: Called from the stack to send a message to layer 4.
Parameters: Mes[IN] Ptr to message buffer. Parameters: Mes[IN] Ptr to message buffer.
Size[IN] Message size in bytes. Size[IN] Message size in bytes.
...@@ -656,7 +666,7 @@ void Q931AddStateEntry(L3UCHAR iD, L3INT iState, L3INT iMes, L3UCHAR cDir) ...@@ -656,7 +666,7 @@ void Q931AddStateEntry(L3UCHAR iD, L3INT iState, L3INT iMes, L3UCHAR cDir)
Message is legal in this state or not. Message is legal in this state or not.
Note: Someone write a bsearch or invent something smart here Note: Someone write a bsearch or invent something smart here
please - sequensial is ok for now. please - sequential is ok for now.
*****************************************************************************/ *****************************************************************************/
L3BOOL Q931IsEventLegal(L3UCHAR iD, L3INT iState, L3INT iMes, L3UCHAR cDir) L3BOOL Q931IsEventLegal(L3UCHAR iD, L3INT iState, L3INT iMes, L3UCHAR cDir)
{ {
...@@ -681,7 +691,7 @@ L3BOOL Q931IsEventLegal(L3UCHAR iD, L3INT iState, L3INT iMes, L3UCHAR cDir) ...@@ -681,7 +691,7 @@ L3BOOL Q931IsEventLegal(L3UCHAR iD, L3INT iState, L3INT iMes, L3UCHAR cDir)
Message is legal in this state or not. Message is legal in this state or not.
Note: Someone write a bsearch or invent something smart here Note: Someone write a bsearch or invent something smart here
please - sequensial is ok for now. please - sequential is ok for now.
*****************************************************************************/ *****************************************************************************/
static const char *q931_error_names[] = { static const char *q931_error_names[] = {
"Q931E_NO_ERROR", /* 0 */ "Q931E_NO_ERROR", /* 0 */
...@@ -733,3 +743,4 @@ const char *q931_error_to_name(q931_error_t error) ...@@ -733,3 +743,4 @@ const char *q931_error_to_name(q931_error_t error)
return q931_error_names[index]; return q931_error_names[index];
} }
...@@ -578,4 +578,4 @@ L3INT Q931AckService(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf) ...@@ -578,4 +578,4 @@ L3INT Q931AckService(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf)
} }
Q931_ENUM_NAMES(DIALECT_TYPE_NAMES, DIALECT_STRINGS) Q931_ENUM_NAMES(DIALECT_TYPE_NAMES, DIALECT_STRINGS)
Q931_STR2ENUM(q931_str2Q931Diaelct_type, q931_Q931Diaelct_type2str, Q931Dialect_t, DIALECT_TYPE_NAMES, Q931_Dialect_Count) Q931_STR2ENUM(q931_str2Q931Dialect_type, q931_Q931Dialect_type2str, Q931Dialect_t, DIALECT_TYPE_NAMES, Q931_Dialect_Count)
/******************************************************************************
FileName: 5ESS.h
Contents: Header and definition for the AT&T 5ESS ISDN dialect. The
header contains the following parts:
- Definition of codes
- Definition of information elements (5ESSie_).
- Definition of messages (5ESSmes_).
- Function prototypes.
Description: The AT&T 5ESS ISDN dialect here covers ????
Related Files: 5ESS.h AT&T 5ESS ISDN Definitions
5ESSie.c AT&T 5ESS ISDN IE encoders/coders (not extant yet)
See Q931ie.c for IE encoders/coders
5ESSStateTE.c AT&T 5ESS ISDN TE State Engine
5ESSStateNT.c AT&T 5ESS ISDN NT State Engine
License/Copyright:
Copyright (c) 2007, Jan Vidar Berger, Case Labs, Ltd. All rights reserved.
email:janvb@caselaboratories.com
Copyright (c) 2007, Michael Jerris. All rights reserved.
email:mike@jerris.com
Copyright (c) 2007, Michael S. Collins, All rights reserved.
email:mcollins@fcnetwork.com
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Case Labs, Ltd nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
#ifndef _5ESS_NL
#define _5ESS_NL
#include "Q931.h"
/*****************************************************************************
Q.931 Message codes
Only 5ESS specific message and ie types
here the rest are inherited from Q931.h
*****************************************************************************/
/*****************************************************************************
Q.931 Message Pack/Unpack functions. Implemented in 5ESSmes.c
Note: Because C variables may not begin with numeric digit, all identifiers
are prefixed with "ATT5ESS" instead of a bare "5ESS"
*****************************************************************************/
L3INT ATT5ESSUmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *OBuf, L3INT IOff, L3INT Size);
L3INT ATT5ESSPmes_Setup(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT ATT5ESSUmes_SetupAck(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *OBuf, L3INT IOff, L3INT Size);
L3INT ATT5ESSPmes_SetupAck(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT ATT5ESSUmes_0x07(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *mes, L3INT IOff, L3INT Size);
L3INT ATT5ESSPmes_0x07(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT ATT5ESSUmes_0x0f(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *mes, L3INT IOff, L3INT Size);
L3INT ATT5ESSPmes_0x0f(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
/*****************************************************************************
Q.931 Process Function Prototyping. Implemented in 5ESSStateTE.c
*****************************************************************************/
L3INT ATT5ESSProc0x0fTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom);
L3INT ATT5ESSProc0x07TE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom);
void ATT5ESSCreateTE(L3UCHAR i);
void ATT5ESSCreateNT(L3UCHAR i);
#endif /* _5ESS_NL */
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
- Error/Trace queue. - Error/Trace queue.
Design Note 3: DSP optimization. The L3 (Rx23) can be called directly Design Note 3: DSP optimization. The L3 (Rx23) can be called directly
from a hdlc receiver without usage of queues for optimized from a HDLC receiver without usage of queues for optimized
processing. But keep in mind that Q.931 calls Tx34 or Tx32 processing. But keep in mind that Q.931 calls Tx34 or Tx32
as part of receiving a message from Layer 2. as part of receiving a message from Layer 2.
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
/***************************************************************************** /*****************************************************************************
Enum helper macros Enum helper macros <Need description of these macros>
*****************************************************************************/ *****************************************************************************/
#define Q931_ENUM_NAMES(_NAME, _STRINGS) static char * _NAME [] = { _STRINGS , NULL }; #define Q931_ENUM_NAMES(_NAME, _STRINGS) static char * _NAME [] = { _STRINGS , NULL };
...@@ -200,11 +200,11 @@ const char *q931_error_to_name(q931_error_t error); ...@@ -200,11 +200,11 @@ const char *q931_error_to_name(q931_error_t error);
/***************************************************************************** /*****************************************************************************
Some speed optimization can be achieved by changing all variables to the Some speed optimization can be achieved by changing all variables to the
word size of your processor. A 32 bit processor have to do a lot of extra word size of your processor. A 32 bit processor has to do a lot of extra
work to read a packed 8 bit integer. Changing all fields to 32 bit integer work to read a packed 8 bit integer. Changing all fields to 32 bit integer
will ressult in usage of some extra space, but speed up the stack. will result in usage of some extra space, but will speed up the stack.
The stack have been designed to allow L3UCHAR etc. to be any size of 8 bit The stack has been designed to allow L3UCHAR etc. to be any size of 8 bit
or larger. or larger.
*****************************************************************************/ *****************************************************************************/
...@@ -233,7 +233,7 @@ typedef L3USHORT ie; /* Special data type to hold a dynamic */ ...@@ -233,7 +233,7 @@ typedef L3USHORT ie; /* Special data type to hold a dynamic */
/* value for single octet ) to the */ /* value for single octet ) to the */
/* struct holding the ie. Offset = 0 */ /* struct holding the ie. Offset = 0 */
/* is buf[1] etc. */ /* is buf[1] etc. */
/* ie == 0xffff indicate error */ /* ie == 0xffff indicates error */
/***************************************************************************** /*****************************************************************************
...@@ -268,8 +268,8 @@ typedef L3USHORT ie; /* Special data type to hold a dynamic */ ...@@ -268,8 +268,8 @@ typedef L3USHORT ie; /* Special data type to hold a dynamic */
changed when a new dialect needs to be inserted into the stack. changed when a new dialect needs to be inserted into the stack.
This stack uses an array of functions to know which function to call as This stack uses an array of functions to know which function to call as
it receives a SETUP message etc. A new dialect can when schoose to use it receives a SETUP message etc. A new dialect can when choose to use
the proc etc for standard Q.931 or insert a modified proc. the proc etc. for standard Q.931 or insert a modified proc.
This technique has also been used to distinguish between user and network This technique has also been used to distinguish between user and network
mode to make the code as easy to read and maintainable as possible. mode to make the code as easy to read and maintainable as possible.
...@@ -283,7 +283,7 @@ typedef L3USHORT ie; /* Special data type to hold a dynamic */ ...@@ -283,7 +283,7 @@ typedef L3USHORT ie; /* Special data type to hold a dynamic */
/* WARNING! Initialize Q931CreateDialectCB[] will NULL when increasing the */ /* WARNING! Initialize Q931CreateDialectCB[] will NULL when increasing the */
/* Q931MAXDLCT value to avoid Q931Initialize from crashing if one entry is */ /* Q931MAXDLCT value to avoid Q931Initialize from crashing if one entry is */
/* not used. */ /* not used. */
#define Q931MAXDLCT 6 /* Max dialects included in this */ #define Q931MAXDLCT 8 /* Max dialects included in this */
/* compile. User and Network count as */ /* compile. User and Network count as */
/* one dialect each. */ /* one dialect each. */
...@@ -294,7 +294,7 @@ typedef L3USHORT ie; /* Special data type to hold a dynamic */ ...@@ -294,7 +294,7 @@ typedef L3USHORT ie; /* Special data type to hold a dynamic */
#define Q931MAXUSEDIE 50 /* Maximum number of ie types per Dialect */ #define Q931MAXUSEDIE 50 /* Maximum number of ie types per Dialect */
#define Q931MAXCODESETS 7 /* Maximum number of codests (by spec, 0-7 */ #define Q931MAXCODESETS 7 /* Maximum number of codests (by spec, 0-7) */
#define Q931MAXSTATE 100 /* Size of state tables */ #define Q931MAXSTATE 100 /* Size of state tables */
...@@ -469,12 +469,12 @@ typedef struct ...@@ -469,12 +469,12 @@ typedef struct
Struct: Q931_TrunkInfo Struct: Q931_TrunkInfo
Description: TrunkInfo is the struct entry used to store Q.931 related Description: TrunkInfo is the struct entry used to store Q.931 related
information and state for E1/T1/J1 trunks and assosiated information and state for E1/T1/J1 trunks and associated
channels in the system. channels in the system.
The user should store this information outside this stack The user should store this information outside this stack
and need to feed the interface functions with a pointer to and needs to feed the interface functions with a pointer to
the trunk Info entry. the TrunkInfo entry.
*****************************************************************************/ *****************************************************************************/
typedef struct Q931_TrunkInfo Q931_TrunkInfo_t; typedef struct Q931_TrunkInfo Q931_TrunkInfo_t;
...@@ -493,11 +493,12 @@ typedef enum /* Dialect enum */ ...@@ -493,11 +493,12 @@ typedef enum /* Dialect enum */
Q931_Dialect_Q931 = 0, Q931_Dialect_Q931 = 0,
Q931_Dialect_National = 2, Q931_Dialect_National = 2,
Q931_Dialect_DMS = 4, Q931_Dialect_DMS = 4,
Q931_Dialect_5ESS = 6, /* Coming soon to a PRI stack near you! */
Q931_Dialect_Count Q931_Dialect_Count
} Q931Dialect_t; } Q931Dialect_t;
#define DIALECT_STRINGS "q931", "", "national", "", "dms" #define DIALECT_STRINGS "q931", "", "national", "", "dms","","5ess",""
Q931_STR2ENUM_P(q931_str2Q931Diaelct_type, q931_Q931Diaelct_type2str, Q931Dialect_t) Q931_STR2ENUM_P(q931_str2Q931Dialect_type, q931_Q931Dialect_type2str, Q931Dialect_t)
typedef enum /* Trunk Line Type. */ typedef enum /* Trunk Line Type. */
{ {
...@@ -525,7 +526,7 @@ struct Q931_TrunkInfo ...@@ -525,7 +526,7 @@ struct Q931_TrunkInfo
{ {
Q931NetUser_t NetUser; /* Network/User Mode. */ Q931NetUser_t NetUser; /* Network/User Mode. */
Q931Dialect_t Dialect; /* Q.931 Based dielact index. */ Q931Dialect_t Dialect; /* Q.931 Based dialect index. */
Q931_TrunkType_t TrunkType; /* Trunk Line Type. */ Q931_TrunkType_t TrunkType; /* Trunk Line Type. */
...@@ -549,7 +550,7 @@ struct Q931_TrunkInfo ...@@ -549,7 +550,7 @@ struct Q931_TrunkInfo
L3UCHAR L2Buf[Q931L2BUF]; /* buffer for messages send to L2. */ L3UCHAR L2Buf[Q931L2BUF]; /* buffer for messages send to L2. */
/* The auto flags below switch on/off automatic Ack messages. SETUP ACK */ /* The auto flags below switch on/off automatic Ack messages. SETUP ACK */
/* as an example can be send by the stack in response to SETUP to buy */ /* as an example can be sent by the stack in response to SETUP to buy */
/* time in processing on L4. Setting this to true will cause the stack */ /* time in processing on L4. Setting this to true will cause the stack */
/* to automatically send this. */ /* to automatically send this. */
...@@ -618,8 +619,8 @@ struct Q931_TrunkInfo ...@@ -618,8 +619,8 @@ struct Q931_TrunkInfo
Description: Define a Q931 State, legal events and next state for each Description: Define a Q931 State, legal events and next state for each
event. Used to simplify the state engine logic. Each state event. Used to simplify the state engine logic. Each state
engine define it's own state table and the logic only need engine defines its own state table and the logic need only
to call a helper function to check if the message is legal call a helper function to check if the message is legal
at this stage. at this stage.
*****************************************************************************/ *****************************************************************************/
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论