comparison g23m/condat/ms/src/mfw/mfw_cm.c @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 /*
2 +--------------------------------------------------------------------+
3 | PROJECT: MMI-Framework (8417) $Workfile:: mfw_cm.c $|
4 | $Author:: Ak $Revision:: 1 $|
5 | CREATED: 3.11.98 $Modtime:: 10.04.00 14:58 $|
6 | STATE : code |
7 +--------------------------------------------------------------------+
8
9 MODULE : MFW_CM
10
11 PURPOSE : This modul contains call management functions.
12
13 HISTORY:
14
15 Mar 28, 2006 REF:DR OMAPS00072407 x0039928
16 Description: Phone hangs when tried to make an outgoing call
17 Solution: Reverting back the changes of issue OMAPS00048894 to stop from stack overflow.
18
19 Feb 27, 2006 REF:DR OMAPS00067884 x0039928
20 Description: Held call released at locosto phone does not release the call at other end
21 Solution: if the mode is greater than CHLD_MOD_RelDialCall then sAT_PercentCHLD() is called
22 instead of sAT_PlusCHLD()
23
24 Jan 27, 2006 REF:DR OMAPS00048894 x0039928
25 Description: Outgoing Call: The called number is not displayed while an outgoing call is made
26 Solution: The called number is extracted from the parameter of callCmEvent() for event E_CM_MO_RES and is displayed.
27
28 Sep 12, 2005 REF: MMI-SMR-34085 x0021334
29 Description: RE: Add +CDIP command - MMI Additions
30 Solution: Dummy implementation of function "rAT_PlusCDIP()" is done to enable successful compilation.
31 Nov 02, 2005 DR OMAPS00052132 xdeepadh
32 Bug:Not able to access the SMS inbox and also not able to send SMS in Locosto Lite build
33 Fix: The ATI Enums usage has been put under the FF_ATI flag.
34
35 Aug 10, 2005 REF: MMI-SPR-30099 x0018858
36 Description: During a held communication, if the user presses 4 and send then there is no response from network.
37 Solution: Modified the return value and also added a case statement to handle the response received.
38
39 Apr 07 2005 REF: CRR 29989 xpradipg
40 Description: Optimisation 3: replace the static global data with dynamic
41 allocation / deallocation
42 Solution: The static global variables are dynamically allocated and
43 deallocated
44
45 Apr 03, 2005 REF: CRR 29988 - xpradipg
46 Description: Optimisation 2: Reduce the keyboard buffer and the dtmf buffer
47 size
48 Solution : The dtmf buffer is reduced to 20 from 50
49
50 Apr 14, 2005 REF: CRR 29991 xpradipg
51 Description: Optimisation 5: Remove the static allocation and use dynamic
52 allocation/ deallocation for pb_list and black_list
53 Solution: The static definition is removed and replaced with the dynamic
54 allocation
55
56 Feb 03, 200 REF: CRR 25960 x0012850
57 Description: Call Hold: While one call in Active and other in Held by swapping either of phone is not audible
58 Solution: swapping action results in one of the calls getting muted. We attach user connection again.
59
60 Aug 23, 2004 REF: CRR 22222 xkundadu
61 Bug: Runaway Call Waiting Tone.
62 Call Waiting tone doesnot stop after ansering waiting call.
63
64 Fix: Handle the AT-Command source id CMD_SRC_ATI_2 also for call control
65 callback functions.
66
67 Jun 05, 2004 REF: CRR 18262 NISHIKANT KULKARNI
68 Description: The sample sends a STOP DTMF message without release of the key by the user
69 Solution: Instead of sending DTMF commands in "VTS_MOD_Auto" mode, on key press DTMF tone is started
70 using VTS_MOD_ManStart and on key release DTMF tone is stopped using VTS_MOD_ManStop mode.
71
72 // Apr 26, 2004 REF: CRR 16545 Ajith K P and Side effect of CRR 16545.
73 // Issue description: When the user enters 11SEND and if the first call is
74 // HELD call,the held call disconnects. This should not happen.
75 // Problem was, though sAT_PlusCHLD(..) is expected to disconnect an ACTIVE
76 // call only, it was disconnecting HELD call rather than returning AT_FAIL.
77 // If sAT_PlusCHLD() Fails, Send the user entered string as USSD to network using sAT-Dn().
78 // So now if the user wants to release a HELD call, in cm_disconect() we are calling the
79 // sAT_PlusCHLD(..) function with C
80
81 */
82
83 #define ENTITY_MFW
84
85 #include <string.h>
86 #include <stdio.h>
87 #include <stdlib.h>
88
89 #if defined (NEW_FRAME)
90
91 #include "typedefs.h"
92 #include "vsi.h"
93 #include "pei.h"
94 #include "custom.h"
95 #include "gsm.h"
96
97 #else
98
99 #include "STDDEFS.H"
100 #include "custom.h"
101 #include "gsm.h"
102 #include "vsi.h"
103
104 #endif
105
106
107 #include "mfw_mfw.h"
108 #include "mfw_phb.h"
109 #include "mfw_phbi.h"
110 #include "mfw_cm.h"
111 #include "mfw_cmi.h"
112 #include "mfw_nm.h"
113 #include "mfw_sim.h"
114 #include "mfw_sima.h"
115 #include "mfw_nmi.h"
116 #include "mfw_simi.h"
117 #include "mfw_win.h"
118
119 #include "mfw_tim.h"
120 #include "mfw_utils.h"
121
122 #include "ksd.h"
123 #include "psa.h"
124
125 #if defined (FAX_AND_DATA)
126 #include "aci_fd.h"
127 #endif
128
129 #include "cmh.h"
130 #include "phb.h"
131 #include "cmh_phb.h"
132
133 #include "mfw_ss.h"
134 #include "mfw_ssi.h"
135 #include "mfw_win.h"
136 #include "mfw_ffs.h"
137
138 #include "prim.h"
139 #ifndef PCM_2_FFS
140 #include "pcm.h"
141 #endif
142
143
144 /*
145 * Conditional compilation flag for CCBS testing.
146 * When defined, the cm_ccbs_... functions do not call ACI functions but
147 * simply set the return value variable to indicate success. Also the body
148 * of the rAT_PercentMMITEST function is defined for parsing AT%MMITEST
149 * commands and calling ACI/MFW functions as if CCBS events had occured.
150 */
151 // #define CCBS_TEST
152
153 /********* current define *******************************************/
154 // Apr 14, 2005 REF: CRR 29991 xpradipg
155 // remove the static definition
156 #ifndef FF_MMI_OPTIM
157 static T_MFW_CM_BLACKLIST_LIST black_list;
158 #endif
159
160 // Apr 06 2005 REF: CRR 29989 xpradipg
161 // The definition of global is removed since it is locally used
162 #ifndef FF_MMI_OPTIM
163 static T_ACI_CAL_ENTR call_tab[MAX_CALL_NR];
164 #endif
165 static T_MFW_PHB_LIST entries;
166 static T_MFW_CM_CC_STAT cc_stat; /* current outgoing call status */
167 static T_MFW_CM_COMMAND cmd;
168 static T_MFW_CM_NOTIFY notify;
169
170 static UBYTE call_type; /* indicate an ECC call or normal call */
171 static UBYTE call_stat; /* indicate an MO call or MT call */
172 static SHORT cc_id; /* current call index */
173 static UBYTE redial_stat;
174 static UBYTE redial_count;
175 static UBYTE cmd_hold;
176
177 static T_MFW_CM_CW_INFO in_call;
178 static T_MFW_CM_MO_INFO out_call;
179 static T_MFW_CM_DISCONNECT dis_connect;
180 static T_MFW_CM_REDIAL rdl;
181 static T_MFW_CM_CPI cm_cpi;
182 /* Marcus: CCBS: 14/11/2002: Start */
183 static T_MFW_CM_CCBS_INFO ccbs_info; // E_CM_CCBS data
184 static T_MFW_CM_CCBS_OP ccbs_op = CM_CCBS_NONE; // Current CCBS operation
185 /* Marcus: CCBS: 14/11/2002: End */
186
187 static T_CM_CLI cli_prefix;
188 /*CONQUEST 5998-MC 30/04/02 -initialised timers to zero (prevents corruption) */
189 static MfwHnd redialTim1= NULL; /* the 1th redialing */
190 static MfwHnd redialTim24 = NULL; /* the 2th to 4st redialing */
191 static MfwHnd redialTim5 = NULL; /* the 5th or over redialing */
192
193 static int cmCommand (U32 cmd, void *h); /* handle window commands */
194 static int cm_redial_timeout(MfwEvt e, MfwTim *t);
195 static char currAccepting = 0; /* ES!! 210999 */
196 static char currConnecting = 0; /* ES!! 290999 */
197 static T_ACI_AT_CMD currCmd;
198
199 void cm_force_disconnect(void); // RAVI
200
201 //APR 03 2005 - REF CRR: 29988 xpradipg
202 //The DTMF buffer is reduced from 50 to 20
203 #ifdef FF_MMI_REDUCED_KBD_BUFFER
204 #define MAX_DTMF_Q_ENTRIES 20
205 #else
206 #define MAX_DTMF_Q_ENTRIES 50
207 #endif
208 #define CPI_CAUSE_MASK 0xFF /* cq11676 cause mask 17-02-04 MZ */
209 static UBYTE dtmf_q[MAX_DTMF_Q_ENTRIES];
210 static SHORT mfw_cm_dtmf_q_id;
211 //xnkulkar 18262 This BOOL variable is used to determine whether we have received an
212 //acknowledegment for command sAT_PlusVTS() to start/stop the previous DTMF tone.
213 static BOOL expectRatOk = FALSE;
214
215 // MMI-SPR 13873 xkundadu.
216 // Added this boolean variable to check whether a particular call is in
217 // multiparty or not
218 BOOL bIsMultpty = FALSE;
219
220 EXTERN MfwHdr * current_mfw_elem;
221
222 LOCAL T_MFW_CM_CALL_STAT cm_cvt_call_status( T_ACI_CAL_STAT stat );
223
224
225 /*
226 +--------------------------------------------------------------------+
227 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
228 | STATE : code ROUTINE: cm_init |
229 +--------------------------------------------------------------------+
230
231
232 PURPOSE : initialize for call management
233
234 */
235
236 void cm_init(void)
237 {
238 // Apr 14, 2005 REF: CRR 29991 xpradipg
239 // local variable definition
240 #ifdef FF_MMI_OPTIM
241 T_MFW_CM_BLACKLIST_LIST black_list;
242 int8 file;
243 #endif
244 TRACE_FUNCTION ("cm_init()");
245 memset(&black_list, 0, sizeof(T_MFW_CM_BLACKLIST_LIST));
246 // Apr 14, 2005 REF: CRR 29991 xpradipg
247 // Since the blacklist is not persistent across powercycles we reset the file
248 // contents
249 #ifdef FF_MMI_OPTIM
250 if( flash_MMI_blackList_write((U8 *)&black_list, sizeof(T_MFW_CM_BLACKLIST_LIST),0) < 0)
251 TRACE_EVENT("Error opening the black list file");
252 #endif
253
254 currAccepting = 0; /* ES!! 210999 */
255 currConnecting = 0; /* ES!! 290999 */
256
257 call_type = MFW_CALL_FREE;
258 call_stat = MFW_CALL_FREE;
259 cc_stat.type = MFW_CALL_FREE;
260 cc_id = 0;
261
262 cmd_hold = 0;
263 currCmd = AT_CMD_NONE;
264
265 // get prefix from EEPROM
266 cli_prefix = 0;
267
268 /* create time event for redialing */
269 redialTim1 = timCreate (0, MIN_DURATION_1, (MfwCb)cm_redial_timeout);
270 redialTim24 = timCreate (0, MIN_DURATION_2_4, (MfwCb)cm_redial_timeout);
271 redialTim5 = timCreate (0, MIN_DURATION_5, (MfwCb)cm_redial_timeout);
272
273 redial_stat = (UBYTE)FFS_flashData.redial_mode;
274
275 mfwCommand[MfwTypCm] = (MfwCb) cmCommand;
276
277 /*
278 ** Create a static circular buffer to hold the dtmf tones
279 */
280 mfw_cm_dtmf_q_id = mfw_cbuf_create( MAX_DTMF_Q_ENTRIES,
281 sizeof(UBYTE),
282 0,
283 0xFF,
284 TRUE,
285 (void *)&dtmf_q[0]);
286
287 if (mfw_cm_dtmf_q_id < 0)
288 TRACE_EVENT_P1("ERROR : mfw_cbuf_create failed with error value %d", mfw_cm_dtmf_q_id);
289 }
290
291
292 /*
293 +--------------------------------------------------------------------+
294 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
295 | STATE : code ROUTINE: cm_exit |
296 +--------------------------------------------------------------------+
297
298
299 PURPOSE :
300
301 */
302
303 void cm_exit(void)
304 {
305 TRACE_FUNCTION ("cm_exit()");
306
307 /* delete time event for redialing */
308 timDelete (redialTim5);
309 timDelete (redialTim24);
310 timDelete (redialTim1);
311 }
312
313
314 /*
315 +--------------------------------------------------------------------+
316 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
317 | STATE : code ROUTINE: cm_create |
318 +--------------------------------------------------------------------+
319
320
321 PURPOSE : create event for call management
322
323 */
324
325 T_MFW_HND cm_create(T_MFW_HND hWin, T_MFW_EVENT event, T_MFW_CB cbfunc)
326 {
327 T_MFW_HDR *hdr;
328 T_MFW_CM *cm_para;
329
330 TRACE_FUNCTION ("cm_create()");
331
332 hdr = (T_MFW_HDR *) mfwAlloc(sizeof (T_MFW_HDR));
333 cm_para = (T_MFW_CM *) mfwAlloc(sizeof (T_MFW_CM));
334
335 if (!hdr OR !cm_para)
336 return FALSE;
337
338 /*
339 * initialisation of the handler
340 */
341 cm_para->emask = event;
342 cm_para->handler = cbfunc;
343
344 hdr->data = cm_para; /* store parameter in node */
345 hdr->type = MFW_TYP_CM; /* store type of event handler */
346
347 /*
348 * installation of the handler
349 */
350 return mfwInsert((T_MFW_HDR *)hWin, hdr);
351 }
352
353
354 /*
355 +--------------------------------------------------------------------+
356 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
357 | STATE : code ROUTINE: cm_delete |
358 +--------------------------------------------------------------------+
359
360
361 PURPOSE : delete a event for call management
362
363 */
364
365 T_MFW_RES cm_delete(T_MFW_HND h)
366 {
367 TRACE_FUNCTION ("cm_delete()");
368
369 if (!h OR !((T_MFW_HDR *)h)->data)
370 return MFW_RES_ILL_HND;
371
372 if (!mfwRemove((T_MFW_HDR *)h))
373 return MFW_RES_ILL_HND;
374
375 mfwFree((U8 *)(((T_MFW_HDR *) h)->data),sizeof(T_MFW_CM));
376 mfwFree((U8 *)h,sizeof(T_MFW_HDR));
377
378 return MFW_RES_OK;
379 }
380
381
382 /*
383 +--------------------------------------------------------------------+
384 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
385 | STATE : code ROUTINE: cm_signal |
386 +--------------------------------------------------------------------+
387
388 PURPOSE : send a event signal.
389
390 */
391
392 void cm_signal(T_MFW_EVENT event, void * para)
393 {
394 UBYTE temp;
395
396
397
398 temp = dspl_Enable(0);
399
400
401 if (mfwSignallingMethod EQ 0)
402 {
403 /*
404 * focus is on a window
405 */
406 if (mfwFocus)
407 /*
408 * send event to sim management
409 * handler if available
410 */
411 if (cm_sign_exec (mfwFocus, event, para))
412 {
413 dspl_Enable(temp);
414 return;
415 }
416
417 /*
418 * acutal focussed window is not available
419 * or has no network management registration
420 * handler, then search all nodes from the root.
421 */
422 if (mfwRoot)
423 cm_sign_exec (mfwRoot, event, para);
424 }
425 else
426 {
427 MfwHdr * h = 0;
428
429 /*
430 * Focus set, then start here
431 */
432 if (mfwFocus)
433 h = mfwFocus;
434 /*
435 * Focus not set, then start root
436 */
437 if (!h)
438 h = mfwRoot;
439
440 /*
441 * No elements available, return
442 */
443
444 while (h)
445
446
447 {
448 /*
449 * Signal consumed, then return
450 */
451 if (cm_sign_exec (h, event, para))
452 {
453 dspl_Enable(temp);
454 return;
455 }
456
457 /*
458 * All windows tried inclusive root
459 */
460 if (h == mfwRoot)
461 {
462 dspl_Enable(temp);
463 return;
464 }
465
466 /*
467 * get parent window
468 */
469 h = mfwParent(mfwParent(h));
470 if(h)
471 h = ((MfwWin * )(h->data))->elems;
472 }
473 cm_sign_exec (mfwRoot, event, para);
474 }
475 dspl_Enable(temp);
476 }
477
478 /*
479 +--------------------------------------------------------------------+
480 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
481 | STATE : code ROUTINE: cm_sign_exec |
482 +--------------------------------------------------------------------+
483
484
485 PURPOSE : Send a signal if CM management handler.
486
487 */
488
489 BOOL cm_sign_exec (T_MFW_HDR * cur_elem, T_MFW_EVENT event, T_MFW_CM_PARA * para)
490 {
491 TRACE_FUNCTION ("cm_sign_exec()");
492
493 while (cur_elem)
494 {
495 /*
496 * event handler is available
497 */
498 if (cur_elem->type EQ MFW_TYP_CM)
499 {
500 T_MFW_CM * cm_data;
501 /*
502 * handler is CM management handler
503 */
504 cm_data = (T_MFW_CM *)cur_elem->data;
505 if (cm_data->emask & event)
506 {
507 /*
508 * event is expected by the call back function
509 */
510 cm_data->event = event;
511 switch (event)
512 {
513 case E_CM_COLP:
514 memcpy (&cm_data->para.mo_data, para, sizeof (T_MFW_CM_MO_INFO));
515 break;
516
517 case E_CM_DISCONNECT:
518 memcpy (&cm_data->para.disconnect, para, sizeof (T_MFW_CM_DISCONNECT));
519 break;
520 case E_CM_DISCONNECT_ALL:
521 memcpy (&cm_data->para.disconnect_all, para, sizeof (T_MFW_CM_DISCONNECT_ALL));
522 break;
523
524 case E_CM_CW:
525 memcpy (&cm_data->para.cw_info, para, sizeof (T_MFW_CM_CW_INFO));
526 break;
527
528 case E_CM_COMMAND:
529 memcpy (&cm_data->para.command, para, sizeof (T_MFW_CM_COMMAND));
530 break;
531
532 case E_CM_AOC:
533 memcpy (&cm_data->para.aoc_info, para, sizeof (T_MFW_CM_AOC_INFO));
534 break;
535
536 case E_CM_REDIAL:
537 memcpy (&cm_data->para.rdl, para, sizeof (T_MFW_CM_REDIAL));
538 break;
539
540 case E_CM_CONNECT_ACK:
541 memcpy (&cm_data->para.call_id, para, sizeof (SHORT));
542 break;
543
544 case E_CM_MO_RES:
545 memcpy (&cm_data->para.call_id, para, sizeof (SHORT));
546 break;
547
548 case E_CM_CPI:
549 memcpy (&cm_data->para.cm_cpi, para, sizeof (T_MFW_CM_CPI));
550 break;
551
552 case E_CM_RING_OFF:
553 break;
554
555 case E_CM_AOC_CNF:
556 memcpy (&cm_data->para.aoc_cnf, para, sizeof (T_MFW_CM_AOC_CNF));
557 break;
558
559 case E_CM_DTMF:
560 memcpy (&cm_data->para.dtmf_tone, para, sizeof (UBYTE));
561 break;
562
563 case E_CM_NOTIFY:
564 memcpy (&cm_data->para.notify, para, sizeof (T_MFW_CM_NOTIFY));
565 break;
566 /*MC SPR 1392*/
567 case E_CM_CALL_DEFLECT_STATUS:
568 memcpy (&cm_data->para.call_deflect_status, para, sizeof (BOOL));
569 break;
570 /* Marcus: CCBS: 14/11/2002: Start */
571 case E_CM_CCBS:
572 TRACE_EVENT("E_CM_CCBS");
573 memcpy (&cm_data->para.ccbs, para, sizeof (T_MFW_CM_CCBS_INFO));
574 break;
575 /* Marcus: CCBS: 14/11/2002: End */
576
577 case E_CM_CTYI:
578 memcpy (&cm_data->para.ctyi, para, sizeof (T_MFW_CM_CTYI));
579 break;
580
581 }
582
583 /*
584 * if call back defined, call it
585 */
586 if (cm_data->handler)
587 {
588 // PATCH LE 06.06.00
589 // store current mfw elem
590 current_mfw_elem = cur_elem;
591 // END PATCH LE 06.06.00
592 if ((*(cm_data->handler)) (cm_data->event, (void *)&cm_data->para))
593 return TRUE;
594 }
595 }
596 }
597 cur_elem = cur_elem->next;
598 }
599 return FALSE;
600 }
601
602
603 /*
604 +--------------------------------------------------------------------+
605 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
606 | STATE : code ROUTINE : cm_callTyp_cvt |
607 +--------------------------------------------------------------------+
608
609
610 PURPOSE : This function is used to convert the type of call class
611 used by MFW to the type of call class used by ACI.
612
613 */
614
615 LOCAL T_MFW_CM_CALL_TYPE cm_callTyp_cvt(T_ACI_CLASS cls)
616 {
617 switch ( cls )
618 {
619 case ( CLASS_Vce ) : return VOICE_CALL;
620 case ( CLASS_AuxVce): return AuxVOICE_CALL;
621 case ( CLASS_Dat ) : return DATA_CALL;
622 case ( CLASS_Fax ) : return FAX_CALL;
623 case ( CLASS_VceDat ) :
624 case ( CLASS_VceFax ) :
625 case ( CLASS_DatFax ) :
626 case ( CLASS_VceDatFax ): return (T_MFW_CM_CALL_TYPE)cls;
627 case ( CLASS_None ) : return NONE_TYPE;
628 case (CLASS_NotPresent): return NONE_TYPE;
629
630 default: return NONE_TYPE;
631 }
632 }
633
634
635 /*
636 +--------------------------------------------------------------------+
637 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
638 | STATE : code ROUTINE: cm_search_callId |
639 +--------------------------------------------------------------------+
640
641
642 PURPOSE : find call index from call table
643
644 */
645
646 int cm_search_callId(T_ACI_CAL_STAT type, SHORT *id)
647 {
648 int i;
649 // Apr 06 2005 REF: CRR 29989 xpradipg
650 // Local definition and allocation
651 #ifdef FF_MMI_OPTIM
652 T_ACI_CAL_ENTR *call_tab;
653 *id = 0;
654 call_tab = (T_ACI_CAL_ENTR*)mfwAlloc(sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
655 if(NULL == call_tab)
656 return CM_ERROR;
657 #else
658 *id = 0;
659 #endif
660 TRACE_FUNCTION("cm_search_callId()");
661
662
663 if (qAT_PercentCAL(CMD_SRC_LCL, call_tab) != AT_CMPL)
664 {
665 // Apr 06 2005 REF: CRR 29989 xpradipg
666 // deallocation of memory allocated
667 #ifdef FF_MMI_OPTIM
668 if(call_tab)
669 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
670 #endif
671 return CM_ERROR;
672 }
673
674 for (i=0; i<MAX_CALL_NR; i++)
675 {
676 if (call_tab[i].index == -1)
677 break;
678
679 if (call_tab[i].status == type)
680 {
681 *id = call_tab[i].index;
682 // Apr 06 2005 REF: CRR 29989 xpradipg
683 // deallocation of memory
684 #ifdef FF_MMI_OPTIM
685 if(call_tab)
686 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
687 #endif
688 return CM_OK;
689 }
690
691 }
692 // Apr 06 2005 REF: CRR 29989 xpradipg
693 // deallocation of memory
694 #ifdef FF_MMI_OPTIM
695 if(call_tab)
696 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
697 #endif
698 return CM_ERROR;
699 }
700
701 /*
702 +--------------------------------------------------------------------+
703 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
704 | STATE : code ROUTINE: cm_search_callMode |
705 +--------------------------------------------------------------------+
706
707
708 PURPOSE : find call type from call table
709
710 */
711
712 T_ACI_CAL_MODE cm_search_callMode(SHORT id)
713 {
714 int i;
715 // Apr 06 2005 REF: CRR 29989 xpradipg
716 // allocation of memory, if the memory allocation fails then we return the
717 // error value same as when the qAT_PercentCAL() fails
718 #ifdef FF_MMI_OPTIM
719 T_ACI_CAL_ENTR *call_tab;//[MAX_CALL_NR];
720 T_ACI_CAL_MODE calMode;
721 call_tab = (T_ACI_CAL_ENTR*)mfwAlloc(sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
722 if(NULL == call_tab)
723 return CAL_MODE_Unknown;
724 #endif
725
726 TRACE_FUNCTION("cm_search_callMode()");
727
728 if (qAT_PercentCAL(CMD_SRC_LCL, call_tab) != AT_CMPL)
729 {
730 // Apr 06 2005 REF: CRR 29989 xpradipg
731 // deallocate memory
732 #ifdef FF_MMI_OPTIM
733 if(call_tab)
734 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
735 #endif
736 return CAL_MODE_Unknown;
737 }
738 for (i=0; i<MAX_CALL_NR; i++)
739 {
740 if (call_tab[i].index == -1)
741 break;
742
743 if (call_tab[i].index == id)
744 {
745 // Apr 06 2005 REF: CRR 29989 xpradipg
746 // deallocate memory
747 #ifdef FF_MMI_OPTIM
748 calMode = call_tab[i].calMode;
749 if(call_tab)
750 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
751 return calMode;
752 #else
753 return call_tab[i].calMode;
754 #endif
755 }
756 }
757 // Apr 06 2005 REF: CRR 29989 xpradipg
758 // deallocate memory
759 #ifdef FF_MMI_OPTIM
760 if(call_tab)
761 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
762 #endif
763 return CAL_MODE_Unknown;
764 }
765
766 /*
767 +--------------------------------------------------------------------+
768 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
769 | STATE : code ROUTINE: cm_search_mptyId |
770
771
772 PURPOSE : find multiparty call index from call table
773
774 */
775
776 int cm_search_mptyId(T_ACI_CAL_MPTY type, SHORT *id)
777 {
778 int i;
779 // Apr 06 2005 REF: CRR 29989 xpradipg
780 // allocate memory
781 #ifdef FF_MMI_OPTIM
782 T_ACI_CAL_ENTR *call_tab;//[MAX_CALL_NR];
783 call_tab = (T_ACI_CAL_ENTR*)mfwAlloc(sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
784 if( NULL == call_tab)
785 return CM_ERROR;
786 #endif
787
788 TRACE_FUNCTION("cm_search_mptyId()");
789 *id = 0;
790
791 if (qAT_PercentCAL(CMD_SRC_LCL, call_tab) != AT_CMPL)
792 {
793 // Apr 06 2005 REF: CRR 29989 xpradipg
794 // deallocate memory
795 #ifdef FF_MMI_OPTIM
796 if(call_tab)
797 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
798 #endif
799 return CM_ERROR;
800 }
801 for (i=0; i<MAX_CALL_NR; i++)
802 {
803 if (call_tab[i].index == -1)
804 break;
805
806 if (call_tab[i].mpty == type)
807 {
808 *id = call_tab[i].index;
809 // Apr 06 2005 REF: CRR 29989 xpradipg
810 // deallocate memory
811 #ifdef FF_MMI_OPTIM
812 if(call_tab)
813 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
814 #endif
815 return CM_OK;
816 }
817 }
818 // Apr 06 2005 REF: CRR 29989 xpradipg
819 // deallocate memory
820 #ifdef FF_MMI_OPTIM
821 if(call_tab)
822 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
823 #endif
824 return CM_ERROR;
825 }
826
827
828 /*
829 +-------------------------------------------------------------------+
830 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
831 | STATE : code ROUTINE: cm_search_numId |
832 +-------------------------------------------------------------------+
833
834
835 PURPOSE : find call index from call table
836
837 */
838
839 LOCAL SHORT cm_search_numId(UBYTE *number)
840 {
841 int i;
842 // Apr 06 2005 REF: CRR 29989 xpradipg
843 // allocate memory
844 #ifdef FF_MMI_OPTIM
845 SHORT index;
846 T_ACI_CAL_ENTR *call_tab;//[MAX_CALL_NR];
847 call_tab = (T_ACI_CAL_ENTR*)mfwAlloc(sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
848 if(NULL == call_tab)
849 return 0;
850 #endif
851
852 TRACE_FUNCTION("cm_search_numId()");
853
854 if (qAT_PercentCAL(CMD_SRC_LCL, call_tab) != AT_CMPL)
855 {
856 // Apr 06 2005 REF: CRR 29989 xpradipg
857 // deallocate memory
858 #ifdef FF_MMI_OPTIM
859 if(call_tab)
860 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
861 #endif
862 return 0;
863 }
864
865 for (i=0; i<MAX_CALL_NR; i++)
866 {
867 if (call_tab[i].index == -1)
868 break;
869
870 if (!strcmp(call_tab[i].number, (char *)number))
871 {
872 // Apr 06 2005 REF: CRR 29989 xpradipg
873 // deallocate memory
874 #ifdef FF_MMI_OPTIM
875 index = call_tab[i].index;
876 if(call_tab)
877 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
878 return index;
879 #else
880 return call_tab[i].index;
881 #endif
882 }
883 }
884 // Apr 06 2005 REF: CRR 29989 xpradipg
885 // deallocate memory
886 #ifdef FF_MMI_OPTIM
887 if(call_tab)
888 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
889 #endif
890 return 0;
891 }
892
893
894 /*
895 +--------------------------------------------------------------------+
896 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
897 | STATE : code ROUTINE: cm_search_callStat |
898 +--------------------------------------------------------------------+
899
900
901 PURPOSE : Search the information from call table.
902
903 */
904
905 T_MFW cm_search_callStat(SHORT call_number,
906 T_MFW_CM_CALL_STAT *stat,
907 UBYTE *ton,
908 UBYTE *mode)
909 {
910 int i;
911 // Apr 06 2005 REF: CRR 29989 xpradipg
912 // allocat memory
913 #ifdef FF_MMI_OPTIM
914 T_ACI_CAL_ENTR *call_tab;//[MAX_CALL_NR];
915 call_tab = (T_ACI_CAL_ENTR*)mfwAlloc(sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
916 if( NULL == call_tab)
917 return CM_ERROR;
918 #endif
919
920 if (qAT_PercentCAL(CMD_SRC_LCL, call_tab) EQ AT_CMPL)
921 {
922 for (i=0; i<MAX_CALL_NR; i++)
923 {
924 if (call_tab[i].index == -1)
925 break;
926
927 if (call_tab[i].index == call_number)
928 {
929 *stat = cm_cvt_call_status(call_tab[i].status);
930 *ton = phb_cvtTon(call_tab[i].type.ton);
931 *mode = cm_cvt_call_mode(call_tab[i].calMode);
932 // Apr 06 2005 REF: CRR 29989 xpradipg
933 // deallocate memory
934 #ifdef FF_MMI_OPTIM
935 if(call_tab)
936 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
937 #endif
938
939 return CM_OK;
940 }
941 }
942 // Apr 06 2005 REF: CRR 29989 xpradipg
943 // this will be returned once we get out of the if statement
944 #ifndef FF_MMI_OPTIM
945 return CM_ERROR;
946 #endif
947 }
948 // Apr 06 2005 REF: CRR 29989 xpradipg
949 // deallocate memory
950 #ifdef FF_MMI_OPTIM
951 if(call_tab)
952 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
953 #endif
954 return CM_ERROR;
955 }
956
957
958 /*
959 +--------------------------------------------------------------------+
960 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
961 | STATE : code ROUTINE: cm_check_emergency |
962 +--------------------------------------------------------------------+
963
964
965 PURPOSE : Check emergency call number
966
967 */
968
969 T_MFW cm_check_emergency(UBYTE *number)
970 {
971 //UBYTE index; // RAVI
972 // T_MFW_PHB_TEXT findText; // RAVI
973 // T_MFW_PHB_ENTRY entry; // RAVI
974
975 TRACE_FUNCTION ("cm_check_emergency()");
976 TRACE_EVENT_P1("String being passed = %s", (char*)number);
977
978 if (strlen((char *)number) <= 0 OR strlen((char *)number) > 3)
979 return FALSE;
980
981 if(psaCC_phbSrchECC((char*)number, FALSE))
982 {
983 TRACE_EVENT("psaCC_phbSrchECC - returned - TRUE");
984 return TRUE;
985 }
986 else
987 {
988 TRACE_EVENT("psaCC_phbSrchECC - returned - FALSE");
989 return FALSE;
990 }
991
992 }
993
994 /*
995 +--------------------------------------------------------------------+
996 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
997 | STATE : code ROUTINE: cm_mo_prefix |
998 +--------------------------------------------------------------------+
999
1000
1001 PURPOSE : set/get CLIP, CLIR, COLP and COLR tempstatus
1002
1003 */
1004
1005 T_CM_CLI cm_mo_prefix(T_CM_CLI prefix)
1006 {
1007 UBYTE bits;
1008
1009 if ((bits = (prefix & 0x0c)) != 0)
1010 cli_prefix = (cli_prefix & 0xf3) | bits;
1011 if ((bits = (prefix & 0xc0)) != 0)
1012 cli_prefix = (cli_prefix & 0x3f) | bits;
1013 return cli_prefix;
1014 }
1015
1016
1017 /*
1018 +--------------------------------------------------------------------+
1019 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
1020 | STATE : code ROUTINE: cm_set_cmd_status |
1021 +--------------------------------------------------------------------+
1022
1023
1024 PURPOSE :
1025
1026 */
1027
1028 void cm_set_cmd_status(T_ACI_CHLD_MOD mode, CHAR* call)
1029 {
1030 SHORT id;
1031 // Added xkundadu MMI-SPR 13873
1032 // Stores the status of a particular call.
1033 T_MFW_CM_STATUS status;
1034
1035 TRACE_FUNCTION("cm_set_cmd_status()"); // Marcus: CCBS: 14/11/2002
1036
1037 memset(&dis_connect, 0, sizeof(T_MFW_CM_DISCONNECT));
1038 memset(&cmd, 0, sizeof(T_MFW_CM_COMMAND));
1039 switch (mode)
1040 {
1041 case CHLD_MOD_RelHldOrUdub:
1042 TRACE_EVENT("CHLD_MOD_RelHldOrUdub"); // Marcus: CCBS: 14/11/2002
1043 /*SPR#1965 - DS - Changed from MFW_CM_MT_REJECT to MFW_CM_TERMINATED because
1044 * the E_CM_DISCONNECT signal is not sent in cm_ok_disconnect() if cmd_hold = MFW_CM_MT_REJECT.
1045 * Port of 1962.
1046 */
1047 cmd_hold = MFW_CM_TERMINATED;
1048
1049 if (cm_search_callId(CAL_STAT_Wait, &id) == CM_OK)
1050 {
1051 TRACE_EVENT("cm_search_callId(CAL_STAT_Wait, &id) == CM_OK"); // Marcus: CCBS: 14/11/2002
1052 dis_connect.call_number = id;
1053 }
1054 else
1055 {
1056 TRACE_EVENT("cm_search_callId(CAL_STAT_Wait, &id) != CM_OK"); // Marcus: CCBS: 14/11/2002
1057 dis_connect.call_number = -1; // call id?
1058 }
1059
1060 break;
1061 case CHLD_MOD_RelActAndAcpt:
1062
1063 TRACE_EVENT("CHLD_MOD_RelActAndAcpt"); // Marcus: CCBS: 14/11/2002
1064 cmd_hold = MFW_CM_1_SEND;
1065
1066 // Added xkundadu MMI-SPR 13873
1067 // Querying if there are any active calls, storing the index of the
1068 // call and setting a flag if found to be multiparty.
1069 if (cm_search_callId(CAL_STAT_Active, &id) == CM_OK)
1070 {
1071 // Active call is present.
1072 dis_connect.call_number = id; // call id ?
1073 cm_status(id, &status, 1);
1074 if (status.mtpy EQ MFW_MTPY_MEMBER)
1075 {
1076 bIsMultpty = TRUE;
1077 }
1078 else
1079 {
1080 bIsMultpty = FALSE;
1081 }
1082
1083 }
1084 else
1085 {
1086 dis_connect.call_number = -1;
1087 }
1088 // Added xkundadu MMI-SPR 13873
1089 // Querying if there are any held calls, storing the index of the call
1090 // to change the status to active call.
1091 if (cm_search_callId(CAL_STAT_Held, &id) == CM_OK)
1092 {
1093 cmd.command = CM_RETRIEVE;
1094 cmd.call_number = id;
1095 }
1096 // Added xkundadu MMI-SPR 13873
1097 // Checking is there any waiting call exists or not.
1098 if (cm_search_callId(CAL_STAT_Wait, &id) == CM_OK)
1099 {
1100 // This variable determines whether to accept/reject the call
1101 // in the cm_result_cmd().
1102 cmd.call_number=0;
1103 }
1104 else
1105 {
1106 cmd.call_number=-1;
1107 }
1108
1109 break;
1110
1111 case CHLD_MOD_RelActSpec:
1112 TRACE_EVENT("CHLD_MOD_RelActSpec"); // Marcus: CCBS: 14/11/2002
1113 dis_connect.call_number = (SHORT)atoi(call);
1114 if (dis_connect.call_number)
1115 {
1116 TRACE_EVENT("dis_connect.call_number"); // Marcus: CCBS: 14/11/2002
1117 cmd_hold = MFW_CM_TERMINATED;
1118 }
1119 else
1120 {
1121 TRACE_EVENT("!dis_connect.call_number"); // Marcus: CCBS: 14/11/2002
1122 cmd_hold = MFW_CM_MPTY_TERMINATED;
1123 }
1124 break;
1125 case CHLD_MOD_HldActAndAcpt:
1126 TRACE_EVENT("CHLD_MOD_HldActAndAcpt"); // Marcus: CCBS: 14/11/2002
1127 if (cm_search_callId(CAL_STAT_Wait, &id) == CM_OK)
1128 {
1129 TRACE_EVENT("cm_search_callId(CAL_STAT_Wait, &id) == CM_OK"); // Marcus: CCBS: 14/11/2002
1130 cmd_hold = MFW_CM_MT_ACCEPT;
1131 /*
1132 * initialize for result event
1133 */
1134 cmd.command = CM_HOLD;
1135 cc_id = id;
1136 }
1137 else
1138 {
1139 TRACE_EVENT("cm_search_callId(CAL_STAT_Wait, &id) != CM_OK"); // Marcus: CCBS: 14/11/2002
1140 if ((cm_search_callId(CAL_STAT_Active, &id) == CM_OK)
1141 AND (cm_search_callId(CAL_STAT_Held, &id) == CM_OK))
1142 {
1143 TRACE_EVENT("cmd.command = CM_SWAP"); // Marcus: CCBS: 14/11/2002
1144 cmd.command = CM_SWAP;
1145 }
1146 if ((cm_search_callId(CAL_STAT_Active, &id) != CM_OK)
1147 AND (cm_search_callId(CAL_STAT_Held, &id) == CM_OK))
1148 {
1149 TRACE_EVENT("cmd.command = CM_RETRIEVE"); // Marcus: CCBS: 14/11/2002
1150 cmd.command = CM_RETRIEVE;
1151 }
1152 if ((cm_search_callId(CAL_STAT_Active, &id) == CM_OK)
1153 AND (cm_search_callId(CAL_STAT_Held, &id) != CM_OK))
1154 {
1155 TRACE_EVENT("cmd.command = CM_HOLD"); // Marcus: CCBS: 14/11/2002
1156 cmd.command = CM_HOLD;
1157 }
1158 cmd.call_number = 0;
1159 }
1160 break;
1161 case CHLD_MOD_HldActExc:
1162 TRACE_EVENT("CHLD_MOD_HldActExc"); // Marcus: CCBS: 14/11/2002
1163 cmd.command = CM_SPLIT_MULTIPARTY;
1164 cmd.call_number = 0;
1165 break;
1166 case CHLD_MOD_AddHld:
1167 TRACE_EVENT("CHLD_MOD_AddHld"); // Marcus: CCBS: 14/11/2002
1168 cmd.command = CM_BUILD_MULTIPARTY;
1169 cmd.call_number = 0;
1170 break;
1171 case CHLD_MOD_Ect:
1172 TRACE_EVENT("CHLD_MOD_Ect"); // Marcus: CCBS: 14/11/2002
1173 cmd.command = CM_ETC;
1174 cmd.call_number = 0;
1175 break;
1176 case CHLD_MOD_Ccbs:
1177 TRACE_EVENT("CHLD_MOD_Ccbs"); // Marcus: CCBS: 14/11/2002
1178 cmd.command = CM_CCBS;
1179 cmd.call_number = 0;
1180 break;
1181 case CHLD_MOD_HldActDial:
1182 TRACE_EVENT("CHLD_MOD_HldActDial"); // Marcus: CCBS: 14/11/2002
1183 cmd_hold = MFW_CM_HOLD_AND_DIAL;
1184 /*
1185 * initialize for result event
1186 */
1187 cmd.command = CM_HOLD;
1188 cc_id = id;
1189 break;
1190 }
1191 }
1192
1193
1194 /*
1195 +--------------------------------------------------------------------+
1196 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
1197 | STATE : code ROUTINE: cm_check_mo_number |
1198 +--------------------------------------------------------------------+
1199
1200
1201 PURPOSE : start mobile originated call
1202
1203 */
1204
1205 T_MFW cm_check_mo_number(UBYTE *number)
1206 {
1207 UBYTE i;
1208 // Apr 14, 2005 REF: CRR 29991 xpradipg
1209 // local definition
1210 #ifdef FF_MMI_OPTIM
1211 UBYTE count = 0;
1212 UBYTE blackListNum[MFW_NUM_LEN];
1213 int8 file;
1214 #endif
1215
1216 /* check whether a redialing exists */
1217 if (call_stat EQ REDIALING_CALL)
1218 {
1219 cm_stop_redialTim();
1220 rdl.redial_mode = CM_REDIAL_OUTGOING;
1221 cm_signal(E_CM_REDIAL, &rdl);
1222 }
1223
1224
1225 if (!number)
1226 return CM_OK;
1227 // Apr 14, 2005 REF: CRR 29991 xpradipg
1228 // the list is read from the file
1229 #ifdef FF_MMI_OPTIM
1230 if(( file = flash_MMI_blackList_open()) > 0)
1231 {
1232 if(flash_MMI_blackList_read(file,(U8*)&count,1,0) > 0)
1233 {
1234 for(i=0; i < (int)count; i++)
1235 {
1236 if(flash_MMI_blackList_read(file,(U8*)blackListNum,MFW_NUM_LEN,(i*MFW_NUM_LEN)+1) > 0)
1237 {
1238 if(!strcmp((char*)blackListNum, (char*)number))
1239 {
1240 flash_MMI_blackList_close(file);
1241 return CM_BLACKLIST;
1242 }
1243 }
1244 }
1245 }
1246 flash_MMI_blackList_close(file);
1247 }
1248 #else
1249 /* check whether this number is in blacklist */
1250 for (i=0; i<black_list.count; i++)
1251 {
1252 if (!strcmp((char *)black_list.number[i], (char *)number))
1253 return CM_BLACKLIST;
1254 }
1255 #endif
1256
1257 /* check the type of this number */
1258 if (cm_check_emergency(number) EQ TRUE)
1259 call_type = MFW_ECC_CALL;
1260 else
1261 call_type = MFW_NORMAL_CALL;
1262
1263 return CM_OK;
1264 }
1265
1266 /*
1267 +--------------------------------------------------------------------+
1268 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
1269 | STATE : code ROUTINE: cm_set_call_mode |
1270 +--------------------------------------------------------------------+
1271
1272
1273 PURPOSE : set call mode
1274
1275 */
1276
1277 void cm_set_call_mode(T_MFW_CM_CALL_TYPE mode)
1278 {
1279 switch (mode)
1280 {
1281 case VOICE_CALL:
1282 case AuxVOICE_CALL: /*MC, SPR 1026, assume line 2 is handled like line 1*/
1283 case DATA_CALL:
1284 case FAX_CALL:
1285 sAT_PlusCMOD(CMD_SRC_LCL, CMOD_MOD_Single);
1286 break;
1287 case VFD_VOICE:
1288 case VFD_DATA:
1289 sAT_PlusCMOD(CMD_SRC_LCL, CMOD_MOD_VoiceFlwdDat);
1290 break;
1291 case VAD_VOICE:
1292 case VAD_DATA:
1293 sAT_PlusCMOD(CMD_SRC_LCL, CMOD_MOD_VoiceDat);
1294 break;
1295 case VAF_VOICE:
1296 case VAF_FAX:
1297 sAT_PlusCMOD(CMD_SRC_LCL, CMOD_MOD_VoiceFax);
1298 break;
1299 default:
1300 break;
1301 }
1302 }
1303
1304 /*
1305 +--------------------------------------------------------------------+
1306 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
1307 | STATE : code ROUTINE: cm_mo_idx |
1308 +--------------------------------------------------------------------+
1309
1310
1311 PURPOSE : start mobile originated call
1312
1313 */
1314
1315 T_MFW cm_mo_idx(T_KSD_SEQPARAM *para, T_MFW_CM_CALL_TYPE mode)
1316 {
1317 T_MFW_PHB_LIST entries;
1318 T_MFW_PHB_ENTRY entry;
1319 UBYTE res;
1320
1321 //RM 19_09_2000
1322 #ifdef NO_ASCIIZ
1323 T_ACI_PB_TEXT mfwpbText;
1324 #endif
1325 //RM
1326
1327 entries.entry = &entry;
1328
1329 /* search this number from phonebook */
1330 if ((phb_read_entries(PHB_ADN, (UBYTE)para->dialIdx.index,
1331 MFW_PHB_INDEX, 1,
1332 &entries) EQ MFW_PHB_OK)
1333 AND ((int)entries.num_entries > 0))
1334 {
1335 res = cm_check_mo_number(entries.entry->number);
1336 if (res NEQ CM_OK)
1337 return res;
1338 }
1339 else
1340 {
1341 res = cm_check_mo_number(0);
1342 if (res NEQ CM_OK)
1343 return res;
1344 }
1345
1346 /* set the outgoing call status */
1347 call_stat = OUTGOING_CALL;
1348 redial_count = 0;
1349 cc_stat.type = OUTGOING_CALL;
1350
1351 cm_set_call_mode(mode);
1352
1353 //RM 19_09_2000 instead change in ksd structure T_KSD_SEQPARAM etc., later to change !!!!
1354 #ifdef NO_ASCIIZ
1355 if(para->dialIdx.str NEQ NULL)
1356 {
1357 mfwpbText.cs = CS_GsmDef;
1358 mfwpbText.len = strlen(para->dialIdx.str);
1359 memcpy(mfwpbText.data,para->dialIdx.str,mfwpbText.len);
1360 }
1361 else
1362 {
1363 mfwpbText.cs = CS_NotPresent;
1364 mfwpbText.len = 0;
1365 }
1366 res = sAT_Dm(CMD_SRC_LCL, &mfwpbText,
1367 para->dialIdx.mem, para->dialIdx.index,
1368 para->dialIdx.clirOvrd, para->dialIdx.cugCtrl,
1369 para->dialIdx.callType);
1370 #else
1371 res = sAT_Dm(CMD_SRC_LCL, para->dialIdx.str,
1372 para->dialIdx.mem, para->dialIdx.index,
1373 para->dialIdx.clirOvrd, para->dialIdx.cugCtrl,
1374 para->dialIdx.callType);
1375 #endif
1376
1377 if ((res == AT_FAIL) OR (res == AT_BUSY))
1378 {
1379 call_stat = MFW_CALL_FREE;
1380 return cm_error_code(AT_CMD_D);
1381 }
1382
1383 return CM_OK;
1384 }
1385
1386 /*
1387 +--------------------------------------------------------------------+
1388 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
1389 | STATE : code ROUTINE: cm_mo_call |
1390 +--------------------------------------------------------------------+
1391
1392
1393 PURPOSE : start mobile originated call
1394
1395 */
1396
1397 T_MFW cm_mo_call(UBYTE *number, T_MFW_CM_CALL_TYPE type)
1398 {
1399 CHAR * rest;
1400 T_KSD_SEQPARAM para;
1401 T_MFW_SS_RETURN typ;
1402 T_MFW_SS_RETURN new_typ;
1403 CHAR * string;
1404 UBYTE cm_grp = 0; // RAVI
1405 UBYTE clir_status;
1406 UBYTE colr_status;
1407 UBYTE prefix;
1408 char buf[80];
1409 UBYTE phone[MFW_NUM_LEN];
1410 UBYTE num_save[MFW_STRING_LEN];
1411 SHORT id;
1412 T_ACI_RETURN res,aci_result;//aci_result was added to fix the bug MMI-SPR 16545
1413
1414 TRACE_FUNCTION ("cm_mo_call()");
1415
1416 strncpy((char *)num_save, (char *)number, MFW_STRING_LEN-1);
1417 num_save[MFW_STRING_LEN-1] = 0;
1418
1419 /* check the type of number (key sequence), current no function */
1420 typ = ss_decode(number, &rest, &para);
1421 TRACE_EVENT_P1("Type: %d", typ);
1422 if (typ == MFW_SS_DIAL)
1423 {
1424 mfwStrncpy((char *)phone, para.dial.number, MFW_NUM_LEN);
1425
1426 }
1427
1428 if (typ == MFW_SS_HOLD)
1429 {
1430 cm_set_cmd_status(para.chld.mode, para.chld.call);
1431
1432 // Feb 27, 2006 REF:DR OMAPS00067884 x0039928
1433 // Fix : sAT_PercentCHLD() is called if the mode > CHLD_MOD_RelDialCall
1434 if(para.chld.mode > CHLD_MOD_RelDialCall)
1435 aci_result = sAT_PercentCHLD(CMD_SRC_LCL, para.chld.mode, para.chld.call);
1436 else
1437 aci_result = sAT_PlusCHLD(CMD_SRC_LCL, para.chld.mode, para.chld.call);
1438
1439 // Apr 26, 2004 REF: CRR 16545 Ajith K P
1440 // If sAT_PlusCHLD() Fails, Send the user entered string as USSD to network using sAT-Dn().
1441 // So if its not failed just return CM_CTRL_STR, otherwise call sAT_Dn().
1442 if ( (aci_result EQ AT_CMPL ) OR (aci_result EQ AT_EXCT ) OR (aci_result EQ AT_BUSY ))
1443 {
1444 return CM_CTRL_STR;
1445 }
1446 }
1447 //MC 11.04.02
1448 if (typ == MFW_SS_ECT)
1449 {
1450 cm_set_cmd_status(para.chld.mode, para.chld.call);
1451 if (sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_Ect, 0) != AT_EXCT)
1452 {
1453 //Aug 10, 2005 REF: MMI-SPR-30099 x0018858
1454 //commented this return value.
1455 // return CM_ERROR;
1456 }
1457 else
1458 return CM_CTRL_STR;
1459 }
1460 //MC
1461
1462 if (typ == MFW_SS_DIAL_IDX)
1463 {
1464 return cm_mo_idx(&para, type);
1465 }
1466
1467 switch (typ)
1468 {
1469
1470 //NM
1471 case MFW_SS_CLIR: //jgg wrong not CM_OK should be CM_SS, however cm_grp not used after funtion callnumber called
1472
1473 case MFW_SS_DIAL:
1474 cm_grp = CM_OK;
1475 break;
1476
1477 case MFW_SS_DTMF:
1478 case MFW_SS_CF:
1479 case MFW_SS_CB:
1480 case MFW_SS_CLIP:
1481 case MFW_SS_COLR:
1482 case MFW_SS_COLP:
1483 case MFW_SS_WAIT:
1484 case MFW_SS_HOLD:
1485 case MFW_SS_CCBS:
1486 case MFW_SS_REG_PW:
1487 //Aug 10, 2005 REF: MMI-SPR-30099 x0018858
1488 //Added this case statement.
1489 case MFW_SS_ECT:
1490 cm_grp = CM_SS;
1491 break;
1492
1493 case MFW_SS_USSD:
1494 cm_grp = CM_USSD;
1495 break;
1496
1497 case MFW_SS_SIM_LOCK:
1498 case MFW_SS_SIM_REG_PW:
1499 case MFW_SS_SIM_UNBLCK_PIN:
1500 cm_grp = CM_SIM;
1501 break;
1502
1503 case MFW_SS_MMI:
1504 cm_grp = CM_MMI;
1505 break;
1506
1507 /* SPR#1352 - SH - TTY
1508 * If an SS string has been entered, temporarily enable or disable
1509 * TTY for this call only. */
1510
1511 case MFW_SS_TTY_NEXTCALL_ON:
1512 case MFW_SS_TTY_NEXTCALL_OFF:
1513 {
1514 if (typ==MFW_SS_TTY_NEXTCALL_ON)
1515 {
1516 cm_tty_enable(TRUE);
1517 }
1518 else
1519 {
1520 cm_tty_enable(FALSE);
1521 }
1522
1523 strcpy((char *)num_save, (char *)&num_save[4]); /* Ignore SS string when dialling */
1524 rest = (char *)&number[4]; /* Look at number following SS string */
1525 }
1526 break;
1527 /* SH end */
1528
1529 default:
1530 return CM_ERROR;
1531 }
1532
1533 string = rest;
1534 clir_status = 0;
1535 colr_status = 0;
1536 buf[0] = '\0';
1537 cc_stat.prefix[0] = '\0';
1538 while(strlen(string))
1539 {
1540 TRACE_EVENT("In the while");
1541 new_typ = ss_decode((UBYTE *)string, &rest, &para);
1542 // /*
1543 if (new_typ == MFW_SS_CLIR)
1544 {
1545 clir_status = 1;
1546 if (para.Clir.mode == CLIR_MOD_Supp)
1547 {
1548 strcat((char *)cc_stat.prefix, "*31#");
1549 TRACE_EVENT ("CLIR_MOD_Supp");
1550 }
1551 if (para.Clir.mode == CLIR_MOD_Invoc)
1552 {
1553 strcat((char *)cc_stat.prefix, "#31#");
1554 TRACE_EVENT ("CLIR_MOD_Invoc");
1555 }
1556 }
1557 if (new_typ == MFW_SS_COLR)
1558 colr_status = 1;
1559 if (new_typ == MFW_SS_DIAL)
1560 {
1561 TRACE_EVENT("It's a dial");
1562 /* SPR#1352 - SH - only copy string to dial, not whole string */
1563 if (typ==MFW_SS_TTY_NEXTCALL_ON || typ==MFW_SS_TTY_NEXTCALL_OFF)
1564 {
1565 typ = new_typ;
1566 TRACE_EVENT_P1("phone now holds: %s", phone);
1567 }
1568 else
1569 /* end SH */
1570 {
1571 typ = new_typ;
1572 mfwStrncpy((char *)phone, para.dial.number, MFW_NUM_LEN);
1573 }
1574 }
1575 string = rest;
1576 }
1577
1578 if (!colr_status AND (typ == MFW_SS_DIAL))
1579 {
1580 prefix = cli_prefix & 0xc0;
1581 if (prefix == 0x80)
1582 {
1583 strcat(buf, "*77#");
1584 strcat((char *)cc_stat.prefix, "*77#");
1585 }
1586 if (prefix == 0xc0)
1587 {
1588 strcat(buf, "#77#");
1589 strcat((char *)cc_stat.prefix, "#77#");
1590 }
1591 }
1592
1593 if (typ == MFW_SS_DIAL)
1594 {
1595 res = (T_ACI_RETURN)cm_check_mo_number(phone);
1596 if ( res != CM_OK)
1597 return res;
1598
1599 /* set the outgoing call status */
1600 call_stat = OUTGOING_CALL;
1601 redial_count = 0;
1602 cc_stat.type = OUTGOING_CALL;
1603 cm_grp = CM_OK;
1604 currConnecting = 1;
1605 cm_set_call_mode(type);
1606 }
1607
1608 strcat(buf, (char *)num_save);
1609 if (cm_search_callId(CAL_STAT_Active, &id) EQ CM_OK)
1610 {
1611 /*
1612 * at least one active, this must be put on hold
1613 * by ACI first, then dial
1614 */
1615 cm_set_cmd_status(CHLD_MOD_HldActDial, "");
1616 cc_id = id;
1617 }
1618 if (type == DATA_CALL)
1619 para.dial.callType = D_TOC_Data;
1620
1621 // Apr 22, 2004 REF: CRR MMI-SPR-16873 Rashmi C N(Sasken)
1622 // Using the CLIR status maintained in the flash, while making a call
1623 if (!FFS_flashData.CLIR)
1624 {
1625 res = sAT_Dn(CMD_SRC_LCL, buf, D_CLIR_OVRD_Supp, -1, para.dial.callType);
1626 }
1627 else
1628 {
1629 res = sAT_Dn(CMD_SRC_LCL, buf, D_CLIR_OVRD_Invoc, -1, para.dial.callType);
1630 }
1631
1632 if ((res == AT_FAIL) OR (res == AT_BUSY))
1633 {
1634 if (typ == MFW_SS_CLIP)
1635 return CM_CLI;
1636
1637 call_stat = MFW_CALL_FREE;
1638 return cm_error_code(AT_CMD_D);
1639 }
1640 if (res == AT_CMPL)
1641 {
1642 switch (typ)
1643 {
1644 case MFW_SS_CLIR:
1645 case MFW_SS_CLIP:
1646 case MFW_SS_COLR:
1647 case MFW_SS_COLP:
1648 return CM_CLI;
1649 default:
1650 break;
1651 }
1652 }
1653 return cm_grp;
1654 }
1655
1656
1657 /*
1658 +--------------------------------------------------------------------+
1659 | PROJECT: GSM-MFW (8417) MODULE: MFW_CB |
1660 | STATE : code ROUTINE: rAT_PlusCRING_OFF |
1661 +--------------------------------------------------------------------+
1662
1663
1664 PURPOSE : Alert Off indication from ACI
1665
1666 */
1667
1668 #ifdef FF_2TO1_PS
1669 GLOBAL void rAT_PlusCRING_OFF ( SHORT cId )
1670 {
1671 T_MFW_CM_CALL_STAT stat;
1672 UBYTE ton;
1673 T_CAUSE_ps_cause report; /* Marcus: Extended error reporting: 12/11/2002 */
1674 UBYTE mode;
1675
1676 TRACE_FUNCTION ("rAT_PlusCRING_OFF()");
1677
1678 if (cm_search_callStat(cId, &stat, &ton, &mode) == CM_OK)
1679 {
1680 call_stat = MFW_CALL_FREE;
1681 call_type = MFW_CALL_FREE;
1682
1683 if (stat == CALL_DEACTIVE)
1684 {
1685 dis_connect.call_number = cId;
1686
1687 qAT_PlusCEER( CMD_SRC_LCL, &report);
1688 /* Marcus: Extended error reporting: 12/11/2002: Start */
1689
1690 // TRACE_EVENT_P1("qAT_PlusCEER(%04X)", report);
1691 if (report.ctrl_value != CAUSE_is_from_nwcc)
1692 {
1693 /* Treat Condat defined cause values as if no cause given */
1694 dis_connect.cause = NOT_PRESENT_8BIT;
1695 }
1696 else
1697 {
1698 /* Standards defined cause value is given */
1699 dis_connect.cause = report.value.nwcc_cause;
1700 }
1701 TRACE_EVENT_P1("dis_connect.cause = %02X)", dis_connect.cause);
1702 /* Marcus: Extended error reporting: 12/11/2002: End */
1703 cm_signal(E_CM_DISCONNECT, &dis_connect);
1704 return;
1705 }
1706 cm_signal(E_CM_RING_OFF, 0);
1707 }
1708 }
1709 #else
1710 GLOBAL void rAT_PlusCRING_OFF ( SHORT cId )
1711 {
1712 T_MFW_CM_CALL_STAT stat;
1713 UBYTE ton;
1714 USHORT report; /* Marcus: Extended error reporting: 12/11/2002 */
1715 UBYTE mode;
1716
1717 TRACE_FUNCTION ("rAT_PlusCRING_OFF()");
1718
1719 if (cm_search_callStat(cId, &stat, &ton, &mode) == CM_OK)
1720 {
1721 call_stat = MFW_CALL_FREE;
1722 call_type = MFW_CALL_FREE;
1723
1724 if (stat == CALL_DEACTIVE)
1725 {
1726 dis_connect.call_number = cId;
1727
1728 qAT_PlusCEER( CMD_SRC_LCL, &report);
1729 /* Marcus: Extended error reporting: 12/11/2002: Start */
1730 TRACE_EVENT_P1("qAT_PlusCEER(%04X)", report);
1731 if (GET_CAUSE_DEFBY(report) == DEFBY_CONDAT)
1732 {
1733 /* Treat Condat defined cause values as if no cause given */
1734 dis_connect.cause = NOT_PRESENT_8BIT;
1735 }
1736 else
1737 {
1738 /* Standards defined cause value is given */
1739 dis_connect.cause = GET_CAUSE_VALUE(report);
1740 }
1741 TRACE_EVENT_P1("dis_connect.cause = %02X)", dis_connect.cause);
1742 /* Marcus: Extended error reporting: 12/11/2002: End */
1743 cm_signal(E_CM_DISCONNECT, &dis_connect);
1744 return;
1745 }
1746 cm_signal(E_CM_RING_OFF, 0);
1747 }
1748 }
1749 #endif
1750
1751 /*
1752 +--------------------------------------------------------------------+
1753 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
1754 | STATE : code ROUTINE : rAT_PlusCRING |
1755 +--------------------------------------------------------------------+
1756
1757
1758 PURPOSE : Alert indication from ACI
1759
1760 */
1761
1762 void rAT_PlusCRING(T_ACI_CRING_MOD mode,
1763 T_ACI_CRING_TYP type1,
1764 T_ACI_CRING_TYP type2)
1765 {
1766 SHORT call_number;
1767
1768 TRACE_FUNCTION ("rAT_PlusCRING()");
1769
1770 in_call.result = Present;
1771
1772 /* search the call identifier */
1773 if (cm_search_callId(CAL_STAT_Wait, &call_number) == CM_OK)
1774 in_call.call_number = call_number;
1775 else
1776 in_call.call_number = 0;
1777
1778 /* If redial is active, it must be stoped. */
1779 if (call_stat == REDIALING_CALL)
1780 {
1781 cm_stop_redialTim();
1782 rdl.redial_mode = CM_REDIAL_INCOMING;
1783 cm_signal(E_CM_REDIAL, &rdl);
1784 }
1785
1786 if (mode EQ CRING_MOD_Direct)
1787 {
1788 switch (type1)
1789 {
1790 /* Voice call */
1791 case CRING_TYP_Voice:
1792 if (type2 EQ CRING_TYP_NotPresent)
1793 {
1794 in_call.type = VOICE_CALL;
1795 cm_set_call_mode(VOICE_CALL);
1796 }
1797 else
1798 {
1799 switch (type2)
1800 {
1801 case CRING_TYP_Sync:
1802 case CRING_TYP_Async:
1803 case CRING_TYP_RelSync:
1804 case CRING_TYP_RelAsync:
1805 in_call.type = VFD_VOICE;
1806 cm_bc_parameter(type2);
1807 cm_set_call_mode(VFD_VOICE);
1808 break;
1809 /*MC, SPR 1026, check for line1 and line2*/
1810 case CRING_TYP_Voice:
1811 in_call.type = VOICE_CALL;
1812 cm_set_call_mode(VOICE_CALL);
1813 break;
1814 case CRING_TYP_AuxVoice:
1815 cm_set_call_mode(AuxVOICE_CALL);
1816 in_call.type = AuxVOICE_CALL;
1817 break;
1818 /*MC, end*/
1819 default:
1820 in_call.type = VOICE_CALL;
1821 cm_set_call_mode(VOICE_CALL);
1822 break;
1823 }
1824 }
1825 break;
1826 /*MC, SPR 1026, Added case of Type1=CRING_TYP_AuxVoice*/
1827 /*assuming line 2 is handled like line 1*/
1828 case CRING_TYP_AuxVoice:
1829 if (type2 EQ CRING_TYP_NotPresent)
1830 {
1831 in_call.type = AuxVOICE_CALL;
1832 cm_set_call_mode(AuxVOICE_CALL);
1833 }
1834 else
1835 {
1836 switch (type2)
1837 {
1838 case CRING_TYP_Sync:
1839 case CRING_TYP_Async:
1840 case CRING_TYP_RelSync:
1841 case CRING_TYP_RelAsync:
1842 in_call.type = VFD_VOICE;
1843 cm_bc_parameter(type2);
1844 cm_set_call_mode(VFD_VOICE);
1845 break;
1846 case CRING_TYP_Voice:
1847 in_call.type = VOICE_CALL;
1848 cm_set_call_mode(VOICE_CALL);
1849 break;
1850 case CRING_TYP_AuxVoice:
1851 cm_set_call_mode(AuxVOICE_CALL);
1852 in_call.type = AuxVOICE_CALL;
1853 break;
1854 default:
1855 in_call.type = VOICE_CALL;
1856 cm_set_call_mode(VOICE_CALL);
1857 break;
1858 }
1859 }
1860 break;
1861 /*MC, end*/
1862 /* Data call */
1863 case CRING_TYP_Sync:
1864 case CRING_TYP_Async:
1865 case CRING_TYP_RelSync:
1866 case CRING_TYP_RelAsync:
1867 in_call.type = DATA_CALL;
1868 cm_bc_parameter(type1);
1869 cm_set_call_mode(DATA_CALL);
1870 break;
1871
1872 case CRING_TYP_Fax:
1873 in_call.type = FAX_CALL;
1874 in_call.bc1.conn_elem = Transparent;
1875 cm_set_call_mode(FAX_CALL);
1876 break;
1877
1878 default:
1879 in_call.result = NotPresent;
1880 break;
1881 }
1882 call_stat = INCOMING_CALL;
1883 }
1884
1885 if (mode EQ CRING_MOD_Alternate)
1886 {
1887 cm_build_callType(type1, type2);
1888 cm_bc_parameter(type1);
1889 cm_bc_parameter(type2);
1890 cm_set_call_mode(in_call.type);
1891 }
1892 }
1893
1894
1895 /*
1896 +--------------------------------------------------------------------+
1897 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
1898 | STATE : code ROUTINE: rAT_PlusCLIP |
1899 +--------------------------------------------------------------------+
1900
1901
1902 PURPOSE : The calling line identification for an incomming call.
1903
1904 */
1905
1906 #ifdef NO_ASCIIZ
1907 void rAT_PlusCLIP(T_ACI_CLIP_STAT stat,
1908 CHAR * number,
1909 T_ACI_TOA * type,
1910 U8 validity,
1911 CHAR * subaddr,
1912 T_ACI_TOS * satype,
1913 T_ACI_PB_TEXT * alpha)
1914 {
1915 int flag;
1916
1917 TRACE_FUNCTION ("rAT_PlusCLIP()");
1918
1919 flag = 0;
1920
1921 if (number != NULL)
1922 {
1923 mfwStrncpy((char *)in_call.number, (char *)number, MFW_NUM_LEN);
1924 in_call.ton = phb_cvtTon(type->ton);
1925 flag = 1;
1926 }
1927 else
1928 memset(in_call.number, '\0', MFW_NUM_LEN);
1929
1930 if (alpha != NULL)
1931 {
1932 in_call.name.len = alpha->len;
1933 if (alpha->len)
1934 {
1935 memcpy(in_call.name.data,
1936 alpha->data,
1937 alpha->len);
1938 flag = 1;
1939 }
1940 }
1941 else
1942 in_call.name.len = 0;
1943
1944
1945 if (subaddr != NULL)
1946 {
1947 mfwStrncpy((char *)in_call.subaddr, (char *)subaddr, MFW_SUBADR_LEN);
1948 flag = 1;
1949 }
1950 else
1951 memset(in_call.subaddr, '\0', MFW_SUBADR_LEN);
1952
1953 if (flag == 1)
1954 in_call.result = Present;
1955 else
1956 in_call.result = 0;
1957
1958 cm_signal(E_CM_CW, &in_call);
1959 }
1960
1961 #else
1962
1963 void rAT_PlusCLIP(T_ACI_CLIP_STAT stat,
1964 CHAR * number,
1965 T_ACI_TOA * type,
1966 U8 validity,
1967 CHAR * subaddr,
1968 T_ACI_TOS * satype,
1969 CHAR * alpha)
1970 {
1971 int flag;
1972
1973 TRACE_FUNCTION ("rAT_PlusCLIP()");
1974
1975 flag = 0;
1976 // in_call.result = 0;
1977
1978 if (number != NULL)
1979 {
1980 mfwStrncpy((char *)in_call.number, (char *)number, MFW_NUM_LEN);
1981 in_call.ton = phb_cvtTon(type->ton);
1982 flag = 1;
1983 }
1984 else
1985 memset(in_call.number, '\0', MFW_NUM_LEN);
1986
1987 if (alpha != NULL)
1988 {
1989 mfwStrncpy((char *)in_call.name, (char *)alpha, MFW_TAG_LEN);
1990 flag = 1;
1991 }
1992 else
1993 memset(in_call.name, '\0', MFW_TAG_LEN);
1994
1995 if (subaddr != NULL)
1996 {
1997 mfwStrncpy((char *)in_call.subaddr, (char *)subaddr, MFW_SUBADR_LEN);
1998 flag = 1;
1999 }
2000 else
2001 memset(in_call.subaddr, '\0', MFW_SUBADR_LEN);
2002
2003 if (flag == 1)
2004 in_call.result = Present;
2005 else
2006 in_call.result = 0;
2007
2008 cm_signal(E_CM_CW, &in_call);
2009 }
2010 #endif
2011
2012 /*
2013 +--------------------------------------------------------------------+
2014 | PROJECT : GSM-MFW (8417) MODULE : MFW_CM |
2015 | STATE : code ROUTINE : rAT_PlusCOLP |
2016 +--------------------------------------------------------------------+
2017
2018
2019 PURPOSE : Connected line presentation indication from ACI
2020
2021 */
2022
2023 #ifdef NO_ASCIIZ
2024 GLOBAL void rAT_PlusCOLP ( T_ACI_COLP_STAT stat,
2025 CHAR* number,
2026 T_ACI_TOA* type,
2027 CHAR* subaddr,
2028 T_ACI_TOS* satype,
2029 T_ACI_PB_TEXT* alpha)
2030 {
2031
2032 TRACE_FUNCTION ("rAT_PlusCOLP()");
2033
2034 if (number != NULL)
2035 {
2036 mfwStrncpy((char *)out_call.number, (char *)number, MFW_NUM_LEN);
2037 out_call.ton = phb_cvtTon(type->ton);
2038 }
2039 else
2040 memset(out_call.number, '\0', MFW_NUM_LEN);
2041
2042 /*NM, p001 */
2043 if(alpha != NULL)
2044 /*NM, p001 end */
2045 {
2046 out_call.name.len = MINIMUM(alpha->len, MFW_TAG_LEN);
2047 if (alpha->len)
2048 memcpy(out_call.name.data,
2049 alpha->data,
2050 alpha->len);
2051 }
2052
2053 if (subaddr != NULL)
2054 mfwStrncpy((char *)out_call.subaddr, (char *)subaddr, MFW_SUBADR_LEN);
2055 else
2056 memset(out_call.subaddr, '\0', MFW_SUBADR_LEN);
2057
2058 if (number != NULL)
2059 cm_signal(E_CM_COLP, &out_call);
2060 }
2061
2062 #else
2063
2064 GLOBAL void rAT_PlusCOLP ( T_ACI_COLP_STAT stat,
2065 CHAR* number,
2066 T_ACI_TOA* type,
2067 CHAR* subaddr,
2068 T_ACI_TOS* satype,
2069 CHAR* alpha)
2070 {
2071 TRACE_FUNCTION ("rAT_PlusCOLP()");
2072
2073 // patch PMA 15 06 99 from Andreas
2074 // if (stat == -1)
2075 // return;
2076
2077 if (number != NULL)
2078 {
2079 mfwStrncpy((char *)out_call.number, (char *)number, MFW_NUM_LEN);
2080 out_call.ton = phb_cvtTon(type->ton);
2081 }
2082 else
2083 memset(out_call.number, '\0', MFW_NUM_LEN);
2084
2085 if (alpha != NULL)
2086 mfwStrncpy((char *)out_call.name, (char *)alpha, MFW_TAG_LEN);
2087 else
2088 memset(out_call.name, '\0', MFW_TAG_LEN);
2089
2090 if (subaddr != NULL)
2091 mfwStrncpy((char *)out_call.subaddr, (char *)subaddr, MFW_SUBADR_LEN);
2092 else
2093 memset(out_call.subaddr, '\0', MFW_SUBADR_LEN);
2094
2095 // patch PMA 15 06 99 from Andreas
2096 if (number != NULL)
2097 cm_signal(E_CM_COLP, &out_call);
2098 }
2099 #endif
2100
2101 /*
2102 +--------------------------------------------------------------------+
2103 | PROJECT : GSM-MFW (8417) MODULE : MFW_CM |
2104 | STATE : code ROUTINE : rAT_PlusCCWA |
2105 +--------------------------------------------------------------------+
2106
2107
2108 PURPOSE : Connected line presentation indication from ACI
2109
2110 */
2111
2112 #ifdef NO_ASCIIZ
2113
2114 GLOBAL void rAT_PlusCCWA ( T_ACI_CLSSTAT * clsStatLst,
2115 CHAR * number,
2116 T_ACI_TOA * type,
2117 U8 validity,
2118 T_ACI_CLASS call_class,
2119 T_ACI_PB_TEXT * alpha)
2120 {
2121 SHORT call_number;
2122
2123 TRACE_FUNCTION("rAT_PlusCCWA()");
2124
2125 in_call.result = NotPresent;
2126 if (clsStatLst == 0)
2127 {
2128 if (number != NULL)
2129 {
2130 mfwStrncpy((char *)in_call.number, (char *)number, MFW_NUM_LEN);
2131 in_call.ton = phb_cvtTon(type->ton);
2132 }
2133 else
2134 memset(in_call.number, '\0', MFW_NUM_LEN);
2135
2136 if (alpha != NULL)
2137 in_call.name.len = alpha->len;
2138 else
2139 in_call.name.len = 0;
2140
2141 if (in_call.name.len)
2142 {
2143 memcpy(in_call.name.data,
2144 alpha->data,
2145 alpha->len);
2146 }
2147
2148 in_call.type = cm_callTyp_cvt(call_class);
2149
2150 if (number != 0 || in_call.name.len != 0 || in_call.type != NONE_TYPE)
2151 in_call.result = Present;
2152
2153 cm_search_callId(CAL_STAT_Wait, &call_number);
2154 in_call.call_number = call_number;
2155
2156 cm_signal(E_CM_CW, &in_call);
2157 }
2158 }
2159
2160 #else
2161
2162 GLOBAL void rAT_PlusCCWA ( T_ACI_CLSSTAT * clsStatLst,
2163 CHAR * number,
2164 T_ACI_TOA * type,
2165 U8 validity,
2166 T_ACI_CLASS call_class,
2167 CHAR * alpha)
2168 {
2169 SHORT call_number;
2170
2171 in_call.result = NotPresent;
2172 if (clsStatLst == 0)
2173 {
2174 if (number != NULL)
2175 {
2176 mfwStrncpy((char *)in_call.number, (char *)number, MFW_NUM_LEN);
2177 in_call.ton = phb_cvtTon(type->ton);
2178 }
2179 else
2180 memset(in_call.number, '\0', MFW_NUM_LEN);
2181
2182 if (alpha != NULL)
2183 mfwStrncpy((char *)in_call.name, (char *)alpha, MFW_TAG_LEN);
2184 else
2185 memset(in_call.name, '\0', MFW_TAG_LEN);
2186
2187 in_call.type = cm_callTyp_cvt(call_class);
2188
2189 if (number != 0 || alpha != 0 || in_call.type != NONE_TYPE)
2190 in_call.result = Present;
2191
2192 cm_search_callId(CAL_STAT_Wait, &call_number);
2193 in_call.call_number = call_number;
2194
2195 cm_signal(E_CM_CW, &in_call);
2196 }
2197 }
2198 #endif
2199
2200 /*
2201 +--------------------------------------------------------------------+
2202 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
2203 | STATE : code ROUTINE : cm_mt_reject |
2204 +--------------------------------------------------------------------+
2205
2206
2207 PURPOSE : Reject the incoming call.
2208
2209 */
2210
2211 void cm_mt_reject()
2212 {
2213 TRACE_FUNCTION ("cm_mt_reject()");
2214
2215 if (currAccepting)
2216 {
2217 currAccepting = 0; /* ES!! 210999 */
2218 sAT_Abort(CMD_SRC_LCL, AT_CMD_A);
2219 return;
2220 }
2221
2222 cmd_hold = MFW_CM_MT_REJECT;
2223 cm_search_callId(CAL_STAT_Wait, &dis_connect.call_number);
2224 sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_RelHldOrUdub, 0);
2225 }
2226
2227
2228 /*
2229 +--------------------------------------------------------------------+
2230 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
2231 | STATE : code ROUTINE: cm_mt_accept |
2232 +--------------------------------------------------------------------+
2233
2234
2235 PURPOSE : Accept the incoming call. If the active call exists,
2236 place this active call on hold and accepts the
2237 waiting call.
2238
2239 */
2240
2241 void cm_mt_accept()
2242 {
2243 SHORT call_number;
2244 T_MFW_CM_CALL_STAT stat; /* SPR#1983 - SH */
2245 UBYTE ton;
2246 UBYTE mode;
2247
2248 TRACE_FUNCTION ("cm_mt_accept()");
2249
2250 if (cm_search_callId(CAL_STAT_Active, &call_number) != CM_OK)
2251 {
2252 if (sAT_A(CMD_SRC_LCL) NEQ AT_EXCT)
2253 {
2254 TRACE_ERROR("sAT_A error");
2255 }
2256 else
2257 {
2258 currAccepting = 1; /* ES!! 210999 */
2259 }
2260 }
2261 else
2262 {
2263 cmd_hold = MFW_CM_MT_ACCEPT;
2264
2265 /* SPR#1983 - SH - Get status of active call */
2266
2267 cm_search_callStat(call_number, &stat, &ton, &mode);
2268
2269 if (cm_search_callId(CAL_STAT_Wait, &call_number) EQ CM_OK)
2270 cc_id = call_number;
2271
2272 /* SPR#1983 - SH - If data call is active, end it and accept other call */
2273
2274 if (mode==DATA_CALL)
2275 {
2276 /*
2277 * Accepting a call when there is an active data call,
2278 * so drop the active call and accept the waiting call by the
2279 * equivalent of the AT+CHLD=1 command.
2280 */
2281 cm_set_cmd_status(CHLD_MOD_RelActAndAcpt, "");
2282 if (sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_RelActAndAcpt, 0) NEQ AT_EXCT)
2283 {
2284 TRACE_ERROR("sAT_PlusCHLD(CHLD_MOD_RelActAndAcpt) error");
2285 }
2286 }
2287
2288 else /* SPR#1983 - SH - Important! Acts on next 'if' */
2289
2290 /* Marcus: issue 1049: 03/09/2002: Start */
2291 if (cm_search_callId(CAL_STAT_Held, &call_number) EQ CM_OK)
2292 {
2293 /*
2294 * Accepting a call when there is already an active call and a held
2295 * call, so drop the active call and accept the waiting call by the
2296 * equivalent of the AT+CHLD=1 command.
2297 */
2298 cm_set_cmd_status(CHLD_MOD_RelActAndAcpt, "");
2299 if (sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_RelActAndAcpt, 0) NEQ AT_EXCT)
2300 {
2301 TRACE_ERROR("sAT_PlusCHLD(CHLD_MOD_RelActAndAcpt) error");
2302 }
2303 }
2304 else
2305 {
2306 /*
2307 * Accepting a call when there is already an active call but no held
2308 * call, so hold the active call and accept the waiting call by the
2309 * equivalent of the AT+CHLD=2 command.
2310 */
2311 cm_set_cmd_status(CHLD_MOD_HldActAndAcpt, "");
2312 if (sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_HldActAndAcpt, 0) NEQ AT_EXCT)
2313 {
2314 TRACE_ERROR("sAT_PlusCHLD(CHLD_MOD_HldActAndAcpt) error");
2315 }
2316 }
2317 /* Marcus: issue 1049: 03/09/2002: End */
2318 }
2319 }
2320
2321
2322 /*
2323 +--------------------------------------------------------------------+
2324 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
2325 | STATE : code ROUTINE : cm_end_all |
2326 +--------------------------------------------------------------------+
2327
2328
2329 PURPOSE : End all calls (Held and Active)
2330
2331 */
2332
2333 void cm_end_all(void)
2334 {
2335 T_ACI_RETURN aci_res; // The value returned by sAT_H
2336
2337 TRACE_EVENT("cm_end_all()");
2338
2339 aci_res = sAT_H(CMD_SRC_LCL);
2340
2341 if (aci_res == AT_EXCT)
2342 {
2343 TRACE_EVENT("sAT_H returned AT_EXCT");
2344 cmd_hold = MFW_CM_DISCONNECT_ALL;
2345 }
2346 else
2347 {
2348 TRACE_EVENT_P1("sAT_H returned %d", aci_res);
2349 }
2350 return;
2351 }
2352
2353
2354 /*
2355 +--------------------------------------------------------------------+
2356 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
2357 | STATE : code ROUTINE : cm_ok_connect |
2358 +--------------------------------------------------------------------+
2359
2360
2361 PURPOSE : The connect is successful.
2362
2363 */
2364
2365 void cm_ok_connect(void)
2366 {
2367 SHORT call_number;
2368
2369 TRACE_FUNCTION ("cm_ok_connect()");
2370
2371 currAccepting = 0; /* ES!! 210999 */
2372 currConnecting = 0; /* ES!! 290999 */
2373
2374 if (cc_stat.type == REDIALING_CALL)
2375 {
2376 rdl.redial_mode = CM_REDIAL_SUCCESS;
2377 cm_signal(E_CM_REDIAL, &rdl);
2378 }
2379
2380 cm_search_callId(CAL_STAT_Active, &call_number);
2381
2382 /* allow a new outgoing */
2383 call_stat = MFW_CALL_FREE;
2384 call_type = MFW_CALL_FREE;
2385 cmd_hold = MFW_CM_NO_FLAG;
2386
2387 cm_signal(E_CM_CONNECT_ACK, &call_number);
2388 }
2389
2390
2391 /*
2392 +--------------------------------------------------------------------+
2393 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
2394 | STATE : code ROUTINE : cm_rmt_ok_connect |
2395 +--------------------------------------------------------------------+
2396
2397
2398 PURPOSE : The connect is successful.
2399
2400 */
2401
2402 void cm_rmt_ok_connect()
2403 {
2404 SHORT call_number;
2405
2406 TRACE_FUNCTION ("cm_rmt_ok_connect()");
2407
2408 cm_search_callId(CAL_STAT_Active, &call_number);
2409
2410 cm_signal(E_CM_CONNECT_ACK, &call_number);
2411 }
2412
2413
2414 /*
2415 +--------------------------------------------------------------------+
2416 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
2417 | STATE : code ROUTINE : cm_error_connect |
2418 +--------------------------------------------------------------------+
2419
2420
2421 PURPOSE : The connection is not successful
2422
2423 */
2424
2425 #ifdef FF_2TO1_PS
2426 void cm_error_connect(SHORT call_number)
2427 {
2428 int i;
2429 T_CAUSE_ps_cause report; /* Marcus: Extended error reporting: 12/11/2002 */
2430 USHORT extend_report; /* API - 1564 - 16-01-03 - add this variable to store the new error code */
2431
2432 TRACE_FUNCTION ("cm_error_connect()");
2433
2434 currAccepting = 0; /* ES!! 210999 */
2435 currConnecting = 0; /* ES!! 290999 */
2436
2437 /* send event */
2438 dis_connect.call_number = call_number;
2439
2440 qAT_PlusCEER( CMD_SRC_LCL, &report);
2441 /* Marcus: Extended error reporting: 12/11/2002: Start */
2442 // TRACE_EVENT_P1("qAT_PlusCEER(%04X)", report);
2443
2444 /* API - 1564 - 16-01-03 - store the error value to the new variable & throughout this function replace 'report' with 'extend_report */
2445 extend_report = report.value.nwcc_cause;
2446
2447 if (report.ctrl_value != CAUSE_is_from_nwcc)
2448 {
2449 /* Treat Condat defined cause values as if no cause given */
2450 dis_connect.cause = NOT_PRESENT_8BIT;
2451 }
2452 else
2453 {
2454 /* Standards defined cause value is given */
2455 dis_connect.cause = report.value.nwcc_cause;
2456 }
2457 TRACE_EVENT_P1("dis_connect.cause = %02X)", dis_connect.cause);
2458 /* Marcus: Extended error reporting: 12/11/2002: End */
2459 cm_signal(E_CM_DISCONNECT, &dis_connect);
2460 TRACE_EVENT("passed the E_CM_DISCONNECT point");
2461
2462 if ((call_stat EQ OUTGOING_CALL)
2463 AND (call_type NEQ MFW_ECC_CALL)
2464 AND ((redial_stat EQ CM_REDIAL_AUTO) OR (redial_stat EQ CM_REDIAL_MANU)))
2465 {
2466 /* If this call is 2nd outgoing call, redial is not started */
2467 if (qAT_PercentCAL(CMD_SRC_LCL, call_tab) EQ AT_CMPL)
2468 {
2469 for (i=0; i<MAX_CALL_NR; i++)
2470 {
2471 if (call_tab[i].index == -1)
2472 break;
2473
2474 if ((call_tab[i].status == CAL_STAT_NotPresent)
2475 OR (call_tab[i].status == CAL_STAT_DeactiveReq))
2476 continue;
2477
2478 if (call_tab[i].calType == CAL_TYPE_MOC)
2479 {
2480 call_stat = MFW_CALL_FREE;
2481 call_type = MFW_CALL_FREE;
2482 cmd_hold = MFW_CM_NO_FLAG;
2483 return;
2484 }
2485 }
2486 }
2487
2488 /* check blacklist whether it is full */
2489 if (black_list.count == MAX_BLACKLIST_NUM)
2490 {
2491 TRACE_EVENT ("blacklist is now full");
2492
2493 /* Blacklist is now full and
2494 MT shall prohibit further automatic call attempts
2495 */
2496 redial_stat = CM_REDIAL_OFF;
2497
2498
2499 /* allow a new outgoing */
2500 call_stat = MFW_CALL_FREE;
2501 call_type = MFW_CALL_FREE;
2502 cc_stat.type = MFW_CALL_FREE;
2503
2504 rdl.redial_mode = CM_REDIAL_BLACKLIST;
2505 cm_signal(E_CM_REDIAL, &rdl);
2506 return;
2507 }
2508
2509 /* check the registration staus */
2510 if (nm_reg_status() == MFW_NO_SERVICE)
2511 {
2512 call_stat = MFW_CALL_FREE;
2513 call_type = MFW_CALL_FREE;
2514 cc_stat.type = MFW_CALL_FREE;
2515
2516 rdl.redial_mode = CM_REDIAL_NO_SERVICE;
2517 cm_signal(E_CM_REDIAL, &rdl);
2518 return;
2519 }
2520
2521 TRACE_EVENT_P1("report = %d", extend_report);
2522 switch (extend_report)
2523 {
2524 case 28:
2525 // API - 1480 - Added this code to stop redial on an incorrect number
2526 if(!redial_count)
2527 {
2528 call_stat = MFW_CALL_FREE;
2529 call_type = MFW_CALL_FREE;
2530 cc_stat.type = MFW_CALL_FREE;
2531
2532 rdl.redial_mode = CM_REDIAL_ABORTED;
2533 cm_signal(E_CM_REDIAL, &rdl);
2534 return;
2535 }
2536 case 1: /* check whether the reason is in category 3 (GSM 02.07) */
2537 case 3:
2538 case 22:
2539 case 38:
2540 TRACE_EVENT ("category 3");
2541 if (!redial_count)
2542 {
2543 /* redial_count == 0;
2544 this is for the first outgoing call and
2545 now it is going to start the Auto-redial procedure
2546 */
2547 cc_stat.type = REDIALING_CALL;
2548 cc_stat.call_number = 0;
2549
2550 call_stat = REDIALING_CALL;
2551 rdl.redial_mode = CM_REDIAL_STARTED;
2552 mfwStrncpy((char *)rdl.number, (char *)cc_stat.number, MFW_NUM_LEN);
2553
2554 #ifdef NO_ASCIIZ
2555 rdl.name.len = cc_stat.name.len;
2556 memcpy(rdl.name.data,
2557 cc_stat.name.data,
2558 cc_stat.name.len);
2559 #else
2560 mfwStrncpy((char *)rdl.name, (char *)cc_stat.name, MFW_TAG_LEN);
2561 // strcpy((char *)rdl.subaddr, (char *)cc_stat.subaddr);
2562 #endif
2563 rdl.ton = cc_stat.ton;
2564 rdl.type = cc_stat.mode;
2565
2566 /* reasons in the category 3 have
2567 a call repeat attempts of max. 1 !
2568 */
2569 redial_count = MAX_REDIAL_ATTEMPT-1;
2570 cm_signal(E_CM_REDIAL, &rdl);
2571 return;
2572 }
2573 else
2574 redial_count = MAX_REDIAL_ATTEMPT;
2575 break;
2576
2577 case 17: /* check whether the reason is in category 1 and 2 (GSM 02.07) */
2578 case 18:
2579 case 19:
2580 case 27:
2581 case 34:
2582 case 41:
2583 case 42:
2584 case 44:
2585 case 47:
2586 TRACE_EVENT ("category 1 & 2");
2587 if (!redial_count)
2588 {
2589 /* redial_count == 0
2590 this is for the first outgoing call and
2591 now it is going to start the Auto-redial procedure
2592 */
2593 cc_stat.type = REDIALING_CALL;
2594 cc_stat.call_number = 0;
2595
2596 call_stat = REDIALING_CALL;
2597 rdl.redial_mode = CM_REDIAL_STARTED;
2598 mfwStrncpy((char *)rdl.number, (char *)cc_stat.number, MFW_NUM_LEN);
2599 #ifdef NO_ASCIIZ
2600 rdl.name.len = cc_stat.name.len;
2601 memcpy(rdl.name.data,
2602 cc_stat.name.data,
2603 cc_stat.name.len);
2604 #else
2605 mfwStrncpy((char *)rdl.name, (char *)cc_stat.name, MFW_TAG_LEN);
2606 // strcpy((char *)rdl.subaddr, (char *)cc_stat.subaddr);
2607 #endif
2608 rdl.ton = cc_stat.ton;
2609 rdl.type = cc_stat.mode;
2610
2611 /* reasons in the category 1 and 2 have
2612 a call repeat attempts of max. 10 !
2613 */
2614
2615 cm_signal(E_CM_REDIAL, &rdl);
2616 return;
2617 }
2618
2619 if (redial_count >= 1 AND redial_count <= 3)
2620 {
2621 timStart(redialTim24);
2622 call_stat = REDIALING_CALL;
2623 cc_stat.call_number = 0;
2624 return;
2625 }
2626
2627 if (redial_count >= 4 AND redial_count < MAX_REDIAL_ATTEMPT)
2628 {
2629 timStart(redialTim5);
2630 call_stat = REDIALING_CALL;
2631 cc_stat.call_number = 0;
2632 return;
2633 }
2634 #ifdef CUSTOMER_6366
2635 // JP PATCH The MMI needs to know if the 'error disconnect' has
2636 // resulted in redial starting irrespective of whether this was a redial attempt or not
2637 rdl.redial_mode = CM_REDIAL_STARTED;
2638 cm_signal(E_CM_REDIAL, &rdl);
2639 // END JP PATCH
2640 #endif /* CUSTOMER_6366 */
2641 break;
2642
2643 default:
2644 if (redial_count)
2645 {
2646 rdl.redial_mode = CM_REDIAL_STOP;
2647 mfwStrncpy((char *)rdl.number, (char *)cc_stat.number, MFW_NUM_LEN);
2648 #ifdef NO_ASCIIZ
2649 rdl.name.len = cc_stat.name.len;
2650 memcpy(rdl.name.data,
2651 cc_stat.name.data,
2652 cc_stat.name.len);
2653 #else
2654 mfwStrncpy((char *)rdl.name, (char *)cc_stat.name, MFW_TAG_LEN);//???
2655 // strcpy((char *)rdl.subaddr, (char *)cc_stat.subaddr);
2656 #endif
2657 rdl.ton = cc_stat.ton;
2658 rdl.type = cc_stat.mode;
2659 cm_signal(E_CM_REDIAL, &rdl);
2660 }
2661 /* allow a new outgoing */
2662 call_stat = MFW_CALL_FREE;
2663 call_type = MFW_CALL_FREE;
2664 cc_stat.type = MFW_CALL_FREE;
2665 return;
2666 }
2667
2668 if (redial_count >= MAX_REDIAL_ATTEMPT
2669 AND black_list.count < MAX_BLACKLIST_NUM)
2670 {
2671 mfwStrncpy((char *)black_list.number[black_list.count],
2672 (char *)cc_stat.number, MFW_NUM_LEN);
2673 black_list.count++;
2674
2675 rdl.redial_mode = CM_REDIAL_BLACKLISTED;
2676 mfwStrncpy((char *)rdl.number, (char *)cc_stat.number, MFW_NUM_LEN);
2677 #ifdef NO_ASCIIZ
2678 rdl.name.len = cc_stat.name.len;
2679 memcpy(rdl.name.data,
2680 cc_stat.name.data,
2681 cc_stat.name.len);
2682 #else
2683 mfwStrncpy((char *)rdl.name, (char *)cc_stat.name, MFW_TAG_LEN);
2684 // strcpy((char *)rdl.subaddr, (char *)cc_stat.subaddr);
2685 #endif
2686 rdl.ton = cc_stat.ton;
2687 rdl.type = cc_stat.mode;
2688 rdl.left_attempts = 0;
2689 cc_stat.call_number = 0;
2690 cm_signal(E_CM_REDIAL, &rdl);
2691 }
2692 }
2693
2694 /* allow a new outgoing */
2695 call_stat = MFW_CALL_FREE;
2696 call_type = MFW_CALL_FREE;
2697 cc_stat.type = MFW_CALL_FREE;
2698 }
2699 #else
2700 void cm_error_connect(SHORT call_number)
2701 {
2702
2703 int i;
2704 USHORT report; /* Marcus: Extended error reporting: 12/11/2002 */
2705 USHORT extend_report; /* API - 1564 - 16-01-03 - add this variable to store the new error code */
2706 // Apr 06 2005 REF: CRR 29989 xpradipg
2707 // local definition
2708 #ifdef FF_MMI_OPTIM
2709 T_ACI_CAL_ENTR *call_tab;//[MAX_CALL_NR];
2710 #endif
2711 // Apr 14, 2005 REF: CRR 29991 xpradipg
2712 // local definition
2713 #ifdef FF_MMI_OPTIM
2714 UBYTE count;
2715 UBYTE blackListNum[MFW_NUM_LEN];
2716 int32 file = 0;
2717 #endif
2718 TRACE_FUNCTION ("cm_error_connect()");
2719
2720 currAccepting = 0; /* ES!! 210999 */
2721 currConnecting = 0; /* ES!! 290999 */
2722
2723 /* send event */
2724 dis_connect.call_number = call_number;
2725
2726 qAT_PlusCEER( CMD_SRC_LCL, &report);
2727 /* Marcus: Extended error reporting: 12/11/2002: Start */
2728 TRACE_EVENT_P1("qAT_PlusCEER(%04X)", report);
2729
2730 /* API - 1564 - 16-01-03 - store the error value to the new variable & throughout this function replace 'report' with 'extend_report */
2731 extend_report = GET_CAUSE_VALUE(report);
2732
2733 if (GET_CAUSE_DEFBY(extend_report) == DEFBY_CONDAT)
2734 {
2735 /* Treat Condat defined cause values as if no cause given */
2736 dis_connect.cause = NOT_PRESENT_8BIT;
2737 }
2738 else
2739 {
2740 /* Standards defined cause value is given */
2741 dis_connect.cause = GET_CAUSE_VALUE(extend_report);
2742 }
2743 TRACE_EVENT_P1("dis_connect.cause = %02X)", dis_connect.cause);
2744 /* Marcus: Extended error reporting: 12/11/2002: End */
2745 cm_signal(E_CM_DISCONNECT, &dis_connect);
2746 TRACE_EVENT("passed the E_CM_DISCONNECT point");
2747
2748 if ((call_stat EQ OUTGOING_CALL)
2749 AND (call_type NEQ MFW_ECC_CALL)
2750 AND ((redial_stat EQ CM_REDIAL_AUTO) OR (redial_stat EQ CM_REDIAL_MANU)))
2751 {
2752 // Apr 06 2005 REF: CRR 29989 xpradipg
2753 // allocate memory
2754 #ifdef FF_MMI_OPTIM
2755 call_tab = (T_ACI_CAL_ENTR*)mfwAlloc(sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
2756 if( NULL == call_tab)
2757 return;
2758 #endif
2759 /* If this call is 2nd outgoing call, redial is not started */
2760 if (qAT_PercentCAL(CMD_SRC_LCL, call_tab) EQ AT_CMPL)
2761 {
2762 for (i=0; i<MAX_CALL_NR; i++)
2763 {
2764 if (call_tab[i].index == -1)
2765 break;
2766
2767 if ((call_tab[i].status == CAL_STAT_NotPresent)
2768 OR (call_tab[i].status == CAL_STAT_DeactiveReq))
2769 continue;
2770
2771 if (call_tab[i].calType == CAL_TYPE_MOC)
2772 {
2773 call_stat = MFW_CALL_FREE;
2774 call_type = MFW_CALL_FREE;
2775 cmd_hold = MFW_CM_NO_FLAG;
2776 // Apr 06 2005 REF: CRR 29989 xpradipg
2777 // deallocate memory
2778 #ifdef FF_MMI_OPTIM
2779 if(call_tab)
2780 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
2781 #endif
2782 return;
2783 }
2784 }
2785 }
2786 // Apr 06 2005 REF: CRR 29989 xpradipg
2787 // deallocate memory
2788 #ifdef FF_MMI_OPTIM
2789 if(call_tab)
2790 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
2791 #endif
2792 // Apr 14, 2005 REF: CRR 29991 xpradipg
2793 // read the list into the variable
2794 #ifdef FF_MMI_OPTIM
2795 if((file = flash_MMI_blackList_open()) >= 0 )
2796 {
2797 if(flash_MMI_blackList_read(file,(U8*)&count, 1,0) > 0)
2798 {
2799 if(count == MAX_BLACKLIST_NUM)
2800 #else
2801 /* check blacklist whether it is full */
2802 if (black_list.count == MAX_BLACKLIST_NUM)
2803 #endif
2804 {
2805 TRACE_EVENT ("blacklist is now full");
2806
2807 /* Blacklist is now full and
2808 MT shall prohibit further automatic call attempts
2809 */
2810 redial_stat = CM_REDIAL_ABORTED;
2811
2812
2813 /* allow a new outgoing */
2814 call_stat = MFW_CALL_FREE;
2815 call_type = MFW_CALL_FREE;
2816 cc_stat.type = MFW_CALL_FREE;
2817
2818 rdl.redial_mode = CM_REDIAL_BLACKLIST;
2819 cm_signal(E_CM_REDIAL, &rdl);
2820 #ifdef FF_MMI_OPTIM
2821 flash_MMI_blackList_close(file);
2822 #endif
2823 return;
2824 }
2825 #ifdef FF_MMI_OPTIM
2826 }
2827 flash_MMI_blackList_close(file);
2828 }
2829 #endif
2830
2831 /* check the registration staus */
2832 if (nm_reg_status() == MFW_NO_SERVICE)
2833 {
2834 call_stat = MFW_CALL_FREE;
2835 call_type = MFW_CALL_FREE;
2836 cc_stat.type = MFW_CALL_FREE;
2837
2838 rdl.redial_mode = CM_REDIAL_NO_SERVICE;
2839 cm_signal(E_CM_REDIAL, &rdl);
2840 return;
2841 }
2842
2843 TRACE_EVENT_P1("report = %d", extend_report);
2844 switch (extend_report)
2845 {
2846 case 28:
2847 // API - 1480 - Added this code to stop redial on an incorrect number
2848 if(!redial_count)
2849 {
2850 call_stat = MFW_CALL_FREE;
2851 call_type = MFW_CALL_FREE;
2852 cc_stat.type = MFW_CALL_FREE;
2853
2854 rdl.redial_mode = CM_REDIAL_ABORTED;
2855 cm_signal(E_CM_REDIAL, &rdl);
2856 return;
2857 }
2858 case 1: /* check whether the reason is in category 3 (GSM 02.07) */
2859 case 3:
2860 case 22:
2861 case 38:
2862 TRACE_EVENT ("category 3");
2863 if (!redial_count)
2864 {
2865 /* redial_count == 0;
2866 this is for the first outgoing call and
2867 now it is going to start the Auto-redial procedure
2868 */
2869 cc_stat.type = REDIALING_CALL;
2870 cc_stat.call_number = 0;
2871
2872 call_stat = REDIALING_CALL;
2873 rdl.redial_mode = CM_REDIAL_STARTED;
2874 mfwStrncpy((char *)rdl.number, (char *)cc_stat.number, MFW_NUM_LEN);
2875
2876 #ifdef NO_ASCIIZ
2877 rdl.name.len = cc_stat.name.len;
2878 memcpy(rdl.name.data,
2879 cc_stat.name.data,
2880 cc_stat.name.len);
2881 #else
2882 mfwStrncpy((char *)rdl.name, (char *)cc_stat.name, MFW_TAG_LEN);
2883 // strcpy((char *)rdl.subaddr, (char *)cc_stat.subaddr);
2884 #endif
2885 rdl.ton = cc_stat.ton;
2886 rdl.type = cc_stat.mode;
2887
2888 /* reasons in the category 3 have
2889 a call repeat attempts of max. 1 !
2890 */
2891 redial_count = MAX_REDIAL_ATTEMPT-1;
2892 cm_signal(E_CM_REDIAL, &rdl);
2893 return;
2894 }
2895 else
2896 redial_count = MAX_REDIAL_ATTEMPT;
2897 break;
2898
2899 case 17: /* check whether the reason is in category 1 and 2 (GSM 02.07) */
2900 case 18:
2901 case 19:
2902 case 27:
2903 case 34:
2904 case 41:
2905 case 42:
2906 case 44:
2907 case 47:
2908 TRACE_EVENT ("category 1 & 2");
2909 if (!redial_count)
2910 {
2911 /* redial_count == 0
2912 this is for the first outgoing call and
2913 now it is going to start the Auto-redial procedure
2914 */
2915 cc_stat.type = REDIALING_CALL;
2916 cc_stat.call_number = 0;
2917
2918 call_stat = REDIALING_CALL;
2919 rdl.redial_mode = CM_REDIAL_STARTED;
2920 mfwStrncpy((char *)rdl.number, (char *)cc_stat.number, MFW_NUM_LEN);
2921 #ifdef NO_ASCIIZ
2922 rdl.name.len = cc_stat.name.len;
2923 memcpy(rdl.name.data,
2924 cc_stat.name.data,
2925 cc_stat.name.len);
2926 #else
2927 mfwStrncpy((char *)rdl.name, (char *)cc_stat.name, MFW_TAG_LEN);
2928 // strcpy((char *)rdl.subaddr, (char *)cc_stat.subaddr);
2929 #endif
2930 rdl.ton = cc_stat.ton;
2931 rdl.type = cc_stat.mode;
2932
2933 /* reasons in the category 1 and 2 have
2934 a call repeat attempts of max. 10 !
2935 */
2936
2937 cm_signal(E_CM_REDIAL, &rdl);
2938 return;
2939 }
2940
2941 if (redial_count >= 1 AND redial_count <= 3)
2942 {
2943 timStart(redialTim24);
2944 call_stat = REDIALING_CALL;
2945 cc_stat.call_number = 0;
2946 return;
2947 }
2948
2949 if (redial_count >= 4 AND redial_count < MAX_REDIAL_ATTEMPT)
2950 {
2951 timStart(redialTim5);
2952 call_stat = REDIALING_CALL;
2953 cc_stat.call_number = 0;
2954 return;
2955 }
2956 #ifdef CUSTOMER_6366
2957 // JP PATCH The MMI needs to know if the 'error disconnect' has
2958 // resulted in redial starting irrespective of whether this was a redial attempt or not
2959 rdl.redial_mode = CM_REDIAL_STARTED;
2960 cm_signal(E_CM_REDIAL, &rdl);
2961 // END JP PATCH
2962 #endif /* CUSTOMER_6366 */
2963 break;
2964
2965 default:
2966 if (redial_count)
2967 {
2968 rdl.redial_mode = CM_REDIAL_STOP;
2969 mfwStrncpy((char *)rdl.number, (char *)cc_stat.number, MFW_NUM_LEN);
2970 #ifdef NO_ASCIIZ
2971 rdl.name.len = cc_stat.name.len;
2972 memcpy(rdl.name.data,
2973 cc_stat.name.data,
2974 cc_stat.name.len);
2975 #else
2976 mfwStrncpy((char *)rdl.name, (char *)cc_stat.name, MFW_TAG_LEN);//???
2977 // strcpy((char *)rdl.subaddr, (char *)cc_stat.subaddr);
2978 #endif
2979 rdl.ton = cc_stat.ton;
2980 rdl.type = cc_stat.mode;
2981 cm_signal(E_CM_REDIAL, &rdl);
2982 }
2983 /* allow a new outgoing */
2984 call_stat = MFW_CALL_FREE;
2985 call_type = MFW_CALL_FREE;
2986 cc_stat.type = MFW_CALL_FREE;
2987 return;
2988 }
2989 #ifdef FF_MMI_OPTIM
2990 if (redial_count >= MAX_REDIAL_ATTEMPT
2991 AND count < MAX_BLACKLIST_NUM)
2992 {
2993 mfwStrncpy((char *)blackListNum,(char *)cc_stat.number, MFW_NUM_LEN);
2994 // Apr 14, 2005 REF: CRR 29991 xpradipg
2995 // once there is new addition update it onto the file
2996 if(flash_MMI_blackList_write((U8*)blackListNum, MFW_NUM_LEN, (count*MFW_NUM_LEN)+1) < 0)
2997 TRACE_FUNCTION("ERROR OPENING the blacklist file");
2998 count++;
2999 if(flash_MMI_blackList_write((U8*)&count,1,0) < 0)
3000 TRACE_FUNCTION("ERROR OPENING the blacklist file");
3001 #else
3002 if (redial_count >= MAX_REDIAL_ATTEMPT
3003 AND black_list.count < MAX_BLACKLIST_NUM)
3004 {
3005 mfwStrncpy((char *)black_list.number[black_list.count],
3006 (char *)cc_stat.number, MFW_NUM_LEN);
3007 black_list.count++;
3008 #endif
3009 rdl.redial_mode = CM_REDIAL_BLACKLISTED;
3010 mfwStrncpy((char *)rdl.number, (char *)cc_stat.number, MFW_NUM_LEN);
3011 #ifdef NO_ASCIIZ
3012 rdl.name.len = cc_stat.name.len;
3013 memcpy(rdl.name.data,
3014 cc_stat.name.data,
3015 cc_stat.name.len);
3016 #else
3017 mfwStrncpy((char *)rdl.name, (char *)cc_stat.name, MFW_TAG_LEN);
3018 // strcpy((char *)rdl.subaddr, (char *)cc_stat.subaddr);
3019 #endif
3020 rdl.ton = cc_stat.ton;
3021 rdl.type = cc_stat.mode;
3022 rdl.left_attempts = 0;
3023 cc_stat.call_number = 0;
3024 cm_signal(E_CM_REDIAL, &rdl);
3025 }
3026 }
3027
3028 /* allow a new outgoing */
3029 call_stat = MFW_CALL_FREE;
3030 call_type = MFW_CALL_FREE;
3031 cc_stat.type = MFW_CALL_FREE;
3032 }
3033 #endif
3034
3035
3036 /*
3037 +-----------------------------------------------------------------------+
3038 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
3039 | STATE : code ROUTINE : cm_rmt_error_connect |
3040 +-----------------------------------------------------------------------+
3041
3042
3043 PURPOSE : The connection is not successful
3044
3045 */
3046
3047 #ifdef FF_2TO1_PS
3048 void cm_rmt_error_connect(SHORT call_number)
3049 {
3050 T_CAUSE_ps_cause report; /* Marcus: Extended error reporting: 12/11/2002 */
3051
3052 TRACE_FUNCTION ("cm_error_connect()");
3053
3054 /* send event */
3055 dis_connect.call_number = call_number;
3056
3057 qAT_PlusCEER( CMD_SRC_LCL, &report);
3058 /* Marcus: Extended error reporting: 12/11/2002: Start */
3059 // TRACE_EVENT_P1("qAT_PlusCEER(%04X)", report);
3060
3061 if (report.ctrl_value != CAUSE_is_from_nwcc)
3062 {
3063 /* Treat Condat defined cause values as if no cause given */
3064 dis_connect.cause = NOT_PRESENT_8BIT;
3065 }
3066 else
3067 {
3068 /* Standards defined cause value is given */
3069 dis_connect.cause = report.value.nwcc_cause;
3070 }
3071
3072 TRACE_EVENT_P1("dis_connect.cause = %02X)", dis_connect.cause);
3073 /* Marcus: Extended error reporting: 12/11/2002: End */
3074
3075 cm_signal(E_CM_DISCONNECT, &dis_connect);
3076 }
3077 #else
3078 void cm_rmt_error_connect(SHORT call_number)
3079 {
3080 USHORT report; /* Marcus: Extended error reporting: 12/11/2002 */
3081
3082 TRACE_FUNCTION ("cm_error_connect()");
3083
3084 /* send event */
3085 dis_connect.call_number = call_number;
3086
3087 qAT_PlusCEER( CMD_SRC_LCL, &report);
3088 /* Marcus: Extended error reporting: 12/11/2002: Start */
3089 TRACE_EVENT_P1("qAT_PlusCEER(%04X)", report);
3090 if (GET_CAUSE_DEFBY(report) == DEFBY_CONDAT)
3091 {
3092 /* Treat Condat defined cause values as if no cause given */
3093 dis_connect.cause = NOT_PRESENT_8BIT;
3094 }
3095 else
3096 {
3097 /* Standards defined cause value is given */
3098 dis_connect.cause = GET_CAUSE_VALUE(report);
3099 }
3100 TRACE_EVENT_P1("dis_connect.cause = %02X)", dis_connect.cause);
3101 /* Marcus: Extended error reporting: 12/11/2002: End */
3102
3103 cm_signal(E_CM_DISCONNECT, &dis_connect);
3104 }
3105 #endif
3106
3107
3108 /*
3109 +--------------------------------------------------------------------+
3110 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
3111 | STATE : code ROUTINE: cm_disconnect |
3112 +--------------------------------------------------------------------+
3113
3114
3115 PURPOSE : Disconnection for outgoing call or active call
3116
3117 */
3118
3119 T_MFW cm_disconnect(SHORT call_number)
3120 {
3121 CHAR callId[5];
3122 T_MFW_CM_CALL_STAT stat;
3123 UBYTE ton;
3124 UBYTE mode;
3125
3126 TRACE_FUNCTION ("cm_disconnect()");
3127
3128 dis_connect.call_number = call_number;
3129
3130 if (!call_number)
3131 {
3132 cmd_hold = MFW_CM_MPTY_TERMINATED;
3133 sprintf(callId, "%d", 0);
3134 if (sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_RelActSpec, callId) != AT_EXCT)
3135 return CM_ERROR;
3136 return CM_OK;
3137 }
3138
3139 cm_search_callStat(call_number, &stat, &ton, &mode);
3140
3141 TRACE_EVENT_P3("Status %d Ton %d Mode %d",stat,ton,mode);
3142
3143 /* HANG UP DATA CALL (WAP)
3144 * SPR#1983 - SH - Use sAT_Abort() when call has not yet connected,
3145 * rather than sAT_H */
3146
3147 if (mode == DATA_CALL)
3148 {
3149 T_ACI_RETURN retval;
3150
3151 TRACE_EVENT_P1("***Disconnect data call, stat=%d", stat);
3152
3153 if ((stat == CALL_DIAL) OR (stat == CALL_ALERT))
3154 {
3155 if (sAT_Abort(CMD_SRC_LCL, AT_CMD_D) NEQ AT_CMPL)
3156 return CM_ERROR;
3157 return CM_OK;
3158 }
3159
3160 if (stat == CALL_DEACTIVE && currConnecting) /* ES/AK 290999 */
3161 {
3162 currConnecting = 0;
3163 if (sAT_Abort(CMD_SRC_LCL, AT_CMD_D) NEQ AT_CMPL)
3164 return CM_ERROR;
3165 return CM_OK;
3166 }
3167
3168 retval = sAT_H(CMD_SRC_LCL);
3169
3170 TRACE_EVENT_P1("Result of sAT_H = %d", retval);
3171 if (retval)
3172 return CM_ERROR;
3173 return CM_OK;
3174 }
3175
3176
3177 if ((stat == CALL_DIAL) OR (stat == CALL_ALERT))
3178 {
3179 if (sAT_Abort(CMD_SRC_LCL, AT_CMD_D) NEQ AT_CMPL)
3180 return CM_ERROR;
3181 return CM_OK;
3182 }
3183
3184 if (stat == CALL_DEACTIVE && currConnecting) /* ES/AK 290999 */
3185 {
3186 currConnecting = 0;
3187 if (sAT_Abort(CMD_SRC_LCL, AT_CMD_D) NEQ AT_CMPL)
3188 return CM_ERROR;
3189 return CM_OK;
3190 }
3191
3192 if ((stat == CALL_ACTIVE) OR (stat == CALL_DEACTIVE))
3193 {
3194 cmd_hold = MFW_CM_TERMINATED;
3195 sprintf(callId, "%d", call_number);
3196 if (sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_RelActSpec, callId) != AT_EXCT)
3197 return CM_ERROR;
3198 return CM_OK;
3199 }
3200 else if (stat == CALL_HELD)
3201 {
3202
3203
3204 // Apr 26, 2004 REF: CRR 16545 Ajith K P Side effect of CRR 16545.
3205 // CHLD_MOD_RelActSpec no longer releases held calls.
3206 // So now if the user wants to release a HELD call, now we are calling the
3207 // sAT_PlusCHLD(..) function with CHLD_MOD_RelAnySpec as the parameter.
3208
3209
3210
3211 cmd_hold = MFW_CM_TERMINATED;
3212 sprintf(callId, "%d", call_number);
3213 // Feb 27, 2006 REF:DR OMAPS00067884 x0039928
3214 // Fix : sAT_PercentCHLD() is called if the mode > CHLD_MOD_RelDialCall
3215 if (sAT_PercentCHLD(CMD_SRC_LCL, CHLD_MOD_RelAnySpec, callId) != AT_EXCT)
3216 return CM_ERROR;
3217 return CM_OK;
3218 }
3219 return CM_ERROR;
3220 }
3221
3222 /*
3223 +--------------------------------------------------------------------+
3224 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
3225 | STATE : code ROUTINE: cm_force_disconnect |
3226 +--------------------------------------------------------------------+
3227
3228
3229 PURPOSE : Disconnection of any call existent needed for Multiparty and some structured procedures
3230 call termination in state U9
3231
3232 */
3233
3234 void cm_force_disconnect(void)
3235 {
3236 T_ACI_RETURN res;
3237
3238 TRACE_FUNCTION("cm_force_disconnect()");
3239
3240 res = sAT_H(CMD_SRC_LCL);
3241 if (res != AT_EXCT && res != AT_CMPL)
3242 TRACE_ERROR("satReject() error");
3243
3244 return;
3245 }
3246
3247
3248 /*
3249 +--------------------------------------------------------------------+
3250 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
3251 | STATE : code ROUTINE: cm_ok_disconnect |
3252 +--------------------------------------------------------------------+
3253
3254
3255 PURPOSE : indicates disconnection from called party;
3256 sends E_CM_DISCONNECT to mmi
3257
3258 */
3259
3260 #ifdef FF_2TO1_PS
3261 void cm_ok_disconnect(T_ACI_CMD_SRC src, SHORT call_id)
3262 {
3263 T_CAUSE_ps_cause cause; /* Marcus: Extended error reporting: 12/11/2002 */
3264 T_MFW_CM_DISCONNECT_ALL disconnect_all;
3265
3266 TRACE_FUNCTION("cm_ok_disconnect()");
3267
3268 TRACE_EVENT_P4("dis_connect.call_number %d, cmd_hold %d, src %d, call_id %d",
3269 dis_connect.call_number, cmd_hold, src, call_id);
3270
3271
3272
3273
3274 /* Marcus: CCBS: 14/11/2002: Start */
3275 if (cmd_hold == MFW_CM_CCBS_REGISTER)
3276 {
3277 /* Rejecting the offered CCBS registration */
3278 TRACE_EVENT("cmd_hold == MFW_CM_CCBS_REGISTER");
3279 cmd_hold = 0;
3280 cm_ccbs_ok();
3281 return;
3282 }
3283 /* Marcus: CCBS: 14/11/2002: End */
3284
3285 if (cmd_hold == MFW_CM_MPTY_TERMINATED)
3286 dis_connect.call_number = 0;
3287 //Nov 02, 2005 DR OMAPS00052132 xdeepadh
3288 //The usage of ATI enum is put under the flag FF_ATI
3289 #if defined (FF_ATI) || defined (NEPTUNE_BOARD)
3290 else if (src EQ CMD_SRC_ATI_1) /* NM Berlin/UK integration 21.09.01 */
3291 {
3292 dis_connect.call_number = call_id;
3293 }
3294 #endif
3295
3296
3297 /* send event */
3298 qAT_PlusCEER( CMD_SRC_LCL, &cause);
3299 /* Marcus: Extended error reporting: 12/11/2002: Start */
3300 // TRACE_EVENT_P1("qAT_PlusCEER(%04X)", cause);
3301
3302 if (cause.ctrl_value != CAUSE_is_from_nwcc)
3303 {
3304 /* Treat Condat defined cause values as if no cause given */
3305 dis_connect.cause = NOT_PRESENT_8BIT;
3306 }
3307 else
3308 {
3309 /* Standards defined cause value is given */
3310 dis_connect.cause = cause.value.nwcc_cause;
3311 }
3312
3313 TRACE_EVENT_P1("dis_connect.cause = %02X)", dis_connect.cause);
3314 /* Marcus: Extended error reporting: 12/11/2002: End */
3315
3316 /* allow a new outgoing */
3317 call_stat = MFW_CALL_FREE;
3318 call_type = MFW_CALL_FREE;
3319
3320 if (cmd_hold EQ MFW_CM_DISCONNECT_ALL)
3321 {
3322 disconnect_all.result = CM_DISCONNECT_ALL_RESULT_OK;
3323 if (cause.ctrl_value != CAUSE_is_from_nwcc)
3324 {
3325 /* Treat Condat defined cause values as if no cause given */
3326 disconnect_all.cause = NOT_PRESENT_8BIT;
3327 }
3328 else
3329 {
3330 /* Standards defined cause value is given */
3331 disconnect_all.cause = cause.value.nwcc_cause;
3332 }
3333 cm_signal(E_CM_DISCONNECT_ALL,&disconnect_all);
3334 }
3335 else
3336 cm_signal(E_CM_DISCONNECT, &dis_connect);
3337
3338 cmd_hold = 0;
3339
3340 }
3341 #else
3342 void cm_ok_disconnect(T_ACI_CMD_SRC src, SHORT call_id)
3343 {
3344 USHORT cause; /* Marcus: Extended error reporting: 12/11/2002 */
3345 T_MFW_CM_DISCONNECT_ALL disconnect_all;
3346
3347 TRACE_FUNCTION("cm_ok_disconnect()");
3348
3349 TRACE_EVENT_P4("dis_connect.call_number %d, cmd_hold %d, src %d, call_id %d",
3350 dis_connect.call_number, cmd_hold, src, call_id);
3351
3352
3353
3354
3355 /* Marcus: CCBS: 14/11/2002: Start */
3356 if (cmd_hold == MFW_CM_CCBS_REGISTER)
3357 {
3358 /* Rejecting the offered CCBS registration */
3359 TRACE_EVENT("cmd_hold == MFW_CM_CCBS_REGISTER");
3360 cmd_hold = 0;
3361 cm_ccbs_ok();
3362 return;
3363 }
3364 /* Marcus: CCBS: 14/11/2002: End */
3365
3366 if (cmd_hold == MFW_CM_MPTY_TERMINATED)
3367 dis_connect.call_number = 0;
3368 //Nov 02, 2005 DR OMAPS00052132 xdeepadh
3369 //The usage of ATI enum is put under the flag FF_ATI
3370 #ifdef FF_ATI
3371 else if (src EQ CMD_SRC_ATI_1) //NM Berlin/UK integration 21.09.01
3372 {
3373 dis_connect.call_number = call_id;
3374 }
3375 #endif //FF_ATI
3376
3377 /* send event */
3378 qAT_PlusCEER( CMD_SRC_LCL, &cause);
3379 /* Marcus: Extended error reporting: 12/11/2002: Start */
3380 TRACE_EVENT_P1("qAT_PlusCEER(%04X)", cause);
3381 if (GET_CAUSE_DEFBY(cause) == DEFBY_CONDAT)
3382 {
3383 /* Treat Condat defined cause values as if no cause given */
3384 dis_connect.cause = NOT_PRESENT_8BIT;
3385 }
3386 else
3387 {
3388 /* Standards defined cause value is given */
3389 dis_connect.cause = GET_CAUSE_VALUE(cause);
3390 }
3391 TRACE_EVENT_P1("dis_connect.cause = %02X)", dis_connect.cause);
3392 /* Marcus: Extended error reporting: 12/11/2002: End */
3393
3394 /* allow a new outgoing */
3395 call_stat = MFW_CALL_FREE;
3396 call_type = MFW_CALL_FREE;
3397
3398 if (cmd_hold EQ MFW_CM_DISCONNECT_ALL)
3399 {
3400 disconnect_all.result = CM_DISCONNECT_ALL_RESULT_OK;
3401 if (GET_CAUSE_DEFBY(cause) == DEFBY_CONDAT)
3402 {
3403 /* Treat Condat defined cause values as if no cause given */
3404 disconnect_all.cause = NOT_PRESENT_8BIT;
3405 }
3406 else
3407 {
3408 /* Standards defined cause value is given */
3409 disconnect_all.cause = GET_CAUSE_VALUE(cause);
3410 }
3411 cm_signal(E_CM_DISCONNECT_ALL,&disconnect_all);
3412 }
3413 else
3414 cm_signal(E_CM_DISCONNECT, &dis_connect);
3415
3416 cmd_hold = 0;
3417
3418 }
3419 #endif
3420
3421 /* Marcus: CCBS: 14/11/2002: Start */
3422 /*
3423 +--------------------------------------------------------------------+
3424 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
3425 | STATE : code ROUTINE: cm_error_disconnect |
3426 +--------------------------------------------------------------------+
3427
3428 PURPOSE : indicates failed disconnection
3429
3430 */
3431 void cm_error_disconnect(void)
3432 {
3433 TRACE_FUNCTION ("cm_error_disconnect()");
3434 if (cmd_hold == MFW_CM_DISCONNECT_ALL)
3435 {
3436 TRACE_EVENT("cmd_hold == MFW_CM_DISCONNECT_ALL");
3437 cmd_hold = 0;
3438 }
3439
3440 /* Marcus: CCBS: 14/11/2002: Start */
3441 if (cmd_hold == MFW_CM_CCBS_REGISTER)
3442 {
3443 TRACE_EVENT("cmd_hold == MFW_CM_CCBS_REGISTER");
3444 /* Rejecting the offered CCBS registration */
3445 cmd_hold = 0;
3446 cm_ccbs_error();
3447 }
3448 }
3449 /* Marcus: CCBS: 14/11/2002: End */
3450
3451 /*
3452 +--------------------------------------------------------------------+
3453 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
3454 | STATE : code ROUTINE: cm_command |
3455 +--------------------------------------------------------------------+
3456
3457
3458 PURPOSE :
3459
3460 */
3461
3462 T_MFW cm_command(SHORT call_number, UBYTE command, UBYTE crss_string)
3463 {
3464 CHAR callId[5];
3465 UBYTE res;
3466 SHORT retVal, modeRetVal; // xnkulkar SPR-18262: Added "modeRetVal" to store the return value of "mfw_cbuf_put_mode ()"
3467
3468 TRACE_FUNCTION ("cm_command()");
3469
3470 // JP PATCH
3471 cmd_hold = 0;
3472 // END PATCH
3473
3474 cmd.call_number = call_number;
3475 cmd.command = command;
3476
3477 switch (command)
3478 {
3479 case CM_HOLD:
3480 case CM_SWAP:
3481 case CM_RETRIEVE:
3482 case CM_SWAP_MULTIPARTY:
3483 case CM_HOLD_MULTIPARTY:
3484 case CM_RETRIEVE_MULTIPARTY:
3485 /* place all active calls on held and accept held or waiting call */
3486 if (sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_HldActAndAcpt, 0) != AT_EXCT)
3487 return FALSE;
3488 break;
3489
3490 case CM_BUILD_MULTIPARTY:
3491 if (sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_AddHld, 0)!= AT_EXCT)
3492 return FALSE;
3493 break;
3494
3495 case CM_SPLIT_MULTIPARTY:
3496 if (call_number <= 0)
3497 return FALSE;
3498 sprintf(callId, "%d", call_number);
3499 if (sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_HldActExc, callId)!= AT_EXCT)
3500 return FALSE;
3501 break;
3502
3503 case CM_ETC:
3504 /* connects two calls and disconnects the subsrciber from both calls */
3505 if (sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_Ect, 0) != AT_EXCT)
3506 return FALSE;
3507 break;
3508
3509 case CM_CALL_DEFLECTION:
3510 break;
3511
3512 case CM_CCBS:
3513 TRACE_EVENT("CM_CCBS");
3514 sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_Ccbs, 0);
3515 break;
3516
3517 case CM_MODIFY:
3518 break;
3519
3520 case CM_DTMF_ACTIVE:
3521 // xnkulkar SPR-18262
3522 // If there is a DTMF tone command already in the queue, add the current tone also
3523 // in the queue (with start mode). While attempting to send a tone, if the request is not successful,
3524 // add the DTMF request to the queue. Also, start adding to the queue if we are expecting an acknowledgement
3525 // (rAT_OK) for the previous DTMF tone request sent.
3526 if (mfw_cbuf_num_elements(mfw_cm_dtmf_q_id) != 0)
3527 {
3528 /*
3529 ** There are already DTMF tones queued to be sent, so queue this request too along with the mode (Start).
3530 */
3531 modeRetVal = mfw_cbuf_put_mode(mfw_cm_dtmf_q_id, VTS_MOD_ManStart);
3532 retVal = mfw_cbuf_put(mfw_cm_dtmf_q_id, &crss_string);
3533 // If the return values are negative, attempt to Queue the DTMF request failed
3534 if (retVal < 0 || modeRetVal < 0)
3535 {
3536 TRACE_EVENT_P1("ERROR : mfw_cbuf_put failed with error %d", retVal);
3537 TRACE_EVENT_P1("ERROR : mfw_cbuf_put_mode failed with error %d", modeRetVal);
3538 /*
3539 ** Failed to Queue the DTMF request.
3540 */
3541 return(FALSE);
3542 }
3543 }
3544 else
3545 {
3546 //xnkulkar 18262
3547 // While attempting to send a tone, if the command is not successfully completed, add
3548 // the request to the queue. After sending a DTMF tone comand, set the variable expectRatOk to true.
3549 // This will be reset only when all the DTMF tones in queue are sent.
3550 if ( expectRatOk == TRUE || sAT_PlusVTS(CMD_SRC_LCL, (CHAR)crss_string, VTS_MOD_ManStart) != AT_EXCT)
3551 {
3552 /*
3553 ** The attempt to send an immediate DTMF failed.
3554 ** Add the failed attempt onto the DTMF queue and wait.
3555 */
3556 // xnkulkar 18262
3557 // Also store the "mode"(Start), in which the DTMF tone has to be sent.
3558 // This is stored in the queue in an array.
3559 modeRetVal = mfw_cbuf_put_mode(mfw_cm_dtmf_q_id, VTS_MOD_ManStart);
3560 retVal = mfw_cbuf_put(mfw_cm_dtmf_q_id, &crss_string);
3561 if (retVal < 0 || modeRetVal < 0 )
3562 {
3563 TRACE_EVENT_P1("ERROR : mfw_cbuf_put failed with error %d", retVal);
3564 TRACE_EVENT_P1("ERROR : mfw_cbuf_put_mode failed with error %d", modeRetVal);
3565 /*
3566 ** Failed to Queue the DTMF request.
3567 */
3568 return(FALSE);
3569 }
3570 }
3571 expectRatOk = TRUE; // xnkulkar SPR-18262: Set this flag to TRUE
3572 }
3573 currCmd = AT_CMD_VTS;
3574 break;
3575
3576 case CM_DTMF_INACTIVE:
3577 // xnkulkar SPR-18262
3578 // If there is a DTMF tone command already in the queue, add the current tone also
3579 // in the queue (with stop mode). While attempting to send a tone, if the request is not successful,
3580 // add the DTMF request to the queue. Also, start adding to the queue if we are expecting an acknowledgement
3581 // (rAT_OK) for the previous DTMF tone request sent.
3582 if (mfw_cbuf_num_elements(mfw_cm_dtmf_q_id) != 0)
3583 {
3584 /*
3585 ** There are already DTMF tones queued to be sent, so queue this request too along with the mode (Stop).
3586 */
3587 modeRetVal = mfw_cbuf_put_mode(mfw_cm_dtmf_q_id, VTS_MOD_ManStop);
3588 retVal = mfw_cbuf_put(mfw_cm_dtmf_q_id, &crss_string);
3589 if (retVal < 0 || modeRetVal < 0)
3590 {
3591 TRACE_EVENT_P1("ERROR : mfw_cbuf_put failed with error %d", retVal);
3592 TRACE_EVENT_P1("ERROR : mfw_cbuf_put_mode failed with error %d", modeRetVal);
3593 /*
3594 ** Failed to Queue the DTMF request.
3595 */
3596 return(FALSE);
3597 }
3598 }
3599 else
3600 {
3601 if (expectRatOk == TRUE || sAT_PlusVTS(CMD_SRC_LCL, (CHAR)crss_string, VTS_MOD_ManStop) != AT_EXCT)
3602 {
3603 /*
3604 ** The attempt to send an immediate DTMF failed.
3605 ** Add the failed attempt onto the DTMF queue and wait.
3606 */
3607 modeRetVal = mfw_cbuf_put_mode(mfw_cm_dtmf_q_id, VTS_MOD_ManStop);
3608 retVal = mfw_cbuf_put(mfw_cm_dtmf_q_id, &crss_string);
3609 if (retVal < 0 || modeRetVal < 0)
3610 {
3611 TRACE_EVENT_P1("ERROR : mfw_cbuf_put failed with error %d", retVal);
3612 TRACE_EVENT_P1("ERROR : mfw_cbuf_put_mode failed with error %d", modeRetVal);
3613 /*
3614 ** Failed to Queue the DTMF request.
3615 */
3616 return(FALSE);
3617 }
3618 }
3619 expectRatOk = TRUE; //xnkulkar SPR-18262: set this flag to TRUE
3620 }
3621 res = TRUE;
3622 cm_signal(E_CM_DTMF, &res);
3623 break;
3624
3625 case CM_DTMF_AUTO:
3626 if (mfw_cbuf_num_elements(mfw_cm_dtmf_q_id) != 0)
3627 {
3628 /*
3629 ** There are already DTMF tones queued to be sent, so queue this request to.
3630 */
3631 modeRetVal = mfw_cbuf_put_mode(mfw_cm_dtmf_q_id, VTS_MOD_Auto);
3632 retVal = mfw_cbuf_put(mfw_cm_dtmf_q_id, &crss_string);
3633 if (retVal < 0 || modeRetVal < 0)
3634 {
3635 TRACE_EVENT_P1("ERROR : mfw_cbuf_put failed with error %d", retVal);
3636 TRACE_EVENT_P1("ERROR : mfw_cbuf_put_mode failed with error %d", modeRetVal);
3637 /*
3638 ** Failed to Queue the DTMF request.
3639 */
3640 return(FALSE);
3641 }
3642 }
3643 else
3644 {
3645 if (sAT_PlusVTS(CMD_SRC_LCL, (CHAR)crss_string, VTS_MOD_Auto) != AT_EXCT)
3646 {
3647 /*
3648 ** The attempt to send an immediate DTMF failed.
3649 ** Add the failed attempt onto the DTMF queue and wait.
3650 */
3651 modeRetVal = mfw_cbuf_put_mode(mfw_cm_dtmf_q_id, VTS_MOD_Auto);
3652 retVal = mfw_cbuf_put(mfw_cm_dtmf_q_id, &crss_string);
3653 if (retVal < 0 || modeRetVal < 0)
3654 {
3655 TRACE_EVENT_P1("ERROR : mfw_cbuf_put failed with error %d", retVal);
3656 TRACE_EVENT_P1("ERROR : mfw_cbuf_put_mode failed with error %d", modeRetVal);
3657 /*
3658 ** Failed to Queue the DTMF request.
3659 */
3660 return(FALSE);
3661 }
3662 }
3663 }
3664 break;
3665
3666 default:
3667 break;
3668 }
3669 return TRUE;
3670 }
3671
3672
3673 /*
3674 +--------------------------------------------------------------------+
3675 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
3676 | STATE : code ROUTINE : send_queued_dtmf_tone |
3677 +--------------------------------------------------------------------+
3678
3679
3680 PURPOSE : Check the DTMF Queue and if required send the next DTMF Tone Request.
3681
3682 */
3683 static void send_queued_dtmf_tone(void)
3684 {
3685 SHORT retVal;
3686 UBYTE qdtmf;
3687 //xnkulkar SPR-18262: Added these variables to store the Mode
3688 T_ACI_VTS_MOD vts_mode = VTS_MOD_NotPresent;
3689
3690 TRACE_FUNCTION("send_queued_dtmf_tone()");
3691
3692 // If there are DTMF tones to be sent in the queue
3693 if (mfw_cbuf_num_elements(mfw_cm_dtmf_q_id) > 0)
3694 {
3695 // Get the mode (Start / Stop) corresponding to the DTMF tone
3696 vts_mode = (T_ACI_VTS_MOD)mfw_cbuf_get_mode(mfw_cm_dtmf_q_id);
3697 // Get the DTMF key for which the tone is to be sent from the queue
3698 retVal = mfw_cbuf_get(mfw_cm_dtmf_q_id, &qdtmf);
3699 if (retVal > 0)
3700 {
3701 if (sAT_PlusVTS(CMD_SRC_LCL, (CHAR)qdtmf, vts_mode) != AT_EXCT)
3702 {
3703 /*
3704 ** The attempt to send an immediate DTMF failed
3705 */
3706 TRACE_EVENT("ERROR : Attempt to send a queued DTMF tone failed!!!!");
3707 }
3708 }
3709 else
3710 {
3711 TRACE_EVENT_P1("ERROR : mfw_cbuf_get failed with error value %d", retVal);
3712 }
3713 }
3714 else
3715 {
3716 // xnkulkar SPR-18262: if number of elements in queue is zero, we can start sending
3717 // DTMF so reset this variable.
3718 expectRatOk = FALSE;
3719 }
3720 }
3721
3722 /*
3723 +--------------------------------------------------------------------+
3724 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
3725 | STATE : code ROUTINE : cm_ok_dtmf |
3726 +--------------------------------------------------------------------+
3727
3728
3729 PURPOSE : DTMF activation is successful.
3730
3731 */
3732
3733 void cm_ok_dtmf(void)
3734 {
3735 UBYTE res;
3736
3737 currCmd = AT_CMD_NONE;
3738 res = TRUE;
3739 cm_signal(E_CM_DTMF, &res);
3740
3741 send_queued_dtmf_tone();
3742
3743 return;
3744 }
3745
3746
3747 /*
3748 +--------------------------------------------------------------------+
3749 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
3750 | STATE : code ROUTINE : cm_error_tdmf |
3751 +--------------------------------------------------------------------+
3752
3753
3754 PURPOSE : DTMF activation is failed.
3755
3756 */
3757
3758 void cm_error_dtmf(void)
3759 {
3760 UBYTE res;
3761
3762 currCmd = AT_CMD_NONE;
3763 res = FALSE;
3764 cm_signal(E_CM_DTMF, &res);
3765
3766 send_queued_dtmf_tone();
3767
3768 }
3769
3770
3771 /*
3772 +--------------------------------------------------------------------+
3773 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
3774 | STATE : code ROUTINE : cm_result_cmd |
3775 +--------------------------------------------------------------------+
3776
3777
3778 PURPOSE : Acknowledgement for the requested ss command.
3779
3780 */
3781
3782 void cm_result_cmd(T_ACI_CMD_SRC src, UBYTE result)
3783 {
3784 SHORT call_number;
3785
3786 TRACE_EVENT_P1("cm_result_cmd(), cmd_hold = %d", cmd_hold);
3787
3788 /* MC changed all the "if"s to a switch to allow default 11/04/02*/
3789 switch (cmd_hold)
3790 {
3791 case MFW_CM_MT_REJECT:
3792 break; /* CONQUEST 6040- MC- put a break in the case so no action taken*/
3793 case MFW_CM_MPTY_TERMINATED:
3794 case MFW_CM_TERMINATED:
3795
3796 {
3797 if (result EQ Present)
3798 cm_ok_disconnect(CMD_SRC_LCL, 0);
3799 return;
3800 }
3801 // break; // RAVI
3802
3803 case MFW_CM_MT_ACCEPT:
3804 {
3805 /*
3806 * active call on hold, accept new incoming call
3807 */
3808 cmd_hold = 0;
3809 if (result EQ Present)
3810 /*
3811 * Call on hold was successful
3812 */
3813 cm_ok_connect();
3814
3815 else
3816 {
3817 if (cm_search_callId(CAL_STAT_Active, &call_number) != CM_OK)
3818 return;
3819 cmd.call_number = call_number;
3820 cc_id = 0; // ???
3821 }
3822 }
3823 break;
3824
3825
3826 case MFW_CM_HOLD_AND_DIAL:
3827 {
3828 /*
3829 * active call on hold, accept new incoming call
3830 */
3831 cmd_hold = 0;
3832 if (result EQ Present)
3833 /*
3834 * Call on hold was successful
3835 */
3836 cm_ok_connect();
3837
3838 else
3839 {
3840 if (cm_search_callId(CAL_STAT_Active, &call_number) != CM_OK)
3841 return;
3842 cmd.call_number = call_number;
3843 cc_id = 0; // ???
3844 }
3845 }
3846 break;
3847
3848 case MFW_CM_1_SEND:
3849 {
3850
3851 cmd_hold = 0;
3852 if (result == Present)
3853 {
3854 // MMI-SPR 13873 xkundadu
3855 // Handling of 1SEND
3856 // If the user presses 1SEND, release active calls and accept
3857 // the WAITING call
3858 if (dis_connect.call_number NEQ -1)
3859 {
3860 // If there is an active call, disconnect it.
3861 cm_ok_disconnect(CMD_SRC_LCL, 0);
3862 }
3863
3864 if (!cmd.call_number)
3865 {
3866 // If there is waiting call, accept the call
3867 cm_ok_connect();
3868 }
3869 cmd.call_number = -1;
3870 }
3871
3872 }
3873 break;
3874
3875 /* Marcus: CCBS: 14/11/2002: Start */
3876 case MFW_CM_CCBS_REGISTER:
3877
3878 TRACE_EVENT("MFW_CM_CCBS_REGISTER");
3879
3880 cmd_hold = 0;
3881
3882 if (result == Present)
3883 {
3884 TRACE_EVENT("result == Present");
3885 cm_ccbs_ok();
3886 }
3887 else /* result is NotPresent */
3888 {
3889 TRACE_EVENT("result != Present");
3890 cm_ccbs_error();
3891 }
3892 return;
3893
3894 case MFW_CM_CCBS_RECALL:
3895
3896 TRACE_EVENT("MFW_CM_CCBS_RECALL");
3897
3898 cmd_hold = 0;
3899
3900 if (result == Present)
3901 {
3902 TRACE_EVENT("result == Present");
3903 cm_ccbs_ok();
3904 }
3905 else /* result is NotPresent */
3906 {
3907 TRACE_EVENT("result != Present");
3908 cm_ccbs_error();
3909 }
3910 return;
3911 /* Marcus: CCBS: 14/11/2002: Start */
3912
3913 default:/*For other command types ensure correct result is passed up to BMI*/
3914 {
3915 cmd.result = result;
3916 }
3917 break;
3918 }
3919
3920
3921 #if defined (WIN32)
3922 {
3923 char buf[40];
3924 sprintf (buf, "Event CM_COMMAND for %d", cmd.call_number);
3925 TRACE_EVENT (buf);
3926 sprintf (buf, "Result %d Command %d",cmd.result, cmd.command);
3927 TRACE_EVENT (buf);
3928 }
3929 #endif
3930 cmd.result = result;
3931 cm_signal(E_CM_COMMAND, &cmd);
3932 }
3933
3934
3935 /*
3936 +--------------------------------------------------------------------+
3937 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
3938 | STATE : code ROUTINE: cm_cvt_speed_type |
3939 +--------------------------------------------------------------------+
3940
3941
3942 PURPOSE : This function is used to convert the type of data rate
3943 used by MFW to the type of data rate used by ACI.
3944
3945 */
3946
3947 LOCAL T_ACI_BS_SPEED cm_cvt_speed_type ( T_MFW_CM_DATA_SPEED speed )
3948 {
3949 switch ( speed )
3950 {
3951 case ( SPEED_300 ): return BS_SPEED_300_V110;
3952 case ( SPEED_1200 ): return BS_SPEED_1200_V110;
3953 case ( SPEED_2400 ): return BS_SPEED_2400_V110;
3954 case ( SPEED_4800 ): return BS_SPEED_4800_V110;
3955 case ( SPEED_9600 ): return BS_SPEED_9600_V110;
3956 case ( SPEED_14400 ): return BS_SPEED_14400_V110;
3957 default: return BS_SPEED_NotPresent;
3958 }
3959 }
3960
3961
3962 /*
3963 +--------------------------------------------------------------------+
3964 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
3965 | STATE : code ROUTINE: cm_cvt_bs_type |
3966 +--------------------------------------------------------------------+
3967
3968
3969 PURPOSE : This function is used to convert the type of bearer service
3970 used by MFW to the type of bearer service used by ACI.
3971
3972 */
3973
3974 LOCAL T_ACI_CBST_NAM cm_cvt_bs_type ( T_MFW_CM_BS bs )
3975 {
3976 switch ( bs )
3977 {
3978 case ( Asynch ): return CBST_NAM_Asynch;
3979 case ( Synch ): return CBST_NAM_Synch;
3980 default: return CBST_NAM_NotPresent;
3981 }
3982 }
3983
3984
3985 /*
3986 +--------------------------------------------------------------------+
3987 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
3988 | STATE : code ROUTINE: cm_cvt_ce_type |
3989 +--------------------------------------------------------------------+
3990
3991
3992 PURPOSE : This function is used to convert the data mode
3993 used by MFW to the data mode used by ACI.
3994
3995 */
3996
3997 LOCAL T_ACI_CBST_CE cm_cvt_ce_type ( T_MFW_CM_CE ce )
3998 {
3999 switch ( ce )
4000 {
4001 case ( Transparent ): return CBST_CE_Transparent;
4002 case ( NonTransparent ): return CBST_CE_NonTransparent;
4003 default: return CBST_CE_NotPresent;
4004 }
4005 }
4006
4007 /*
4008 +--------------------------------------------------------------------+
4009 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
4010 | STATE : code ROUTINE: cm_set_bc_para |
4011 +--------------------------------------------------------------------+
4012
4013
4014 PURPOSE : Set bearer parameter for mobile originated calls.
4015
4016 */
4017
4018 void cm_set_bc_para(T_MFW_CM_BC_PARA * bc, UBYTE ti)
4019 {
4020 TRACE_FUNCTION ("cm_set_bc_para()");
4021
4022 sAT_PlusCBST(CMD_SRC_LCL,
4023 cm_cvt_speed_type ((T_MFW_CM_DATA_SPEED)bc->rate),
4024 cm_cvt_bs_type ((T_MFW_CM_BS)bc->bearer_serv),
4025 cm_cvt_ce_type ((T_MFW_CM_CE)bc->conn_elem));
4026 }
4027
4028
4029 /*
4030 +--------------------------------------------------------------------+
4031 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
4032 | STATE : code ROUTINE: cm_notify |
4033 +--------------------------------------------------------------------+
4034
4035
4036 PURPOSE : Change of SS status from call party.
4037
4038 */
4039 void cm_notify(T_ACI_CSSU_CODE code,
4040 SHORT index,
4041 UBYTE *number)
4042 { char debug[50];
4043 sprintf(debug,"cm_notify(), code:%d, index:%d" , code, index);
4044 TRACE_EVENT(debug);
4045 if (number)
4046 notify.call_number = index;
4047
4048 if (code == CSSU_CODE_OnHold)
4049 notify.notification = MFW_CM_HOLD;
4050 if (code == CSSU_CODE_Retrieved)
4051 notify.notification = MFW_CM_RETRIEVED;
4052
4053 cm_signal(E_CM_NOTIFY, &notify);
4054 }
4055
4056
4057 /*
4058 +--------------------------------------------------------------------+
4059 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
4060 | STATE : code ROUTINE : cm_get_aoc_value |
4061 +--------------------------------------------------------------------+
4062
4063
4064 PURPOSE : Getting AoC (advice of charge) value.
4065
4066 */
4067
4068 T_MFW cm_get_aoc_value(UBYTE request_type, T_MFW_CM_AOC_INFO *aoc_info)
4069 {
4070 T_ACI_RPCT_VAL rpuct;
4071
4072 TRACE_FUNCTION ("cm_get_aoc_value()");
4073
4074 switch (request_type)
4075 {
4076 /* Price pro unit and currency table */
4077 case CM_AOC_PUCT:
4078 if (qAT_PlusCPUC(CMD_SRC_LCL,
4079 (CHAR *)aoc_info->cur,
4080 (CHAR *)aoc_info->ppu) == AT_CMPL)
4081 {
4082 aoc_info->requested_type = CM_AOC_PUCT;
4083 return CM_OK;
4084 }
4085 else
4086 return CM_NO_AOC;
4087 // break; // RAVI
4088
4089 /* maximum value of accumulated Call Meter */
4090 case CM_AOC_ACMMAX:
4091 if (qAT_PlusCAMM(CMD_SRC_LCL, &aoc_info->acm_max) == AT_CMPL)
4092 {
4093 aoc_info->requested_type = CM_AOC_ACMMAX;
4094 return CM_OK;
4095 }
4096 else
4097 return CM_NO_AOC;
4098 // break; // RAVI
4099
4100 /* Accumulated Call Meter */
4101 case CM_AOC_ACM:
4102 if (qAT_PlusCACM(CMD_SRC_LCL, &aoc_info->acm) == AT_CMPL)
4103 {
4104 aoc_info->requested_type = CM_AOC_ACM;
4105 return CM_OK;
4106 }
4107 else
4108 return CM_NO_AOC;
4109 // break; // RAVI
4110
4111 case CM_AOC_CCM:
4112 if (qAT_PlusCAOC(CMD_SRC_LCL, &aoc_info->ccm) == AT_CMPL)
4113 {
4114 aoc_info->requested_type = CM_AOC_CCM;
4115 return CM_OK;
4116 }
4117 else
4118 return CM_NO_AOC;
4119 // break; // RAVI
4120
4121 case CM_AOC_TIMERS:
4122 if (qAT_PercentCTV(CMD_SRC_LCL, &aoc_info->actual_call_timer) == AT_CMPL)
4123 {
4124 aoc_info->requested_type = CM_AOC_TIMERS;
4125 return CM_OK;
4126 }
4127 else
4128 return CM_NO_AOC;
4129 // break; // RAVI
4130
4131 case CM_AOC_CCM_PUCT:
4132 if (qAT_PercentCAOC(CMD_SRC_LCL, (CHAR *)aoc_info->cur, (CHAR *)aoc_info->ccm_puct) == AT_CMPL)
4133 {
4134 aoc_info->requested_type = CM_AOC_CCM_PUCT;
4135 return CM_OK;
4136 }
4137 else
4138 return CM_NO_AOC;
4139 // break; // RAVI
4140
4141 case CM_AOC_ACM_PUCT:
4142 if (qAT_PercentCACM(CMD_SRC_LCL, (CHAR *)aoc_info->cur, (CHAR *)aoc_info->acm_puct) == AT_CMPL)
4143 {
4144 aoc_info->requested_type = CM_AOC_ACM_PUCT;
4145 return CM_OK;
4146 }
4147 else
4148 return CM_NO_AOC;
4149 case CM_AOC_RAW_PUCT:
4150 if (qAT_PercentRPCT(CMD_SRC_LCL, &rpuct) == AT_CMPL)
4151 {
4152 aoc_info->requested_type = CM_AOC_RAW_PUCT;
4153 strncpy((char *)aoc_info->cur, (char *)rpuct.currency, MAX_CUR_LEN);
4154 aoc_info->eppu = rpuct.eppu;
4155 aoc_info->exp = rpuct.exp;
4156 aoc_info->sexp = rpuct.sexp;
4157 return CM_OK;
4158 }
4159 else
4160 return CM_NO_AOC;
4161 // break; // RAVI
4162
4163 default:
4164 return CM_NO_AOC;
4165 }
4166 }
4167
4168
4169
4170 /*
4171 +----------------------------------------------------------------------+
4172 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
4173 | STATE : code ROUTINE : cm_reset_aoc_value |
4174 +----------------------------------------------------------------------+
4175
4176
4177 PURPOSE : Setting AoC (advice of charge) value.
4178
4179 */
4180
4181 T_MFW cm_set_aoc_value(UBYTE request_type,
4182 T_MFW_CM_AOC_INFO *aoc_info,
4183 UBYTE *pwd)
4184 {
4185 TRACE_FUNCTION ("cm_reset_aoc_value()");
4186
4187 switch (request_type)
4188 {
4189 case CM_AOC_PUCT:
4190 if (sAT_PlusCPUC(CMD_SRC_LCL, (CHAR *)aoc_info->cur,
4191 (CHAR *)aoc_info->ppu, (CHAR *)pwd) != AT_EXCT)
4192 return CM_ERROR;
4193 break;
4194
4195 case CM_AOC_ACMMAX:
4196 if (sAT_PlusCAMM(CMD_SRC_LCL, aoc_info->acm_max,
4197 (CHAR *)pwd) != AT_EXCT)
4198 return CM_ERROR;
4199 break;
4200
4201 case CM_AOC_ACM:
4202 if (sAT_PlusCACM(CMD_SRC_LCL, (CHAR *)pwd) != AT_EXCT)
4203 return CM_ERROR;
4204 break;
4205
4206 default:
4207 return CM_ERROR;
4208 }
4209
4210 return CM_OK;
4211 }
4212
4213
4214 /*
4215 +----------------------------------------------------------------------+
4216 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
4217 | STATE : code ROUTINE : cm_cvt_cmd |
4218 +----------------------------------------------------------------------+
4219
4220
4221 PURPOSE : Convert AoC command
4222
4223 */
4224
4225 UBYTE cm_cvt_cmd(T_ACI_AT_CMD cmdId)
4226 {
4227 switch (cmdId)
4228 {
4229 case AT_CMD_CACM: return CM_AOC_ACM;
4230 case AT_CMD_CAMM: return CM_AOC_ACMMAX;
4231 case AT_CMD_CPUC: return CM_AOC_PUCT;
4232 default: return CM_AOC_UNKNOWN;
4233 }
4234 }
4235
4236
4237 /*
4238 +----------------------------------------------------------------------+
4239 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
4240 | STATE : code ROUTINE : cm_ok_aoc |
4241 +----------------------------------------------------------------------+
4242
4243
4244 PURPOSE : Setting AoC is successful.
4245
4246 */
4247
4248 void cm_ok_aoc(T_ACI_AT_CMD cmdId)
4249 {
4250 T_MFW_CM_AOC_CNF aoc_cnf;
4251
4252 aoc_cnf.requested_type = cm_cvt_cmd(cmdId);
4253 aoc_cnf.result = CM_AOC_CONF_OK;
4254 cm_signal(E_CM_AOC_CNF, &aoc_cnf);
4255 }
4256
4257
4258 /*
4259 +----------------------------------------------------------------------+
4260 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
4261 | STATE : code ROUTINE : cm_error_aoc |
4262 +----------------------------------------------------------------------+
4263
4264
4265 PURPOSE : Setting AoC is failure.
4266
4267 */
4268
4269 void cm_error_aoc(T_ACI_AT_CMD cmdId, T_ACI_CME_ERR reason)
4270 {
4271 T_MFW_CM_AOC_CNF aoc_cnf;
4272
4273 aoc_cnf.requested_type = cm_cvt_cmd(cmdId);
4274 aoc_cnf.result = CM_AOC_CONF_UNKNOWN;
4275
4276 if (reason EQ CME_ERR_SimPin2Req)
4277 aoc_cnf.result = CM_AOC_CONF_SIMPIN2REQ;
4278
4279 if (reason EQ CME_ERR_WrongPasswd)
4280 aoc_cnf.result = CM_AOC_CONF_WRONGPASSWD;
4281
4282 if (reason EQ CME_ERR_OpNotAllow)
4283 aoc_cnf.result = CM_AOC_CONF_OPNOTALLOW;
4284
4285 if (reason EQ CME_ERR_AcmResetNeeded)
4286 aoc_cnf.result = CM_AOC_CONF_ACMRESETNEEDED;
4287
4288 cm_signal(E_CM_AOC_CNF, &aoc_cnf);
4289 }
4290
4291
4292 /*
4293 +-----------------------------------------------------------------+
4294 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
4295 | STATE : code ROUTINE : rAT_PercentCTV |
4296 +-----------------------------------------------------------------+
4297
4298
4299 PURPOSE : manage timer in every second
4300
4301 */
4302
4303 void rAT_PercentCTV()
4304 {
4305 TRACE_FUNCTION("rAT_PercentCTV()");
4306 cm_signal(E_CM_TIMER_EVERY_SECOND, 0);
4307 }
4308
4309
4310 /*
4311 +-----------------------------------------------------------------+
4312 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
4313 | STATE : code ROUTINE : rAT_PlusCCCM |
4314 +-----------------------------------------------------------------+
4315
4316
4317 PURPOSE :
4318
4319 */
4320
4321 void rAT_PlusCCCM(LONG *ccm)
4322 {
4323 T_MFW_CM_AOC_INFO aoc_info;
4324 T_ACI_RPCT_VAL rpuct;
4325
4326 TRACE_FUNCTION("rAT_PlusCCCM()");
4327
4328 memset(&aoc_info, 0, sizeof(T_MFW_CM_AOC_INFO));
4329
4330 qAT_PlusCAMM(CMD_SRC_LCL, &aoc_info.acm_max);
4331 qAT_PlusCACM(CMD_SRC_LCL, &aoc_info.acm);
4332 aoc_info.ccm = *ccm;
4333 qAT_PercentCTV(CMD_SRC_LCL, &aoc_info.actual_call_timer);
4334 qAT_PercentRPCT(CMD_SRC_LCL, &rpuct);
4335 strncpy((char *)aoc_info.cur, (char *)rpuct.currency, MAX_CUR_LEN);
4336 aoc_info.requested_type = CM_AOC_CCM;
4337 aoc_info.eppu = rpuct.eppu;
4338 aoc_info.exp = rpuct.exp;
4339 aoc_info.sexp = rpuct.sexp;
4340
4341 cm_signal(E_CM_AOC, &aoc_info);
4342 }
4343
4344
4345 /*
4346 +----------------------------------------------------------------+
4347 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
4348 | STATE : code ROUTINE : cm_set_redial |
4349 +----------------------------------------------------------------+
4350
4351
4352 PURPOSE : Set redial mode (automatic/manual).
4353
4354 */
4355
4356 void cm_set_redial(UBYTE redial_mode)
4357 {
4358 // U8 version; // RAVI
4359 // Apr 14, 2005 REF: CRR 29991 xpradipg
4360 // local definition
4361 #ifdef FF_MMI_OPTIM
4362 T_MFW_CM_BLACKLIST_LIST black_list;
4363 #endif
4364
4365 TRACE_FUNCTION ("cm_set_redial()");
4366
4367 if (redial_mode == CM_REDIAL_BLACKLIST)
4368 {
4369 memset(&black_list, 0, sizeof(T_MFW_CM_BLACKLIST_LIST));
4370 // Apr 14, 2005 REF: CRR 29991 xpradipg
4371 // reset the file contents
4372 #ifdef FF_MMI_OPTIM
4373 if(flash_MMI_blackList_write((U8 *)&black_list, sizeof(T_MFW_CM_BLACKLIST_LIST),0) < 0)
4374 TRACE_FUNCTION(" Error writing into file");
4375 #endif
4376 return;
4377 }
4378
4379 if (redial_mode == CM_REDIAL_OFF
4380 || redial_mode == CM_REDIAL_AUTO
4381 || redial_mode == CM_REDIAL_MANU)
4382 {
4383 redial_stat = redial_mode;
4384
4385 /* write redialing mode to EEPROM */
4386
4387 FFS_flashData.redial_mode =redial_mode;
4388 flash_write();
4389
4390 }
4391 }
4392
4393
4394 /*
4395 +---------------------------------------------------------------------+
4396 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
4397 | STATE : code ROUTINE : cm_get_redial_mode |
4398 +---------------------------------------------------------------------+
4399
4400
4401 PURPOSE : Request the setting of redial mode (automatic/manual).
4402
4403 */
4404
4405 T_MFW cm_get_redial_mode(void)
4406 {
4407 return redial_stat;
4408 }
4409
4410
4411
4412
4413 /*
4414 +--------------------------------------------------------------------+
4415 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
4416 | STATE : code ROUTINE: cm_stop_redialTim |
4417 +--------------------------------------------------------------------+
4418
4419
4420 PURPOSE : Stop redialing time.
4421
4422 */
4423
4424 void cm_stop_redialTim(void)
4425 {
4426 if (!redial_count)
4427 timStop(redialTim1);
4428
4429 if (redial_count >= 1 AND redial_count <= 3)
4430 timStop(redialTim24);
4431
4432 if (redial_count >= 4 AND redial_count < MAX_REDIAL_ATTEMPT)
4433 timStop(redialTim5);
4434 redial_count = 0;
4435 rdl.left_attempts = 0;
4436
4437 /*
4438 reset the counter
4439 */
4440
4441 call_stat = MFW_CALL_FREE;
4442 call_type = MFW_CALL_FREE;
4443 cc_stat.type = MFW_CALL_FREE;
4444 }
4445
4446
4447 /*
4448 +--------------------------------------------------------------------+
4449 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
4450 | STATE : code ROUTINE: cm_redial_abort |
4451 +--------------------------------------------------------------------+
4452
4453
4454 PURPOSE : Stop redialing from MMI.
4455
4456 */
4457
4458 void cm_redial_abort(void)
4459 {
4460
4461 TRACE_FUNCTION ("cm_redial_abort()");
4462
4463 if (call_stat == REDIALING_CALL OR call_stat == OUTGOING_CALL)
4464 cm_stop_redialTim();
4465
4466 rdl.redial_mode = CM_REDIAL_ABORTED;
4467 cm_signal(E_CM_REDIAL, &rdl);
4468 }
4469
4470
4471 /*
4472 +---------------------------------------------------------------------+
4473 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
4474 | STATE : code ROUTINE: cm_autoredial_start |
4475 +---------------------------------------------------------------------+
4476
4477
4478 PURPOSE : start autoredial.
4479
4480 */
4481
4482 void cm_autoredial_start(void)
4483 {
4484 timStart(redialTim1);
4485 }
4486
4487
4488 /*
4489 +--------------------------------------------------------------------+
4490 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
4491 | STATE : code ROUTINE: cm_redial_timeout |
4492 +--------------------------------------------------------------------+
4493
4494
4495 PURPOSE : Call back from system clock for redialing time interval.
4496
4497 */
4498
4499 static int cm_redial_timeout(MfwEvt e, MfwTim *t)
4500 {
4501 CHAR number[MFW_NUM_LEN+MAX_LEN+1];
4502 int max_num_size = MFW_NUM_LEN+MAX_LEN+1;
4503
4504 TRACE_FUNCTION ("cm_redial_timeout()");
4505
4506 memset(number, 0, sizeof(number));
4507 mfwStrncpy(number, (CHAR *)cc_stat.prefix, max_num_size);
4508 max_num_size -= strlen((char *)cc_stat.prefix);
4509
4510 if ((cc_stat.ton EQ MFW_TON_INTERNATIONAL) AND (cc_stat.number[0] != '+'))
4511 {
4512 strcat(number, "+");
4513 max_num_size--;
4514 }
4515
4516 strncat(number, (CHAR *)cc_stat.number, max_num_size);
4517
4518 switch (redial_stat)
4519 {
4520 case CM_REDIAL_AUTO:
4521 if (sAT_Dn(CMD_SRC_LCL,
4522 (CHAR *)number,
4523 D_CLIR_OVRD_Default,
4524 D_CUG_CTRL_NotPresent,
4525 D_TOC_Voice) NEQ AT_EXCT)
4526 {
4527 TRACE_ERROR("sAT_Dn error");
4528 return 0;
4529 }
4530
4531 call_stat = OUTGOING_CALL;
4532
4533 cm_search_callId(CAL_STAT_Dial, &cc_stat.call_number);
4534 cc_stat.type = REDIALING_CALL;
4535
4536 rdl.redial_mode = CM_REDIAL_ATTEMPT;
4537 rdl.call_id = cc_stat.call_number;
4538 mfwStrncpy((char *)rdl.number, (char *)cc_stat.number, MFW_NUM_LEN);
4539 #ifdef NO_ASCIIZ
4540 rdl.name.len = cc_stat.name.len;
4541 memcpy(rdl.name.data,
4542 cc_stat.name.data,
4543 cc_stat.name.len);
4544 #else
4545 mfwStrncpy((char *)rdl.name, (char *)cc_stat.name, MFW_TAG_LEN);
4546 // strcpy((char *)rdl.subaddr, (char *)cc_stat.subaddr);
4547 #endif
4548 rdl.ton = cc_stat.ton;
4549 rdl.type = cc_stat.mode;
4550 redial_count++;
4551 rdl.left_attempts = MAX_REDIAL_ATTEMPT - redial_count;
4552 cm_signal(E_CM_REDIAL, &rdl);
4553 return 1;
4554
4555 case CM_REDIAL_MANU:
4556 rdl.redial_mode = CM_REDIAL_MANU;
4557 mfwStrncpy((char *)rdl.number, (char *)cc_stat.number, MFW_NUM_LEN);
4558 #ifdef NO_ASCIIZ
4559 rdl.name.len = cc_stat.name.len;
4560 memcpy(rdl.name.data,
4561 cc_stat.name.data,
4562 cc_stat.name.len);
4563 #else
4564 mfwStrncpy((char *)rdl.name, (char *)cc_stat.name, MFW_TAG_LEN);
4565 #endif
4566 rdl.ton = cc_stat.ton;
4567 rdl.type = cc_stat.mode;
4568 rdl.left_attempts = MAX_REDIAL_ATTEMPT - redial_count;
4569
4570 cm_signal(E_CM_REDIAL, &rdl);
4571 return 1;
4572
4573 default:
4574 return 0;
4575 }
4576 }
4577
4578
4579 /*
4580 +--------------------------------------------------------------------+
4581 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
4582 | STATE : code ROUTINE: cm_redial |
4583 +--------------------------------------------------------------------+
4584
4585
4586 PURPOSE : Start the manual redialing.
4587
4588 */
4589
4590 void cm_redial()
4591 {
4592 char buf[80];
4593
4594 int max_buf_size = sizeof(buf);
4595
4596 TRACE_FUNCTION ("cm_redial()");
4597
4598 buf[0] = '\0';
4599
4600 mfwStrncpy(buf, (char *)cc_stat.prefix, max_buf_size);
4601 max_buf_size -= strlen((char *)cc_stat.prefix);
4602
4603 if ((cc_stat.ton EQ MFW_TON_INTERNATIONAL) AND (cc_stat.number[0] != '+'))
4604 {
4605 strcat(buf, "+");
4606 max_buf_size--;
4607 }
4608
4609 strncat(buf, (char *)cc_stat.number, max_buf_size);
4610
4611 if (sAT_Dn(CMD_SRC_LCL, buf, -1, -1, D_TOC_Voice) NEQ AT_EXCT)
4612 {
4613 TRACE_ERROR("sAT_Dn error");
4614 }
4615
4616 call_stat = OUTGOING_CALL;
4617 cc_stat.type = REDIALING_CALL;
4618 redial_count++;
4619 }
4620
4621
4622 /*
4623 +--------------------------------------------------------------------+
4624 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
4625 | STATE : code ROUTINE: cm_redial_get_count |
4626 +--------------------------------------------------------------------+
4627
4628
4629 PURPOSE : returns the counter of call attempt
4630
4631 */
4632 UBYTE cm_redial_get_count(void)
4633 {
4634 return redial_count;
4635 }
4636
4637
4638
4639 /*
4640 +--------------------------------------------------------------------+
4641 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
4642 | STATE : code ROUTINE: cm_cvt_call_status |
4643 +--------------------------------------------------------------------+
4644
4645
4646 PURPOSE : Convert the call status.
4647
4648 */
4649
4650 LOCAL T_MFW_CM_CALL_STAT cm_cvt_call_status( T_ACI_CAL_STAT stat )
4651 {
4652 switch ( stat )
4653 {
4654 case ( CAL_STAT_Held ): return CALL_HELD;
4655 case ( CAL_STAT_Active ): return CALL_ACTIVE;
4656 case ( CAL_STAT_Wait ): return CALL_WAIT;
4657 case ( CAL_STAT_Dial ): return CALL_DIAL;
4658 case (CAL_STAT_Alerting): return CALL_ALERT;
4659 case (CAL_STAT_DeactiveReq): return CALL_DEACTIVE;
4660 default: return NOT_PRESENT;
4661 }
4662 }
4663
4664 /*
4665 +--------------------------------------------------------------------+
4666 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
4667 | STATE : code ROUTINE: cm_cvt_call_status |
4668 +--------------------------------------------------------------------+
4669
4670
4671 PURPOSE : Request the call status.
4672
4673 */
4674
4675 T_MFW_CM_CALL_TYPE cm_cvt_call_mode( T_ACI_CAL_MODE type )
4676 {
4677 TRACE_EVENT_P1("cm_cnt_call_mode %d", type);
4678 switch ( type )
4679 {
4680 case ( CAL_MODE_Voice ): return VOICE_CALL;
4681 case ( CAL_MODE_Data ): return DATA_CALL;
4682 case ( CAL_MODE_Fax ): return FAX_CALL;
4683 case (CAL_MODE_VFD_Voice): return VFD_VOICE;
4684 case (CAL_MODE_VAD_Voice): return VAD_VOICE;
4685 case (CAL_MODE_VAF_Voice): return VAF_VOICE;
4686 case (CAL_MODE_VFD_Data): return VFD_DATA;
4687 case (CAL_MODE_VAD_Data): return VAD_DATA;
4688 case (CAL_MODE_VAF_Fax): return VAF_FAX;
4689 default: return NONE_TYPE;
4690 }
4691 }
4692
4693 T_MFW_CM_CALL_DIR cm_cvt_call_direction( T_ACI_CAL_TYPE type )
4694 {
4695 TRACE_EVENT_P1("cm_cvt_call_direction %d", type);
4696 switch ( type )
4697 {
4698 case ( CAL_TYPE_NotPresent): return MFW_CM_INV_DIR;
4699 case ( CAL_TYPE_MOC): return MFW_CM_MOC;
4700 case ( CAL_TYPE_MTC): return MFW_CM_MTC;
4701 default: return MFW_CM_INV_DIR;
4702 }
4703 }
4704
4705 /*
4706 +--------------------------------------------------------------------+
4707 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
4708 | STATE : code ROUTINE: cm_status |
4709 +--------------------------------------------------------------------+
4710
4711
4712 PURPOSE : Request the call status.
4713
4714 */
4715
4716 int cm_status(SHORT call_number, T_MFW_CM_STATUS *status, UBYTE num)
4717 {
4718 UBYTE cnt;
4719 int i;
4720 // Apr 06 2005 REF: CRR 29989 xpradipg
4721 // define and allocate memory
4722 #ifdef FF_MMI_OPTIM
4723 T_ACI_CAL_ENTR *call_tab;//[MAX_CALL_NR];
4724 call_tab = (T_ACI_CAL_ENTR*)mfwAlloc(sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
4725 if( NULL == call_tab)
4726 return 0;
4727 #endif
4728
4729
4730 cnt = 0;
4731 qAT_PercentCAL(CMD_SRC_LCL, call_tab);
4732
4733 if (call_number > 0)
4734 {
4735 for (i=0; i<MAX_CALL_NR; i++)
4736 {
4737 if (call_tab[i].index == call_number)
4738 {
4739 status[0].call_number = call_tab[i].index;
4740 status[0].stat = cm_cvt_call_status(call_tab[i].status);
4741 status[0].type = cm_cvt_call_mode(call_tab[i].calMode);
4742 status[0].mtpy = (T_MFW_MTPY_MEMBER)call_tab[i].mpty;
4743 status[0].call_direction = cm_cvt_call_direction(call_tab[i].calType);
4744
4745 if (call_tab[i].number != NULL)
4746 {
4747 mfwStrncpy((char *)status[0].number, call_tab[i].number, MFW_NUM_LEN);
4748 status[0].ton = phb_cvtTon(call_tab[i].type.ton);
4749 }
4750 else
4751 memset(status[0].number, '\0', MFW_NUM_LEN);
4752
4753 #ifdef NO_ASCIIZ
4754 status[0].name.len = call_tab[i].alpha.len;
4755 if (call_tab[i].alpha.len)
4756 memcpy(status[0].name.data,
4757 call_tab[i].alpha.data,
4758 call_tab[i].alpha.len);
4759 else //We'll also zero the string.
4760 memset(status[0].name.data, '\0', PHB_MAX_LEN);
4761 #else
4762 if (call_tab[i].alpha != NULL)
4763 mfwStrncpy((char *)status[0].name, call_tab[i].alpha, MFW_TAG_LEN);
4764 else
4765 memset(status[0].name, '\0', MFW_TAG_LEN);
4766 #endif
4767 cnt = 1;
4768 break;
4769 }
4770 }
4771 // Apr 06 2005 REF: CRR 29989 xpradipg
4772 // deallocate memory
4773 #ifdef FF_MMI_OPTIM
4774 if(call_tab)
4775 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
4776 #endif
4777 return cnt;
4778 }
4779
4780 if (!call_number)
4781 {
4782 for (i=0; i<MAX_CALL_NR; i++)
4783 {
4784 if ((call_tab[i].index EQ -1) OR cnt > num)
4785 break;
4786
4787 if (call_tab[i].status != CAL_STAT_NotPresent)
4788 {
4789 status[cnt].call_number = call_tab[i].index;
4790 status[cnt].stat = cm_cvt_call_status(call_tab[i].status);
4791 status[cnt].type = cm_cvt_call_mode(call_tab[i].calMode);
4792 status[cnt].mtpy = (T_MFW_MTPY_MEMBER)call_tab[i].mpty;
4793 if (call_tab[i].number != NULL)
4794 {
4795 mfwStrncpy((char *)status[cnt].number, call_tab[i].number, MFW_NUM_LEN);
4796 status[cnt].ton = phb_cvtTon(call_tab[i].type.ton);
4797 }
4798 else
4799 memset(status[cnt].number, '\0', MFW_NUM_LEN);
4800
4801 #ifdef NO_ASCIIZ
4802 status[cnt].name.len = call_tab[i].alpha.len;
4803 if (call_tab[i].alpha.len != 0)
4804 memcpy(status[cnt].name.data,
4805 call_tab[i].alpha.data,
4806 call_tab[i].alpha.len);
4807 else //We'll also zero the string.
4808 memset(status[cnt].name.data, '\0', PHB_MAX_LEN);
4809 #else
4810 if (call_tab[i].alpha != NULL)
4811 mfwStrncpy((char *)status[cnt].name, call_tab[i].alpha, MFW_TAG_LEN);
4812 else
4813 memset(status[cnt].name, '\0', MFW_TAG_LEN);
4814 #endif
4815 cnt++;
4816 }
4817 }
4818 // Apr 06 2005 REF: CRR 29989 xpradipg
4819 // deallocate memory
4820 #ifdef FF_MMI_OPTIM
4821 if(call_tab)
4822 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
4823 #endif
4824 return cnt;
4825 }
4826 // Apr 06 2005 REF: CRR 29989 xpradipg
4827 // deallocate memory
4828 #ifdef FF_MMI_OPTIM
4829 if(call_tab)
4830 mfwFree((U8*)call_tab, sizeof(T_ACI_CAL_ENTR)*MAX_CALL_NR);
4831 #endif
4832 return 0;
4833 }
4834
4835
4836 /*
4837 +--------------------------------------------------------------------+
4838 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
4839 | STATE : code ROUTINE: cm_AT_CHLD |
4840 +--------------------------------------------------------------------+
4841
4842
4843 PURPOSE : Notify the CHLD command
4844
4845 */
4846
4847 void cm_AT_CHLD(T_ACI_CLOG *clog_cmd)
4848 {
4849 SHORT id;
4850 T_ACI_CAL_MODE call_mode;
4851 T_MFW_CM_STATUS status;
4852 char buf[80];
4853
4854 TRACE_EVENT("cm_AT_CHLD()");
4855
4856 /*SPR#1965 - DS - Removed setting of call_number to zero. Port of 1962
4857 *dis_connect.call_number = 0;
4858 */
4859 sprintf(buf, "dis_connect.call_number %d, cmd_hold %d, cId %d, srcId %d, mode %d, act %d",
4860 dis_connect.call_number, cmd_hold, clog_cmd->cId, clog_cmd->cmdPrm.sCHLD.srcId,
4861 clog_cmd->cmdPrm.sCHLD.mode, clog_cmd->cmdPrm.sCHLD.act);
4862 TRACE_EVENT(buf);
4863
4864 if ((clog_cmd->cmdPrm.sCHLD.act != CHLD_ACT_Retrieve) &&
4865 (clog_cmd->cmdPrm.sCHLD.act != CHLD_ACT_RetrieveMpty))
4866 {
4867 /*SPR#1962 - DS - Set call_number to call Id returned from ACI */
4868 TRACE_EVENT("Set dis_connect.call_number to clog_cmd->cId");
4869 dis_connect.call_number = clog_cmd->cId;
4870 }
4871 else
4872 {
4873 dis_connect.call_number = -1;
4874 }
4875 if (clog_cmd->cmdPrm.sCHLD.srcId == CMD_SRC_LCL)
4876 {
4877 switch(clog_cmd->cmdPrm.sCHLD.mode)
4878 {
4879 case CHLD_MOD_RelHldOrUdub:
4880
4881 if (cm_search_callId(CAL_STAT_DeactiveReq, &id) == CM_OK)
4882 {
4883 TRACE_FUNCTION("CAL_STAT_DeactiveReq - 0SEND");
4884 if ( cmd_hold EQ MFW_CM_1_SEND )
4885 {
4886 TRACE_FUNCTION("cmd_hold EQ MFW_CM_1_SEND");
4887 cm_status(id, &status, 1);
4888 if (status.mtpy EQ MFW_MTPY_MEMBER)
4889 dis_connect.call_number = 0;
4890 else
4891 dis_connect.call_number = id;
4892 }
4893 }
4894
4895 break;
4896
4897 case CHLD_MOD_RelActAndAcpt:
4898
4899 // MMI-SPR 13873 xkundadu
4900 // Handling of 1+SEND - Releases all active calls (if any exist) and
4901 // accepts the other (held or waiting) call.
4902
4903 if( (cm_search_callId(CAL_STAT_DeactiveReq, &id) == CM_OK) OR
4904 (cm_search_callId(CAL_STAT_Active, &id) == CM_OK))
4905 {
4906 // If there is an active call/active call whose disconnection
4907 // is initiated, store the index of that call.
4908 dis_connect.call_number = id;
4909 if(bIsMultpty == TRUE)
4910 {
4911 // Call is in multiparty
4912 // 1SEND for multiparty will disconnect all the active calls
4913 // To clear all calls assign the dis_connect.call_number to
4914 // zero
4915 dis_connect.call_number = 0;
4916 bIsMultpty = FALSE;
4917 }
4918 }
4919 else
4920 {
4921 // There is no active calls/active calls whose disconnection is
4922 // iniated existing
4923 dis_connect.call_number = -1;
4924 }
4925 if (cm_search_callId(CAL_STAT_Wait, &id) == CM_OK)
4926 {
4927 // Waiting call is existing.
4928 // In the function cm_result_cmd(), value of cmd.call_number
4929 // is used to determine whether to call cm_connect() or not
4930 cmd.call_number=0;
4931 }
4932 cmd_hold = MFW_CM_1_SEND;
4933 break;
4934
4935 case CHLD_MOD_HldActAndAcpt:
4936
4937 // MMI -SPR 13873 xkundadu
4938 // Handling of 2+SEND - Places all active calls (if any exist) on hold
4939 // and accepts the other (held or waiting) call.
4940
4941 switch (clog_cmd->cmdPrm.sCHLD.act)
4942 {
4943
4944 case CHLD_ACT_Accept:
4945 // Accept the incoming call
4946 cmd_hold = MFW_CM_MT_ACCEPT;
4947 break;
4948
4949 case CHLD_ACT_Hold:
4950 // Getting the id of the call which has been put on hold by ACI
4951 cmd.command = CM_HOLD;
4952 if (cm_search_callId(CAL_STAT_Held, &id) == CM_OK)
4953 {
4954 cmd.call_number = id;
4955 }
4956 else
4957 {
4958 cmd.call_number = -1;
4959 }
4960 break;
4961
4962 case CHLD_ACT_Swap:
4963 // Swap the call
4964 cmd.command = CM_SWAP;
4965 break;
4966
4967 case CHLD_ACT_Retrieve:
4968 // Getting the id of the call which has been made active by ACI
4969 cmd.command = CM_RETRIEVE;
4970 if (cm_search_callId(CAL_STAT_Active, &id) == CM_OK)
4971 {
4972 cmd.call_number = id;
4973 }
4974 else
4975 {
4976 cmd.call_number = -1;
4977 }
4978 break;
4979 case CHLD_ACT_HoldMpty:
4980 // Put the calls on HOLD
4981 cmd.command = CM_HOLD_MULTIPARTY;
4982 break;
4983
4984 case CHLD_ACT_RetrieveMpty:
4985 // Retrieve the held calls to active
4986 cmd.command = CM_RETRIEVE_MULTIPARTY;
4987 break;
4988
4989 case CHLD_ACT_SwapMpty:
4990 // Swap muliparty calls
4991 cmd.command = CM_SWAP_MULTIPARTY;
4992 break;
4993
4994 default:
4995 cmd.command = CM_COMMAND_UNKNOWN;
4996 break;
4997
4998 }
4999 break;
5000 case CHLD_MOD_RelActSpec:
5001 dis_connect.call_number = (SHORT)atoi(clog_cmd->cmdPrm.sCHLD.call);
5002 break;
5003
5004 default:
5005 break;
5006 }
5007 }
5008
5009 // Aug 23, 2004 REF: CRR 22222 xkundadu
5010 // Bug: Runaway Call Waiting Tone.
5011 // Fix: Handle the AT-Command source id CMD_SRC_ATI_2 also for call control
5012 // callback functions.Include source Id CMD_SRC_ATI_2 also for checking.
5013
5014 //Nov 02, 2005 DR OMAPS00052132 xdeepadh
5015 //The usage of ATI enum is put under the flag FF_ATI
5016 #ifdef FF_ATI
5017 if ((clog_cmd->cmdPrm.sCHLD.srcId == CMD_SRC_ATI_1) //NM Berlin UK integration
5018 OR (clog_cmd->cmdPrm.sCHLD.srcId == CMD_SRC_ATI_2)) // Added for MMI-SPR 22222 FIX
5019 {
5020 switch(clog_cmd->cmdPrm.sCHLD.mode)
5021 {
5022 case CHLD_MOD_RelHldOrUdub:
5023 if (clog_cmd->cmdPrm.sCHLD.act == CHLD_ACT_Release)
5024 dis_connect.call_number = clog_cmd->cId;
5025 cmd_hold = MFW_CM_TERMINATED;
5026 break;
5027 case CHLD_MOD_RelActAndAcpt:
5028 switch (clog_cmd->cmdPrm.sCHLD.act)
5029 {
5030 case CHLD_ACT_Release:
5031 dis_connect.call_number = clog_cmd->cId;
5032 break;
5033 case CHLD_ACT_Accept:
5034 if (cm_search_callId(CAL_STAT_DeactiveReq, &id) == CM_OK)
5035 dis_connect.call_number = id;
5036 else if (cm_search_callId(CAL_STAT_Active, &id) == CM_OK)
5037 {
5038 call_mode = cm_search_callMode(id);
5039 if (call_mode EQ CAL_MODE_Data
5040 OR call_mode EQ CAL_MODE_Fax)
5041 dis_connect.call_number = id;
5042 }
5043 if (cm_search_callId(CAL_STAT_Wait, &id) == CM_OK)
5044 cc_id = id;
5045 break;
5046 case CHLD_ACT_Retrieve:
5047 if (cm_search_callId(CAL_STAT_Held, &id) == CM_OK)
5048 {
5049 cmd.command = CM_RETRIEVE;
5050 cmd.call_number = id;
5051 }
5052 if (cm_search_callId(CAL_STAT_Wait, &id) == CM_OK)
5053 cc_id = id;
5054 break;
5055 }
5056 cmd_hold = MFW_CM_1_SEND;
5057 break;
5058 case CHLD_MOD_RelActSpec:
5059 dis_connect.call_number = clog_cmd->cId;
5060 if (dis_connect.call_number)
5061 cmd_hold = MFW_CM_TERMINATED;
5062 else
5063 cmd_hold = MFW_CM_MPTY_TERMINATED;
5064 break;
5065 case CHLD_MOD_HldActAndAcpt:
5066 switch (clog_cmd->cmdPrm.sCHLD.act)
5067 {
5068 case CHLD_ACT_Accept:
5069 cmd_hold = MFW_CM_MT_ACCEPT;
5070 break;
5071 case CHLD_ACT_Hold:
5072 cmd.command = CM_HOLD;
5073 if (cm_search_callId(CAL_STAT_Held, &id) == CM_OK)
5074 cmd.call_number = id;
5075 else
5076 cmd.call_number = -1;
5077 break;
5078 case CHLD_ACT_Swap:
5079 cmd.command = CM_SWAP;
5080 break;
5081 case CHLD_ACT_Retrieve:
5082 cmd.command = CM_RETRIEVE;
5083 if (cm_search_callId(CAL_STAT_Active, &id) == CM_OK)
5084 cmd.call_number = id;
5085 else
5086 cmd.call_number = -1;
5087 break;
5088 case CHLD_ACT_SwapMpty:
5089 cmd.command = CM_SWAP_MULTIPARTY;
5090 break;
5091 case CHLD_ACT_HoldMpty:
5092 cmd.command = CM_HOLD_MULTIPARTY;
5093 break;
5094 case CHLD_ACT_RetrieveMpty:
5095 cmd.command = CM_RETRIEVE_MULTIPARTY;
5096 break;
5097 default:
5098 cmd.command = CM_COMMAND_UNKNOWN;
5099 break;
5100 }
5101 break;
5102 case CHLD_MOD_HldActExc:
5103 if (clog_cmd->cmdPrm.sCHLD.act == CHLD_ACT_SplitMpty)
5104 cmd.command = CM_SPLIT_MULTIPARTY;
5105 else
5106 cmd.command = CM_COMMAND_UNKNOWN;
5107 break;
5108 case CHLD_MOD_AddHld:
5109 if (clog_cmd->cmdPrm.sCHLD.act == CHLD_ACT_BuildMpty)
5110 cmd.command = CM_RETRIEVE_MULTIPARTY;
5111 else
5112 cmd.command = CM_COMMAND_UNKNOWN;
5113 break;
5114 case CHLD_MOD_Ect:
5115 cmd.command = CM_ETC;
5116 break;
5117 case CHLD_MOD_Ccbs:
5118 TRACE_EVENT("CHLD_MOD_Ccbs");
5119 cmd.command = CM_CCBS;
5120 break;
5121 case CHLD_MOD_HldActDial:
5122 cmd_hold = MFW_CM_HOLD_AND_DIAL;
5123 cmd.command = CM_HOLD;
5124 break;
5125 default:
5126 break;
5127 }
5128 }
5129 #endif //FF_ATI
5130 }
5131
5132
5133 /*
5134 +--------------------------------------------------------------------+
5135 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5136 | STATE : code ROUTINE: cm_AT_D |
5137 +--------------------------------------------------------------------+
5138
5139
5140 PURPOSE : Notify the outgoing call command.
5141
5142 */
5143
5144 void cm_AT_D(T_ACI_CLOG *cmd)
5145 {
5146 SHORT index;
5147 T_MFW_PHB_ENTRY entry;
5148 T_MFW_CM_CALL_STAT stat;
5149 UBYTE ton;
5150 UBYTE mode;
5151 T_MFW_PHB_TEXT findText;
5152
5153 TRACE_FUNCTION("cm_at_d()");
5154 #ifdef NO_ASCIIZ
5155 entry.name.len = 0;
5156 #else
5157 memset (entry.name, '\0', MAX_LEN);
5158 #endif
5159 memset (entry.number, '\0', MAX_LEN);
5160 entry.index = 0;
5161 entry.npi = 0;
5162 entry.ton = 0;
5163 entries.entry = &entry;
5164
5165 if (cmd->cmdPrm.sD.srcId == CMD_SRC_LCL)
5166 {
5167 out_call.call_id = cmd->cId;
5168 mfwStrncpy((char *)out_call.number, cmd->cmdPrm.sD.number, MFW_NUM_LEN);
5169 if (cc_stat.type == OUTGOING_CALL)
5170 {
5171 mfwStrncpy((char *)cc_stat.number, cmd->cmdPrm.sD.number, MFW_NUM_LEN);
5172 #ifdef NO_ASCIIZ
5173 cc_stat.name.len = 0;
5174 out_call.name.len = 0;
5175 #else
5176 cc_stat.name[0] = '\0';
5177 out_call.name[0] = '\0';
5178 #endif
5179 if (cm_search_callStat(cmd->cId, &stat, &ton, &mode) == CM_OK)
5180 {
5181 out_call.ton = ton;
5182 out_call.type = mode;
5183 cc_stat.ton = ton;
5184 cc_stat.mode = (T_MFW_CM_CALL_TYPE)mode;
5185 }
5186
5187 #ifdef NO_ASCIIZ
5188 mfwStrncpy((char *)findText.data, cmd->cmdPrm.sD.number, PHB_MAX_LEN);
5189 findText.len = strlen(cmd->cmdPrm.sD.number);
5190 if (phb_find_entries (PHB_ADN,
5191 &index,
5192 MFW_PHB_NUMBER,
5193 1,
5194 &findText,
5195 &entries) EQ MFW_PHB_OK)
5196 {
5197 if (entries.num_entries)
5198 {
5199 cc_stat.name.len = entries.entry[0].name.len;
5200 memcpy(cc_stat.name.data,
5201 entries.entry[0].name.data,
5202 entries.entry[0].name.len);
5203
5204 out_call.name.len = entries.entry[0].name.len;
5205 memcpy(out_call.name.data,
5206 entries.entry[0].name.data,
5207 entries.entry[0].name.len);
5208 }
5209 }
5210 #else
5211 if (phb_find_entries (PHB_ADN,
5212 &index,
5213 MFW_PHB_NUMBER,
5214 1,
5215 cmd->cmdPrm.sD.number,
5216 (T_MFW_PHB_LIST *)&entries) EQ MFW_PHB_OK)
5217 {
5218 if (entries.num_entries)
5219 {
5220 mfwStrncpy((char *)cc_stat.name, (char *)entries.entry[0].name, MFW_TAG_LEN);
5221 mfwStrncpy((char *)out_call.name, (char *)entries.entry[0].name, PHB_MAX_LEN);
5222 }
5223 }
5224 #endif
5225 }
5226
5227 if (cc_stat.type == REDIALING_CALL)
5228 {
5229 #ifdef NO_ASCIIZ
5230 out_call.name.len = cc_stat.name.len;
5231 memcpy(out_call.name.data,
5232 cc_stat.name.data,
5233 cc_stat.name.len);
5234 #else
5235 mfwStrncpy((char *)out_call.name, (char *)cc_stat.name, MFW_TAG_LEN);
5236 #endif
5237 out_call.ton = cc_stat.ton;
5238 out_call.type = cc_stat.mode;
5239 }
5240 cm_signal(E_CM_MO_RES, &out_call);
5241 }
5242 else if (cmd->cmdPrm.sD.srcId < CMD_SRC_MAX)
5243 {
5244 out_call.call_id = cmd->cId;
5245 mfwStrncpy((char *)out_call.number, (char *)cmd->cmdPrm.sD.number, MFW_NUM_LEN);
5246 #ifdef NO_ASCIIZ
5247 out_call.name.len = 0;
5248 #else
5249 out_call.name[0] = '\0';
5250 #endif
5251 if (cm_search_callStat(cmd->cId, &stat, &ton, &mode) == CM_OK)
5252 {
5253 out_call.ton = ton;
5254 out_call.type = mode;
5255 }
5256
5257 #ifdef NO_ASCIIZ
5258 mfwStrncpy((char *)findText.data, cmd->cmdPrm.sD.number, PHB_MAX_LEN);
5259 findText.len = strlen(cmd->cmdPrm.sD.number);
5260 if (phb_find_entries (PHB_ADN,
5261 &index,
5262 MFW_PHB_NUMBER,
5263 1,
5264 &findText,
5265 &entries) EQ MFW_PHB_OK)
5266 {
5267 if (entries.num_entries)
5268 {
5269 out_call.name.len = entries.entry[0].name.len;
5270 memcpy(out_call.name.data,
5271 entries.entry[0].name.data,
5272 entries.entry[0].name.len);
5273 }
5274 }
5275 #else
5276 if (phb_find_entries (PHB_ADN,
5277 &index,
5278 MFW_PHB_NUMBER,
5279 1,
5280 cmd->cmdPrm.sD.number,
5281 (T_MFW_PHB_LIST *)&entries) EQ MFW_PHB_OK)
5282 {
5283 if (entries.num_entries)
5284 {
5285 mfwStrncpy((char *)out_call.name, (char *)entries.entry[0].name, MFW_TAG_LEN);
5286 }
5287 }
5288 #endif
5289 cm_signal(E_CM_MO_RES, &out_call);
5290 }
5291 }
5292
5293
5294 /*
5295 +--------------------------------------------------------------------+
5296 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5297 | STATE : code ROUTINE: cm_cvtCPItype |
5298 +--------------------------------------------------------------------+
5299
5300
5301 PURPOSE : Convert the type of
5302
5303 */
5304
5305 T_MFW_CPI_TYPE cm_cvtCPItype(T_ACI_CPI_MSG msg)
5306 {
5307 switch (msg)
5308 {
5309 case CPI_MSG_Setup: return CPI_TYPE_SETUP;
5310 case CPI_MSG_Disc: return CPI_TYPE_DISC;
5311 case CPI_MSG_Alert: return CPI_TYPE_ALERT;
5312 case CPI_MSG_Proc: return CPI_TYPE_PROC;
5313 case CPI_MSG_Sync: return CPI_TYPE_SYNC;
5314 case CPI_MSG_Conn: return CPI_TYPE_CONN;
5315 /* CQ11676 Added new messages types in CPi indication. 17-02-04 MZ */
5316 #ifndef FF_2TO1_PS
5317 case CPI_MSG_Rls: return CPI_TYPE_RELEASE;
5318 case CPI_MSG_Rjct: return CPI_TYPE_REJECT;
5319 #endif
5320 default: return CPI_TYPE_UNKNOWN;
5321 }
5322 }
5323
5324
5325 /*
5326 +--------------------------------------------------------------------+
5327 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5328 | STATE : code ROUTINE: cm_cvtIBT |
5329 +--------------------------------------------------------------------+
5330
5331
5332 PURPOSE : Convert in-band tones indication
5333
5334 */
5335
5336 T_MFW_CPI_IBT cm_cvtIBT(T_ACI_CPI_IBT ibt)
5337 {
5338 switch (ibt)
5339 {
5340 case CPI_IBT_False: return CPI_IBT_FALSE;
5341 case CPI_IBT_True: return CPI_IBT_TRUE;
5342 default: return CPI_IBT_UNKNOWN;
5343 }
5344 }
5345
5346
5347 /*
5348 +--------------------------------------------------------------------+
5349 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5350 | STATE : code ROUTINE: cm_cvtTCH |
5351 +--------------------------------------------------------------------+
5352
5353
5354 PURPOSE : Convert traffic channel indication
5355
5356 */
5357
5358 T_MFW_CPI_TCH cm_cvtTCH(T_ACI_CPI_TCH tch)
5359 {
5360 switch (tch)
5361 {
5362 case CPI_TCH_False: return CPI_TCH_FALSE;
5363 case CPI_TCH_True: return CPI_TCH_TRUE;
5364 default: return CPI_TCH_UNKNOWN;
5365 }
5366 }
5367
5368
5369 /*
5370 +--------------------------------------------------------------------+
5371 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5372 | STATE : code ROUTINE: rAT_PercentCPI |
5373 +--------------------------------------------------------------------+
5374
5375
5376 PURPOSE : Call Progress Information
5377
5378 */
5379 // ADDED BY RAVI - FOR ACI CHANGES - 5-10-2005
5380 #if (defined(FF_2TO1_PS) && BOARD != 61)
5381 void rAT_PercentCPI(SHORT cId,
5382 T_ACI_CPI_MSG msgType,
5383 T_ACI_CPI_IBT ibt,
5384 T_ACI_CPI_TCH tch)
5385
5386 {
5387 cm_cpi.call_number = cId;
5388 cm_cpi.type = cm_cvtCPItype(msgType);
5389 cm_cpi.inband = cm_cvtIBT(ibt);
5390 cm_cpi.tch = cm_cvtTCH(tch);
5391 // cm_cpi.cause = CPI_CAUSE_MASK & cause; /* cq11676 Add cause information to the CPI indication 17-02-04 MZ */
5392 cm_signal(E_CM_CPI, &cm_cpi);
5393 }
5394 #else
5395 void rAT_PercentCPI(SHORT cId,
5396 T_ACI_CPI_MSG msgType,
5397 T_ACI_CPI_IBT ibt,
5398 T_ACI_CPI_TCH tch,
5399 USHORT cause ) /*cq11676 Add cause parameter for cpi indication 17-02-04 MZ */
5400 {
5401 cm_cpi.call_number = cId;
5402 cm_cpi.type = cm_cvtCPItype(msgType);
5403 cm_cpi.inband = cm_cvtIBT(ibt);
5404 cm_cpi.tch = cm_cvtTCH(tch);
5405 cm_cpi.cause = CPI_CAUSE_MASK & cause; /* cq11676 Add cause information to the CPI indication 17-02-04 MZ */
5406 cm_signal(E_CM_CPI, &cm_cpi);
5407 }
5408 #endif
5409 // END OF ADDITION - RAVI - 5-10-2005.
5410
5411 /*
5412 +--------------------------------------------------------------------+
5413 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5414 | STATE : code ROUTINE: cm_error_code |
5415 +--------------------------------------------------------------------+
5416
5417
5418 PURPOSE :
5419
5420 */
5421
5422 UBYTE cm_error_code(T_ACI_AT_CMD cmd)
5423 {
5424 ULONG err;
5425
5426 err = qAT_ErrDesc();
5427 switch (ACI_ERR_DESC_CLASS( err ))
5428 {
5429 case ACI_ERR_CLASS_Cme:
5430 break;
5431 case ACI_ERR_CLASS_Cms:
5432 break;
5433 case ACI_ERR_CLASS_Ceer:
5434 switch (ACI_ERR_DESC_NR( err ))
5435 {
5436 case CEER_ACM_Max: return CM_ACM_MAX;
5437 default: return CM_ERROR;
5438 }
5439 // break; // RAVI
5440 case ACI_ERR_CLASS_Ext:
5441 switch (ACI_ERR_DESC_NR( err ))
5442 {
5443 case EXT_ERR_FdnCheck: return CM_CFDN_ERR;
5444 case EXT_ERR_BdnCheck: return CM_CBDN_ERR;
5445 case EXT_ERR_OneCallOnHold: return CM_2CALLS_ALREADY_ERR;
5446 //xvilliva 21421 - Handling err code returned by ACI.
5447 #ifndef FF_2TO1_PS
5448 case EXT_ERR_AlsLock: return CM_ALS_ERR;
5449 #endif
5450 default: return CM_ERROR;
5451 }
5452 // break; // RAVI
5453 default:
5454 break;
5455 }
5456 return CM_ERROR;
5457 }
5458
5459 /*
5460 +--------------------------------------------------------------------+
5461 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
5462 | STATE : code ROUTINE : cm_bc_parameter |
5463 +--------------------------------------------------------------------+
5464
5465
5466 PURPOSE : Notice bearer service parameter
5467
5468 */
5469
5470 void cm_bc_parameter(T_ACI_CRING_TYP type)
5471 {
5472 TRACE_FUNCTION("cm_cvt_cringType()");
5473
5474 switch (type)
5475 {
5476 case CRING_TYP_Voice:
5477 break;
5478 case CRING_TYP_Fax:
5479 in_call.bc1.conn_elem = Transparent;
5480 break;
5481 case CRING_TYP_Sync:
5482 in_call.bc1.bearer_serv = Synch;
5483 in_call.bc1.conn_elem = Transparent;
5484 break;
5485 case CRING_TYP_Async:
5486 in_call.bc1.bearer_serv = Asynch;
5487 in_call.bc1.conn_elem = Transparent;
5488 break;
5489 case CRING_TYP_RelSync:
5490 in_call.bc1.bearer_serv = Synch;
5491 in_call.bc1.conn_elem = NonTransparent;
5492 break;
5493 case CRING_TYP_RelAsync:
5494 in_call.bc1.bearer_serv = Asynch;
5495 in_call.bc1.conn_elem = NonTransparent;
5496 break;
5497 default:
5498 break;
5499 }
5500 }
5501
5502 /*
5503 +--------------------------------------------------------------------+
5504 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
5505 | STATE : code ROUTINE : cm_build_callType |
5506 +--------------------------------------------------------------------+
5507
5508
5509 PURPOSE :
5510
5511 */
5512
5513 void cm_build_callType(T_ACI_CRING_TYP type1, T_ACI_CRING_TYP type2)
5514 {
5515 if (type1 EQ CRING_TYP_Voice)
5516 {
5517 switch (type2)
5518 {
5519 case CRING_TYP_Sync:
5520 case CRING_TYP_Async:
5521 case CRING_TYP_RelSync:
5522 case CRING_TYP_RelAsync:
5523 in_call.type = VAD_VOICE;
5524 return;
5525 case CRING_TYP_Fax:
5526 in_call.type = VAF_VOICE;
5527 return;
5528 default:
5529 break;
5530 }
5531 }
5532 if (type2 EQ CRING_TYP_Voice)
5533 {
5534 switch (type1)
5535 {
5536 case CRING_TYP_Sync:
5537 case CRING_TYP_Async:
5538 case CRING_TYP_RelSync:
5539 case CRING_TYP_RelAsync:
5540 in_call.type = VAD_DATA;
5541 return;
5542 case CRING_TYP_Fax:
5543 in_call.type = VAF_FAX;
5544 return;
5545 default:
5546 break;
5547 }
5548 }
5549 in_call.type = NONE_TYPE;
5550 }
5551
5552 /*
5553 +--------------------------------------------------------------------+
5554 | PROJECT : MMI-Framework (8417) MODULE : MFW_CM |
5555 | STATE : code ROUTINE : cmCommand |
5556 +--------------------------------------------------------------------+
5557
5558 PURPOSE : handle mfw windows command
5559
5560 */
5561
5562 static int cmCommand (U32 cmd, void *h)
5563 {
5564 switch (cmd)
5565 {
5566 case MfwCmdDelete: /* delete me */
5567 if (!h)
5568 return 0;
5569 cm_delete(h);
5570 return 1;
5571 default:
5572 break;
5573 }
5574
5575 return 0;
5576 }
5577
5578 /*
5579 +--------------------------------------------------------------------+
5580 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5581 | STATE : code ROUTINE: cm_command_abort |
5582 +--------------------------------------------------------------------+
5583
5584
5585 PURPOSE :
5586
5587 */
5588
5589 T_MFW cm_command_abort(UBYTE command)
5590 {
5591 TRACE_FUNCTION ("cm_command()");
5592
5593 switch (command)
5594 {
5595 case CM_HOLD:
5596 case CM_SWAP:
5597 case CM_RETRIEVE:
5598 case CM_SWAP_MULTIPARTY:
5599 case CM_HOLD_MULTIPARTY:
5600 case CM_RETRIEVE_MULTIPARTY:
5601 case CM_BUILD_MULTIPARTY:
5602 case CM_SPLIT_MULTIPARTY:
5603 case CM_ETC:
5604 case CM_CCBS:
5605 sAT_Abort(CMD_SRC_LCL, AT_CMD_CHLD);
5606 break;
5607
5608 case CM_DTMF_ACTIVE:
5609 case CM_DTMF_INACTIVE:
5610 case CM_DTMF_AUTO:
5611 sAT_Abort(CMD_SRC_LCL, AT_CMD_VTS);
5612 break;
5613
5614 default:
5615 return FALSE;
5616 }
5617 return TRUE;
5618 }
5619
5620 /* Marcus: CCBS: 13/11/2002: Start */
5621 /*
5622 +--------------------------------------------------------------------+
5623 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5624 | STATE : code ROUTINE: cm_ccbs_delete_all |
5625 +--------------------------------------------------------------------+
5626
5627 PURPOSE : Delete all registered CCBS
5628
5629 Returns: T_MFW: CM_OK if successful, CM_ERROR if not
5630
5631 Arguments: None
5632 */
5633 T_MFW cm_ccbs_delete_all(void)
5634 {
5635 T_MFW res = CM_ERROR; // The value to be returned by this function
5636 T_ACI_RETURN aci_res; // The value returned by sAT_PercentCCBS
5637
5638 TRACE_FUNCTION("cm_ccbs_delete_all()");
5639
5640 if (ccbs_op == CM_CCBS_NONE)
5641 {
5642 TRACE_EVENT("ccbs_op == CM_CCBS_NONE");
5643 /* No CCBS operation currently in progress */
5644 #ifndef CCBS_TEST
5645 aci_res = sAT_PercentCCBS(CMD_SRC_LCL, 0);
5646 #else
5647 aci_res = AT_EXCT;
5648 #endif
5649 if (aci_res == AT_EXCT)
5650 {
5651 TRACE_EVENT("sAT_PercentCCBS returned AT_EXCT");
5652 ccbs_op = CM_CCBS_DELETE_ALL;
5653 res = CM_OK;
5654 }
5655 else
5656 {
5657 TRACE_EVENT_P1("sAT_PercentCCBS returned %d", aci_res);
5658 }
5659 }
5660 else
5661 {
5662 TRACE_EVENT_P1("ccbs_op is %d", ccbs_op);
5663 }
5664
5665 return res;
5666 }
5667
5668 /*
5669 +--------------------------------------------------------------------+
5670 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5671 | STATE : code ROUTINE: cm_ccbs_delete |
5672 +--------------------------------------------------------------------+
5673
5674 PURPOSE : Delete a specific registered CCBS
5675
5676 Returns: T_MFW: CM_OK if successful, CM_ERROR if not
5677
5678 Arguments: SHORT idx: the index to the specific CCBS to be deleted
5679 */
5680 T_MFW cm_ccbs_delete(SHORT idx)
5681 {
5682 T_MFW res = CM_ERROR; // The value to be returned by this function
5683 T_ACI_RETURN aci_res; // The value returned by sAT_PercentCCBS
5684
5685 TRACE_FUNCTION("cm_ccbs_delete()");
5686 TRACE_EVENT_P1("deleting CCBS %d", idx);
5687
5688 if (ccbs_op == CM_CCBS_NONE)
5689 {
5690 TRACE_EVENT("ccbs_op == CM_CCBS_NONE");
5691 /* No CCBS operation currently in progress */
5692 #ifndef CCBS_TEST
5693 aci_res = sAT_PercentCCBS(CMD_SRC_LCL, idx);
5694 #else
5695 aci_res = AT_EXCT;
5696 #endif
5697 if (aci_res == AT_EXCT)
5698 {
5699 TRACE_EVENT("sAT_PercentCCBS returned AT_EXCT");
5700 ccbs_op = CM_CCBS_DELETE;
5701 res = CM_OK;
5702 }
5703 else
5704 {
5705 TRACE_EVENT_P1("sAT_PercentCCBS returned %d", aci_res);
5706 }
5707 }
5708 else
5709 {
5710 TRACE_EVENT_P1("ccbs_op is %d", ccbs_op);
5711 }
5712
5713 return res;
5714 }
5715
5716 /*
5717 +--------------------------------------------------------------------+
5718 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5719 | STATE : code ROUTINE: cm_ccbs_list |
5720 +--------------------------------------------------------------------+
5721
5722 PURPOSE : Delete all registered CCBS
5723
5724 Returns: T_MFW: CM_OK if successful, CM_ERROR if not
5725
5726 Arguments: None
5727 */
5728 T_MFW cm_ccbs_list(void)
5729 {
5730 T_MFW res = CM_ERROR; // The value to be returned by this function
5731 T_ACI_RETURN aci_res; // The value returned by qAT_PercentCCBS
5732
5733 TRACE_FUNCTION("cm_ccbs_list()");
5734
5735 if (ccbs_op == CM_CCBS_NONE)
5736 {
5737 /* No CCBS operation currently in progress */
5738 TRACE_EVENT("ccbs_op == CM_CCBS_NONE");
5739 #ifndef CCBS_TEST
5740 aci_res = qAT_PercentCCBS(CMD_SRC_LCL);
5741 #else
5742 aci_res = AT_EXCT;
5743 #endif
5744 if (aci_res == AT_EXCT)
5745 {
5746 TRACE_EVENT("qAT_PercentCCBS returned AT_EXCT");
5747 ccbs_op = CM_CCBS_LIST;
5748 res = CM_OK;
5749 }
5750 else
5751 {
5752 TRACE_EVENT_P1("qAT_PercentCCBS returned %d", aci_res);
5753 }
5754 }
5755 else
5756 {
5757 TRACE_EVENT_P1("ccbs_op is %d", ccbs_op);
5758 }
5759
5760 return res;
5761 }
5762
5763 /*
5764 +--------------------------------------------------------------------+
5765 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5766 | STATE : code ROUTINE: cm_ccbs_accept_registration |
5767 +--------------------------------------------------------------------+
5768
5769 PURPOSE : Accepts the CCBS registration being offered
5770
5771 Returns: T_MFW: CM_OK if successful, CM_ERROR if not
5772
5773 Arguments: None
5774 */
5775 T_MFW cm_ccbs_accept_registration(void)
5776 {
5777 T_MFW res = CM_ERROR; // The value to be returned by this function
5778 T_ACI_RETURN aci_res; // The value returned by sAT_PlusCHLD
5779
5780 TRACE_FUNCTION("cm_ccbs_accept_registration()");
5781
5782 if (ccbs_op == CM_CCBS_NONE)
5783 {
5784 /* No CCBS operation currently in progress */
5785 TRACE_EVENT("ccbs_op == CM_CCBS_NONE");
5786 cm_set_cmd_status(CHLD_MOD_Ccbs, "");
5787 cmd_hold = MFW_CM_CCBS_REGISTER;
5788 #ifndef CCBS_TEST
5789 aci_res = sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_Ccbs, NULL);
5790 #else
5791 aci_res = AT_EXCT;
5792 #endif
5793 if (aci_res == AT_EXCT)
5794 {
5795 TRACE_EVENT("sAT_PlusCHLD returned AT_EXCT");
5796 ccbs_op = CM_CCBS_ACCEPT_REGISTRATION;
5797 res = CM_OK;
5798 }
5799 else
5800 {
5801 TRACE_EVENT_P1("sAT_PlusCHLD returned %d", aci_res);
5802 }
5803 }
5804 else
5805 {
5806 TRACE_EVENT_P1("ccbs_op is %d", ccbs_op);
5807 }
5808
5809 return res;
5810 }
5811
5812 /*
5813 +--------------------------------------------------------------------+
5814 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5815 | STATE : code ROUTINE: cm_ccbs_reject_registration |
5816 +--------------------------------------------------------------------+
5817
5818 PURPOSE : Rejects the CCBS registration being offered
5819
5820 Returns: T_MFW: CM_OK if successful, CM_ERROR if not
5821
5822 Arguments: None
5823 */
5824 T_MFW cm_ccbs_reject_registration(void)
5825 {
5826 T_MFW res = CM_ERROR; // The value to be returned by this function
5827 T_ACI_RETURN aci_res; // The value returned by sAT_H
5828
5829 TRACE_FUNCTION("cm_ccbs_reject_registration()");
5830
5831 if (ccbs_op == CM_CCBS_NONE)
5832 {
5833 /* No CCBS operation currently in progress */
5834 TRACE_EVENT("ccbs_op == CM_CCBS_NONE");
5835 cmd_hold = MFW_CM_CCBS_REGISTER;
5836 #ifndef CCBS_TEST
5837 aci_res = sAT_H(CMD_SRC_LCL);
5838 #else
5839 aci_res = AT_EXCT;
5840 #endif
5841 if (aci_res == AT_EXCT)
5842 {
5843 TRACE_EVENT("sAT_H returned AT_EXCT");
5844 ccbs_op = CM_CCBS_REJECT_REGISTRATION;
5845 res = CM_OK;
5846 }
5847 else
5848 {
5849 TRACE_EVENT_P1("sAT_H returned %d", aci_res);
5850 }
5851 }
5852 else
5853 {
5854 TRACE_EVENT_P1("ccbs_op is %d", ccbs_op);
5855 }
5856
5857 return res;
5858 }
5859
5860 /*
5861 +--------------------------------------------------------------------+
5862 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5863 | STATE : code ROUTINE: cm_ccbs_accept_recall |
5864 +--------------------------------------------------------------------+
5865
5866 PURPOSE : Accepts the CCBS recall being offered
5867
5868 Returns: T_MFW: CM_OK if successful, CM_BLACKIST or CM_ERROR if not
5869
5870 Arguments: UBYTE *number - the number of the phone to call
5871 T_MFW_CM_CALL_TYPE type - the type of the call to be made
5872 */
5873 T_MFW cm_ccbs_accept_recall(UBYTE *number, T_MFW_CM_CALL_TYPE type)
5874 {
5875 T_MFW res = CM_ERROR; // The value to be returned by this function
5876 int search_res; // The value returned by cm_search_callId
5877 T_ACI_RETURN aci_res; // The value returned by sAT_PlusCHLD
5878 SHORT call_number;// The call identity of any held call
5879 UBYTE phone[MFW_NUM_LEN]; // Working copy of phone number
5880 // CHAR *rest; // Parameter for ss_decode // RAVI
5881 // T_KSD_SEQPARAM para; // Parameter for ss_decode // RAVI
5882 // T_MFW_SS_RETURN ss_res; // The value returned by ss_decode // RAVI
5883
5884 TRACE_FUNCTION("cm_ccbs_accept_recall()");
5885
5886 if (ccbs_op == CM_CCBS_NONE)
5887 {
5888 /* No CCBS operation currently in progress */
5889 TRACE_EVENT("ccbs_op == CM_CCBS_NONE");
5890 /* Ensure the number given is an ASCIIZ string thet is not too long */
5891 mfwStrncpy((char *)phone, (char *)number, MFW_NUM_LEN);
5892 TRACE_EVENT_P1("ccbs nr: %s", phone);
5893
5894 /* Make sure that it is OK to call this number */
5895 if ((res = cm_check_mo_number(phone)) == CM_OK)
5896 {
5897 TRACE_EVENT("cm_check_mo_number returned CM_OK");
5898 /* Set up data as for mobile originated call */
5899 cm_set_call_mode(type);
5900 call_stat = OUTGOING_CALL;
5901 redial_count = 0;
5902 cc_stat.type = OUTGOING_CALL;
5903 currConnecting = 1;
5904
5905 if ((search_res = cm_search_callId(CAL_STAT_Held, &call_number)) == CM_OK)
5906 {
5907 TRACE_EVENT("Held call: CHLD_MOD_RelActAndAcpt");
5908 /* There is a held call: release active call and accept callback */
5909 cm_set_cmd_status(CHLD_MOD_RelActAndAcpt, "");
5910 #ifndef CCBS_TEST
5911 aci_res = sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_RelActAndAcpt, NULL);
5912 #else
5913 aci_res = AT_EXCT;
5914 #endif
5915 }
5916 else
5917 {
5918 TRACE_EVENT("No held call: CHLD_MOD_HldActAndAcpt");
5919 /* There is no held call: hold any active call and accept callback */
5920 cm_set_cmd_status(CHLD_MOD_HldActAndAcpt, "");
5921 #ifndef CCBS_TEST
5922 aci_res = sAT_PlusCHLD(CMD_SRC_LCL, CHLD_MOD_HldActAndAcpt, NULL);
5923 #else
5924 aci_res = AT_EXCT;
5925 #endif
5926 }
5927
5928 cmd_hold = MFW_CM_CCBS_RECALL;
5929
5930 if (aci_res == AT_EXCT)
5931 {
5932 TRACE_EVENT("sAT_PlusCHLD returned AT_EXCT");
5933 ccbs_op = CM_CCBS_ACCEPT_RECALL;
5934 res = CM_OK;
5935 }
5936 else
5937 {
5938 /* The attempt to accept the callback failed */
5939 TRACE_EVENT_P1("sAT_PlusCHLD returned %d", aci_res);
5940 call_stat = MFW_CALL_FREE;
5941 }
5942 }
5943 else
5944 {
5945 /* It is not OK to call this number for some reason */
5946 TRACE_EVENT_P1("cm_check_mo_number returned %d", res);
5947 }
5948 }
5949 else
5950 {
5951 TRACE_EVENT_P1("ccbs_op is %d", ccbs_op);
5952 }
5953
5954 return res;
5955 }
5956
5957 /*
5958 +--------------------------------------------------------------------+
5959 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
5960 | STATE : code ROUTINE: cm_ccbs_reject_recall |
5961 +--------------------------------------------------------------------+
5962
5963 PURPOSE : Rejects the CCBS recall being offered
5964
5965 Returns: T_MFW: CM_OK if successful, CM_ERROR if not
5966
5967 Arguments: None
5968 */
5969 T_MFW cm_ccbs_reject_recall(void)
5970 {
5971 T_MFW res = CM_ERROR; // The value to be returned by this function
5972 T_ACI_RETURN aci_res; // The value returned by sAT_PlusCHLD
5973
5974 TRACE_FUNCTION("cm_ccbs_reject_recall()");
5975
5976 if (ccbs_op == CM_CCBS_NONE)
5977 {
5978 /* No CCBS operation currently in progress */
5979 TRACE_EVENT("ccbs_op == CM_CCBS_NONE");
5980 cm_set_cmd_status(CHLD_MOD_RelHldOrUdub, "");
5981 cmd_hold = MFW_CM_CCBS_RECALL;
5982
5983 #ifndef CCBS_TEST
5984 aci_res = sAT_H(CMD_SRC_LCL);
5985 #else
5986 aci_res = AT_CMPL;
5987 #endif
5988 if (aci_res == AT_CMPL)
5989 {
5990 TRACE_EVENT("sAT_H returned AT_CMPL");
5991 ccbs_op = CM_CCBS_REJECT_RECALL;
5992 res = CM_OK;
5993 }
5994 else
5995 {
5996 TRACE_EVENT_P1("sAT_H returned %d", aci_res);
5997 }
5998 }
5999 else
6000 {
6001 TRACE_EVENT_P1("ccbs_op is %d", ccbs_op);
6002 }
6003
6004 return res;
6005 }
6006
6007 /*
6008 +--------------------------------------------------------------------+
6009 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
6010 | STATE : code ROUTINE: cm_ccbs_ok |
6011 +--------------------------------------------------------------------+
6012
6013 PURPOSE : Called by rAT_OK for "OK" result code for %CCBS command
6014
6015 Returns: Nothing
6016
6017 Arguments: None
6018 */
6019 void cm_ccbs_ok(void)
6020 {
6021 TRACE_FUNCTION("cm_ccbs_ok()");
6022
6023 memset((void *)&ccbs_info, 0, sizeof(ccbs_info));
6024
6025 ccbs_info.operation = ccbs_op;
6026 ccbs_op = CM_CCBS_NONE;
6027 ccbs_info.type = CM_CCBS_OK;
6028
6029 TRACE_EVENT_P2("E_CM_CCBS: op = %d: type = %d",
6030 ccbs_info.operation, ccbs_info.type);
6031
6032 cm_signal(E_CM_CCBS, &ccbs_info);
6033 }
6034
6035 /*
6036 +--------------------------------------------------------------------+
6037 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
6038 | STATE : code ROUTINE: cm_ccbs_error |
6039 +--------------------------------------------------------------------+
6040
6041 PURPOSE : Called by rAT_PlusCME for "+CME error" result code for %CCBS command
6042
6043 Returns: Nothing
6044
6045 Arguments: None
6046 */
6047 void cm_ccbs_error(void)
6048 {
6049 TRACE_FUNCTION("cm_ccbs_error()");
6050
6051 memset((void *)&ccbs_info, 0, sizeof(ccbs_info));
6052
6053 ccbs_info.operation = ccbs_op;
6054 ccbs_op = CM_CCBS_NONE;
6055 ccbs_info.type = CM_CCBS_ERROR;
6056
6057 TRACE_EVENT_P2("E_CM_CCBS: op = %d: type = %d",
6058 ccbs_info.operation, ccbs_info.type);
6059
6060 cm_signal(E_CM_CCBS, &ccbs_info);
6061 }
6062
6063 /*
6064 +--------------------------------------------------------------------+
6065 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
6066 | STATE : code ROUTINE: rAT_PercentCCBS |
6067 +--------------------------------------------------------------------+
6068
6069 PURPOSE : Called by ACI for "%CCBS:" result code
6070
6071 Returns: Nothing
6072
6073 Arguments: T_ACI_CCBS_IND indct - type of %CCBS indication
6074 T_ACI_CCBS_STAT status - status of %CCBS indication
6075 T_ACI_CCBS_SET *setting - optiona parameters of %CCBS indication
6076 */
6077 void rAT_PercentCCBS( T_ACI_CCBS_IND indct,
6078 T_ACI_CCBS_STAT status,
6079 T_ACI_CCBS_SET *setting )
6080 {
6081 TRACE_FUNCTION("rAT_PercentCCBS()");
6082 TRACE_EVENT_P3("indct = %d: status = %d: setting = %p", indct, status, setting);
6083
6084 memset((void *)&ccbs_info, 0, sizeof(ccbs_info));
6085
6086 /* Fill in the fields of the E_CM_CCBS event structure */
6087 switch (indct)
6088 {
6089 case CCBS_IND_Possible:
6090 case CCBS_IND_Recall:
6091 case CCBS_IND_PossibilityTimedOut:
6092 case CCBS_IND_RecallTimedOut:
6093
6094 /* An asynchronous %CCBS, not in response to a %CCBS command */
6095 TRACE_EVENT("Unsolicited event");
6096 ccbs_info.operation = CM_CCBS_ASYNC;
6097 break;
6098
6099 default:
6100 TRACE_EVENT("Solicited event");
6101 ccbs_info.operation = ccbs_op;
6102 break;
6103 }
6104
6105 ccbs_info.type = CM_CCBS_INFO;
6106 ccbs_info.indct = indct;
6107 ccbs_info.status = status;
6108
6109 TRACE_EVENT_P2("E_CM_CCBS: op = %d: type = %d",
6110 ccbs_info.operation, ccbs_info.type);
6111 TRACE_EVENT_P2(" indct = %d: status = %d",
6112 ccbs_info.indct, ccbs_info.status);
6113
6114 if (setting == (T_ACI_CCBS_SET *) NULL)
6115 {
6116 /* No T_ACI_CCBS_SET structure given. Indicate in the idx field of ccbs_info */
6117 TRACE_EVENT("setting == NULL");
6118 ccbs_info.idx = 0;
6119 }
6120 else
6121 {
6122 /* T_ACI_CCBS_SET structure given. Fill in the remaining field of ccbs_info */
6123 TRACE_EVENT("setting != NULL");
6124 ccbs_info.idx = setting->idx;
6125 strncpy((char *) ccbs_info.number, (char *) setting->number, sizeof(ccbs_info.number)-1);
6126 ccbs_info.number[sizeof(ccbs_info.number)-1] = '\0';
6127 ccbs_info.ton = phb_cvtTon(setting->type.ton);
6128 ccbs_info.call_type = cm_callTyp_cvt(setting->class_type);
6129 strncpy((char *) ccbs_info.subaddr, (char *) setting->subaddr, sizeof(ccbs_info.subaddr)-1);
6130 ccbs_info.subaddr[sizeof(ccbs_info.subaddr)-1] = '\0';
6131 ccbs_info.alrtPtn = setting->alrtPtn;
6132 TRACE_EVENT_P3(" idx = %d: number = %s: ton = %d",
6133 ccbs_info.idx, ccbs_info.number, ccbs_info.ton);
6134 TRACE_EVENT_P3(" call_type = %d: subaddr = %s: alrtPtn = %d",
6135 ccbs_info.call_type, ccbs_info.subaddr, ccbs_info.alrtPtn);
6136 }
6137
6138 cm_signal(E_CM_CCBS, &ccbs_info);
6139 }
6140
6141 /* Marcus: CCBS: 13/11/2002: End */
6142
6143 /*
6144 +--------------------------------------------------------------------+
6145 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
6146 | STATE : code ROUTINE: cm_error_dial |
6147 +--------------------------------------------------------------------+
6148
6149
6150 PURPOSE : The call setup is not successful
6151
6152 */
6153
6154 void cm_error_dial(T_ACI_CME_ERR err)
6155 {
6156 TRACE_FUNCTION("cm_error_dial()");
6157
6158 switch (err)
6159 {
6160 case CME_ERR_OpNotAllow: /* the active call can not be hold */
6161 /* allow a new outgoing */
6162 call_stat = MFW_CALL_FREE;
6163 call_type = MFW_CALL_FREE;
6164 cmd.command = CM_HOLD;
6165 if (cm_search_callId(CAL_STAT_Active, &cmd.call_number) NEQ CM_OK)
6166 cmd.call_number = -1;
6167 cmd.result = NotPresent;
6168 cm_signal(E_CM_COMMAND, &cmd);
6169 break;
6170
6171 /*SPR#2235 - DS - If handset is powered-up without a SIM and an emergency
6172 *call is attempted, the UK networks will reject the call attempt. Send a signal to
6173 *the BMI to enable it to destroy the call and show an appropriate error message.
6174 *
6175 *The ACI calls rAT_PlusCME() - then rAT_PlusCME() calls this funct - for this SIM
6176 *failure but the ACI doesn't supply the callId. Without the callId, the MFW/BMI
6177 *cannot close down the call properly. The ACI interface will need to be changed
6178 *so that it supplies the callId (if there is an active call) when this failure occurs.
6179 */
6180 case CME_ERR_SimFail:
6181 /* allow a new outgoing */
6182 call_stat = MFW_CALL_FREE;
6183 call_type = MFW_CALL_FREE;
6184
6185 /*SPR#2235 - DS - Fake the callId. Workaround needed until the ACI interface is changed */
6186 cm_error_connect(1);
6187 break;
6188
6189 default:
6190 TRACE_EVENT_P1("Error code: %d. No signal sent.", err);
6191 break;
6192 }
6193 }
6194
6195 /*
6196 +--------------------------------------------------------------------+
6197 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
6198 | STATE : code ROUTINE: cm_data_connect |
6199 +--------------------------------------------------------------------+
6200
6201
6202 PURPOSE : Fax/Data connect
6203
6204 */
6205
6206 void cm_data_connect(SHORT callId)
6207 {
6208 SHORT call_number;
6209
6210 TRACE_FUNCTION("cm_data_connect()");
6211
6212 call_number = callId;
6213 cm_signal(E_CM_CONNECT, &call_number);
6214 }
6215
6216 /*
6217 +--------------------------------------------------------------------+
6218 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
6219 | STATE : code ROUTINE: cm_data_connect |
6220 +--------------------------------------------------------------------+
6221
6222
6223 PURPOSE : Fax/Data connect
6224
6225 */
6226
6227 void cm_wap_data_connected(void)
6228 {
6229 // SHORT call_number; // RAVI
6230
6231 TRACE_FUNCTION("cm_wap_data_connected()");
6232
6233 cm_signal(E_CM_WAP_CALL_CONNECTED, NULL);
6234 }
6235 /*
6236 +--------------------------------------------------------------------+
6237 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
6238 | STATE : code ROUTINE: cm_deflect_incoming_call |
6239 +--------------------------------------------------------------------+
6240
6241
6242 PURPOSE : try to deflect a call using AT command CTFR
6243
6244 */
6245 T_MFW cm_deflect_incoming_call(char* number)
6246 { T_ACI_RETURN result;
6247 T_ACI_TOA type;
6248 T_ACI_TOS subaddr_type;
6249
6250 type.ton = TON_Unknown;
6251 type.npi = NPI_Unknown;
6252
6253 subaddr_type.tos = TOS_NotPresent;
6254 subaddr_type.oe = OE_NotPresent;
6255
6256 result = sAT_PlusCTFR(CMD_SRC_LCL, number, &type, NULL, &subaddr_type);
6257
6258 if ((result == AT_BUSY) || (result == AT_FAIL))
6259 return FALSE;
6260 return TRUE;
6261
6262 }
6263 /*
6264 +--------------------------------------------------------------------+
6265 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
6266 | STATE : code ROUTINE: cm_ok_CTFR |
6267 +--------------------------------------------------------------------+
6268
6269
6270 PURPOSE : sends call deflect OK event to MMI
6271
6272 */
6273 void cm_ok_CTFR(void)
6274 { BOOL status = TRUE;
6275
6276 cm_signal(E_CM_CALL_DEFLECT_STATUS, &status);
6277
6278 }
6279 /*
6280 +--------------------------------------------------------------------+
6281 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
6282 | STATE : code ROUTINE: cm_error_CTFR |
6283 +--------------------------------------------------------------------+
6284
6285
6286 PURPOSE : Sends call deflect failed event to MMI
6287
6288 */
6289 void cm_error_CTFR(void)
6290 {
6291 BOOL status = FALSE;
6292
6293 cm_signal(E_CM_CALL_DEFLECT_STATUS, &status);
6294 }
6295 #ifdef CCBS_TEST
6296 /* Marcus: CCBS testing: 20/11/2002: Start */
6297 static void strlower(char *string)
6298 {
6299 while(*string)
6300 {
6301 *string = (char)tolower((int) *string);
6302 string++;
6303 }
6304 }
6305
6306 static BOOL getCmdId(char *token, T_ACI_AT_CMD *cmdId)
6307 {
6308 BOOL cmdIdOk = FALSE;
6309 TRACE_FUNCTION("getCmdId()");
6310 if (token)
6311 {
6312 strlower(token);
6313 TRACE_EVENT_P1("token: %s", token);
6314 if (strstr(token, "ccbs"))
6315 {
6316 *cmdId = AT_CMD_CCBS;
6317 cmdIdOk = TRUE;
6318 }
6319 else if (strstr(token, "chld"))
6320 {
6321 *cmdId = AT_CMD_CHLD;
6322 cmdIdOk = TRUE;
6323 }
6324 else if (strcmp("h", token) == 0)
6325 {
6326 *cmdId = AT_CMD_H;
6327 cmdIdOk = TRUE;
6328 }
6329 else if ((*cmdId = atoi(token)))
6330 {
6331 cmdIdOk = TRUE;
6332 }
6333 }
6334 else
6335 {
6336 TRACE_EVENT("No token");
6337 }
6338
6339 return cmdIdOk;
6340 }
6341 #endif
6342
6343 void rAT_PercentMMITEST(char *param)
6344 {
6345 char work[80];
6346 char *token; // Current token obtained from strtok
6347 TRACE_FUNCTION("rAT_PercentMMITEST()");
6348
6349 strncpy(work, param, sizeof(work)-1);
6350 work[sizeof(work)-1] = '\0';
6351
6352 if ((token = strtok(work, ",()")) != NULL)
6353 {
6354 #ifdef CCBS_TEST
6355 T_ACI_AT_CMD cmdId;
6356 strlower(token);
6357 TRACE_EVENT_P1("token: %s", token);
6358
6359 if (strcmp("ok", token) == 0)
6360 {
6361 TRACE_EVENT("OK");
6362 if ((token = strtok(NULL, ",()")) != NULL)
6363 {
6364 if (getCmdId(token, &cmdId) == TRUE)
6365 {
6366 TRACE_EVENT_P1("rAT_OK(cmdId = %d", cmdId);
6367 rAT_OK(cmdId);
6368 }
6369 else
6370 {
6371 TRACE_EVENT("Unknown cmdId");
6372 }
6373 }
6374 else
6375 {
6376 TRACE_EVENT("No cmdId token");
6377 }
6378 }
6379 else if (strcmp("error", token) == 0)
6380 {
6381 TRACE_EVENT("ERROR");
6382 if ((token = strtok(NULL, ",()")) != NULL)
6383 {
6384 if (getCmdId(token, &cmdId) == TRUE)
6385 {
6386 T_ACI_CME_ERR err;
6387 if ((token = strtok(NULL, ",()")) != NULL)
6388 {
6389 err = atoi(token);
6390 rAT_PlusCME(cmdId, err);
6391 }
6392 else
6393 {
6394 TRACE_EVENT("No err token");
6395 }
6396 }
6397 }
6398 else
6399 {
6400 TRACE_EVENT("No cmdId token");
6401 }
6402 }
6403 else if (strcmp("info", token) == 0)
6404 {
6405 T_ACI_CCBS_IND indct = CCBS_IND_NotPresent;
6406 T_ACI_CCBS_STAT status = CCBS_STAT_NotPresent;
6407 T_ACI_CCBS_SET setting, *pSetting = NULL;
6408 TRACE_EVENT("INFO");
6409 if ((token = strtok(NULL, ",()")) != NULL)
6410 {
6411 strlower(token);
6412 TRACE_EVENT_P1("token: %s", token);
6413 if (strstr(token, "notpresent"))
6414 indct = CCBS_IND_NotPresent;
6415 else if (strstr(token, "possibility"))
6416 indct = CCBS_IND_PossibilityTimedOut;
6417 else if (strstr(token, "possible"))
6418 indct = CCBS_IND_Possible;
6419 else if (strstr(token, "registered"))
6420 indct = CCBS_IND_Registered;
6421 else if (strstr(token, "recallt"))
6422 indct = CCBS_IND_RecallTimedOut;
6423 else if (strstr(token, "recall"))
6424 indct = CCBS_IND_Recall;
6425 else if (strstr(token, "irgt"))
6426 indct = CCBS_IND_IrgtResult;
6427 }
6428
6429 if ((token = strtok(NULL, ",()")) != NULL)
6430 {
6431 strlower(token);
6432 TRACE_EVENT_P1("token: %s", token);
6433 if (strstr(token, "notpresent"))
6434 status = CCBS_STAT_NotPresent;
6435 else if (strstr(token, "notprov"))
6436 status = CCBS_STAT_NotProvisioned;
6437 else if (strstr(token, "prov"))
6438 status = CCBS_STAT_Provisioned;
6439 else if (strstr(token, "active"))
6440 status = CCBS_STAT_Active;
6441 }
6442
6443 setting.idx = 0;
6444 if ((token = strtok(NULL, ",()")) != NULL)
6445 {
6446 TRACE_EVENT_P1("token: %s", token);
6447 setting.idx = atoi(token);
6448 }
6449
6450 if (setting.idx != 0)
6451 {
6452 pSetting = &setting;
6453 strcpy(setting.number, "01317180538");
6454 setting.type.ton = TON_National;
6455 setting.type.npi = NPI_IsdnTelephony;
6456 setting.subaddr[0] = '\0';
6457 setting.satype.tos = TOS_NotPresent;
6458 setting.satype.oe = OE_NotPresent;
6459 setting.class_type = CLASS_Vce;
6460 setting.alrtPtn = ALPT_Level_0;
6461
6462 if ((token = strtok(NULL, ",()")) != NULL)
6463 {
6464 TRACE_EVENT_P1("token: %s", token);
6465 strncpy(setting.number, token, sizeof(setting.number)-1);
6466 setting.number[sizeof(setting.number)-1] = '\0';
6467 }
6468
6469 if ((token = strtok(NULL, ",()")) != NULL)
6470 {
6471 TRACE_EVENT_P1("token: %s", token);
6472 setting.type.ton = TON_International;
6473 }
6474 }
6475
6476 TRACE_EVENT_P3("rAT_PercentCCBS(%d, %d, %p)", indct, status, pSetting);
6477 if (pSetting != NULL)
6478 {
6479 TRACE_EVENT_P3("idx = %d: number = %s: ton = %d",
6480 setting.idx, setting.number, setting.type.ton);
6481 }
6482 rAT_PercentCCBS(indct, status, pSetting);
6483 }
6484 else
6485 {
6486 TRACE_EVENT("Unrecognised token");
6487 }
6488 #endif
6489 }
6490 else
6491 {
6492 TRACE_EVENT("No token");
6493 }
6494 }
6495 /* Marcus: CCBS testing: 20/11/2002: End */
6496
6497
6498 /* SPR#1985 - SH - Added this function */
6499
6500 /*
6501 +--------------------------------------------------------------------+
6502 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
6503 | STATE : code ROUTINE: cm_tty_enable |
6504 +--------------------------------------------------------------------+
6505
6506
6507 PURPOSE : Receipt of unsolicited TTY information
6508
6509 */
6510
6511 void rAT_PercentCTYI(T_ACI_CTTY_NEG neg, T_ACI_CTTY_TRX trx)
6512 {
6513 T_MFW_CM_CTYI res;
6514
6515 TRACE_FUNCTION("rAT_PercentCTYI()");
6516
6517 currCmd = AT_CMD_NONE;
6518 switch(neg)
6519 {
6520 case CTTY_NEG_None:
6521 res.neg = CTYI_NONE;
6522 break;
6523 case CTTY_NEG_Request:
6524 res.neg = CTYI_REQUEST;
6525 break;
6526 case CTTY_NEG_Reject:
6527 res.neg = CTYI_REJECT;
6528 break;
6529 case CTTY_NEG_Grant:
6530 res.neg = CTYI_GRANT;
6531 break;
6532 }
6533
6534 cm_signal(E_CM_CTYI, &res);
6535
6536 return;
6537 }
6538
6539
6540 /*
6541 +--------------------------------------------------------------------+
6542 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
6543 | STATE : code ROUTINE: cm_tty_enable |
6544 +--------------------------------------------------------------------+
6545
6546
6547 PURPOSE : Request ACI to switch TTY on or off
6548
6549 */
6550
6551 void cm_tty_enable(UBYTE enable)
6552 {
6553 T_ACI_RETURN ret;
6554
6555 TRACE_FUNCTION("cm_tty_enable()");
6556
6557 /* SPR#1985 - SH - Now use proper ACI functions. */
6558
6559 if (enable)
6560 ret = sAT_PercentCTTY(CMD_SRC_LCL, CTTY_MOD_Enable, CTTY_REQ_On);
6561 else
6562 ret = sAT_PercentCTTY(CMD_SRC_LCL, CTTY_MOD_Enable, CTTY_REQ_Off);
6563
6564 /* SPR#1985 - SH - Check that TTY status has changed and inform MMI */
6565
6566 cm_tty_query();
6567
6568 return;
6569 }
6570
6571
6572 /*
6573 +--------------------------------------------------------------------+
6574 | PROJECT: MMI-Framework (8417) MODULE: MFW_CM |
6575 | STATE : code ROUTINE: cm_tty_query |
6576 +--------------------------------------------------------------------+
6577
6578
6579 PURPOSE : Query status of TTY, inform MMI. */
6580 /*SPR#1985 - SH - Added this function */
6581
6582 void cm_tty_query(void)
6583 {
6584 T_MFW_CM_CTYI res;
6585 // T_ACI_RETURN ret; // RAVI
6586 T_ACI_CTTY_MOD mode;
6587 T_ACI_CTTY_REQ req;
6588 T_ACI_CTTY_STAT stat;
6589 T_ACI_CTTY_TRX trx;
6590
6591 TRACE_FUNCTION("cm_tty_query()");
6592
6593 qAT_PercentCTTY(CMD_SRC_LCL, &mode, &req, &stat, &trx);
6594
6595 res.neg = CTYI_REJECT;
6596
6597 if (req==CTTY_REQ_On)
6598 {
6599 if (req)
6600 res.neg = CTYI_GRANT;
6601 }
6602
6603 cm_signal(E_CM_CTYI, &res);
6604
6605 return;
6606 }
6607
6608 // Feb 03, 2005 REF: CRR 25960 x0012850
6609 // Description: Call Hold: While one call in Active and other in Held by swapping either of phone is not audible
6610
6611 /*
6612 +--------------------------------------------------------------------+
6613 | PROJECT: MMI-Framework MODULE: MFW_CM |
6614 | STATE : code ROUTINE: cm_setSpeechMode |
6615 +--------------------------------------------------------------------+
6616
6617
6618 PURPOSE : MFW function to call psaCC_setSpeechMode() to attach user connection.
6619
6620 */
6621 void cm_setSpeechMode(void)
6622 {
6623 TRACE_FUNCTION("cm_setSpeechMode()");
6624 psaCC_setSpeechMode();
6625 return;
6626 }
6627
6628
6629 // Sep 12, 2005 REF: MMI-SMR-34085 x0021334
6630 // Description: RE: Add +CDIP command - MMI Additions
6631 // Solution: Dummy implementation of function "rAT_PlusCDIP()" is done to enable successful compilation.
6632
6633 /*
6634 +--------------------------------------------------------------------+
6635 | PROJECT: MMI-Framework MODULE: MFW_CM |
6636 | STATE : code ROUTINE : rAT_PlusCDIP |
6637 +--------------------------------------------------------------------+
6638
6639 PURPOSE : Stub implementation
6640 */
6641
6642 GLOBAL void rAT_PlusCDIP( CHAR * number,
6643 T_ACI_TOA * type,
6644 CHAR * subaddr,
6645 T_ACI_TOS * satype)
6646 {
6647 TRACE_FUNCTION ("rAT_PlusCDIP()");
6648 }