mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 06:34:19 +00:00
cleanup of service message handling, add separate dialects for dms and national.
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@290 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
1 parent
94e92fe25c
commit
c1f9897ff5
15 files changed
+1252
-156
No files matched your search
@@ -0,0 +1,95 @@
|
||||
/******************************************************************************
|
||||
|
||||
FileName: national.h
|
||||
|
||||
Contents: Header and definition for the National ISDN dialect. The
|
||||
header contents the following parts:
|
||||
|
||||
- Definition of codes
|
||||
- Definition of information elements (nationalie_).
|
||||
- Definition of messages (nationalmes_).
|
||||
- Function prototypes.
|
||||
|
||||
Description: The National ISDN dialect here covers ????
|
||||
|
||||
Related Files: national.h National ISDN Definitions
|
||||
nationalie.c National ISDN IE encoders/coders
|
||||
nationalStateTE.c National ISDN TE State Engine
|
||||
nationalStateNT.c National 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
|
||||
|
||||
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 _DMS_NL
|
||||
#define _DMS_NL
|
||||
|
||||
#include "Q931.h"
|
||||
|
||||
/*****************************************************************************
|
||||
|
||||
Q.931 Message codes
|
||||
Only National specific message and ie types
|
||||
here the rest are inherited from national.h
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
||||
Q.931 Message Pack/Unpack functions. Implemented in nationalmes.c
|
||||
|
||||
*****************************************************************************/
|
||||
L3INT DMSUmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *OBuf, L3INT IOff, L3INT Size);
|
||||
L3INT DMSPmes_Setup(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
|
||||
L3INT DMSUmes_0x07(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *mes, L3INT IOff, L3INT Size);
|
||||
L3INT DMSPmes_0x07(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
|
||||
L3INT DMSUmes_0x0f(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *mes, L3INT IOff, L3INT Size);
|
||||
L3INT DMSPmes_0x0f(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
||||
Q.931 Process Function Prototyping. Implemented in nationalStateTE.c
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
L3INT DMSProc0x0fTE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom);
|
||||
L3INT DMSProc0x07TE(Q931_TrunkInfo_t *pTrunk, L3UCHAR * buf, L3INT iFrom);
|
||||
|
||||
|
||||
void DMSCreateTE(L3UCHAR i);
|
||||
void DMSCreateNT(L3UCHAR i);
|
||||
|
||||
#endif /* _DMS_NL */
|
||||
@@ -283,7 +283,7 @@ typedef L3USHORT ie; /* Special data type to hold a dynamic */
|
||||
/* WARNING! Initialize Q931CreateDialectCB[] will NULL when increasing the */
|
||||
/* Q931MAXDLCT value to avoid Q931Initialize from crashing if one entry is */
|
||||
/* not used. */
|
||||
#define Q931MAXDLCT 4 /* Max dialects included in this */
|
||||
#define Q931MAXDLCT 6 /* Max dialects included in this */
|
||||
/* compile. User and Network count as */
|
||||
/* one dialect each. */
|
||||
|
||||
@@ -377,6 +377,9 @@ typedef L3USHORT ie; /* Special data type to hold a dynamic */
|
||||
#define Q931mes_STATUS_ENQUIRY 0x75 /* 0111 0101 */
|
||||
#define Q931mes_SEGMENT 0x60 /* 0110 0000 */
|
||||
|
||||
#define Q931mes_SERVICE 0x0f /* 0000 1111 */
|
||||
#define Q931mes_SERVICE_ACKNOWLEDGE 0x07 /* 0000 0111 */
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
||||
@@ -422,6 +425,7 @@ typedef struct
|
||||
ie CallState; /* Call State */
|
||||
ie CallID; /* Call Identity */
|
||||
ie ChanID; /* Channel Identification */
|
||||
ie ChangeStatus; /* Change Staus */
|
||||
ie ProgInd; /* Progress Indicator */
|
||||
ie NetFac; /* Network Spesific Facilities */
|
||||
ie NotifInd; /* Notification Indicator */
|
||||
@@ -488,10 +492,11 @@ typedef enum /* Dialect enum */
|
||||
{
|
||||
Q931_Dialect_Q931 = 0,
|
||||
Q931_Dialect_National = 2,
|
||||
Q931_Dialect_DMS = 4,
|
||||
|
||||
Q931_Dialect_Count
|
||||
} Q931Dialect_t;
|
||||
#define DIALECT_STRINGS "q931", "", "national"
|
||||
#define DIALECT_STRINGS "q931", "", "national", "", "dms"
|
||||
Q931_STR2ENUM_P(q931_str2Q931Diaelct_type, q931_Q931Diaelct_type2str, Q931Dialect_t)
|
||||
|
||||
typedef enum /* Trunk Line Type. */
|
||||
@@ -557,7 +562,10 @@ struct Q931_TrunkInfo
|
||||
L3BOOL autoRestartAck; /* Indicate if the stack should send */
|
||||
/* RESTART ACK or not. 0=No, 1=Yes. */
|
||||
|
||||
/* channel array holding info per channel. Usually defined to 32 */
|
||||
L3BOOL autoServiceAck; /* Indicate if the stack should send */
|
||||
/* SERVICE ACK or not. 0=No, 1=Yes. */
|
||||
|
||||
/* channel array holding info per channel. Usually defined to 32 */
|
||||
/* channels to fit an E1 since T1/J1 and BRI will fit inside a E1. */
|
||||
struct _charray
|
||||
{
|
||||
@@ -786,6 +794,9 @@ L3INT Q931Pmes_Notify(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISi
|
||||
L3INT Q931Pmes_Segment(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
|
||||
L3INT Q931Pmes_Status(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
|
||||
L3INT Q931Pmes_StatusEnquiry(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
|
||||
L3INT Q931Pmes_Service(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
|
||||
L3INT Q931Pmes_ServiceAck(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
|
||||
|
||||
|
||||
L3INT Q931Umes_Alerting(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *OBuf, L3INT I, L3INT O);
|
||||
L3INT Q931Umes_CallProceeding(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *OBuf, L3INT I, L3INT O);
|
||||
@@ -812,6 +823,9 @@ L3INT Q931Umes_Notify(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *
|
||||
L3INT Q931Umes_Segment(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *OBuf, L3INT I, L3INT O);
|
||||
L3INT Q931Umes_Status(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *OBuf, L3INT I, L3INT O);
|
||||
L3INT Q931Umes_StatusEnquiry(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *OBuf, L3INT I, L3INT O);
|
||||
L3INT Q931Umes_Service(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *mes, L3INT IOff, L3INT Size);
|
||||
L3INT Q931Umes_ServiceAck(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *mes, L3INT IOff, L3INT Size);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
||||
@@ -943,6 +957,7 @@ L3INT Q931ReleaseComplete(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf);
|
||||
L3INT Q931AckRestart(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf);
|
||||
L3INT Q931AckConnect(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf);
|
||||
L3INT Q931AckSetup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf);
|
||||
L3INT Q931AckService(Q931_TrunkInfo_t *pTrunk, L3UCHAR *buf);
|
||||
|
||||
L3INT Q931Api_InitTrunk(Q931_TrunkInfo_t *pTrunk,
|
||||
Q931Dialect_t Dialect,
|
||||
|
||||
@@ -1068,6 +1068,18 @@ typedef struct
|
||||
/* 111 All interfaces */
|
||||
}Q931ie_RestartInd;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
L3UCHAR IEId; /* 01110100 */
|
||||
L3UCHAR Size; /* Length of Information Element */
|
||||
L3UCHAR Preference; /* Preference 0 = reserved, 1 = channel */
|
||||
L3UCHAR Spare; /* Spare */
|
||||
L3UCHAR NewStatus; /* NewStatus */
|
||||
/* 000 In service */
|
||||
/* 001 Maintenance */
|
||||
/* 010 Out of service */
|
||||
}Q931ie_ChangeStatus;
|
||||
|
||||
/*****************************************************************************
|
||||
|
||||
Struct: Q931ie_GenericDigits
|
||||
@@ -1090,7 +1102,7 @@ typedef struct
|
||||
Q.931 Information Element Pack/Unpack functions. Implemented in Q931ie.c
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
q931pie_func_t Q931Pie_ChangeStatus;
|
||||
q931pie_func_t Q931Pie_BearerCap;
|
||||
q931pie_func_t Q931Pie_ChanID;
|
||||
q931pie_func_t Q931Pie_ProgInd;
|
||||
@@ -1121,6 +1133,7 @@ q931pie_func_t Q931Pie_GenericDigits;
|
||||
|
||||
L3USHORT Q931Uie_CRV(Q931_TrunkInfo_t *pTrunk,L3UCHAR * IBuf, L3UCHAR *OBuf, L3INT *IOff, L3INT *OOff);
|
||||
|
||||
q931uie_func_t Q931Uie_ChangeStatus;
|
||||
q931uie_func_t Q931Uie_BearerCap;
|
||||
q931uie_func_t Q931Uie_ChanID;
|
||||
q931uie_func_t Q931Uie_ProgInd;
|
||||
|
||||
@@ -72,7 +72,8 @@
|
||||
*****************************************************************************/
|
||||
L3INT nationalUmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *OBuf, L3INT IOff, L3INT Size);
|
||||
L3INT nationalPmes_Setup(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
|
||||
L3INT DMSUmes_0x0f(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic *mes, L3INT IOff, L3INT Size);
|
||||
|
||||
#include "DMS.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
||||
Reference in new issue
Block a user