comparison gsm-fw/g23m-aci/aci/psa_cc.h @ 775:eedbf248bac0

gsm-fw/g23m-aci subtree: initial import from LoCosto source
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 12 Oct 2014 01:45:14 +0000
parents
children
comparison
equal deleted inserted replaced
774:40a721fd9854 775:eedbf248bac0
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : PSA
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : Definitions for the protocol stack adapter
18 | Call Control ( CC )
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef PSA_CC_H
23 #define PSA_CC_H
24
25 #include "aci_lst.h"
26
27 /*==== CONSTANTS ==================================================*/
28 #define DEF_CLIR_SUP (MNCC_CLR_SUP) /* default CLIR suppression */
29 #define DEF_BC1_UR (MNCC_UR_NOT_PRES) /* default user rate BC 1 */
30 #define DEF_BC2_UR (MNCC_UR_NOT_PRES) /* default user rate BC 2 */
31 #define DEF_BC1_BS (MNCC_BEARER_SERV_NOT_PRES) /* default bearer service BC 1 */
32 #define DEF_BC2_BS (MNCC_BEARER_SERV_NOT_PRES) /* default bearer service BC 2 */
33 #define DEF_BC1_CE (MNCC_CONN_ELEM_NOT_PRES) /* default connection element BC 1 */
34 #define DEF_BC2_CE (MNCC_CONN_ELEM_NOT_PRES) /* default connection element BC 2 */
35 #define DEF_BC1_SB (MNCC_STOP_1_BIT) /* default stop bits BC 1 */
36 #define DEF_BC2_SB (MNCC_STOP_1_BIT) /* default stop bits BC 2 */
37 #define DEF_BC1_DB (MNCC_DATA_8_BIT) /* default data bits BC 1 */
38 #define DEF_BC2_DB (MNCC_DATA_8_BIT) /* default data bits BC 2 */
39 #define DEF_BC1_PR (MNCC_PARITY_NONE) /* default parity BC 1 */
40 #define DEF_BC2_PR (MNCC_PARITY_NONE) /* default parity BC 2 */
41 #define DEF_BC1_FC (MNCC_NO_FLOW_CONTROL) /* default flow control BC 1 */
42 #define DEF_BC2_FC (MNCC_NO_FLOW_CONTROL) /* default flow control BC 2 */
43 #define DEF_BC1_MT (MNCC_MT_NONE) /* default flow control BC 1 */
44 #define DEF_BC2_MT (MNCC_MT_NONE) /* default flow control BC 2 */
45 #define DEF_BC1_TC (MNCC_ITC_NONE) /* default transfer cap BC 1 */
46 #define DEF_BC1_RA (MNCC_RATE_ADAPT_NONE) /* default rate adaption BC 1 */
47 #define DEF_UD_MD (MNCC_MD_NOT_PRES) /* default more user data */
48 #define DEF_UD_CL (MNCC_CL_NOT_PRES) /* default congest level user data */
49 #define DEF_RPT_IND (MNCC_RI_NOT_PRES) /* default repeat indicator */
50 #define DEF_OS_TOS (MNCC_TOS_NOT_PRES) /* default type of subaddress */
51 #define MAX_ALPHA (20) /* maximum length of alpha identifier */
52 #define MAX_DTMF_DIG (MAX_DIAL_LEN) /* maximum number of DTMF digits */
53
54 #define NO_ENTRY (-1) /* not a valid entry */
55
56
57
58 typedef enum /* call status */
59 {
60 NO_VLD_CS = 0, /* not a valid call status */
61 CS_IDL, /* call idle */
62 CS_ACT_REQ, /* call active request */
63 CS_ACT, /* call active */
64 CS_HLD_REQ, /* call hold request */
65 CS_HLD, /* call held */
66 CS_DSC_REQ, /* call disconnect request */
67 CS_CPL_REQ, /* call completion request */
68 CS_MDF_REQ, /* call modification request */
69 CS_SAT_REQ /* call SAT request */
70 #ifdef FF_SAT_E
71 , CS_SAT_CSD_REQ /* call SAT open CSD channel request */
72 #endif /* FF_SAT_E */
73 } T_CC_CLST;
74
75 typedef enum /* data status */
76 {
77 NO_VLD_DS = 0, /* not a valid data status */
78 DS_IDL, /* data idle */
79 DS_ACT_REQ, /* data active request */
80 DS_ACT, /* data active */
81 DS_DSC_REQ, /* data disconnect request */
82 DS_ABO_REQ, /* data abort request */
83 DS_MDF_REQ, /* data modification request */
84 DS_REST_REQ, /* data reestablishment request */
85 DS_STOP_REQ, /* data stop request */
86 DS_TCH_MDF /* data TCH modification expected */
87 } T_CC_DTST;
88
89 typedef enum
90 {
91 NO_VLD_CT = 0, /* not a valid call type */
92 CT_MOC, /* mobile originated call */
93 CT_MTC, /* mobile terminated call */
94 CT_NI_MOC, /* network initiated mobile originated call */
95 CT_MOC_RDL /* redialling mobile originated call */
96 } T_CC_CLTP;
97
98 typedef enum
99 {
100 NO_VLD_AS = 0, /* not a valid alert state */
101 AS_IDL, /* alerting not sended */
102 AS_PND, /* alerting pending */
103 AS_SND /* alerting sended */
104 } T_CC_ALST;
105
106 typedef enum
107 {
108 NO_VLD_MT = 0, /* not a valid message type */
109 MT_SETUP, /* setup message */
110 MT_DISC, /* disconnect message */
111 MT_ALRT, /* alert message */
112 MT_PROC, /* proceeding message */
113 MT_SYNC, /* synchronization message */
114 MT_PROGR, /* progress message */
115 MT_CONN /* connected message */
116 } T_CC_MSGT;
117
118 typedef enum
119 {
120 NO_VLD_BCRI = 0, /* not a valid bc request id */
121 BCRI_SAT /* bc request by SAT */
122 } T_BC_RQID;
123
124 typedef enum
125 {
126 NO_VLD_CCBSS = 0, /* not a valid CCBS status */
127 CCBSS_PSSBL, /* CCBS is possible */
128 CCBSS_REQ /* CCBS registration requested */
129 } T_CC_CCBSS;
130
131 typedef enum
132 {
133 NO_VLD_CD = 0, /* not a valid CD status */
134 CD_Requested, /* CD Request sent */
135 CD_Failed, /* CD Request failed (Reject, Error) */
136 CD_Succeeded, /* CD Request succeeded (Result) */
137 CD_Notified /* CD Notification received */
138 } T_CD_STAT;
139
140 /* Wap States for the parameter CCShrdParm.wapStat */
141 #if defined (FF_WAP) || defined (FF_SAT_E)
142 typedef enum
143 {
144 CC_WAP_STACK_DOWN = 0, /* Wapstack is down */
145 CC_WAP_STACK_UP /* Wapstack is activ */
146 } T_CC_WAP;
147 #endif
148
149 typedef enum
150 {
151 END_UNDEFINED = -1,
152 NEAR_END,
153 FAR_END
154 } T_CC_INITIATER;
155
156 typedef enum
157 {
158 TTY_STATE_NONE,
159 TTY_STATE_IDLE,
160 TTY_STATE_SYNC,
161 TTY_STATE_BCAP,
162 TTY_STATE_WAIT,
163 TTY_STATE_ACTIVE
164 } T_CC_TTY_STATE;
165
166 typedef enum
167 {
168 ALS_CMD_NONE,
169 ALS_CMD_SET,
170 ALS_CMD_TEST
171 } T_CC_ALS_CMD;
172
173 /*==== TYPES ======================================================*/
174 typedef struct CCDTMFPrm
175 {
176 SHORT cId; /* DTMF related call id */
177 UBYTE cnt; /* count of DTMF to send */
178 UBYTE cur; /* current DTMF digit */
179 UBYTE dig[MAX_DTMF_DIG+1]; /* buffer for DTMF digits to send +'\0'*/
180 } T_CC_DTMF_PRM;
181
182 /*
183 * called party, dynamic structure
184 */
185 typedef struct
186 {
187 UBYTE ton; /* type of number */
188 UBYTE npi; /* numbering plan identification */
189 UBYTE c_called_num; /* number of BCD digits */
190 UBYTE *called_num; /* bcd (unpacked) */
191 } T_dyn_called_party;
192
193 /*
194 * redirecting party, dynamic structure
195 */
196 typedef struct
197 {
198 UBYTE ton; /* type of number */
199 UBYTE npi; /* numbering plan identification */
200 UBYTE present; /* presentation indicator */
201 UBYTE screen; /* screening indicator */
202 UBYTE c_redir_num; /* number of BCD digits */
203 UBYTE *redir_num; /* bcd (unpacked) */
204 } T_dyn_redir_party;
205
206 /*
207 * subaddress, dynamic structure
208 */
209 typedef struct
210 {
211 UBYTE tos; /* type of subaddress */
212 UBYTE odd_even; /* odd / even indicator */
213 UBYTE c_subaddr; /* length of subaddress info */
214 UBYTE *subaddr; /* subaddress information */
215 } T_dyn_redir_party_sub;
216
217 typedef struct CCCallTabl
218 {
219 UBYTE ti; /* transaction identifier */
220 UBYTE calStat; /* call status */
221 UBYTE calType; /* type of call */
222 UBYTE alrtStat; /* alerting status */
223 BOOL inBndTns; /* in-band tones flag */
224 UBYTE prgDesc; /* progress description */
225 T_MNCC_bcpara BC[2]; /* bearer capabilities */
226 UBYTE curBC; /* current bearer capability */
227 T_MNCC_calling_party clgPty; /* calling party address */
228 T_MNCC_calling_party_sub clgPtySub; /* calling party subaddress */
229 T_dyn_called_party cldPty; /* called party address */
230 T_MNCC_called_party_sub cldPtySub; /* called party subaddress */
231 T_dyn_redir_party rdrPty; /* Redirecting party */
232 T_dyn_redir_party_sub rdrPtySub; /* Redirecting party subaddress */
233 /*CHAR alphId[MAX_ALPHA+1];*/ /* alpha identifier */
234 T_ACI_PB_TEXT alphIdUni; /* alpha identifier */
235 UBYTE rptInd; /* repeat indicator */
236 UBYTE sigInf; /* signal information */
237 UBYTE prio; /* priority of call */
238 UBYTE CLIRsup; /* CLIR suppression */
239 UBYTE mptyStat; /* multiparty status */
240 UBYTE iId; /* invoke id */
241 UBYTE srvStat; /* service status */
242 UBYTE srvType; /* type of service */
243 UBYTE SSver; /* supplementary service version */
244 UBYTE opCode; /* SS operation code */
245 UBYTE CUGidx; /* CUG index */
246 UBYTE CUGprf; /* preferential CUG */
247 UBYTE OAsup; /* OA suppress */
248 USHORT rslt; /* result */
249 USHORT nrmCs; /* normal cause */
250 USHORT rejCs; /* rejection cause */
251 UBYTE failType; /* type of SS failure */
252 UBYTE rejPrb; /* reject problem code */
253 UBYTE errCd; /* return error code */
254 UBYTE ssDiag; /* SS diagnostic (CQ 23619 - %DIAG) */
255 UBYTE SATinv; /* SAT invocation flag */
256 UBYTE CCBSstat; /* CCBS status */
257 UBYTE CDStat; /* CD status */
258 UBYTE curCmd; /* current command executing */
259 S8 curSrc; /* current command source */
260 BOOL dtmfCmd; /* AT_CMD_VTS or AT_CMD_NONE */
261 UBYTE dtmfMode; /* DTMF_MOD_AUTO/DTMF_MOD_MAN_START/DTMF_MOD_MAN_STOP */
262 T_OWN dtmfSrc; /* current command source for DTMF */
263 T_OWN calOwn; /* owner of call */
264 #ifdef SIM_TOOLKIT
265 BOOL SatDiscEvent; /* flag for DISC event for SAT */
266 #endif
267 UBYTE rdlCnt; /* redial counter */
268 UBYTE rdlTimIndex; /* redial timer index for 5th and more attempts */
269 USHORT curCs; /* current cause of rejected call intended for %CPI reports*/
270 UBYTE numRawCauseBytes; /* Number of cause bytes-for SAT evt Download CTS cases*/
271 UBYTE *rawCauseBytes; /* Pointer to cause value sent by network*/
272
273 } T_CC_CALL_TBL;
274
275
276 typedef struct CCShrdParm
277 {
278 T_ACI_CMOD_MOD CMODmode;
279 SHORT cIdFail; /* holds failed call identifier */
280 SHORT cIdMPTY; /* holds multiparty root call id */
281 SHORT nrOfMOC; /* number of current MOC's */
282 SHORT nrOfMTC; /* number of current MTC's */
283 UBYTE chMod; /* channel mode */
284 UBYTE chType; /* channel type */
285 USHORT syncCs; /* synchronisation cause */
286 BOOL TCHasg; /* TCH assignment flag */
287 #ifdef FAX_AND_DATA
288 T_ACI_BS_SPEED CBSTspeed; /* parameters passed to CC by CC_CNFG_REQ: for MTC */
289 T_ACI_CBST_NAM CBSTname; /* parameters passed to CC by CC_CNFG_REQ: for MTC */
290 T_ACI_CBST_CE CBSTce; /* parameters passed to CC by CC_CNFG_REQ: for MTC */
291 #endif /* FAX_AND_DATA */
292 UBYTE snsMode; /* single numbering scheme mode */
293 UBYTE iIdNxt; /* next available invoke id */
294 UBYTE cmpType; /* component type */
295 UBYTE msgType; /* message type */
296 T_CC_CALL_TBL *ctb[MAX_CALL_NR];/* max. nr of calls pointers to call table */
297 USHORT ccCs[MAX_CALL_NR]; /* Last CC cause for qAT_PlusCEER() */
298 S8 callType[MAX_CALL_NR]; /* Call type T_CC_CALL_TYPE has to survive call end */
299 T_CC_DTMF_PRM dtmf; /* dtmf parameter */
300 T_ACI_LIST *facility_list; /* List with stored MNCC_FACILITY_IND */
301 UBYTE wapStat; /* Wap connection status */
302 UBYTE als_cmd; /* ALS command: set or query */
303 UBYTE aocRsmpPend; /* resumption of AOC pending */
304 BOOL BC0_send_flag; /* Flag the 1st bearer capability for data call */
305 BOOL BC1_send_flag; /* Flag the 2nd bearer capability for data call */
306 UBYTE datStat; /* data connection status */
307 #ifdef FF_TTY
308 UBYTE ctmReq; /* TTY/CTM Service to be requested */
309 UBYTE ctmState; /* State of TTY/CTM Service */
310 UBYTE ttyCmd; /* Type of TTY: HCO, VCO, bidirectional */
311 UBYTE ctmOvwr; /* overwrite CTM request for next call */
312 #endif
313 T_ACI_CVHU_MODE cvhu; /* Voice Hangup Control */
314 }
315 T_CC_SHRD_PRM;
316
317 /*==== PROTOTYPES =================================================*/
318
319 EXTERN SHORT psaCC_NewCall ( SHORT cId );
320 EXTERN void psaCC_AcceptCall ( SHORT cId );
321 EXTERN void psaCC_ClearCall ( SHORT cId );
322 EXTERN void psaCC_HoldCall ( SHORT cId );
323 EXTERN void psaCC_RetrieveCall ( SHORT cId );
324 EXTERN SHORT psaCC_ModifyCall ( SHORT cId );
325 EXTERN void psaCC_Config ( void );
326 EXTERN void psaCC_BuildMPTY ( SHORT cId );
327 EXTERN void psaCC_Hold_RetrieveMPTY ( SHORT cId,
328 T_CC_CLST call_stat,
329 T_CC_CLST call_stat_new,
330 UBYTE cId_new,
331 UBYTE opc);
332 EXTERN void psaCC_SplitMPTY ( SHORT cId );
333 EXTERN int psaCC_CountMPTY ( void );
334
335 EXTERN SHORT psaCC_ECT ( SHORT cId );
336
337 EXTERN SHORT psaCC_SendDTMF ( SHORT cId,
338 UBYTE digit,
339 UBYTE mode );
340
341 EXTERN void psaCC_send_satevent( UBYTE event,
342 SHORT callId ,
343 T_CC_INITIATER actionSrc,
344 BOOL check_SatDiscEvent );
345
346 GLOBAL void psaCC_init_mtcbearer( void );
347 GLOBAL void psaCC_Init ( void );
348
349 EXTERN SHORT psaCC_ctbNewEntry ( void );
350 EXTERN SHORT psaCC_ctbFindTi ( UBYTE ti2Find );
351 EXTERN SHORT psaCC_ctbFindCall ( T_OWN calOwn,
352 T_CC_CLST calStat,
353 T_CC_CLTP calType );
354 EXTERN BOOL psaCC_ctbCallInUse ( void );
355 EXTERN BOOL psaCC_ctbAnyCallInUse ( void );
356 EXTERN SHORT psaCC_ctbDialNr2CldAdr ( SHORT cId, CHAR * pDialStr );
357 EXTERN CHAR* psaCC_ctbClrAdr2Num ( SHORT cId, CHAR * pNumBuf, UBYTE maxSize );
358 EXTERN CHAR* psaCC_ctbClrAdr2Sub ( SHORT cId, CHAR * pSubBuf );
359 EXTERN CHAR* psaCC_ctbCldAdr2Num ( SHORT cId, CHAR * pNumBuf, UBYTE maxSize );
360 EXTERN CHAR* psaCC_ctbCldAdr2Sub ( SHORT cId, CHAR * pSubBuf );
361 EXTERN CHAR* psaCC_ctbRdrAdr2Num ( SHORT cId, CHAR * pNumBuf, UBYTE maxSize );
362 EXTERN CHAR* psaCC_ctbRdrAdr2Sub ( SHORT cId, CHAR * pSubBuf );
363 EXTERN T_ACI_PB_TEXT* psaCC_ctbGetAlpha ( SHORT cId );
364 #ifdef TRACING
365 /*
366 EXTERN void psaCC_ctbDump ( void );
367 EXTERN void psaCC_ctbDumpBC ( void );
368 */
369 EXTERN void psaCC_shrPrmDump ( void );
370 #endif /* TRACING */
371 EXTERN void psaCC_chngCalTypCnt ( SHORT cId, SHORT dlt );
372 EXTERN void psaCC_chkPrgDesc ( SHORT cId, UBYTE prgDesc,
373 UBYTE msgType );
374 EXTERN SHORT psaCC_getMOCTi ( SHORT cId );
375 EXTERN void psaCC_retMOCTi ( UBYTE ti );
376 EXTERN void psaCC_setSpeechMode ( void );
377 EXTERN BOOL psaCC_phbSrchNumPlnTxt ( CHAR * inNum,
378 UBYTE * inoutMaxLen,
379 T_ACI_PB_TEXT * outTxt );
380 EXTERN BOOL psaCC_phbMfwSrchNumPlnTxt ( CHAR * inNum,
381 T_ACI_PB_TEXT * outTxt );
382 EXTERN void psaCC_phbSrchNum ( SHORT cId, T_CC_CLTP call_type );
383 EXTERN BOOL psaCC_phbSrchName ( T_ACI_CMD_SRC srcId,
384 T_ACI_PB_TEXT *srchName,
385 T_CLPTY_PRM *calPrm );
386 EXTERN UBYTE psaCC_phbSrchECC ( CHAR* dialStr, BOOL srchECC );
387 EXTERN BOOL psaCC_phbNtryFnd ( UBYTE phb,
388 T_CLPTY_PRM* calPrm );
389 EXTERN void psaCC_phbAddNtry ( UBYTE phb, SHORT cId,
390 UBYTE clTp, T_CLPTY_PRM *cldPty );
391 EXTERN void psaCC_asmBuildMPTY ( void );
392 EXTERN void psaCC_asmHoldMPTY ( void );
393 EXTERN void psaCC_asmRetrieveMPTY ( void );
394 EXTERN void psaCC_asmSplitMPTY ( void );
395 EXTERN void psaCC_asmECT ( void );
396 EXTERN void psaCC_asmCUGInfo ( SHORT cId );
397 EXTERN void psaCC_asmCDReq ( const CHAR *number,
398 const T_ACI_TOA *type,
399 const CHAR *subaddr,
400 const T_ACI_TOS *satype);
401 EXTERN void psaCC_asmComponent ( SHORT cId );
402 EXTERN void psaCC_asmCCBSReq ( SHORT cId );
403 EXTERN void psaCC_dasmInvokeCmp ( SHORT cId, T_inv_comp *invCmp );
404 EXTERN void psaCC_dasmResultCmp ( SHORT cId, T_res_comp *resCmp );
405 EXTERN void psaCC_dasmErrorCmp ( SHORT cId, T_err_comp *errCmp );
406 EXTERN void psaCC_dasmRejectCmp ( SHORT cId, T_rej_comp *rejCmp );
407 EXTERN void psaCC_ProcessCmp ( T_MNCC_FACILITY_IND *mncc_facility_ind );
408 EXTERN void psaCC_InitCtbNtry ( SHORT idx );
409 EXTERN void psaCC_FreeRdrPty ( SHORT idx );
410 EXTERN void psaCC_FreeCtbNtry ( SHORT idx );
411 EXTERN BOOL psaCC_ctbIsValid ( SHORT cId );
412 EXTERN T_CC_CALL_TBL * psaCC_ctb ( SHORT cId );
413 EXTERN void psaCC_DumpFIE ( T_MNCC_fac_inf *fie );
414 EXTERN void psaCC_DTMFSent ( SHORT cId );
415 EXTERN void psaCC_StopDTMF ( SHORT cId );
416 EXTERN SHORT psaCC_BCapCode ( UBYTE reqId,
417 SHORT cId );
418
419 EXTERN SHORT psaCC_BCapDecode ( UBYTE reqId,
420 UINT16 bcLen1,
421 UBYTE *bc1,
422 UINT16 bcLen2,
423 UBYTE *bc2);
424 EXTERN SHORT psaCC_MPTY ( SHORT cId,
425 UBYTE mpty_event );
426
427 EXTERN void psaCC_DTMFTimeout ( void );
428
429 /*==== EXPORT =====================================================*/
430
431 #ifdef PSA_CCF_C
432
433 GLOBAL T_CC_SHRD_PRM ccShrdPrm;
434
435 #else
436
437 EXTERN T_CC_SHRD_PRM ccShrdPrm;
438
439 #endif /* PSA_CCF_C */
440
441
442 #endif /* PSA_CC_H */
443 /*==== EOF =======================================================*/