comparison src/aci2/aci/psa_cc.h @ 3:93999a60b835

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