FreeCalypso > hg > freecalypso-citrine
comparison g23m-aci/aci/cmh_ccq.c @ 0:75a11d740a02
initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 09 Jun 2016 00:02:41 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:75a11d740a02 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-PS (6147) | |
4 | Modul : CMH_CCQ | |
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 : This module provides the query functions related to the | |
18 | protocol stack adapter for mobility management. | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #ifndef CMH_CCQ_C | |
23 #define CMH_CCQ_C | |
24 #endif | |
25 | |
26 #include "config.h" | |
27 #include "fixedconf.h" | |
28 #include "condat-features.h" | |
29 #include "aci_conf.h" | |
30 | |
31 /*==== INCLUDES ===================================================*/ | |
32 | |
33 #include "aci_all.h" | |
34 #include "aci_cmh.h" | |
35 | |
36 #ifdef FAX_AND_DATA | |
37 #include "aci_fd.h" | |
38 #endif /* of #ifdef FAX_AND_DATA */ | |
39 | |
40 #include "psa.h" | |
41 #include "psa_cc.h" | |
42 #include "cmh.h" | |
43 #include "cmh_cc.h" | |
44 | |
45 #include "aoc.h" | |
46 #include "audio.h" | |
47 | |
48 #include "dti_conn_mng.h" | |
49 #include "psa_sim.h" | |
50 #include "cmh_sim.h" | |
51 #include "psa_mm.h" | |
52 | |
53 /*==== CONSTANTS ==================================================*/ | |
54 #ifdef TI_PS_FF_AT_P_CMD_RDLB | |
55 EXTERN T_ACI_CC_REDIAL_BLACKL * cc_blacklist_ptr; | |
56 #endif /* TI_PS_FF_AT_P_CMD_RDLB */ | |
57 | |
58 const UBYTE aci_clcc_dir [5][2] = { | |
59 { NO_VLD_CT, NO_VLD_CT }, | |
60 { CLCC_DIR_MOC, CLCC_DIR_MOC }, | |
61 { CLCC_DIR_MTC, CLCC_DIR_MTC }, | |
62 { CLCC_DIR_MOC, CLCC_DIR_MOC_NI }, | |
63 { CLCC_DIR_MOC, CLCC_DIR_MOC_RDL } | |
64 }; | |
65 | |
66 /*==== EXPORT =====================================================*/ | |
67 | |
68 /*==== VARIABLES ==================================================*/ | |
69 #ifdef TI_PS_FF_AT_P_CMD_CUSCFG | |
70 EXTERN T_ACI_CUSCFG_PARAMS cuscfgParams; | |
71 #endif /* TI_PS_FF_AT_P_CMD_CUSCFG */ | |
72 | |
73 GLOBAL T_PCEER causeMod = P_CEER_mod; /* Hold which module caused the extended error */ | |
74 GLOBAL SHORT causeCeer; /* Hold extended error for sim, mm and ss */ | |
75 EXTERN UBYTE std; | |
76 | |
77 /*==== FUNCTIONS ==================================================*/ | |
78 LOCAL T_ACI_RETURN qAT_plus_percent_CLCC( T_ACI_CMD_SRC srcId, | |
79 T_ACI_CLCC_CALDESC *calLst, | |
80 T_ACI_AT_CMD at_cmd_id, | |
81 SHORT rdlcId ); | |
82 | |
83 /* | |
84 +--------------------------------------------------------------------+ | |
85 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
86 | STATE : code ROUTINE : qAT_PlusCSTA | | |
87 +--------------------------------------------------------------------+ | |
88 | |
89 PURPOSE : This is the functional counterpart to the +CSTA? AT command | |
90 which returns the current setting for type of address. | |
91 | |
92 <toa>: type of address. | |
93 */ | |
94 | |
95 GLOBAL T_ACI_RETURN qAT_PlusCSTA ( T_ACI_CMD_SRC srcId, | |
96 T_ACI_TOA * toa ) | |
97 { | |
98 T_CC_CMD_PRM * pCCCmdPrm; /* points to CC command parameters */ | |
99 | |
100 TRACE_FUNCTION ("qAT_PlusCSTA()"); | |
101 | |
102 /* | |
103 *------------------------------------------------------------------- | |
104 * check command source | |
105 *------------------------------------------------------------------- | |
106 */ | |
107 if(!cmh_IsVldCmdSrc (srcId)) | |
108 { | |
109 return( AT_FAIL ); | |
110 } | |
111 | |
112 pCCCmdPrm = &cmhPrm[srcId].ccCmdPrm; | |
113 | |
114 /* | |
115 *------------------------------------------------------------------- | |
116 * fill in parameters | |
117 *------------------------------------------------------------------- | |
118 */ | |
119 *toa = pCCCmdPrm -> CSTAtoa; | |
120 | |
121 return( AT_CMPL ); | |
122 } | |
123 | |
124 /* | |
125 +--------------------------------------------------------------------+ | |
126 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
127 | STATE : code ROUTINE : qAT_PlusCMOD | | |
128 +--------------------------------------------------------------------+ | |
129 | |
130 PURPOSE : This is the functional counterpart to the +CMOD? AT command | |
131 which returns the current setting for call mode. | |
132 | |
133 <mode>: call mode. | |
134 */ | |
135 | |
136 GLOBAL T_ACI_RETURN qAT_PlusCMOD ( T_ACI_CMD_SRC srcId, | |
137 T_ACI_CMOD_MOD* mode ) | |
138 { | |
139 TRACE_FUNCTION ("qAT_PlusCMOD()"); | |
140 | |
141 /* check command source */ | |
142 if(!cmh_IsVldCmdSrc (srcId)) | |
143 { | |
144 return( AT_FAIL ); | |
145 } | |
146 | |
147 | |
148 /* fill in parameters */ | |
149 *mode = ccShrdPrm.CMODmode; | |
150 | |
151 return( AT_CMPL ); | |
152 } | |
153 | |
154 #ifdef FAX_AND_DATA | |
155 /* | |
156 +--------------------------------------------------------------------+ | |
157 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
158 | STATE : code ROUTINE : qAT_PlusCBST | | |
159 +--------------------------------------------------------------------+ | |
160 | |
161 PURPOSE : This is the functional counterpart to the +CBST? AT command | |
162 which returns the current setting for bearer service type. | |
163 | |
164 */ | |
165 | |
166 GLOBAL T_ACI_RETURN qAT_PlusCBST ( T_ACI_CMD_SRC srcId, | |
167 T_ACI_BS_SPEED* speed, | |
168 T_ACI_CBST_NAM* name, | |
169 T_ACI_CBST_CE* ce) | |
170 { | |
171 TRACE_FUNCTION ("qAT_PlusCBST()"); | |
172 | |
173 /* | |
174 *------------------------------------------------------------------- | |
175 * check command source | |
176 *------------------------------------------------------------------- | |
177 */ | |
178 if(!cmh_IsVldCmdSrc (srcId)) | |
179 { | |
180 return( AT_FAIL ); | |
181 } | |
182 | |
183 /* | |
184 *------------------------------------------------------------------- | |
185 * fill in parameters | |
186 *------------------------------------------------------------------- | |
187 */ | |
188 *speed = ccShrdPrm.CBSTspeed; | |
189 *name = ccShrdPrm.CBSTname; | |
190 *ce = ccShrdPrm.CBSTce; | |
191 | |
192 return( AT_CMPL ); | |
193 } | |
194 #endif /* FAX_AND_DATA */ | |
195 | |
196 /* | |
197 +--------------------------------------------------------------------+ | |
198 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
199 | STATE : code ROUTINE : qAT_PlusCCUG | | |
200 +--------------------------------------------------------------------+ | |
201 | |
202 PURPOSE : This is the functional counterpart to the +CCUG AT command | |
203 which is responsible to query the parameters for closed user | |
204 group supplementary services. | |
205 | |
206 <mode> : CUG mode. | |
207 <index> : CUG index. | |
208 <info> : CUG info. | |
209 */ | |
210 | |
211 GLOBAL T_ACI_RETURN qAT_PlusCCUG ( T_ACI_CMD_SRC srcId, | |
212 T_ACI_CCUG_MOD *mode, | |
213 T_ACI_CCUG_IDX *index, | |
214 T_ACI_CCUG_INFO *info) | |
215 { | |
216 T_CC_CMD_PRM * pCCCmdPrm; /* points to SS command parameters */ | |
217 | |
218 TRACE_FUNCTION ("qAT_PlusCCUG()"); | |
219 | |
220 /* | |
221 *------------------------------------------------------------------- | |
222 * check command source | |
223 *------------------------------------------------------------------- | |
224 */ | |
225 if(!cmh_IsVldCmdSrc (srcId)) | |
226 { | |
227 return( AT_FAIL ); | |
228 } | |
229 | |
230 pCCCmdPrm = &cmhPrm[srcId].ccCmdPrm; | |
231 | |
232 /* | |
233 *------------------------------------------------------------------- | |
234 * fill in parameters | |
235 *------------------------------------------------------------------- | |
236 */ | |
237 *mode = pCCCmdPrm -> CCUGmode; | |
238 *index = pCCCmdPrm -> CCUGidx; | |
239 *info = pCCCmdPrm -> CCUGinfo; | |
240 | |
241 return( AT_CMPL ); | |
242 } | |
243 | |
244 /* | |
245 +--------------------------------------------------------------------+ | |
246 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
247 | STATE : code ROUTINE : qAT_PlusCLCC | | |
248 +--------------------------------------------------------------------+ | |
249 | |
250 PURPOSE : This is the functional counterpart to the +CLCC? AT command | |
251 which returns the current call status. | |
252 | |
253 */ | |
254 | |
255 GLOBAL T_ACI_RETURN qAT_PlusCLCC ( T_ACI_CMD_SRC srcId, | |
256 T_ACI_CLCC_CALDESC *calLst) | |
257 { | |
258 /* Implements Measure 47 and 216 */ | |
259 return ( qAT_plus_percent_CLCC(srcId, calLst, AT_CMD_CLCC, rdlPrm.rdlcId) ); | |
260 } | |
261 | |
262 /* | |
263 +--------------------------------------------------------------------+ | |
264 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
265 | STATE : code ROUTINE : qAT_PercentCLCC | | |
266 +--------------------------------------------------------------------+ | |
267 | |
268 PURPOSE : This is the functional counterpart to the %CLCC? AT command | |
269 which returns the current call status. | |
270 | |
271 */ | |
272 | |
273 GLOBAL T_ACI_RETURN qAT_PercentCLCC ( T_ACI_CMD_SRC srcId, | |
274 T_ACI_CLCC_CALDESC *calLst) | |
275 { | |
276 /* Implements Measure 47 and 216 */ | |
277 return ( qAT_plus_percent_CLCC(srcId, calLst, AT_CMD_P_CLCC, NO_ENTRY) ); | |
278 } | |
279 | |
280 /* | |
281 +--------------------------------------------------------------------+ | |
282 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
283 | STATE : code ROUTINE : qAT_PlusCEER | | |
284 +--------------------------------------------------------------------+ | |
285 | |
286 PURPOSE : This is the functional counterpart to the +CEER AT command | |
287 which returns an extended error report. | |
288 | |
289 */ | |
290 | |
291 GLOBAL T_ACI_RETURN qAT_PlusCEER ( T_ACI_CMD_SRC srcId, | |
292 USHORT *cause) | |
293 { | |
294 T_CC_CALL_TBL *ctbFail = ccShrdPrm.ctb[ccShrdPrm.cIdFail]; | |
295 | |
296 TRACE_FUNCTION ("qAT_PlusCEER()"); | |
297 | |
298 /* | |
299 *------------------------------------------------------------------- | |
300 * check command source | |
301 *------------------------------------------------------------------- | |
302 */ | |
303 if(!cmh_IsVldCmdSrc (srcId)) | |
304 { | |
305 return( AT_FAIL ); | |
306 } | |
307 | |
308 /* | |
309 *------------------------------------------------------------------- | |
310 * get error report | |
311 *------------------------------------------------------------------- | |
312 */ | |
313 | |
314 /* Extended error report to indicate attach related problems */ | |
315 if ((causeCeer NEQ CEER_NotPresent) AND (causeMod EQ P_CEER_mm)) | |
316 { | |
317 *cause = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_NET, MM_ORIGINATING_ENTITY, causeCeer); | |
318 return( AT_CMPL ); | |
319 } | |
320 if ((causeCeer NEQ CEER_NotPresent) AND (causeMod EQ P_CEER_ss)) | |
321 { | |
322 *cause = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_NET, SS_ORIGINATING_ENTITY, causeCeer); | |
323 return( AT_CMPL ); | |
324 } | |
325 if ((causeCeer EQ P_CEER_ACMMaxReachedOrExceeded) AND (causeMod EQ P_CEER_sim)) /* ACI cause check */ | |
326 { | |
327 *cause = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, MNCC_ACI_ORIGINATING_ENTITY, P_CEER_ACMMaxReachedOrExceeded); | |
328 return( AT_CMPL ); | |
329 } | |
330 | |
331 if ((causeCeer EQ P_CEER_InvalidFDN) AND (causeMod EQ P_CEER_sim)) /* ACI cause check */ | |
332 { | |
333 *cause = CAUSE_MAKE(DEFBY_CONDAT, ORIGSIDE_MS, MNCC_ACI_ORIGINATING_ENTITY, P_CEER_InvalidFDN ); | |
334 return( AT_CMPL ); | |
335 } | |
336 | |
337 if( ccShrdPrm.cIdFail < 0 OR ccShrdPrm.cIdFail > MAX_CALL_NR ) | |
338 { | |
339 *cause = CAUSE_MAKE(DEFBY_STD, ORIGSIDE_MS, MNCC_ACI_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
340 return( AT_CMPL ); | |
341 } | |
342 | |
343 /* | |
344 * This code has to become better understood, probably it can be simplified | |
345 * Be sure to use ctbFail here because TI compiler 1.22e may have a problem | |
346 * otherwise. | |
347 */ | |
348 if (ctbFail NEQ NULL) | |
349 { | |
350 /* Call table entry still existant */ | |
351 if (GET_CAUSE_VALUE(ctbFail->rejCs) NEQ NOT_PRESENT_8BIT) | |
352 { | |
353 *cause = ctbFail->rejCs; | |
354 } | |
355 else if (GET_CAUSE_VALUE(ctbFail->nrmCs) NEQ NOT_PRESENT_8BIT) | |
356 { | |
357 *cause = ctbFail->nrmCs; | |
358 } | |
359 else if (GET_CAUSE_VALUE(ctbFail->rslt) NEQ NOT_PRESENT_8BIT) | |
360 { | |
361 *cause = ctbFail->rslt; | |
362 } | |
363 else | |
364 { | |
365 /* in case network has sent no extended report */ | |
366 *cause = CAUSE_MAKE(DEFBY_STD, ORIGSIDE_MS, MNCC_ACI_ORIGINATING_ENTITY, NOT_PRESENT_8BIT); | |
367 } | |
368 } | |
369 else | |
370 { | |
371 /* Call table entry already freed */ | |
372 *cause = ccShrdPrm.ccCs[ccShrdPrm.cIdFail]; | |
373 } | |
374 return AT_CMPL; | |
375 } | |
376 | |
377 /* | |
378 +--------------------------------------------------------------------+ | |
379 | PROJECT : GSM-PS (6147) MODULE : CMH_CCS | | |
380 | STATE : code ROUTINE : sAT_PlusPAS | | |
381 +--------------------------------------------------------------------+ | |
382 | |
383 PURPOSE : This is the functional counterpart to the +CPAS AT command | |
384 which returns the phone activity status. | |
385 */ | |
386 | |
387 GLOBAL T_ACI_RETURN qAT_PlusCPAS ( T_ACI_CMD_SRC srcId, | |
388 T_ACI_CPAS_PAS *pas) | |
389 { | |
390 SHORT cId; /* holds call id */ | |
391 T_ACI_CFUN_FUN cfun_stat; | |
392 | |
393 TRACE_FUNCTION ("qAT_PlusCPAS()"); | |
394 | |
395 /* | |
396 *------------------------------------------------------------------- | |
397 * check command source | |
398 *------------------------------------------------------------------- | |
399 */ | |
400 if(!cmh_IsVldCmdSrc (srcId)) | |
401 { | |
402 return( AT_FAIL ); | |
403 } | |
404 | |
405 /* | |
406 *------------------------------------------------------------------- | |
407 * get phone activity status | |
408 *------------------------------------------------------------------- | |
409 */ | |
410 | |
411 /* check if power is off (+CFUN=0) */ | |
412 if ( qAT_PlusCFUN(srcId, &cfun_stat) EQ AT_FAIL ) | |
413 { | |
414 return( AT_FAIL ); | |
415 } | |
416 | |
417 if ( cfun_stat EQ CFUN_FUN_Minimum ) | |
418 { | |
419 *pas = CPAS_PAS_Asleep; | |
420 return( AT_CMPL ); | |
421 } | |
422 | |
423 /* search for active call */ | |
424 cId = psaCC_ctbFindCall( OWN_SRC_INV, CS_ACT, NO_VLD_CT ); | |
425 | |
426 if( cId NEQ NO_ENTRY ) | |
427 { | |
428 *pas = CPAS_PAS_CallProg; | |
429 return( AT_CMPL ); | |
430 } | |
431 | |
432 /* search for call on hold */ | |
433 cId = psaCC_ctbFindCall( OWN_SRC_INV, CS_HLD, NO_VLD_CT ); | |
434 | |
435 if( cId NEQ NO_ENTRY ) | |
436 { | |
437 *pas = CPAS_PAS_CallProg; | |
438 return( AT_CMPL ); | |
439 } | |
440 | |
441 /* search for an incoming call */ | |
442 cId = psaCC_ctbFindCall( (T_OWN)CMD_SRC_NONE, CS_ACT_REQ, CT_MTC ); | |
443 | |
444 if( cId NEQ NO_ENTRY ) | |
445 { | |
446 *pas = CPAS_PAS_Ring; | |
447 return( AT_CMPL ); | |
448 } | |
449 | |
450 /* ready to accept commands */ | |
451 *pas = CPAS_PAS_Ready; | |
452 return( AT_CMPL ); | |
453 } | |
454 | |
455 /* | |
456 +--------------------------------------------------------------------+ | |
457 | PROJECT : GSM-PS (6147) MODULE : CMH_CCS | | |
458 | STATE : code ROUTINE : sAT_PlusCSNS | | |
459 +--------------------------------------------------------------------+ | |
460 | |
461 PURPOSE : This is the functional counterpart to the +CSNS AT command | |
462 which returns the single numbering scheme mode. | |
463 */ | |
464 | |
465 GLOBAL T_ACI_RETURN qAT_PlusCSNS ( T_ACI_CMD_SRC srcId, | |
466 T_ACI_CSNS_MOD *mode) | |
467 { | |
468 | |
469 TRACE_FUNCTION ("qAT_PlusCSNS()"); | |
470 | |
471 /* | |
472 *------------------------------------------------------------------- | |
473 * check command source | |
474 *------------------------------------------------------------------- | |
475 */ | |
476 if(!cmh_IsVldCmdSrc (srcId)) | |
477 { | |
478 return( AT_FAIL ); | |
479 } | |
480 | |
481 /* | |
482 *------------------------------------------------------------------- | |
483 * get SNS mode | |
484 *------------------------------------------------------------------- | |
485 */ | |
486 *mode = (T_ACI_CSNS_MOD)ccShrdPrm.snsMode; | |
487 | |
488 return( AT_CMPL ); | |
489 } | |
490 | |
491 /* | |
492 +--------------------------------------------------------------------+ | |
493 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
494 | STATE : code ROUTINE : qAT_PercentCAL | | |
495 +--------------------------------------------------------------------+ | |
496 | |
497 PURPOSE : This is the functional counterpart to the %CAL? AT command | |
498 which returns the current call status. | |
499 03.06.03 SKA: This function is called by MFW only. It uses | |
500 this function to get the called number for emitting on display. | |
501 But there is a protocoll between ACI and MFW which says, that | |
502 the RAT_COLP signal sent by ACI to MFW at receiving of MNCC_SETUP_CNF | |
503 to tell MFW/BMI whether it can emit the called number caused by the | |
504 content of mncc_setup_cnf->connected_number.present sent by the network or not. | |
505 If present = PRES_PRES_REST, ACI does not send RAT_COLP to MFW, but in this | |
506 function ACI did copy the number to the MFW callTable structure! | |
507 Now, ACI does not copy the called number in case of PRES_PRES_REST and | |
508 MFW/BMI will emit an empty string on display. Therefore we could save | |
509 a lot of memory and internal traffic between ACI and MFW, if we keep | |
510 all the logic within ACI! | |
511 */ | |
512 | |
513 GLOBAL T_ACI_RETURN qAT_PercentCAL( T_ACI_CMD_SRC srcId, | |
514 T_ACI_CAL_ENTR* callTable ) | |
515 { | |
516 SHORT ctbIdx; /* holds call table index */ | |
517 SHORT lstIdx; /* holds call list index */ | |
518 | |
519 TRACE_FUNCTION ("qAT_PercentCAL()"); | |
520 | |
521 /* | |
522 *------------------------------------------------------------------- | |
523 * for every call of the call table | |
524 *------------------------------------------------------------------- | |
525 */ | |
526 for( ctbIdx = 0, lstIdx = 0; ctbIdx < MAX_CALL_NR; ctbIdx++ ) | |
527 { | |
528 if (ccShrdPrm.ctb[ctbIdx] NEQ NULL) | |
529 { | |
530 | |
531 /* | |
532 *--------------------------------------------------------------- | |
533 * fill in call type | |
534 *--------------------------------------------------------------- | |
535 */ | |
536 switch( psaCC_ctb(ctbIdx)->calType ) | |
537 { | |
538 case( CT_MOC ): | |
539 case( CT_MOC_RDL ): | |
540 case( CT_NI_MOC ): | |
541 callTable[lstIdx].calType = CAL_TYPE_MOC; | |
542 break; | |
543 | |
544 case( CT_MTC ): | |
545 callTable[lstIdx].calType = CAL_TYPE_MTC; | |
546 break; | |
547 | |
548 default: | |
549 callTable[lstIdx].calType = CAL_TYPE_NotPresent; | |
550 } | |
551 | |
552 /* | |
553 *--------------------------------------------------------------- | |
554 * fill in call status | |
555 *--------------------------------------------------------------- | |
556 */ | |
557 switch( psaCC_ctb(ctbIdx)->calStat ) | |
558 { | |
559 case( CS_ACT_REQ ): | |
560 switch( psaCC_ctb(ctbIdx)->calType ) | |
561 { | |
562 case( CT_MOC ): | |
563 case( CT_MOC_RDL ): | |
564 case( CT_NI_MOC ): | |
565 if( psaCC_ctb(ctbIdx)->alrtStat EQ AS_SND ) | |
566 { | |
567 callTable[lstIdx].status = CAL_STAT_Alerting; | |
568 } | |
569 else | |
570 { | |
571 callTable[lstIdx].status = CAL_STAT_Dial; | |
572 } | |
573 break; | |
574 | |
575 case( CT_MTC ): | |
576 if( psaCC_ctbFindCall ( (T_OWN)CMD_SRC_NONE, CS_ACT_REQ, NO_VLD_CT ) | |
577 NEQ -1 ) | |
578 { | |
579 callTable[lstIdx].status = CAL_STAT_Wait; | |
580 } | |
581 else | |
582 { | |
583 callTable[lstIdx].status = CAL_STAT_Incomming; | |
584 } | |
585 break; | |
586 | |
587 default: | |
588 callTable[lstIdx].status = CAL_STAT_NotPresent; | |
589 | |
590 } | |
591 break; | |
592 | |
593 case( CS_ACT ): | |
594 case( CS_MDF_REQ ): | |
595 case( CS_HLD_REQ ): | |
596 callTable[lstIdx].status = CAL_STAT_Active; | |
597 break; | |
598 | |
599 case( CS_HLD ): | |
600 callTable[lstIdx].status = CAL_STAT_Held; | |
601 break; | |
602 | |
603 case( CS_IDL ): | |
604 case( CS_DSC_REQ ): | |
605 callTable[lstIdx].status = CAL_STAT_DeactiveReq; | |
606 | |
607 /* | |
608 * reset of all other values | |
609 */ | |
610 callTable[lstIdx].mpty = CAL_MPTY_NotPresent; | |
611 callTable[lstIdx].type.ton = TON_NotPresent; | |
612 callTable[lstIdx].type.npi = NPI_NotPresent; | |
613 callTable[lstIdx].number[0] = '\0'; | |
614 #ifdef NO_ASCIIZ | |
615 callTable[lstIdx].alpha.cs = CS_NotPresent; | |
616 callTable[lstIdx].alpha.len = 0; | |
617 #else /* #ifdef NO_ASCIIZ */ | |
618 callTable[lstIdx].alpha[0] = '\0'; | |
619 #endif /* #ifdef NO_ASCIIZ */ | |
620 callTable[lstIdx].calType = CAL_TYPE_NotPresent; | |
621 callTable[lstIdx].calMode = CAL_MODE_NotPresent; | |
622 callTable[lstIdx].calOwner = CAL_OWN_NotPresent; | |
623 | |
624 | |
625 /* | |
626 * indes and next entry, because of the continue statement | |
627 */ | |
628 callTable[lstIdx].index = ctbIdx+1; | |
629 lstIdx++; | |
630 continue; | |
631 | |
632 case( CS_CPL_REQ ): | |
633 continue; | |
634 } | |
635 | |
636 /* | |
637 *--------------------------------------------------------------- | |
638 * fill in number of connected party | |
639 *--------------------------------------------------------------- | |
640 */ | |
641 switch( psaCC_ctb(ctbIdx)->calType ) | |
642 { | |
643 | |
644 case( CT_MOC ): | |
645 case( CT_MOC_RDL ): | |
646 case( CT_NI_MOC ): | |
647 /* presentation restricted FTA 31.1.4.2 procedure 1 */ | |
648 /* number not available due to interworking FTA 31.1.4.2 procedure 2 */ | |
649 if ((psaCC_ctb(ctbIdx)->clgPty.present NEQ MNCC_PRES_NOT_PRES) /* any .present indicator received from MSC? */ | |
650 AND (psaCC_ctb(ctbIdx)->clgPty.c_num EQ 0) ) /* but no number available? */ | |
651 { | |
652 /* | |
653 * this prevents MFW/BMI to emit the called number, but it | |
654 * ignores the NOT received COLP signal. Without a COLP signal | |
655 * MFW/BMI should not emit the called number. (FTA 31.1.4.2) | |
656 */ | |
657 callTable[lstIdx].number[0] = '\0'; | |
658 callTable[lstIdx].type.ton = TON_NotPresent; | |
659 callTable[lstIdx].type.npi = NPI_NotPresent; | |
660 } | |
661 else | |
662 { | |
663 psaCC_ctbCldAdr2Num (ctbIdx, callTable[lstIdx].number, | |
664 MAX_CC_ORIG_NUM_LEN); | |
665 callTable[lstIdx].type.ton = (T_ACI_TOA_TON)psaCC_ctb(ctbIdx)->cldPty.ton; | |
666 callTable[lstIdx].type.npi = (T_ACI_TOA_NPI)psaCC_ctb(ctbIdx)->cldPty.npi; | |
667 } | |
668 break; | |
669 | |
670 case( CT_MTC ): | |
671 psaCC_ctbClrAdr2Num (ctbIdx, callTable[lstIdx].number, | |
672 MAX_CC_ORIG_NUM_LEN); | |
673 callTable[lstIdx].type.ton = (T_ACI_TOA_TON)psaCC_ctb(ctbIdx)->clgPty.ton; | |
674 callTable[lstIdx].type.npi = (T_ACI_TOA_NPI)psaCC_ctb(ctbIdx)->clgPty.npi; | |
675 break; | |
676 | |
677 case( NO_VLD_CT ): | |
678 default: | |
679 callTable[lstIdx].number[0] = '\0'; | |
680 callTable[lstIdx].type.ton = TON_NotPresent; | |
681 callTable[lstIdx].type.npi = NPI_NotPresent; | |
682 break; | |
683 } | |
684 | |
685 #ifdef NO_ASCIIZ | |
686 memcpy( ( UBYTE* ) &callTable[lstIdx].alpha, | |
687 ( UBYTE* ) &psaCC_ctb(ctbIdx)->alphIdUni, | |
688 sizeof( T_ACI_PB_TEXT ) ); | |
689 #else /* NO_ASCIIZ */ | |
690 memcpy( callTable[lstIdx].alpha, | |
691 psaCC_ctb(ctbIdx)->alphIdUni.data, | |
692 psaCC_ctb(ctbIdx)->alphIdUni.len ); | |
693 | |
694 cmh_cvtFromDefGsm ( ( CHAR* ) psaCC_ctb(ctbIdx)->alphIdUni.data, | |
695 ( USHORT ) psaCC_ctb(ctbIdx)->alphIdUni.len, | |
696 callTable[lstIdx].alpha ); | |
697 #endif /* NO_ASCIIZ */ | |
698 | |
699 /* | |
700 *--------------------------------------------------------------- | |
701 * fill in in-band tones setting | |
702 *--------------------------------------------------------------- | |
703 */ | |
704 switch( psaCC_ctb(ctbIdx)->inBndTns ) | |
705 { | |
706 case( TRUE ): | |
707 callTable[lstIdx].ibtUse = CAL_IBT_TRUE; | |
708 break; | |
709 | |
710 case( FALSE ): | |
711 callTable[lstIdx].ibtUse = CAL_IBT_FALSE; | |
712 break; | |
713 } | |
714 | |
715 | |
716 /* | |
717 *--------------------------------------------------------------- | |
718 * fill in call mode | |
719 *--------------------------------------------------------------- | |
720 */ | |
721 switch( cmhCC_getcalltype(ctbIdx) ) | |
722 { | |
723 case( VOICE_CALL ): | |
724 switch( psaCC_ctb(ctbIdx)->BC | |
725 [(psaCC_ctb(ctbIdx)->curBC EQ 0)?1:0]. | |
726 bearer_serv) | |
727 { | |
728 case( MNCC_BEARER_SERV_ASYNC ): | |
729 if( psaCC_ctb(ctbIdx)->rptInd EQ MNCC_RI_CIRCULAR ) | |
730 callTable[lstIdx].calMode = CAL_MODE_VAD_Voice; | |
731 else | |
732 callTable[lstIdx].calMode = CAL_MODE_VFD_Voice; | |
733 break; | |
734 | |
735 case( MNCC_BEARER_SERV_FAX ): | |
736 callTable[lstIdx].calMode = CAL_MODE_VAF_Voice; | |
737 break; | |
738 | |
739 case( MNCC_BEARER_SERV_NOT_PRES ): | |
740 callTable[lstIdx].calMode = CAL_MODE_Voice; | |
741 break; | |
742 | |
743 default: | |
744 callTable[lstIdx].calMode = CAL_MODE_Unknown; | |
745 } | |
746 break; | |
747 | |
748 #ifdef FAX_AND_DATA | |
749 case( TRANS_CALL ): | |
750 case( NON_TRANS_CALL ): | |
751 switch( psaCC_ctb(ctbIdx)->BC | |
752 [(psaCC_ctb(ctbIdx)->curBC EQ 0)?1:0]. | |
753 bearer_serv) | |
754 { | |
755 case( MNCC_BEARER_SERV_SPEECH ): | |
756 if( psaCC_ctb(ctbIdx)->rptInd EQ MNCC_RI_CIRCULAR ) | |
757 callTable[lstIdx].calMode = CAL_MODE_VAD_Data; | |
758 else | |
759 callTable[lstIdx].calMode = CAL_MODE_VFD_Data; | |
760 break; | |
761 | |
762 case( MNCC_BEARER_SERV_NOT_PRES ): | |
763 callTable[lstIdx].calMode = CAL_MODE_Data; | |
764 break; | |
765 | |
766 default: | |
767 callTable[lstIdx].calMode = CAL_MODE_Unknown; | |
768 } | |
769 break; | |
770 | |
771 case( FAX_CALL ): | |
772 switch( psaCC_ctb(ctbIdx)->BC | |
773 [(psaCC_ctb(ctbIdx)->curBC EQ 0)?1:0]. | |
774 bearer_serv) | |
775 { | |
776 case( MNCC_BEARER_SERV_SPEECH ): | |
777 callTable[lstIdx].calMode = CAL_MODE_VAF_Fax; | |
778 break; | |
779 | |
780 case( MNCC_BEARER_SERV_NOT_PRES ): | |
781 callTable[lstIdx].calMode = CAL_MODE_Fax; | |
782 break; | |
783 | |
784 default: | |
785 callTable[lstIdx].calMode = CAL_MODE_Unknown; | |
786 } | |
787 break; | |
788 #endif /* #ifdef FAX_AND_DATA */ | |
789 | |
790 #if defined CO_UDP_IP || defined(FF_GPF_TCPIP) | |
791 | |
792 /* SPR#1983 - SH - Identify WAP call */ | |
793 #ifdef CO_UDP_IP | |
794 | |
795 case( UDPIP_CALL ): | |
796 /*fallthrough if both defined*/ | |
797 #endif | |
798 #if defined(FF_GPF_TCPIP) | |
799 case (TCPIP_CALL): | |
800 #endif /* FF_GPF_TCPIP */ | |
801 switch( psaCC_ctb(ctbIdx)->BC | |
802 [(psaCC_ctb(ctbIdx)->curBC EQ 0)?1:0]. | |
803 bearer_serv) | |
804 { | |
805 case( MNCC_BEARER_SERV_SPEECH ): | |
806 if( psaCC_ctb(ctbIdx)->rptInd EQ MNCC_RI_CIRCULAR ) | |
807 callTable[lstIdx].calMode = CAL_MODE_VAD_Data; | |
808 else | |
809 callTable[lstIdx].calMode = CAL_MODE_VFD_Data; | |
810 break; | |
811 | |
812 case( MNCC_BEARER_SERV_NOT_PRES ): | |
813 callTable[lstIdx].calMode = CAL_MODE_Data; | |
814 break; | |
815 | |
816 default: | |
817 callTable[lstIdx].calMode = CAL_MODE_Unknown; | |
818 break; | |
819 } | |
820 break; | |
821 #endif /* (CO_UDP_IP) || defined(FF_GPF_TCPIP) */ | |
822 default: | |
823 callTable[lstIdx].calMode = CAL_MODE_Unknown; | |
824 } | |
825 /* | |
826 *--------------------------------------------------------------- | |
827 * fill in call owner | |
828 *--------------------------------------------------------------- | |
829 */ | |
830 switch( (T_ACI_CMD_SRC)psaCC_ctb(ctbIdx)->calOwn ) | |
831 { | |
832 case( CMD_SRC_LCL ): | |
833 callTable[lstIdx].calOwner = CAL_OWN_LCL; | |
834 break; | |
835 #ifdef FF_ATI | |
836 case(CMD_SRC_ATI_1): | |
837 case(CMD_SRC_ATI_2): | |
838 case(CMD_SRC_ATI_3): | |
839 case(CMD_SRC_ATI_4): | |
840 callTable[lstIdx].calOwner = CAL_OWN_RMT; | |
841 break; | |
842 #endif /* FF_ATI */ | |
843 default: | |
844 callTable[lstIdx].calOwner = CAL_OWN_NONE; | |
845 } | |
846 | |
847 /* | |
848 *--------------------------------------------------------------- | |
849 * fill in multiparty status | |
850 *--------------------------------------------------------------- | |
851 */ | |
852 callTable[lstIdx].mpty = (psaCC_ctb(ctbIdx)->mptyStat EQ CS_ACT)? | |
853 CAL_MPTY_IsMember : CAL_MPTY_NoMember; | |
854 /* | |
855 *--------------------------------------------------------------- | |
856 * fill in call index | |
857 *--------------------------------------------------------------- | |
858 */ | |
859 callTable[lstIdx].index = ctbIdx+1; | |
860 lstIdx++; | |
861 } | |
862 } | |
863 | |
864 /* | |
865 *------------------------------------------------------------------- | |
866 * terminate list of calls | |
867 *------------------------------------------------------------------- | |
868 */ | |
869 if( lstIdx < ctbIdx ) | |
870 { | |
871 callTable[lstIdx].index = -1; | |
872 } | |
873 | |
874 return( AT_CMPL ); | |
875 } | |
876 | |
877 | |
878 /* | |
879 +--------------------------------------------------------------------+ | |
880 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
881 | STATE : code ROUTINE : qAT_CallActive | | |
882 +--------------------------------------------------------------------+ | |
883 | |
884 PURPOSE : The function checks whether at least one call is in an | |
885 active state. This is not an official AT command ! | |
886 */ | |
887 | |
888 GLOBAL UBYTE qAT_CallActive ( void ) | |
889 { | |
890 SHORT ctbIdx; /* holds call table index */ | |
891 | |
892 TRACE_FUNCTION ("qAT_CallActive()"); | |
893 | |
894 /* | |
895 *------------------------------------------------------------------- | |
896 * for every call of the call table | |
897 *------------------------------------------------------------------- | |
898 */ | |
899 for( ctbIdx = 0; ctbIdx < MAX_CALL_NR; ctbIdx++ ) | |
900 { | |
901 if (ccShrdPrm.ctb[ctbIdx] NEQ NULL) | |
902 { | |
903 /* | |
904 *--------------------------------------------------------------- | |
905 * check call status | |
906 *--------------------------------------------------------------- | |
907 */ | |
908 switch( psaCC_ctb(ctbIdx)->calStat ) | |
909 { | |
910 case CS_ACT: | |
911 case CS_HLD_REQ: | |
912 case CS_HLD: | |
913 case CS_MDF_REQ: | |
914 return TRUE; | |
915 default: | |
916 break; | |
917 } | |
918 } | |
919 | |
920 } | |
921 return FALSE; | |
922 } | |
923 | |
924 /* | |
925 +-------------------------------------------------------------------+ | |
926 | PROJECT : GSM-PS (6147) MODULE : PSA_CCF | | |
927 | ROUTINE : qAT_PercentALS | | |
928 +-------------------------------------------------------------------+ | |
929 | |
930 PURPOSE : get the ALS mode for outgoing calls (voice) | |
931 0: indicates bearer capability => BEARER_SERV_SPEECH | |
932 1: indicates bearer capability => BEARER_SERV_AUX_SPEECH | |
933 */ | |
934 | |
935 GLOBAL void cmhCC_get_active_als_mode( T_ACI_CMD_SRC srcId, T_ACI_ALS_MOD *mode ) | |
936 { | |
937 T_CC_CMD_PRM *pCCCmdPrm; /* points to CC command parameters */ | |
938 | |
939 pCCCmdPrm = &cmhPrm[srcId].ccCmdPrm; | |
940 *mode = pCCCmdPrm->ALSmode; | |
941 } | |
942 | |
943 GLOBAL T_ACI_RETURN qAT_PercentALS( T_ACI_CMD_SRC srcId, T_ACI_ALS_MOD *mode ) | |
944 { | |
945 TRACE_FUNCTION("qAT_PercentALS()"); | |
946 | |
947 if( !cmh_IsVldCmdSrc( srcId ) ) | |
948 { | |
949 return( AT_FAIL ); | |
950 } | |
951 | |
952 cmhCC_get_active_als_mode( srcId, mode ); | |
953 | |
954 return( AT_CMPL ); | |
955 } | |
956 | |
957 /* | |
958 +-------------------------------------------------------------------+ | |
959 | PROJECT : GSM-PS (6147) MODULE : PSA_CCF | | |
960 | ROUTINE : qAT_PercentCTTY | | |
961 +-------------------------------------------------------------------+ | |
962 | |
963 PURPOSE : Query the state of the TTY Service | |
964 */ | |
965 | |
966 GLOBAL T_ACI_RETURN qAT_PercentCTTY (T_ACI_CMD_SRC srcId, | |
967 T_ACI_CTTY_MOD *mode, | |
968 T_ACI_CTTY_REQ *req, | |
969 T_ACI_CTTY_STAT *stat, | |
970 T_ACI_CTTY_TRX *trx) | |
971 { | |
972 SHORT ctNr; | |
973 BOOL fnd_act = FALSE;; | |
974 | |
975 if( !cmh_IsVldCmdSrc( srcId ) ) | |
976 { | |
977 return( AT_FAIL ); | |
978 } | |
979 *mode = cmhPrm[srcId].ccCmdPrm.CTTYmode; | |
980 #ifdef FF_TTY | |
981 if (ccShrdPrm.ctmReq EQ MNCC_CTM_DISABLED) | |
982 { | |
983 *req = CTTY_REQ_Off; | |
984 } | |
985 else switch (ccShrdPrm.ttyCmd) | |
986 { | |
987 case TTY_ALL: | |
988 *req = CTTY_REQ_On; | |
989 break; | |
990 case TTY_HCO: | |
991 *req = CTTY_REQ_HCO; | |
992 break; | |
993 case TTY_VCO: | |
994 *req = CTTY_REQ_VCO; | |
995 break; | |
996 default: | |
997 *req = CTTY_REQ_Off; | |
998 break; | |
999 } | |
1000 for (ctNr = 0; !fnd_act AND ctNr < MAX_CALL_NR; ctNr++) | |
1001 { | |
1002 if (ccShrdPrm.ctb[ctNr] NEQ NULL) | |
1003 { | |
1004 switch (psaCC_ctb(ctNr)->calStat) | |
1005 { | |
1006 case CS_ACT_REQ: | |
1007 case CS_ACT: | |
1008 case CS_HLD_REQ: | |
1009 case CS_HLD: | |
1010 case CS_MDF_REQ: | |
1011 *stat = (ccShrdPrm.ctmState EQ TTY_STATE_ACTIVE)? | |
1012 CTTY_STAT_On: CTTY_STAT_Off; | |
1013 if (*stat EQ CTTY_STAT_On) | |
1014 { | |
1015 *trx = cmhCC_getTTYtrx_state ((int)ccShrdPrm.ttyCmd); | |
1016 } | |
1017 else | |
1018 { | |
1019 *trx = CTTY_TRX_Unknown; | |
1020 } | |
1021 fnd_act = TRUE; | |
1022 break; | |
1023 default: | |
1024 break; | |
1025 } | |
1026 } | |
1027 } | |
1028 if (!fnd_act) | |
1029 #else | |
1030 *req = CTTY_REQ_Off; | |
1031 #endif /* FF_TTY */ | |
1032 { | |
1033 *stat = CTTY_STAT_Unknown; | |
1034 *trx = CTTY_TRX_Unknown; | |
1035 } | |
1036 return( AT_CMPL ); | |
1037 } | |
1038 | |
1039 /* | |
1040 +--------------------------------------------------------------------+ | |
1041 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
1042 | STATE : code ROUTINE : qAT_PercentRDL | | |
1043 +--------------------------------------------------------------------+ | |
1044 | |
1045 PURPOSE : This is the functional counterpart to the %RDL? AT command | |
1046 which returns the current setting for redial mode. | |
1047 */ | |
1048 | |
1049 GLOBAL T_ACI_RETURN qAT_PercentRDL ( T_ACI_CMD_SRC srcId, | |
1050 T_ACI_CC_REDIAL_MODE* redial_mode, | |
1051 T_ACI_CC_REDIAL_NOTIF* notification) | |
1052 { | |
1053 TRACE_FUNCTION ("qAT_PercentRDL()"); | |
1054 | |
1055 /* check command source */ | |
1056 if(!cmh_IsVldCmdSrc (srcId)) | |
1057 { | |
1058 return( AT_FAIL ); | |
1059 } | |
1060 | |
1061 /* fill in parameter */ | |
1062 switch(rdlPrm.rdlMod) | |
1063 { | |
1064 case AUTOM_REPEAT_OFF: | |
1065 case AUTOM_REPEAT_ON: | |
1066 *redial_mode = rdlPrm.rdlMod; | |
1067 break; | |
1068 default: | |
1069 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1070 return( AT_FAIL ); | |
1071 } | |
1072 switch(rdlPrm.rdlModN) | |
1073 { | |
1074 case NO_NOTIF_USER: | |
1075 case NOTIF_USER: | |
1076 *notification = rdlPrm.rdlModN; | |
1077 return( AT_CMPL ); | |
1078 default: | |
1079 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1080 return( AT_FAIL ); | |
1081 } | |
1082 } | |
1083 | |
1084 #ifdef TI_PS_FF_AT_P_CMD_RDLB | |
1085 /* | |
1086 +--------------------------------------------------------------------+ | |
1087 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
1088 | STATE : code ROUTINE : qAT_PercentRDLB | | |
1089 +--------------------------------------------------------------------+ | |
1090 | |
1091 PURPOSE : This is the functional counterpart to the %RDLB? AT command | |
1092 which returns the current black list. | |
1093 */ | |
1094 | |
1095 GLOBAL T_ACI_RETURN qAT_PercentRDLB ( T_ACI_CMD_SRC srcId, | |
1096 T_ACI_CC_REDIAL_BLACKL *blackl, | |
1097 T_ACI_CC_REDIAL_NOTIF* notification) | |
1098 { | |
1099 TRACE_FUNCTION ("qAT_PercentRDLB()"); | |
1100 | |
1101 /* check command source */ | |
1102 if(!cmh_IsVldCmdSrc (srcId)) | |
1103 { | |
1104 return( AT_FAIL ); | |
1105 } | |
1106 | |
1107 if (rdlPrm.rdlMod EQ AUTOM_REPEAT_ON) | |
1108 { | |
1109 if((cc_blacklist_ptr NEQ NULL) AND (cc_blacklist_ptr->blCount NEQ 0)) | |
1110 {/* fill in parameter */ | |
1111 memcpy(blackl,cc_blacklist_ptr,sizeof(T_ACI_CC_REDIAL_BLACKL)); | |
1112 } | |
1113 *notification = rdlPrm.rdlBlN; | |
1114 return( AT_CMPL ); | |
1115 } | |
1116 else | |
1117 { | |
1118 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1119 return( AT_FAIL ); | |
1120 } | |
1121 } | |
1122 #endif /* TI_PS_FF_AT_P_CMD_RDLB */ | |
1123 /* | |
1124 +--------------------------------------------------------------------+ | |
1125 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
1126 | STATE : code ROUTINE : qAT_PercentCSSD | | |
1127 +--------------------------------------------------------------------+ | |
1128 | |
1129 PURPOSE : This is the functional counterpart to the AT%CSSD command | |
1130 which returns an extended error report. | |
1131 | |
1132 */ | |
1133 | |
1134 GLOBAL T_ACI_RETURN qAT_PercentCSSD ( T_ACI_CMD_SRC srcId, | |
1135 UBYTE *ss_diag) | |
1136 { | |
1137 T_CC_CALL_TBL *ctbFail = ccShrdPrm.ctb[ccShrdPrm.cIdFail]; | |
1138 | |
1139 TRACE_FUNCTION ("qAT_PercentCSSD()"); | |
1140 | |
1141 /* | |
1142 *------------------------------------------------------------------- | |
1143 * check command source | |
1144 *------------------------------------------------------------------- | |
1145 */ | |
1146 if(!cmh_IsVldCmdSrc (srcId)) | |
1147 { | |
1148 return( AT_FAIL ); | |
1149 } | |
1150 | |
1151 /* | |
1152 *------------------------------------------------------------------- | |
1153 * get ss diagnostic | |
1154 *------------------------------------------------------------------- | |
1155 */ | |
1156 | |
1157 /* | |
1158 * check whether this diagnostic is within the specified parameters | |
1159 * cross-check also MNCC SAP: VAL_ss_diag | |
1160 * (This implementation follows version V3.19.0 (2004-06)) | |
1161 */ | |
1162 if( (ctbFail->ssDiag >= MNCC_SS_DIAG_MOC_BAR_CUG) AND | |
1163 (ctbFail->ssDiag <= MNCC_SS_DIAG_CCBS_NOT_POSSIBLE )) | |
1164 { | |
1165 *ss_diag = ctbFail->ssDiag; | |
1166 return( AT_CMPL ); | |
1167 } | |
1168 /* not yet initialized or not defined, return no information available */ | |
1169 else | |
1170 { | |
1171 /*reset ccShrdPrm.ctb[ccShrdPrm.cIdFail].ssDiag */ | |
1172 *ss_diag = ctbFail->ssDiag = MNCC_SS_DIAG_NOT_PROVIDED; | |
1173 return( AT_CMPL ); | |
1174 } | |
1175 } | |
1176 | |
1177 #ifdef TI_PS_FF_AT_P_CMD_CUSCFG | |
1178 /* | |
1179 +--------------------------------------------------------------------+ | |
1180 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
1181 | STATE : code ROUTINE : qAT_PercentCUSCFG | | |
1182 +--------------------------------------------------------------------+ | |
1183 | |
1184 PURPOSE : This is the functional counterpart to the AT%CUSCFG query command | |
1185 which returns the customization status of the facility requested. | |
1186 | |
1187 */ | |
1188 GLOBAL T_ACI_RETURN qAT_PercentCUSCFG ( T_ACI_CMD_SRC srcId, | |
1189 T_ACI_CUSCFG_FAC facility, | |
1190 T_ACI_CUSCFG_STAT *status) | |
1191 { | |
1192 TRACE_FUNCTION ("qAT_PercentCUSCFG()"); | |
1193 | |
1194 /* | |
1195 *------------------------------------------------------------------- | |
1196 * check command source | |
1197 *------------------------------------------------------------------- | |
1198 */ | |
1199 if(!cmh_IsVldCmdSrc (srcId)) | |
1200 { | |
1201 return( AT_FAIL ); | |
1202 } | |
1203 | |
1204 switch(facility) | |
1205 { | |
1206 case CUSCFG_FAC_MO_SM_Control: | |
1207 *status = (T_ACI_CUSCFG_STAT)cuscfgParams.MO_SM_Control_SIM; | |
1208 break; | |
1209 | |
1210 case CUSCFG_FAC_MO_Call_Control: | |
1211 *status = (T_ACI_CUSCFG_STAT)cuscfgParams.MO_Call_Control_SIM; | |
1212 break; | |
1213 | |
1214 case CUSCFG_FAC_MO_SS_Control: | |
1215 *status = (T_ACI_CUSCFG_STAT)cuscfgParams.MO_SS_Control_SIM; | |
1216 break; | |
1217 | |
1218 case CUSCFG_FAC_MO_USSD_Control: | |
1219 *status = (T_ACI_CUSCFG_STAT)cuscfgParams.MO_USSD_Control_SIM; | |
1220 break; | |
1221 | |
1222 case CUSCFG_FAC_2_Digit_Call: | |
1223 *status = (T_ACI_CUSCFG_STAT)cuscfgParams.Two_digit_MO_Call; | |
1224 break; | |
1225 | |
1226 case CUSCFG_FAC_Ext_USSD_Res: | |
1227 *status = (T_ACI_CUSCFG_STAT)cuscfgParams.Ext_USSD_Response; | |
1228 break; | |
1229 | |
1230 case CUSCFG_FAC_T_MOBILE_Eons: | |
1231 *status = (T_ACI_CUSCFG_STAT)cuscfgParams.T_MOBILE_Eons; | |
1232 break; | |
1233 | |
1234 case CUSCFG_FAC_USSD_As_MO_Call: | |
1235 *status = (T_ACI_CUSCFG_STAT)cuscfgParams.USSD_As_MO_Call; | |
1236 break; | |
1237 | |
1238 | |
1239 default: | |
1240 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1241 return( AT_FAIL ); | |
1242 } | |
1243 return(AT_CMPL); | |
1244 } | |
1245 #endif /* TI_PS_FF_AT_P_CMD_CUSCFG */ | |
1246 | |
1247 #ifdef TI_PS_FF_AT_P_CMD_STDR | |
1248 /* | |
1249 +--------------------------------------------------------------------+ | |
1250 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
1251 | STATE : code ROUTINE : qAT_PercentSTDR | | |
1252 +--------------------------------------------------------------------+ | |
1253 | |
1254 PURPOSE : This is the functional counterpart to the AT%STDR command | |
1255 which returns the value of global variable <std>. | |
1256 | |
1257 */ | |
1258 | |
1259 GLOBAL T_ACI_RETURN qAT_PercentSTDR ( T_ACI_CMD_SRC srcId, | |
1260 UBYTE *rvstd) | |
1261 { | |
1262 TRACE_FUNCTION ("qAT_PercentSTDR()"); | |
1263 | |
1264 /* | |
1265 *------------------------------------------------------------------- | |
1266 * check command source | |
1267 *------------------------------------------------------------------- | |
1268 */ | |
1269 if(!cmh_IsVldCmdSrc (srcId)) | |
1270 { | |
1271 return( AT_FAIL ); | |
1272 } | |
1273 | |
1274 /* | |
1275 *------------------------------------------------------------------- | |
1276 * Read <std> | |
1277 *------------------------------------------------------------------- | |
1278 */ | |
1279 *rvstd = std; | |
1280 | |
1281 return( AT_CMPL ); | |
1282 } | |
1283 #endif /* TI_PS_FF_AT_P_CMD_STDR */ | |
1284 | |
1285 /* Implements Measure 47 and 216 */ | |
1286 /* | |
1287 +------------------------------------------------------------------------------ | |
1288 | Function : qAT_plus_percent_CLCC | |
1289 +------------------------------------------------------------------------------ | |
1290 | Purpose : This is common functional counterpart to the %CLCC? and +CLCC? | |
1291 | | |
1292 | Parameters : srcId - AT command source identifier | |
1293 | calLst - Points to CLCC current call | |
1294 | list element. | |
1295 | at_cmd_id - AT Command Identifier | |
1296 | ( AT_CMD_CLCC or AT_CMD_P_CLCC ) | |
1297 | | |
1298 | rdlcId - Redial Call Identifier , NO_ENTRY if no redial | |
1299 | | |
1300 | Return : ACI functional return codes | |
1301 +------------------------------------------------------------------------------ | |
1302 */ | |
1303 | |
1304 LOCAL T_ACI_RETURN qAT_plus_percent_CLCC( T_ACI_CMD_SRC srcId, | |
1305 T_ACI_CLCC_CALDESC *calLst, | |
1306 T_ACI_AT_CMD at_cmd_id, | |
1307 SHORT rdlcId ) | |
1308 { | |
1309 SHORT ctbIdx; | |
1310 SHORT lstIdx; | |
1311 int index; | |
1312 | |
1313 TRACE_FUNCTION ("qAT_plus_percent_CLCC()"); | |
1314 | |
1315 index = ( at_cmd_id EQ AT_CMD_P_CLCC )?1:0; | |
1316 /* | |
1317 *------------------------------------------------------------------- | |
1318 * for every call of the call table | |
1319 *------------------------------------------------------------------- | |
1320 */ | |
1321 for( ctbIdx = 0, lstIdx = 0; ctbIdx < MAX_CALL_NR; ctbIdx++ ) | |
1322 { | |
1323 if ( (ccShrdPrm.ctb[ctbIdx] NEQ NULL) AND (rdlcId EQ NO_ENTRY) ) | |
1324 { | |
1325 /* | |
1326 *--------------------------------------------------------------- | |
1327 * fill in call type | |
1328 *--------------------------------------------------------------- | |
1329 */ | |
1330 if ( ( psaCC_ctb(ctbIdx)->calType >= CT_MOC ) AND | |
1331 ( psaCC_ctb(ctbIdx)->calType <= CT_MOC_RDL )) | |
1332 { | |
1333 calLst[lstIdx].dir = | |
1334 (T_ACI_CLCC_DIR) aci_clcc_dir[psaCC_ctb(ctbIdx)->calType][index]; | |
1335 } | |
1336 | |
1337 | |
1338 /* | |
1339 *--------------------------------------------------------------- | |
1340 * fill in call status | |
1341 *--------------------------------------------------------------- | |
1342 */ | |
1343 switch( psaCC_ctb(ctbIdx)->calStat ) | |
1344 { | |
1345 case( CS_ACT_REQ ): | |
1346 switch( psaCC_ctb(ctbIdx)->calType ) | |
1347 { | |
1348 case( CT_MOC ): | |
1349 case( CT_MOC_RDL ): | |
1350 if( psaCC_ctb(ctbIdx)->alrtStat EQ AS_SND ) | |
1351 { | |
1352 calLst[lstIdx].stat = CLCC_STAT_Alerting; | |
1353 } | |
1354 else | |
1355 { | |
1356 calLst[lstIdx].stat = CLCC_STAT_Dialing; | |
1357 } | |
1358 break; | |
1359 | |
1360 case( CT_MTC ): | |
1361 if ( psaCC_ctbCallInUse ( ) ) | |
1362 { | |
1363 calLst[lstIdx].stat = CLCC_STAT_Waiting; | |
1364 } | |
1365 else | |
1366 { | |
1367 calLst[lstIdx].stat = CLCC_STAT_Incoming; | |
1368 } | |
1369 break; | |
1370 } | |
1371 break; | |
1372 | |
1373 case( CS_ACT ): | |
1374 case( CS_DSC_REQ ): | |
1375 /* | |
1376 * Also show calls in disconnecting state since in 4.08/5.4.4.2.1.1 ii) | |
1377 * the user is still connected to the network. | |
1378 * This call is then either terminated from the network side. | |
1379 * (after the operator announcement) or user initiated by ATH | |
1380 */ | |
1381 case( CS_MDF_REQ ): | |
1382 case( CS_HLD_REQ ): | |
1383 calLst[lstIdx].stat = CLCC_STAT_Active; | |
1384 break; | |
1385 | |
1386 case( CS_HLD ): | |
1387 calLst[lstIdx].stat = CLCC_STAT_Held; | |
1388 break; | |
1389 | |
1390 case( CS_IDL ): | |
1391 case( CS_CPL_REQ ): | |
1392 continue; | |
1393 } | |
1394 | |
1395 /* | |
1396 *--------------------------------------------------------------- | |
1397 * fill in number of connected party | |
1398 *--------------------------------------------------------------- | |
1399 */ | |
1400 switch( psaCC_ctb(ctbIdx)->calType ) | |
1401 { | |
1402 case( CT_MOC ): | |
1403 case( CT_MOC_RDL ): | |
1404 psaCC_ctbCldAdr2Num (ctbIdx, calLst[lstIdx].number, | |
1405 MAX_CC_ORIG_NUM_LEN); | |
1406 calLst[lstIdx].type.ton = (T_ACI_TOA_TON)psaCC_ctb(ctbIdx)->cldPty.ton; | |
1407 calLst[lstIdx].type.npi = (T_ACI_TOA_NPI)psaCC_ctb(ctbIdx)->cldPty.npi; | |
1408 break; | |
1409 | |
1410 case( CT_MTC ): | |
1411 psaCC_ctbClrAdr2Num (ctbIdx, calLst[lstIdx].number, | |
1412 MAX_CC_ORIG_NUM_LEN); | |
1413 calLst[lstIdx].type.ton = (T_ACI_TOA_TON)psaCC_ctb(ctbIdx)->clgPty.ton; | |
1414 calLst[lstIdx].type.npi = (T_ACI_TOA_NPI)psaCC_ctb(ctbIdx)->clgPty.npi; | |
1415 break; | |
1416 } | |
1417 #ifdef NO_ASCIIZ | |
1418 memcpy( ( UBYTE* ) &calLst[lstIdx].alpha, | |
1419 ( UBYTE* ) &psaCC_ctb(ctbIdx)->alphIdUni, | |
1420 sizeof( T_ACI_PB_TEXT ) ); | |
1421 #else /* NO_ASCIIZ */ | |
1422 memcpy( calLst[lstIdx].alpha, | |
1423 ccShrdPrm.ctb[ctbIdx].alphIdUni.data, | |
1424 ccShrdPrm.ctb[ctbIdx].alphIdUni.len ); | |
1425 | |
1426 cmh_cvtFromDefGsm ( ( CHAR* ) ccShrdPrm.ctb[ctbIdx].alphIdUni.data, | |
1427 ( USHORT ) ccShrdPrm.ctb[ctbIdx].alphIdUni.len, | |
1428 calLst[lstIdx].alpha ); | |
1429 #endif /* NO_ASCIIZ */ | |
1430 | |
1431 /* | |
1432 *--------------------------------------------------------------- | |
1433 * fill in call mode | |
1434 *--------------------------------------------------------------- | |
1435 */ | |
1436 switch( cmhCC_getcalltype(ctbIdx) ) | |
1437 { | |
1438 case( VOICE_CALL ): | |
1439 switch( psaCC_ctb(ctbIdx)->BC | |
1440 [(psaCC_ctb(ctbIdx)->curBC EQ 0)?1:0]. | |
1441 bearer_serv) | |
1442 { | |
1443 case( MNCC_BEARER_SERV_ASYNC ): | |
1444 if( psaCC_ctb(ctbIdx)->rptInd EQ MNCC_RI_CIRCULAR ) | |
1445 calLst[lstIdx].mode = CLCC_MODE_Voice; | |
1446 else | |
1447 calLst[lstIdx].mode = CLCC_MODE_VFDVoice; | |
1448 break; | |
1449 | |
1450 case( MNCC_BEARER_SERV_FAX ): | |
1451 calLst[lstIdx].mode = CLCC_MODE_VAFVoice; | |
1452 break; | |
1453 | |
1454 case( MNCC_BEARER_SERV_NOT_PRES ): | |
1455 calLst[lstIdx].mode = CLCC_MODE_Voice; | |
1456 break; | |
1457 | |
1458 default: | |
1459 calLst[lstIdx].mode = CLCC_MODE_Unknown; | |
1460 } | |
1461 break; | |
1462 | |
1463 #ifdef FAX_AND_DATA | |
1464 case( TRANS_CALL ): | |
1465 case( NON_TRANS_CALL ): | |
1466 switch( psaCC_ctb(ctbIdx)->BC | |
1467 [(psaCC_ctb(ctbIdx)->curBC EQ 0)?1:0]. | |
1468 bearer_serv) | |
1469 { | |
1470 case( MNCC_BEARER_SERV_SPEECH ): | |
1471 if( psaCC_ctb(ctbIdx)->rptInd EQ MNCC_RI_CIRCULAR ) | |
1472 calLst[lstIdx].mode = CLCC_MODE_VADData; | |
1473 else | |
1474 calLst[lstIdx].mode = CLCC_MODE_VFDData; | |
1475 break; | |
1476 | |
1477 case( MNCC_BEARER_SERV_NOT_PRES ): | |
1478 calLst[lstIdx].mode = CLCC_MODE_Data; | |
1479 break; | |
1480 | |
1481 default: | |
1482 calLst[lstIdx].mode = CLCC_MODE_Unknown; | |
1483 } | |
1484 break; | |
1485 | |
1486 case( FAX_CALL ): | |
1487 switch( psaCC_ctb(ctbIdx)->BC | |
1488 [(psaCC_ctb(ctbIdx)->curBC EQ 0)?1:0]. | |
1489 bearer_serv) | |
1490 { | |
1491 case( MNCC_BEARER_SERV_SPEECH ): | |
1492 calLst[lstIdx].mode = CLCC_MODE_VAFFax; | |
1493 break; | |
1494 | |
1495 case( MNCC_BEARER_SERV_NOT_PRES ): | |
1496 calLst[lstIdx].mode = CLCC_MODE_Fax; | |
1497 break; | |
1498 | |
1499 default: | |
1500 calLst[lstIdx].mode = CLCC_MODE_Unknown; | |
1501 } | |
1502 break; | |
1503 #endif /* #ifdef FAX_AND_DATA */ | |
1504 | |
1505 default: | |
1506 calLst[lstIdx].mode = CLCC_MODE_Unknown; | |
1507 } | |
1508 | |
1509 /* | |
1510 *--------------------------------------------------------------- | |
1511 * fill in multiparty status | |
1512 *--------------------------------------------------------------- | |
1513 */ | |
1514 calLst[lstIdx].mpty = (psaCC_ctb(ctbIdx)->mptyStat EQ CS_ACT)? | |
1515 CLCC_MPTY_IsMember : CLCC_MPTY_NoMember; | |
1516 /* | |
1517 *--------------------------------------------------------------- | |
1518 * fill in line1 or line2 | |
1519 *--------------------------------------------------------------- | |
1520 */ | |
1521 switch (cmhCC_GetCallType_from_bearer( &psaCC_ctb(ctbIdx)->BC[psaCC_ctb(ctbIdx)->curBC] )) | |
1522 { | |
1523 case ( CRING_SERV_TYP_Voice): | |
1524 calLst[lstIdx].class_type = CLCC_CLASS_Line1; | |
1525 break; | |
1526 | |
1527 case ( CRING_SERV_TYP_AuxVoice): | |
1528 calLst[lstIdx].class_type = CLCC_CLASS_Line2; | |
1529 break; | |
1530 | |
1531 default: | |
1532 calLst[lstIdx].class_type = CLCC_CLASS_NotPresent; | |
1533 break; | |
1534 } | |
1535 /* | |
1536 *--------------------------------------------------------------- | |
1537 * fill in progress description if using BAT interface | |
1538 *--------------------------------------------------------------- | |
1539 */ | |
1540 #ifdef FF_BAT | |
1541 if ( at_cmd_id EQ AT_CMD_P_CLCC ) | |
1542 { | |
1543 calLst[lstIdx].prog_desc = psaCC_ctb(ctbIdx)->prgDesc; | |
1544 } | |
1545 #endif | |
1546 | |
1547 /* | |
1548 *--------------------------------------------------------------- | |
1549 * fill in call index | |
1550 *--------------------------------------------------------------- | |
1551 */ | |
1552 calLst[lstIdx].idx = ctbIdx+1; | |
1553 lstIdx++; | |
1554 | |
1555 } | |
1556 } | |
1557 | |
1558 /* | |
1559 *------------------------------------------------------------------- | |
1560 * terminate list of calls | |
1561 *------------------------------------------------------------------- | |
1562 */ | |
1563 if( lstIdx < ctbIdx ) | |
1564 { | |
1565 calLst[lstIdx].idx = ACI_NumParmNotPresent; | |
1566 calLst[lstIdx].dir = CLCC_DIR_NotPresent; | |
1567 calLst[lstIdx].stat = CLCC_STAT_NotPresent; | |
1568 calLst[lstIdx].mode = CLCC_MODE_NotPresent; | |
1569 calLst[lstIdx].mpty = CLCC_MPTY_NotPresent; | |
1570 calLst[lstIdx].type.ton = TON_NotPresent; | |
1571 calLst[lstIdx].number[0] = 0x0; | |
1572 if( at_cmd_id EQ AT_CMD_P_CLCC ) | |
1573 { | |
1574 calLst[lstIdx].class_type = CLCC_CLASS_NotPresent; | |
1575 #ifdef FF_BAT | |
1576 calLst[lstIdx].prog_desc = NOT_PRESENT_8BIT; | |
1577 #endif | |
1578 } | |
1579 #ifdef NO_ASCIIZ | |
1580 calLst[lstIdx].alpha.cs = CS_NotPresent; | |
1581 calLst[lstIdx].alpha.len = 0; | |
1582 #else /* #ifdef NO_ASCIIZ */ | |
1583 calLst[lstIdx].alpha[0] = 0x0; | |
1584 #endif /* #ifdef NO_ASCIIZ */ | |
1585 } | |
1586 | |
1587 return( AT_CMPL ); | |
1588 } | |
1589 | |
1590 /* | |
1591 +--------------------------------------------------------------------+ | |
1592 | PROJECT : GSM-PS (6147) MODULE : CMH_CCQ | | |
1593 | STATE : code ROUTINE : qAT_PlusCVHU | | |
1594 +--------------------------------------------------------------------+ | |
1595 | |
1596 PURPOSE : This is query call for +CVHU for the control of the voice | |
1597 hangup | |
1598 | |
1599 */ | |
1600 GLOBAL T_ACI_RETURN qAT_PlusCVHU ( T_ACI_CMD_SRC srcId, T_ACI_CVHU_MODE *mode) | |
1601 { | |
1602 TRACE_FUNCTION("qAT_PlusCVHU()"); | |
1603 | |
1604 if(!cmh_IsVldCmdSrc (srcId)) | |
1605 { | |
1606 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1607 return( AT_FAIL ); | |
1608 } | |
1609 | |
1610 *mode = ccShrdPrm.cvhu; | |
1611 | |
1612 return( AT_CMPL ); | |
1613 } | |
1614 /*==== EOF ========================================================*/ |