comparison src/aci2/bmi/MmiServices.c @ 3:93999a60b835

src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 26 Sep 2016 00:29:36 +0000
parents
children
comparison
equal deleted inserted replaced
2:c41a534f33c6 3:93999a60b835
1 /*******************************************************************************
2
3 CONDAT (UK)
4
5 ********************************************************************************
6
7 This software product is the property of Condat (UK) Ltd and may not be
8 disclosed to any third party without the express permission of the owner.
9
10 ********************************************************************************
11
12 $Project name: Basic MMI
13 $Project code: BMI (6349)
14 $Module: Supplementary services
15 $File: MmiServices.c
16 $Revision: 1.0
17
18 $Author: Condat(UK)
19 $Date: 25/10/00
20
21 ********************************************************************************
22
23 Description
24
25 This module provides the supplementary services functionality
26
27
28 ********************************************************************************
29 $History: MmiServices.c
30
31 Dec 07, 2005 REF: OMAPS00050087 x0039928
32 Description: Deactivated is displayed while activate Hide Id option is selected
33 Solution: String "Not Activated" is displayed if the Hide Id activation fails.
34
35 July 09, 2005 REF : MMI-22565 - a0876501
36 Description: IMEI CD byte calculation added
37 Solution: Increased the IMEI_LEN from 15 to 17 for displaying the Cd byte.
38
39 Jun 16, 2005 REF: CRR 31543 x0021334
40 Issue: SATK: cannot get TR for send ussd command
41 Solution: When the user presses "Hang up" key when the SAT USSD session is in progress,
42 a call is made to function 'sAT_end_ussd()' to end the USSD session.
43
44 May 12, 2005 REF: CRR 30892 x0021334
45 Bug: MMI doesn't handle 2nd Interogation of "CW for basic services" using USSD *#43#.
46 Fix: Set ss_data.info_win to NULL to pass the check in services_ss_cb() for notification
47
48 May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
49 Description: IMEI retreival by posting a call to ACI sAT_xx API
50 Solution: The direct call to cl_get_imeisv() is replaced with the
51 call to the mmi_imei_store() which inturn calls sAT_Dn() and
52 retrieves the IMEI info and stores it onto the global
53 variable "imei"
54
55 Feb 17, 2005 REF : CRR 17657 x0012850 Divya.P.V
56 Bug : Unable to compose a one or two digit number
57 Fix : This bug is reproducible when a very long message is sent by the service provider when an invalid one or two digit number is dialled.
58 The read only editor with the service provider message that comes up when a one or two digit is dialled
59 was not handled properly. So altered the editor handling to cater for the long message.
60
61 Oct 20, 2004 REF: CRR 25772 Deepa M.D
62 Bug: Not displaying proper RSK name in call divert edit screens
63 Fix: The RSK name will be changed based on whether the editor content is empty or not.
64
65 Jul 23, 2004 REF: CRR 16107 xvilliva
66 Bug: (Call Barring) - MMI response overlayes partially background images.
67 Fix: Alert being displayed is altered.
68
69 Jun 21,2004 CRR:13650 xpradipg - SASKEN
70
71 Jul 16, 2004 REF: CRR 18409 xvilliva
72 Bug: CHW : message "Deactivated" when it should be "Activated".
73 Fix: The alert displayed depends on the status code received. If we
74 receive the status as zero or 0xFF, we now show an alert saying
75 "unknown status" instead of "Deactivated".
76
77
78 Jun 21,2004 CRR:13650 xpradipg - SASKEN
79
80 Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
81 Solution: The CF state is maintained in flash. During bootup the CF icon in the idle screen
82 is displayed depending upon its state in the ffs
83
84 Jun 10, 2004 REF: CRR MMI-SPR-13614 Rashmi C N(Sasken)
85 Solution: The condition for which Call Forward is activated/deactivated or its staus is checked,
86 is displayed in the message along with the activation/deactivation message
87
88 Jun 21,2004 CRR:13650 xpradipg - SASKEN
89 Description: CBA : no basic service sent when using the menu
90 Fix: Basic service code 10(All teleservices) is sent for activation and deactivation thru menus
91
92
93
94 Jun 04,2004 CRR:13601 xpradipg - SASKEN
95 Description: CFO interrogation display : Timer to long
96 Fix: Timer is enabled for the information dialog. It times out after 5 seconds from the last key
97 press.
98
99 Jun 03, 2004 CRR:13649 - xpradipg-SASKEN
100 subject: CBA : Management of password
101 solution: password is promted on selecting activation/deactivation option as against the previous
102 case where it was shown up on selecting CallBarring option in the Network Services
103
104
105 Issue Number : SPR#12882 on 29/03/04 by VadiRaj
106
107 25/10/00 Original Condat(UK) BMI version.
108
109 $End
110
111 *******************************************************************************/
112
113
114 /******************************************************************************
115
116 Include Files
117
118 *******************************************************************************/
119
120 #define BUGS 0
121
122 #define ENTITY_MFW
123
124 /* includes */
125 #include <string.h>
126 #include <stdio.h>
127 #include <stdlib.h>
128
129 #if defined (NEW_FRAME)
130
131 #include "typedefs.h"
132 #include "vsi.h"
133 #include "pei.h"
134 #include "custom.h"
135 #include "gsm.h"
136
137 #else
138
139 #include "STDDEFS.H"
140 #include "custom.h"
141 #include "gsm.h"
142 #include "vsi.h"
143
144 #endif
145 #include "prim.h"
146
147
148 #include "mfw_sys.h"
149 #include "mfw_mfw.h"
150 #include "mfw_win.h"
151 #include "mfw_kbd.h"
152 /* SPR#1428 - SH - New Editor changes */
153 #ifndef NEW_EDITOR
154 #include "mfw_edt.h"
155 #endif /* NEW_EDITOR */
156 #include "mfw_lng.h"
157 #include "mfw_icn.h"
158 #include "mfw_tim.h"
159 #include "mfw_mnu.h"
160 #include "mfw_phb.h"
161 #include "mfw_sat.h"
162 #include "mfw_ffs.h"
163 #include "ksd.h"
164 #include "psa.h"
165 #include "mfw_sms.h"
166 #include "mfw_sim.h"
167 #include "mfw_nm.h"
168 #include "mfw_cm.h"
169 #include "mfw_ss.h"
170 #include "dspl.h"
171 #include "MmiMmi.h"
172 #include "MmiDummy.h"
173 #include "MmiDialogs.h"
174 #include "MmiLists.h"
175 #include "MmiMain.h"
176 #include "MmiStart.h"
177 #include "MmiPins.h"
178 #include "MmiIdle.h"
179 #include "MmiMenu.h"
180 #include "MmiSoftKeys.h"
181 #include "Mmiicons.h"
182 #include "mmiCall.h"
183 #include "MmiServices.h"
184 /* SPR#1428 - SH - New Editor changes */
185 #ifdef NEW_EDITOR
186 #include "ATBCommon.h"
187 #include "ATBDisplay.h"
188 #include "ATBEditor.h"
189 #include "AUIEditor.h"
190 #include "AUITextEntry.h"
191 #else /* NEW_EDITOR */
192 #include "MmiEditor.h"
193 #endif /* NEW_EDITOR */
194
195 #include "MmiCPHS.h"
196
197
198 #include "MmiBookUtils.h"
199 #include "MmiBookShared.h " // MZ 26/02/01
200 #include "cus_aci.h"
201
202 #include "prim.h"
203 #ifndef PCM_2_FFS
204 #include "pcm.h"
205 #endif
206
207
208 #include "mmiColours.h"
209 #include "aci_cmh.h" // Marcus: Issue 1494: 18/12/2002: for MAX_USSD_LEN
210
211 //gprads CQ-16432
212 #include "AUIEditor_i.h"
213 extern void msgsGetVoiceAddress(CHAR *Buffer);
214 extern void InfoDialogTimRestart(T_MFW_HND win);
215
216 static void (*show) (void);
217
218 static void showWait (T_MFW_HND win);
219 static void showOk (T_MFW_HND win);
220 static void showFailed (T_MFW_HND win);
221 static void showError (T_MFW_HND win, T_MFW_SS_ERROR ss_error);
222 static void showCLIStatus (T_MFW_HND win, T_MFW_SS_PARA * ss_cnf );
223 static void showSSNotify (T_MFW_HND win, T_MFW_SS_NOTIFY * ss_notify);
224
225
226
227 static void showIMEI2 (T_MFW_HND win, T_MFW_SS_PARA * ss_cnf);
228 static void showUSSDREQ (T_MFW_HND win, T_MFW_SS_PARA * ss_cnf);
229 static void showUSSDCNF (T_MFW_HND win, T_MFW_SS_PARA * ss_cnf);
230 static void showUSSDEnter (void);
231 static void showUSSDFull (T_MFW_HND win);
232 static void sendUSSD (T_MFW_SS_PARA *ussd_senddata);
233 static int servicesSendCallDivert(char * divert_number);
234 int servicesUSSDEdit(struct MfwMnuTag* m, struct MfwMnuItemTag* i);
235 int servicesUSSDDelete(struct MfwMnuTag* m, struct MfwMnuItemTag* i);
236 static void servicesShowUSSDMenu(void);
237 static void servicesStoreUSSD(void);
238
239 static void ServicesGetOtherNumber(T_MFW_HND win);
240 static void servicesStoreVoiceMailNumber( void );
241 #ifdef NEW_EDITOR
242 static void services_get_voice_number_cb(T_MFW_HND win, USHORT identifier, SHORT reason);
243 #else /* NEW_EDITOR */
244 static void services_get_voice_number_cb(T_MFW_HND win, USHORT reason);
245 #endif /* NEW_EDITOR */
246
247 typedef struct
248 {
249 T_MMI_CONTROL mmi_control;
250 T_MFW_HND parent_win;
251 T_MFW_HND info_win;
252 T_MFW_HND info_tim;
253 T_MFW_HND info_kbd;
254 T_MFW_HND info_kbd_long;
255 USHORT LeftSoftKey; /* used for Ok */
256 USHORT RightSoftKey; /* Used for Back */
257 ULONG Time;
258 T_MFW_EVENT KeyEvents;
259 USHORT TextId1; /* Line 1 */
260 USHORT TextId2; /* Line 2 */
261 char * TextString4;
262 USHORT Identifier;
263 T_VOID_FUNC Callback;
264 } T_dialog_ext_info;
265
266 T_MFW_HND dialog_ext_info_dialog (T_MFW_HND parent_win,
267 T_dialog_ext_info * display_info);
268
269 static MfwHnd lastFocus; /* store old focus */
270 static MfwHnd win; /* our window */
271 static MfwHnd kbd; /* our keyboard handler */
272 static MfwHnd times; /* timeout */
273
274 static MmiState nextState; /* next state when finished */
275 static int servicesState; /* current state of module */
276
277
278 static T_MFW_SS_PARA *ss_cnf; /* union container for all SS confirmations */
279
280 /* decode service type - tele/bearer */
281 static unsigned int serviceGetServiceType( UBYTE ss_telecom_type, UBYTE ss_telecom_service);
282 static unsigned int serviceGetCategory( T_MFW_SS_CATEGORY cat );
283 static unsigned int serviceGetType( T_MFW_SS_CODES type );
284 static unsigned int ServiceGetStatus( UBYTE pStatus);
285 static unsigned int serviceGetError( T_MFW_SS_ERROR ss_error);
286
287
288
289 #define SS_STAT_NONE 0 //xvilliva 18409, not registered, not active,
290 //not provisioned,not quiescent
291
292
293
294 #define CB_PSW_LEN 4
295 //June 17, 2004 - CRR:13650 - CBA : no basic service sent when using the menu
296 //basic service code for "all teleservices"
297 #define BASIC_SERVICE_CODE "10"
298 int ss_Code;
299 // Jun 10, 2004 REF: CRR MMI-SPR-13614 Rashmi C N(Sasken)
300 // ss_Code-- This holds the current CF code for which the activation/deactivation or the staus is being checked
301 // This would be used while displaying the status or activation/deactivation message
302
303
304 typedef enum
305 {
306 CFBusy = 0,
307 CFNoReach,
308 CFNoReply,
309 CFAllConditional,
310 CFUnconditional,
311 CFAllCalls
312 } SERVICE_CF_TYPE;
313
314 typedef enum
315 {
316 CBAllOutgoing = 0,
317 CBInternational,
318 CBInternationalHome,
319 CBAllIncoming,
320 CBIncomingRoaming
321 } SERVICE_CB_TYPE;
322
323
324
325 typedef enum
326 {
327 CFVoice = 0,
328 CFAuxVoice, /*MC, ALS line 2*/
329 CFFax,
330 CFData,
331 CFAll
332 } SERVICE_CF_SERVICE;
333
334 typedef enum
335 {
336 CFActivate = 0,
337 CFDeactivate,
338 CFCheck
339 } SERVICE_CF_ACTION;
340
341 typedef enum
342 {
343 CBActivate = 0,
344 CBDeactivate,
345 CBCheck,
346 CBCheckPassword,
347 CBNewPassword,
348 CBConfirmNewPassword,
349 //Jun 02, 2004 CRR:13649 - xpradipg-SASKEN
350 //added for holding the state for callbarring service
351 //CQ-13649:start
352 CBCancelAll,
353 CBActionNone,
354 //CQ-13649:end
355 //CQ-16432 start
356 CBEnterSatPassword
357 //CQ-16432 end
358 } SERVICE_CB_ACTION;
359
360
361
362 /* NOTE that these are needed in new architecture */
363 static SERVICE_CF_TYPE CFType; /* Type of Call Forwarding */
364 static SERVICE_CF_SERVICE CFService; /* basic service for Call Forwarding */
365 static SERVICE_CF_ACTION CFAction; /* action for Call Forwarding */
366 static SERVICE_CB_TYPE CBType; /* Type of Call Barring */
367 static SERVICE_CB_ACTION CBAction; /* action for Call Barring */
368 //Jun 02, 2004 CRR:13649 - xpradipg-SASKEN
369 //new enum added to indicate the action to be taken in the callback function for password
370 static SERVICE_CB_ACTION CBFlag; /*to indicate the action after retriving the password*/
371 //CRR:13649
372 static char CFNumber[MAX_LEN]; /* number to forward calls to */
373
374
375
376 /* end of bits for USSD */
377
378
379
380 #define CF_ACTIVE_STATUS 1
381 #define CF_INACTIVE_STATUS 2
382 /* Marcus: Issue 1652: 03/02/2003 */
383 #define CF_PROVISIONED_STATUS 3
384 #define CF_UNKNOWN_STATUS 4
385
386 #define MAX_SS_CF_NUM_LEN 16
387
388 typedef struct
389 {
390 USHORT service;
391 USHORT status;
392 char forwarded_to_number[MAX_SS_CF_NUM_LEN];
393 } T_ss_feature_cf_data;
394
395 typedef struct
396 {
397 T_ss_feature_cf_data ss[MFW_MAX_FEAT_NR];
398 } T_ss_feature_cf;
399
400
401 typedef struct
402 {
403 USHORT service;
404 } T_ss_feature_cw_data;
405
406 typedef struct
407 {
408 USHORT status;
409 T_ss_feature_cw_data ss[MFW_MAX_FEAT_NR];
410 } T_ss_feature_cw;
411
412 typedef struct
413 {
414 USHORT service;
415 USHORT status;
416 } T_ss_feature_cb_data;
417
418 typedef struct
419 {
420 T_ss_feature_cb_data ss[MFW_MAX_FEAT_NR];
421 } T_ss_feature_cb;
422
423 typedef struct
424 {
425 T_MMI_CONTROL mmi_control;
426 T_MFW_HND win; // window handle
427 T_MFW_HND ss_handle; /* MFW services handler */
428 T_MFW_HND kbd;
429 T_MFW_HND kbd_long;
430 // T_MFW_CM_AOC_INFO aocInfo;
431 T_MFW_HND info_win; /* handle to info dialog */
432 T_MFW_HND info_wait; /* handle to wait dialog */
433 T_MFW_HND cb_menu_win; /* handle to ussd number dialog */
434 T_MFW_HND input_number_win; /* handle to call forward dialog */
435
436 USHORT event;
437 char edt_buf_name[MAX_ALPHA_LEN];/*MC SPR 1257*/
438 char edt_buf_number[PHB_MAX_LEN];
439 char edt_buf_cb_password[CB_PSW_LEN+1];
440 char edt_buf_cb_new_password[CB_PSW_LEN+1];
441 char edt_buf_cb_conf_new_password[CB_PSW_LEN+1];
442 #ifndef NEW_EDITOR /* SPR#1428 - SH - New Editor changes - no longer required */
443 MfwEdtAttr edt_attr_name;
444 MfwEdtAttr edt_attr_number;
445 #endif /* ifndef NEW_EDITOR */
446 T_ss_feature_cf * mfw_ss_cf;
447 T_ss_feature_cw * mfw_ss_cw;
448 T_ss_feature_cb * mfw_ss_cb;
449 UBYTE current_feature;
450 UBYTE max_feature;
451 UBYTE dcs; /* need it for sending ussd to mfw */
452
453 /*
454 ** NDH : 28/08/2003
455 **
456 ** cfu_services is a binary flag to determine which (if any) of the Call Frwd Uncond
457 ** services are active. The map is as follows :
458 ** bit 0 : Voice Calls ( & 0x01)
459 ** bit 1 : Fax Calls ( & 0x02)
460 ** bit 2 : Data Calls ( & 0x04)
461 ** bit 3 : SMS ( & 0x08)
462 ** bit 4 : unused - for future expansion
463 ** bit 5 : unused - for future expansion
464 ** bit 6 : unused - for future expansion
465 ** bit 7 : unused - for future expansion
466 */
467 UBYTE cfu_services;
468 } T_ss;
469
470 #define MFW_CFU_VOICE_ACTIVE 0x01
471 #define MFW_CFU_FAX_ACTIVE 0x02
472 #define MFW_CFU_DATA_ACTIVE 0x04
473 #define MFW_CFU_SMS_ACTIVE 0x08
474
475 #define MFW_CFU_ALL_SERVICES_ACTIVE (MFW_CFU_VOICE_ACTIVE | MFW_CFU_FAX_ACTIVE | MFW_CFU_DATA_ACTIVE | MFW_CFU_SMS_ACTIVE)
476 #define MFW_CFU_ALL_BASIC_SERVICES_ACTIVE (MFW_CFU_VOICE_ACTIVE | MFW_CFU_FAX_ACTIVE | MFW_CFU_DATA_ACTIVE)
477
478 T_ss ss_data = {0};
479 char satPassword[10]={0};//CQ-16432
480
481 static void srv_empty_list_result (UBYTE ss_category, USHORT event, UBYTE ss_status, UBYTE ss_code); /* Marcus: Issue 1652: 03/02/2002 */
482 static void showCFStatus (T_MFW_HND win , T_ss * data );
483 static UBYTE srv_copy_feature_list_cf (T_ss_feature_cf * out_list, T_MFW_SS_CF_CNF * in_list);
484 static void srv_get_forwarded_to_number ( char * textString,
485 char * forwarded_to_number,
486 UBYTE max_chars);
487 static UBYTE srv_get_service_type ( USHORT * textId,
488 UBYTE ss_telecom_type, UBYTE ss_telecom_service);
489 static void srv_get_status (USHORT *textId, UBYTE pStatus);
490 static UBYTE srv_check_CF_telephony_status (T_MFW_SS_CF_CNF * in_list);
491
492 static void showCWStatus (T_MFW_HND win, T_ss * data );
493 static UBYTE srv_copy_feature_list_cw (T_ss_feature_cw * out_list, T_MFW_SS_CW_CNF * in_list);
494
495 static void showCBStatus (T_MFW_HND win, T_ss * data );
496 static UBYTE srv_copy_feature_list_cb (T_ss_feature_cb * out_list, T_MFW_SS_CB_CNF * in_list);
497
498
499 static int services_win_cb(T_MFW_EVENT e, T_MFW_SS_PARA * para);
500 static int services_ss_cb(T_MFW_EVENT e, T_MFW_HND para);
501
502 static int services_info_cb(T_MFW_HND win, USHORT identifier, UBYTE reason);
503
504
505 static void srv_display_status (UBYTE ss_status);
506
507
508
509 typedef struct
510 {
511 int text;
512 #ifdef NEW_EDITOR /* SPR#1428 - SH - New Editor changes */
513 T_ED_ATTR *editor_attr_input;
514 #else /* NEW_EDITOR */
515 MfwEdtAttr* edt_attr_input;
516 #endif /* NEW_EDITOR */
517 int left_soft_key;
518 int right_soft_key;
519 short abc; /* numeric or alpha? */
520 #ifdef NEW_EDITOR /* SPR#1428 - SH - New Editor changes */
521 T_AUI_EDIT_CB callback;
522 #else /* NEW_EDITOR */
523 void (* callback)(T_MFW_HND win,USHORT reason);
524 #endif /* NEW_EDITOR */
525 } T_input_properties;
526
527
528
529
530 typedef struct
531 {
532 T_MMI_CONTROL mmi_control;
533 T_MFW_HND parent_win;
534 T_MFW_HND win;
535 T_MFW_HND kbd;
536 T_MFW_HND kbd_long;
537 #ifdef NEW_EDITOR /* SPR#1428 - SH - New Editor changes */
538 T_MFW_HND edit_win;
539 #else /* NEW_EDITOR */
540 T_MFW_HND edt_input;
541 #endif /* NEW_EDITOR */
542 T_input_properties properties;
543 } T_services_input;
544
545 /* SPR#1428 - SH - New Editor changes - no longer required*/
546 #ifndef NEW_EDITOR
547 void services_number_input_cb(T_MFW_HND win, UBYTE identifier, USHORT reason);
548 #endif
549
550
551
552 static T_MFW_HND services_input_create (MfwHnd parent);
553 static void services_input_destroy (MfwHnd window);
554 static MfwHnd services_input_start(MfwHnd parent,T_input_properties *properties);
555 void services_input (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
556 static int services_input_win_cb(MfwEvt e, MfwWin *w);
557
558 /* SPR#1428 - SH - New Editor changes - no longer required*/
559 #ifndef NEW_EDITOR
560 static int services_input_kbd_cb(MfwEvt e, MfwKbd *k);
561 static int services_input_kbd_long_cb(MfwEvt e, MfwKbd *k);
562 #endif
563
564
565
566 /* editor */
567 //GW Moved editor definitions to MmiResources.h
568 #define SAT_EDITOR_COLOR 0
569 #define SAT_EDITOR_FONT 0
570 #define SAT_EDITOR_CONTROLS 0
571 #define SAT_EDITOR_BUFFER_SIZE 32
572 /* */
573
574 // May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
575 #ifdef FF_MMI_ATC_MIGRATION
576 #define IMEI_LEN 15
577 #endif
578
579 /*******************************************************************************
580
581 $Function: servicesInit
582
583 $Description:
584
585 $Returns:
586
587 $Arguments:
588
589 *******************************************************************************/
590
591
592
593 T_MFW_HND servicesInit (T_MFW_HND parent)
594 {
595
596 TRACE_FUNCTION("servicesInit function");
597
598 /*
599 * Initialise MFW
600 */
601 ss_mfw_init();
602 /*
603 * Create any other handler
604 */
605 //16432
606 //Changed ss_create(0,0xFFFF,....)
607 ss_data.ss_handle = ss_create (0,
608 0xFFFF,
609 (T_MFW_CB)services_ss_cb);
610
611 ss_data.win = 0;
612 return (services_create (0));
613
614
615 }
616
617
618 /*******************************************************************************
619
620 $Function: servicesExit
621
622 $Description: exit services handling
623
624 $Returns:
625
626 $Arguments:
627
628 *******************************************************************************/
629
630
631
632 void servicesExit (void)
633 {
634 TRACE_FUNCTION("servicesExit");
635
636 ss_delete(ss_data.win);
637 ss_exit();
638 }
639
640
641 /*******************************************************************************
642
643 $Function: services_create
644
645 $Description: Creation of an instance for the Services dialog.
646
647 $Returns:
648
649 $Arguments:
650
651 *******************************************************************************/
652
653
654 T_MFW_HND services_create (T_MFW_HND parent_window)
655 {
656 T_ss * data = &ss_data;
657 T_MFW_WIN * win;
658
659 TRACE_FUNCTION("services_create");
660
661 data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)services_win_cb);
662
663 if (data->win EQ 0)
664 return 0;
665
666 /*
667 * Create window handler
668 */
669 data->mmi_control.dialog = (T_DIALOG_FUNC)services;
670 data->mmi_control.data = data;
671 win = ((T_MFW_HDR *)data->win)->data;
672 win->user = (void *) data;
673
674 /*
675 * Create any other handler
676 */
677 data->info_win = 0;
678 data->info_wait = 0;
679 data->cb_menu_win = 0;
680
681 /* SPR#1428 - SH - New Editor changes - this editor never used */
682 #if 0
683 data->ussd_num_win = 0;
684 data->ussd_name_win = 0;
685 #endif
686
687 data->input_number_win = 0;
688 memset(data->edt_buf_name,'\0',sizeof(data->edt_buf_name));
689 memset(data->edt_buf_number,'\0',sizeof(data->edt_buf_number));
690 memset(data->edt_buf_cb_password,'\0',sizeof(data->edt_buf_number));
691 /* SPR#1428 - SH - New Editor changes - no longer required*/
692 #ifndef NEW_EDITOR
693 bookSetEditAttributes(SERVICE_CREATE_EDITOR,COLOUR_EDITOR_XX,0,edtCurBar1,0,(char*)data->edt_buf_name,PHB_MAX_LEN,&data->edt_attr_name);
694 bookSetEditAttributes(SERVICE_CREATE_EDITOR,COLOUR_EDITOR_XX,0,edtCurBar1,0,(char*)data->edt_buf_number,PHB_MAX_LEN,&data->edt_attr_number);
695 #endif /* ifndef NEW_EDITOR */
696
697 /* NDH : 28/08/2003 : Intialise cfu_services to "ALL Inactive" */
698 data->cfu_services = 0;
699
700 winShow (data->win);
701
702 /*
703 * return window handle
704 */
705 return data->win;
706 }
707
708
709 /*******************************************************************************
710
711 $Function: services_destroy
712
713 $Description:
714
715 $Returns:
716
717 $Arguments:
718
719 *******************************************************************************/
720
721
722 void services_destroy (T_MFW_HND own_window)
723 {
724 // T_MFW_WIN * win; // RAVI
725 T_ss * data = &ss_data;
726
727 TRACE_FUNCTION("=== services_destroy");
728
729 if (data)
730 {
731 /*
732 * Delete WIN Handler
733 */
734
735 if (data->info_win)
736 {
737 SEND_EVENT(data->info_win, DIALOG_DESTROY, 0, 0);
738 data->info_win=0;
739 }
740 if (ss_data.info_wait)
741 {
742 TRACE_FUNCTION("destroying the wait screen b");
743 SEND_EVENT(ss_data.info_wait, DIALOG_DESTROY, 0, 0);
744 ss_data.info_wait = 0;
745 }
746
747
748 if (data->input_number_win)
749 {
750 TRACE_FUNCTION("killing input number win");
751 services_input_destroy( data->input_number_win );
752 data->input_number_win=0;
753 }
754 }
755 }
756
757 /*******************************************************************************
758
759 $Function: services_win_cb
760
761 $Description:
762
763 $Returns:
764
765 $Arguments:
766
767 *******************************************************************************/
768
769 static int services_win_cb(T_MFW_EVENT e, T_MFW_SS_PARA * para)
770 {
771 /*
772 * Top Window has no output
773 */
774 TRACE_FUNCTION ("services_win_cb()");
775 switch (e)
776 {
777 case MfwWinVisible:
778 break;
779 default:
780 return 0;
781 }
782 return 1;
783
784 }
785
786 /*******************************************************************************
787
788 $Function: destroyInfoWindow
789
790 $Description:
791
792 $Returns:
793
794 $Arguments:
795
796 *******************************************************************************/
797
798 static void destroyInfoWindow( void)
799 {
800 TRACE_FUNCTION("destroyInfoWindow");
801
802 /* kill info win if there */
803 if (ss_data.info_wait)
804 {
805 TRACE_FUNCTION("destroying the wait screen a");
806 SEND_EVENT(ss_data.info_wait, DIALOG_DESTROY, 0, 0);
807 ss_data.info_wait = 0;
808 }
809 if (ss_data.input_number_win)
810 {
811 TRACE_FUNCTION("destroying input window!!!");
812 SEND_EVENT(ss_data.input_number_win, SERVICES_INPUT_DESTROY, 0, 0);
813 ss_data.input_number_win = 0;
814 }
815
816 }
817 /*******************************************************************************
818
819 $Function: services_ss_cb
820
821 $Description:
822
823 $Returns:
824
825 $Arguments:
826
827 *******************************************************************************/
828
829
830 static int services_ss_cb(T_MFW_EVENT e, T_MFW_HND para)
831 {
832
833 TRACE_FUNCTION ("services_ss_cb()");
834
835 {
836 // T_MFW_WIN * win; // RAVI
837 // win = (T_MFW_WIN *) ((T_MFW_HDR *)ss_data.win)->data; // RAVI
838 }
839
840 switch (e)
841 {
842 case E_SS_RES:
843 if (!ss_data.info_wait)
844 {
845 TRACE_FUNCTION ("show the wait screen");
846 showWait( ss_data.win );
847 }
848 /*
849 * ignore the event
850 */
851 break;
852
853 case E_SS_NOTIFY:
854 if(!ss_data.info_win)
855 SEND_EVENT(ss_data.win,E_SS_NOTIFY,0, para);
856
857 destroyInfoWindow();
858 break;
859
860 case E_SS_CF_CNF:
861
862 if(!ss_data.info_win)
863 SEND_EVENT(ss_data.win,E_SS_CF_CNF,0, para);
864
865 destroyInfoWindow();
866 break;
867
868 case E_SS_CF_ICN_UPD:
869
870 if(!ss_data.info_win)
871 SEND_EVENT(ss_data.win,E_SS_CF_ICN_UPD,0, para);
872
873 destroyInfoWindow();
874 break;
875
876 case E_SS_CW_CNF:
877 if(!ss_data.info_win)
878 SEND_EVENT(ss_data.win,E_SS_CW_CNF,0, para);
879
880 destroyInfoWindow();
881 break;
882
883 case E_SS_CLI_CNF:
884 if(!ss_data.info_win)
885 SEND_EVENT(ss_data.win,E_SS_CLI_CNF,0, para);
886
887 destroyInfoWindow();
888 break;
889
890 case E_SS_CB_CNF:
891 if(!ss_data.info_win)
892 SEND_EVENT(ss_data.win,E_SS_CB_CNF,0, para);
893
894 destroyInfoWindow();
895 break;
896
897 /* we must display the ussd info and then edit and send a user ussd */
898 case E_SS_USSD_REQ:
899
900 if(!ss_data.info_win)
901 SEND_EVENT(ss_data.win,E_SS_USSD_REQ,0, para);
902
903 destroyInfoWindow();
904 break;
905
906 /* just display the ussd info */
907 case E_SS_USSD_CNF:
908
909 if(!ss_data.info_win)
910 SEND_EVENT(ss_data.win,E_SS_USSD_CNF,0, para);
911
912 destroyInfoWindow();
913 break;
914
915 case E_SS_IMEI:
916
917 if(!ss_data.info_win)
918 SEND_EVENT(ss_data.win,E_SS_IMEI,0, para);
919
920 destroyInfoWindow();
921 break;
922
923
924 case E_SS_GET_PW:
925
926 if(!ss_data.info_win)
927 SEND_EVENT(ss_data.win,E_SS_GET_PW,0, para);
928
929 destroyInfoWindow();
930 break;
931 //CQ-16432 - start
932 case E_SS_SAT_CPWD:
933 TRACE_EVENT("Received event E_SS_SAT_CPWD in BMI");
934 if(!ss_data.info_win)
935 SEND_EVENT(ss_data.win,E_SS_SAT_CPWD,0, para);
936 destroyInfoWindow();
937 break;
938 //CQ-16432 - end
939 default:
940 break;
941 }
942
943 return 1; /* consumed */
944 }
945
946
947 /*******************************************************************************
948
949 $Function: services
950
951 $Description:
952
953 $Returns:
954
955 $Arguments:
956
957 *******************************************************************************/
958
959 void services (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
960 {
961 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
962 T_ss * data = (T_ss *)win_data->user;
963
964 T_MFW_SS_PARA * ss_cnf = (T_MFW_SS_PARA *)parameter;
965
966 // unsigned int i = 0; // RAVI
967
968 // char line[MAX_LINE]; // RAVI
969
970 TRACE_FUNCTION ("services()");
971
972 switch (event)
973 {
974
975
976 case ServicesError:
977 TRACE_FUNCTION ("ServicesError");
978 showError(win, ss_cnf->cb_cnf.ss_error);
979 break;
980
981 case ServicesFailed:
982 TRACE_FUNCTION ("ServicesFailed");
983 showFailed(win);
984 break;
985
986 case ServicesOtherNumber:
987 TRACE_FUNCTION("ServicesOtherNumber");
988 ServicesGetOtherNumber(win);
989 break;
990
991 case ServicesOk:
992 TRACE_FUNCTION ("ServicesOk");
993 showOk(win);
994 break;
995
996 case ServicesUSSDEnter:
997 {
998 #ifdef NEW_EDITOR
999 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
1000 #else
1001 T_EDITOR_DATA editor_data;
1002 #endif /* NEW_EDITOR */
1003
1004 TRACE_FUNCTION("ServicesUSSDEnter");
1005
1006 memset(ss_data.edt_buf_number,'\0',PHB_MAX_LEN);
1007
1008 /* SPR#1428 - SH - New Editor changes */
1009 #ifdef NEW_EDITOR /* NEW_EDITOR */
1010 AUI_edit_SetDefault(&editor_data);
1011 AUI_edit_SetDisplay(&editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR_XX, EDITOR_FONT);
1012 AUI_edit_SetMode(&editor_data, 0, ED_CURSOR_UNDERLINE);
1013 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)ss_data.edt_buf_number, MAX_USSD_LEN);
1014 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtSoftBack, TxtEntAnw, NULL);
1015 AUI_edit_SetAltTextStr(&editor_data, 1, TxtNull, FALSE, TxtNull);
1016 AUI_edit_SetEvents(&editor_data, ServicesUSSDEnter, TRUE, FOREVER, (T_AUI_EDIT_CB)services_info_cb);
1017
1018 AUI_edit_Start(ss_data.win, &editor_data); /* start the editor */
1019 #else /* NEW_EDITOR */
1020 editor_data.editor_attr.win.px = 6;
1021 editor_data.editor_attr.win.py = 12;
1022 editor_data.editor_attr.win.sx = 80;
1023 editor_data.editor_attr.win.sy = 20;
1024 editor_data.editor_attr.edtCol = COLOUR_EDITOR_XX,
1025 editor_data.editor_attr.font = 0;
1026 editor_data.editor_attr.mode = edtCurBar1;
1027 editor_data.editor_attr.controls = 0;
1028 editor_data.hide = FALSE;
1029
1030 editor_data.editor_attr.text = (char*)ss_data.edt_buf_number;
1031
1032 editor_data.editor_attr.size = sizeof(ss_data.edt_buf_number);
1033 editor_data.LeftSoftKey = TxtSoftOK;
1034 editor_data.RightSoftKey = TxtSoftBack;
1035 editor_data.AlternateLeftSoftKey = TxtNull;
1036 editor_data.TextString = '\0';
1037 editor_data.TextId = TxtEntAnw;
1038 editor_data.Identifier = ServicesUSSDEnter;
1039 editor_data.mode = DIGITS_MODE;
1040 editor_data.timeout = FOREVER;
1041 editor_data.min_enter = 1;
1042 editor_data.Callback = (T_EDIT_CB)services_info_cb;
1043 editor_data.destroyEditor = TRUE;
1044
1045
1046 /* create the dialog handler */
1047 editor_start(ss_data.win, &editor_data); /* start the editor */
1048 #endif /* NEW_EDITOR */
1049 }
1050 break;
1051
1052 case SERVICES_DO_CALL_VOICE_DIVERT:
1053 servicesStoreVoiceMailNumber();
1054 servicesSendCallDivert(0);
1055 break;
1056 case ServicesDoCallDivert:
1057 servicesSendCallDivert(0);
1058 break;
1059
1060 case E_SS_RES:
1061 /*
1062 * event is ignored
1063 */
1064 break;
1065 case E_SS_NOTIFY:
1066 TRACE_FUNCTION(" E_SS_NOTIFY");
1067 showSSNotify( win, (T_MFW_SS_NOTIFY*) parameter ); /* all short ss-related notfications */
1068 break;
1069
1070 case E_SS_CF_ICN_UPD:
1071 TRACE_FUNCTION("E_SS_CF_ICN_UPD");
1072
1073 if ((ss_cnf->cf_cnf.ss_code == SS_CF_CFU) ||
1074 (ss_cnf->cf_cnf.ss_code == SS_CF_ALL))
1075 {
1076 /*
1077 * Update icons for idle screen if CFU and telephony
1078 */
1079 switch (srv_check_CF_telephony_status ( &ss_cnf->cf_cnf ))
1080 {
1081 case CF_ACTIVE_STATUS:
1082 iconsSetState(iconIdCallFor);
1083 // Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
1084 // Setting the Current state of CF in Flash
1085 FFS_flashData.CFState=TRUE;
1086 break;
1087
1088 case CF_INACTIVE_STATUS:
1089 iconsDeleteState(iconIdCallFor);
1090 // Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
1091 // Setting the Current state of CF in Flash
1092 FFS_flashData.CFState=FALSE;
1093 break;
1094 }
1095 // Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
1096 // Writng the Current state of CF into ffs
1097 flash_write();
1098 idleEvent(IdleUpdate);
1099 }
1100 break;
1101 /*
1102 * modified handling for results taking lists in account
1103 */
1104 case E_SS_CF_CNF:
1105 /*
1106 * check whether we received data what was requested / consistent
1107 */
1108 switch(ss_cnf->cf_cnf.ss_code)
1109 {
1110 case SS_CODES_UNKNOWN:
1111 /* Marcus: Issue 1652: 03/02/2003: Start */
1112 TRACE_EVENT("SS_CODES_UNKNOWN");
1113 {
1114 T_DISPLAY_DATA display_info;
1115 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, TxtNull, TxtExecuted, COLOUR_STATUS);
1116 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FOREVER, KEY_CLEAR | KEY_LEFT );
1117 display_info.Identifier = E_SS_CF_CNF; // can be used also for CF and CW
1118
1119 /*
1120 * Call Info Screen
1121 */
1122
1123 ss_data.info_win = info_dialog (ss_data.win, &display_info);
1124 }
1125 /* Marcus: Issue 1652: 03/02/2003: End */
1126 break;
1127 case SS_CF_CFU:
1128 case SS_CF_ALL:
1129 TRACE_EVENT("SS_CF_CFU/SS_CF_ALL");
1130 /*
1131 * Update icons for idle screen if CFU and telephony
1132 */
1133 switch (srv_check_CF_telephony_status ( &ss_cnf->cf_cnf ))
1134 {
1135 case CF_ACTIVE_STATUS:
1136 iconsSetState(iconIdCallFor);
1137 // Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
1138 // Setting the Current state of CF in Flash
1139 FFS_flashData.CFState=TRUE;
1140 break;
1141
1142 case CF_INACTIVE_STATUS:
1143 iconsDeleteState(iconIdCallFor);
1144 // Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
1145 // Setting the Current state of CF in Flash
1146 FFS_flashData.CFState=FALSE;
1147 break;
1148 }
1149 // Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
1150 // Writng the Current state of CF into ffs
1151 flash_write();
1152 /*
1153 * no break
1154 */
1155 case SS_CLIR:
1156 case SS_CF_ALL_COND:
1157 case SS_CF_CFNRy:
1158 case SS_CF_CFNR:
1159 case SS_CF_CFB:
1160 switch(ss_cnf->cf_cnf.ss_error)
1161 {
1162 case MFW_SS_NO_ERROR:
1163 /*
1164 * now store the MFW data under the SS window
1165 */
1166 data->mfw_ss_cf = (T_ss_feature_cf *)ALLOC_MEMORY (sizeof (T_ss_feature_cf));
1167
1168 /*
1169 * copy all interesting feature entries
1170 */
1171 data->max_feature = srv_copy_feature_list_cf (data->mfw_ss_cf, &ss_cnf->cf_cnf);
1172 data->current_feature = /*CFService*/0;
1173
1174
1175 if (data->max_feature EQ 0)
1176 {
1177 /* Marcus: Issue 1652: 03/02/2003: Start */
1178 if (ss_cnf->cf_cnf.ss_feature_count)
1179 {
1180 T_MFW_FEATURE *temp = ss_cnf->cf_cnf.ss_feature_list;
1181 srv_empty_list_result (ss_cnf->cf_cnf.ss_category, event, temp->ss_status, ss_cnf->cf_cnf.ss_code);
1182 }
1183 else
1184 {
1185 srv_empty_list_result (ss_cnf->cf_cnf.ss_category, event, 0, ss_cnf->cf_cnf.ss_code);
1186 }
1187 /* Marcus: Issue 1651: 03/02/2003: End */
1188 FREE_MEMORY ((void *)data->mfw_ss_cf, sizeof (T_ss_feature_cf));
1189 data->mfw_ss_cf = NULL;
1190 }
1191 else
1192 {
1193 /*
1194 * now display status
1195 */
1196 // Jun 10, 2004 REF: CRR MMI-SPR-13614 Rashmi C N(Sasken)
1197 // ss_Code-- This holds the current CF code for which the activation/deactivation or the staus is being checked
1198 // This would be used while displaying the status or activation/deactivation message
1199 ss_Code=ss_cnf->cf_cnf.ss_code;
1200 showCFStatus(win, data);
1201 }
1202 break;
1203
1204 default:
1205 TRACE_FUNCTION("ERROR in CFU,INTERROGATION");
1206 showError(win, ss_cnf->cf_cnf.ss_error);
1207 break;
1208 }
1209 break;
1210
1211 default:
1212 break;
1213 } /* end switch(ss_cnf->cf_cnf.ss_code) */
1214 break;
1215
1216
1217 case E_SS_CW_CNF:
1218 if (ss_cnf->cw_cnf.ss_error == MFW_SS_NO_ERROR)
1219 {
1220 /*
1221 * now store the MFW data under the SS window
1222 */
1223 data->mfw_ss_cw = (T_ss_feature_cw *)ALLOC_MEMORY (sizeof (T_ss_feature_cw));
1224
1225 /*
1226 * copy all interesting feature entries
1227 */
1228 data->max_feature = srv_copy_feature_list_cw (data->mfw_ss_cw, &ss_cnf->cw_cnf);
1229 data->current_feature = 0;
1230
1231 if (data->max_feature EQ 0)
1232 {
1233
1234
1235 if (ss_cnf->cw_cnf.ss_status NEQ 0xFF AND ss_cnf->cw_cnf.ss_status NEQ 0x00)
1236 srv_display_status (ss_cnf->cw_cnf.ss_status);
1237 else
1238 srv_empty_list_result (ss_cnf->cw_cnf.ss_category, event, ss_cnf->cw_cnf.ss_status, ss_cnf->cf_cnf.ss_code); /* Marcus: Issue 1588: 23/01/2003 */
1239 FREE_MEMORY ((void *)data->mfw_ss_cw, sizeof (T_ss_feature_cw));
1240 data->mfw_ss_cw = NULL;
1241 }
1242 else
1243 {
1244 /*
1245 * now display status
1246 */
1247 if ((ss_cnf->cw_cnf.ss_status EQ SS_STAT_UNKNOWN) OR
1248 (ss_cnf->cw_cnf.ss_status EQ SS_STAT_NONE))
1249 {
1250 //SPR18409 xvilliva, If we receive the status as zero or 0xFF,
1251 //we show an alert saying "unknown status".
1252 info_screen(win, TxtUnknown, TxtStatus, NULL);
1253 }
1254 else
1255 {
1256 showCWStatus(win, data);
1257 }
1258 }
1259 }
1260 else
1261 {
1262 showError(win, ss_cnf->cw_cnf.ss_error);
1263 }
1264 break;
1265
1266 case E_SS_CLI_CNF:
1267 TRACE_FUNCTION(" E_SS_CLI_CNF");
1268
1269 if (ss_cnf->cli_cnf.ss_error == MFW_SS_NO_ERROR)
1270 {
1271 showCLIStatus(win, ss_cnf);
1272 }
1273 else
1274 {
1275 showError(win, ss_cnf->cli_cnf.ss_error);
1276 }
1277 break;
1278
1279
1280 case E_SS_CB_CNF:
1281 switch(ss_cnf->cb_cnf.ss_error)
1282 {
1283 case MFW_SS_NO_ERROR:
1284 /*
1285 * now store the MFW data under the SS window
1286 */
1287 data->mfw_ss_cb = (T_ss_feature_cb *)ALLOC_MEMORY (sizeof (T_ss_feature_cb));
1288
1289 /*
1290 * copy all interesting feature entries
1291 */
1292 data->max_feature = srv_copy_feature_list_cb (data->mfw_ss_cb, &ss_cnf->cb_cnf);
1293 data->current_feature = 0;
1294
1295 if (data->max_feature EQ 0)
1296 {
1297 srv_empty_list_result (ss_cnf->cb_cnf.ss_category, event, 0, ss_cnf->cf_cnf.ss_code); /* Marcus: Issue 1588: 23/01/2003 */
1298 FREE_MEMORY ((void *)data->mfw_ss_cb, sizeof (T_ss_feature_cb));
1299 data->mfw_ss_cb = NULL;
1300 }
1301 else
1302 {
1303 /*
1304 * now display status
1305 */
1306 showCBStatus(win, data);
1307 }
1308 break;
1309
1310 default:
1311 showError(win, ss_cnf->cb_cnf.ss_error);
1312 break;
1313 }
1314 break;
1315
1316 case E_SS_IMEI: /* present IMEI */
1317 /* T_MFW_IMEI imei_cnf;*/
1318 TRACE_FUNCTION(" E_SS_IMEI");
1319
1320 switch(ss_cnf->imei_info.error)
1321 {
1322 case MFW_SS_NO_ERROR:
1323 TRACE_FUNCTION( "Handling IMEI no error" );
1324 // May 02, 2005 REF : LOCOSTO-ENH-30818 - xpradipg
1325 // copy the IMEI onto the global variable and display the information
1326 #ifdef FF_MMI_ATC_MIGRATION
1327 memset(imei,0x00,IMEI_LEN+1);
1328 memcpy(imei, ss_cnf->imei_info.imei_number, IMEI_LEN);
1329 showIMEI(win,(char*)imei);
1330 #else
1331 showIMEI2(win, ss_cnf);
1332 #endif
1333 break;
1334
1335 default:
1336 TRACE_FUNCTION("ERROR in IMEI");
1337 showError(win, (T_MFW_SS_ERROR)ss_cnf->imei_info.error);
1338 break;
1339 }
1340 break;
1341
1342 /* we must display the ussd info and then edit and send a user ussd */
1343 case E_SS_USSD_REQ:
1344 TRACE_FUNCTION(" E_SS_USSD_REQ");
1345
1346 switch(ss_cnf->ussd_info.error)
1347 {
1348 case MFW_SS_NO_ERROR:
1349 TRACE_FUNCTION( "Handling USSD_REQ no error" );
1350 showUSSDREQ(win, ss_cnf );
1351 break;
1352
1353 default:
1354 TRACE_FUNCTION("ERROR in USSD REQ");
1355 showError(win, (T_MFW_SS_ERROR)ss_cnf->ussd_info.error);
1356 break;
1357 }
1358
1359 break;
1360
1361 /* just display the ussd info */
1362 case E_SS_USSD_CNF:
1363 TRACE_FUNCTION(" E_SS_USSD_CNF");
1364 switch(ss_cnf->ussd_info.error)
1365 {
1366 case MFW_SS_NO_ERROR:
1367 TRACE_FUNCTION( "Handling USSD_CNF no error" );
1368 showUSSDCNF(win, ss_cnf );
1369 break;
1370
1371 default:
1372 TRACE_FUNCTION("ERROR in USSD_CNF");
1373 showError(win, (T_MFW_SS_ERROR)ss_cnf->ussd_info.error);
1374 break;
1375 }
1376 break;
1377 case E_SS_GET_PW:
1378 if (ss_cnf->pw_cnf.ss_error == MFW_SS_NO_ERROR)
1379 {
1380 showOk(win);
1381 strncpy((char*)ss_data.edt_buf_cb_password,
1382 (char*)ss_cnf->pw_cnf.ss_new_pwd,CB_PSW_LEN);
1383 }
1384 else
1385 {
1386 showError(win, ss_cnf->pw_cnf.ss_error);
1387 }
1388 break;
1389 //CQ-16432 start
1390 case E_SS_SAT_CPWD:
1391 TRACE_EVENT("E_SS_SAT_CPWD");
1392 requestSatCBPassword();
1393 break;
1394 //CQ-16432 end
1395 default:
1396 return;
1397 }
1398
1399 }
1400
1401
1402 /*******************************************************************************
1403
1404 $Function: srv_check_CF_telephony_status
1405
1406 $Description:
1407
1408 $Returns:
1409
1410 $Arguments:
1411
1412 *******************************************************************************/
1413
1414 /*
1415 ** NDH : 28/08/2003 : I am modifying the functionality of this routine so that will simply return
1416 ** CF_ACTIVE_STATUS if there is an active Call Forwarding Service and CF_INACTIVE_STATUS
1417 ** otherwise. This function is currently used in only one place and this change would be in line
1418 ** with the required functionality at that point.
1419 */
1420
1421 static UBYTE srv_check_CF_telephony_status (T_MFW_SS_CF_CNF * in_list)
1422 {
1423 UBYTE i;
1424 UBYTE retStat = CF_INACTIVE_STATUS;
1425
1426 TRACE_EVENT("srv_check_CF_telephony_status");
1427
1428 if (in_list->ss_error == MFW_SS_NO_ERROR)
1429 {
1430 if (in_list->ss_feature_count)
1431 {
1432 for (i=0;i<in_list->ss_feature_count;i++)
1433 {
1434 T_MFW_FEATURE * pFeature = &in_list->ss_feature_list[i];
1435
1436 if (pFeature->ss_telecom_type == MFW_BST_TELE)
1437 {
1438 switch(pFeature->ss_telecom_service)
1439 {
1440 case MFW_TS_ALL_SPCH:
1441 case MFW_TS_TLPHNY:
1442 case MFW_TS_EMRGNCY:
1443
1444 TRACE_EVENT("Speech Tele Service");
1445
1446 if (pFeature->ss_status & SS_STAT_ACTIVE)
1447 ss_data.cfu_services |= MFW_CFU_VOICE_ACTIVE;
1448 else
1449 ss_data.cfu_services &= (MFW_CFU_ALL_SERVICES_ACTIVE - MFW_CFU_VOICE_ACTIVE);
1450 break;
1451
1452 case MFW_TS_ALL_FAX:
1453 case MFW_TS_FAX3_ALT_SPCH:
1454 case MFW_TS_FAX3_AUTO:
1455 case MFW_TS_FAX4:
1456
1457 TRACE_EVENT("Fax Tele Service");
1458
1459 if (pFeature->ss_status & SS_STAT_ACTIVE)
1460 ss_data.cfu_services |= MFW_CFU_FAX_ACTIVE;
1461 else
1462 ss_data.cfu_services &= (MFW_CFU_ALL_SERVICES_ACTIVE - MFW_CFU_FAX_ACTIVE);
1463 break;
1464
1465 case MFW_TS_ALL_DATA:
1466
1467 TRACE_EVENT("Data Tele Service");
1468
1469 if (pFeature->ss_status & SS_STAT_ACTIVE)
1470 ss_data.cfu_services |= MFW_CFU_DATA_ACTIVE;
1471 else
1472 ss_data.cfu_services &= (MFW_CFU_ALL_SERVICES_ACTIVE - MFW_CFU_DATA_ACTIVE);
1473 break;
1474
1475 case MFW_TS_ALL_SMS:
1476 case MFW_TS_SMS_MO:
1477 case MFW_TS_SMS_MT:
1478
1479 TRACE_EVENT("SMS Tele Service");
1480
1481 if (pFeature->ss_status & SS_STAT_ACTIVE)
1482 ss_data.cfu_services |= MFW_CFU_SMS_ACTIVE;
1483 else
1484 ss_data.cfu_services &= (MFW_CFU_ALL_SERVICES_ACTIVE - MFW_CFU_SMS_ACTIVE);
1485 break;
1486
1487 case MFW_TS_ALL_XCPT_SMS:
1488
1489 TRACE_EVENT("All Except SMS Tele Service");
1490
1491 if (pFeature->ss_status & SS_STAT_ACTIVE)
1492 ss_data.cfu_services |= (MFW_CFU_VOICE_ACTIVE |
1493 MFW_CFU_FAX_ACTIVE |
1494 MFW_CFU_DATA_ACTIVE);
1495 else
1496 ss_data.cfu_services &= (MFW_CFU_ALL_SERVICES_ACTIVE -
1497 (MFW_CFU_VOICE_ACTIVE |
1498 MFW_CFU_FAX_ACTIVE |
1499 MFW_CFU_DATA_ACTIVE));
1500 break;
1501
1502 case MFW_TS_ALL_TS:
1503
1504 TRACE_EVENT("All Tele Services");
1505
1506 if (pFeature->ss_status & SS_STAT_ACTIVE)
1507 ss_data.cfu_services |= MFW_CFU_ALL_SERVICES_ACTIVE;
1508 else
1509 ss_data.cfu_services = 0;
1510 break;
1511
1512 default:
1513 break;
1514 }
1515 }
1516 else if (pFeature->ss_telecom_type == MFW_BST_BEARER)
1517 {
1518
1519 TRACE_EVENT("Bearer Service Type");
1520
1521 if (pFeature->ss_status & SS_STAT_ACTIVE)
1522 ss_data.cfu_services |= MFW_CFU_DATA_ACTIVE;
1523 else
1524 ss_data.cfu_services &= (MFW_CFU_ALL_SERVICES_ACTIVE - MFW_CFU_DATA_ACTIVE);
1525 break;
1526 }
1527 else
1528 {
1529 /* MFW_BST_UNKNOWN */
1530
1531 TRACE_EVENT("Unknown Service Type");
1532
1533 if (pFeature->ss_status & SS_STAT_ACTIVE)
1534 ss_data.cfu_services |= MFW_CFU_ALL_BASIC_SERVICES_ACTIVE;
1535 else
1536 ss_data.cfu_services = 0;
1537 break;
1538 }
1539
1540 }
1541 }
1542 else if ((in_list->ss_category == SS_REGISTRATION) ||
1543 (in_list->ss_category == SS_ACTIVATION))
1544 {
1545 ss_data.cfu_services |= MFW_CFU_ALL_BASIC_SERVICES_ACTIVE;
1546 }
1547 else if ((in_list->ss_category == SS_ERASURE) ||
1548 (in_list->ss_category == SS_DEACTIVATION))
1549 {
1550 ss_data.cfu_services &= (MFW_CFU_ALL_SERVICES_ACTIVE - MFW_CFU_ALL_BASIC_SERVICES_ACTIVE);
1551 }
1552 }
1553
1554 TRACE_EVENT_P1("cfu_services flag is : %8lx", ss_data.cfu_services);
1555
1556 if (ss_data.cfu_services)
1557 retStat = CF_ACTIVE_STATUS;
1558
1559 return retStat;
1560 }
1561
1562
1563 /*******************************************************************************
1564
1565 $Function: srv_check_CF_telephony_status
1566
1567 $Description: copies only the interesting parts of the call forwarding
1568 feature list.
1569
1570 $Returns:
1571
1572 $Arguments:
1573
1574 *******************************************************************************/
1575
1576 static UBYTE srv_copy_feature_list_cf (T_ss_feature_cf * out_list, T_MFW_SS_CF_CNF * in_list)
1577 {
1578 UBYTE found_entries = 0;
1579 UBYTE i, j;
1580
1581 TRACE_EVENT_P1("ss_feature_count %d",in_list->ss_feature_count);
1582
1583 if (in_list->ss_feature_count == 0)
1584 out_list->ss[0].service = TxtCallDivert;
1585
1586 for (i=0;i<in_list->ss_feature_count;i++)
1587 { //MC got rid of pointer arithmetic
1588
1589 T_MFW_FEATURE * pFeature = &in_list->ss_feature_list[i]; //SPR#1081 - DS - Removed mem allocation. Uses assignment instead.
1590 T_ss_feature_cf_data * cf_data = &out_list->ss[found_entries];
1591 UBYTE srvFound;
1592
1593 TRACE_EVENT_P2("Telecom type:%d, service: %d ",pFeature->ss_telecom_type, pFeature->ss_telecom_service);
1594 /*
1595 * first check teleservice
1596 */
1597 if (srv_get_service_type (&cf_data->service, pFeature->ss_telecom_type/*CFService*/,
1598 pFeature->ss_telecom_service))
1599 {
1600
1601 if (cf_data->service == TxtNull)
1602 cf_data->service = TxtCallDivert;
1603
1604 /*
1605 ** If there is more than one entry of a given type, ensure that an information
1606 ** screen is displayed only once
1607 */
1608 srvFound = FALSE;
1609
1610 for (j=0; j<found_entries && !srvFound; j++)
1611 {
1612 if (cf_data->service == out_list->ss[j].service)
1613 srvFound = TRUE;
1614 }
1615
1616 if (!srvFound)
1617 {
1618 /*
1619 * second set status
1620 */
1621 srv_get_status (&cf_data->status, pFeature->ss_status);
1622
1623 if ((ss_cnf->cf_cnf.ss_code==SS_CF_CFU)||(ss_cnf->cf_cnf.ss_code==SS_CF_ALL)){
1624 if (pFeature->ss_status & SS_STAT_ACTIVE)
1625 {
1626 iconsSetState(iconIdCallFor);
1627 // Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
1628 // Setting the Current state of CF in Flash
1629 FFS_flashData.CFState=TRUE;
1630 }
1631 /* Marcus: Issue 1652: 03/02/2003: Start */
1632 else if (pFeature->ss_status & SS_STAT_PROVISIONED)
1633 {
1634 iconsSetState(iconIdCallFor);
1635 // Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
1636 // Setting the Current state of CF in Flash
1637 FFS_flashData.CFState=TRUE;
1638 }
1639 /* Marcus: Issue 1652: 03/02/2003: End */
1640 else
1641 {
1642 iconsDeleteState(iconIdCallFor);
1643 // Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
1644 // Setting the Current state of CF in Flash
1645 FFS_flashData.CFState=FALSE;
1646 }
1647 // Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
1648 // Writng the Current state of CF into ffs
1649 flash_write();
1650
1651 }
1652
1653 /*
1654 * third set forwarded to number
1655 * If the TON is International, add a '+' to the beginning of the number
1656 */
1657 if ((pFeature->ss_numbering_type == TON_International) &&
1658 (pFeature->ss_forwarded_to_number[0] != '+'))
1659 {
1660 cf_data->forwarded_to_number[0] = '+';
1661 srv_get_forwarded_to_number (&cf_data->forwarded_to_number[1],
1662 (char *)pFeature->ss_forwarded_to_number,
1663 MAX_SS_CF_NUM_LEN-1);
1664 }
1665 else
1666 {
1667 srv_get_forwarded_to_number ((char *)cf_data->forwarded_to_number,
1668 (char *)pFeature->ss_forwarded_to_number,
1669 MAX_SS_CF_NUM_LEN);
1670 }
1671
1672 TRACE_EVENT_P1("ss_forwarded_to_number %s", (CHAR *)pFeature->ss_forwarded_to_number);
1673 found_entries++;
1674 }
1675 }
1676
1677 }
1678
1679 /*
1680 * return the number of interesting entries
1681 */
1682 return found_entries;
1683 }
1684
1685
1686 /*******************************************************************************
1687
1688 $Function: srv_get_forwarded_to_number
1689
1690 $Description: sets the forwarded to number if available.
1691
1692 $Returns:
1693
1694 $Arguments:
1695
1696 *******************************************************************************/
1697
1698
1699
1700 static void srv_get_forwarded_to_number ( char * textString,
1701 char * forwarded_to_number,
1702 UBYTE max_chars)
1703 {
1704 TRACE_FUNCTION("srv_get_forwarded_to_number");
1705
1706 memset (textString, 0, max_chars);
1707 strncpy (textString, forwarded_to_number, max_chars-1);
1708 }
1709
1710
1711 /*******************************************************************************
1712
1713 $Function: srv_get_service_type
1714
1715 $Description: checks if the service is interesting or not.
1716
1717 $Returns:
1718
1719 $Arguments:
1720
1721 $History:
1722
1723 //SPR#0776 - DS - Added default value for textId. Changed references from TxtNotImplemented
1724 to TxtNull.
1725
1726 *******************************************************************************/
1727
1728
1729 static UBYTE srv_get_service_type ( USHORT * textId,
1730 UBYTE ss_telecom_type, UBYTE ss_telecom_service)
1731 {
1732 TRACE_FUNCTION("srv_get_service_type");
1733
1734 TRACE_EVENT_P1("ss_telecom_type: %x", ss_telecom_type);
1735 TRACE_EVENT_P1("ss_telecom_service: %x", ss_telecom_service);
1736
1737 *textId = TxtNull; //Set to TxtNull in case no match found below.
1738
1739 switch ( ss_telecom_type )
1740 {
1741 case MFW_BST_UNKNOWN:
1742 break;
1743
1744 case MFW_BST_TELE:
1745 switch ( ss_telecom_service )
1746 {
1747 case MFW_TS_ALL_TS:
1748 *textId = TxtAllCalls;
1749 return TRUE;
1750
1751 case MFW_TS_ALL_SPCH: /* All speech transmission services */
1752 case MFW_TS_TLPHNY: /* telephony */
1753 case MFW_TS_PLMN1: /*MC, this is returned for auxiliary telephony status, 742*/
1754 *textId = TxtVoice;
1755 return TRUE;
1756
1757 case MFW_TS_ALL_SMS:
1758 case MFW_TS_SMS_MO:
1759 case MFW_TS_SMS_MT:
1760 *textId = TxtSMS;
1761 return TRUE;
1762
1763 case MFW_TS_EMRGNCY:
1764 case MFW_TS_ALL_XCPT_SMS:
1765 case MFW_TS_ALL_PSSS: /* all PLMN specific TS */
1766 case MFW_TS_PLMN2: /* PLMN specific TS 2 */
1767 case MFW_TS_PLMN3: /* PLMN specific TS 3 */
1768 case MFW_TS_PLMN4: /* PLMN specific TS 4 */
1769 case MFW_TS_PLMN5: /* PLMN specific TS 5 */
1770 case MFW_TS_PLMN6: /* PLMN specific TS 6 */
1771 case MFW_TS_PLMN7: /* PLMN specific TS 7 */
1772 case MFW_TS_PLMN8: /* PLMN specific TS 8 */
1773 case MFW_TS_PLMN9: /* PLMN specific TS 9 */
1774 case MFW_TS_PLMNA: /* PLMN specific TS A */
1775 case MFW_TS_PLMNB: /* PLMN specific TS B */
1776 case MFW_TS_PLMNC: /* PLMN specific TS C */
1777 case MFW_TS_PLMND: /* PLMN specific TS D */
1778 case MFW_TS_PLMNE: /* PLMN specific TS E */
1779 case MFW_TS_PLMNF: /* PLMN specific TS F */
1780 *textId = TxtNull;
1781 return TRUE;
1782
1783 case MFW_TS_ALL_DATA:
1784 *textId = TxtData;
1785 return TRUE;
1786
1787 case MFW_TS_ALL_FAX:
1788 case MFW_TS_FAX3_ALT_SPCH:
1789 case MFW_TS_FAX3_AUTO:
1790 case MFW_TS_FAX4:
1791 *textId = TxtFax;
1792 return TRUE;
1793 }
1794
1795 break;
1796
1797 case MFW_BST_BEARER:
1798 switch ( ss_telecom_service )
1799 {
1800 case MFW_BS_ALL_BS:
1801 *textId = TxtData; //SPR#933 - DS - Changed TxtNull to TxtData.
1802 return TRUE;
1803
1804 case MFW_BS_ALL_DATA_CDA: //SPR#933 - DS - Added so MMI displays correct info to user.
1805 *textId = TxtData;
1806 return TRUE;
1807
1808 default:
1809 break;
1810 }
1811 break;
1812 }
1813
1814 return FALSE;
1815 }
1816
1817 /*******************************************************************************
1818
1819 $Function: srv_get_status
1820
1821 $Description:
1822
1823 $Returns:
1824
1825 $Arguments:
1826
1827 *******************************************************************************/
1828
1829
1830 static void srv_get_status (USHORT *textId, UBYTE pStatus)
1831 {
1832 TRACE_FUNCTION("srv_get_status");
1833 TRACE_EVENT_P1("Call Forwarding status: %d", pStatus);
1834
1835 if (pStatus & SS_STAT_ACTIVE) // handles also the case of invalid status
1836 *textId = TxtActivated;
1837 /* Marcus: Issue 1652: 03/02/2003: Removed NDH 10/06/03 */
1838 else
1839 *textId = TxtDeActivated;
1840 }
1841
1842
1843 /*******************************************************************************
1844
1845 $Function: srv_copy_feature_list_cw
1846
1847 $Description: copies only the interesting parts of the call waiting
1848 service list.
1849
1850 $Returns:
1851
1852 $Arguments:
1853
1854 *******************************************************************************/
1855
1856 static UBYTE srv_copy_feature_list_cw (T_ss_feature_cw * out_list, T_MFW_SS_CW_CNF * in_list)
1857 {
1858 UBYTE found_entries = 0;
1859 UBYTE i, j;
1860
1861 if (in_list->ss_service_count == 0)
1862 out_list->ss[0].service = TxtCallWaiting;
1863
1864 for (i=0;i<in_list->ss_service_count;i++)
1865 {
1866 T_MFW_SRV_GROUP * pFeature = &in_list->ss_service_list[i];
1867 T_ss_feature_cw_data * cw_data = &out_list->ss[found_entries];
1868 UBYTE srvFound;
1869 /*
1870 * first check teleservice
1871 */
1872 if (srv_get_service_type (&cw_data->service, pFeature->ss_telecom_type,
1873 pFeature->ss_telecom_service))
1874 {
1875
1876 if (cw_data->service == TxtNull)
1877 cw_data->service = TxtCallWaiting;
1878
1879 /*
1880 ** If there is more than one entry of a given type, ensure that an information
1881 ** screen is displayed only once
1882 */
1883 srvFound = FALSE;
1884
1885 for (j=0; j<found_entries && !srvFound; j++)
1886 {
1887 if (cw_data->service == out_list->ss[j].service)
1888 srvFound = TRUE;
1889 }
1890
1891 if (!srvFound)
1892 {
1893 /*
1894 * second set status
1895 */
1896 srv_get_status (&out_list->status, in_list->ss_status);
1897 found_entries++;
1898 }
1899 }
1900 }
1901
1902 /*
1903 * return the number of interesting entries
1904 */
1905 return found_entries;
1906 }
1907
1908 /*******************************************************************************
1909
1910 $Function: srv_copy_feature_list_cb
1911
1912 $Description:
1913
1914 $Returns:
1915
1916 $Arguments:
1917
1918 *******************************************************************************/
1919
1920 static UBYTE srv_copy_feature_list_cb (T_ss_feature_cb * out_list, T_MFW_SS_CB_CNF * in_list)
1921 {
1922 UBYTE found_entries = 0;
1923 UBYTE i, j;
1924
1925 USHORT textId = 0; // RAVI
1926
1927 /*
1928 * SPR #1878 NDH - Determine which text is to be displayed depending on what request
1929 * was initially sent.
1930 */
1931 switch(in_list->ss_category)
1932 {
1933 case SS_REGISTRATION:
1934 case SS_ACTIVATION:
1935 case SS_INTERROGATION:
1936 /*
1937 * Interrogation returns only those services which are active
1938 */
1939 textId = TxtActivated;
1940 break;
1941
1942 case SS_ERASURE:
1943 case SS_DEACTIVATION:
1944 textId = TxtDeActivated;
1945 break;
1946 }
1947
1948 if (in_list->ss_telecom_count == 0)
1949 out_list->ss[0].service = TxtCallBarringAll;
1950
1951 for (i=0;i<in_list->ss_telecom_count;i++)
1952 {
1953 T_MFW_TELECOM * pFeature = &in_list->ss_telecom_list[i];
1954 T_ss_feature_cb_data * cb_data = &out_list->ss[found_entries];
1955 UBYTE srvFound;
1956 /*
1957 * first check teleservice
1958 */
1959 if (srv_get_service_type (&cb_data->service, pFeature->ss_telecom_type,
1960 pFeature->ss_telecom_service))
1961 {
1962 if (cb_data->service == TxtNull)
1963 cb_data->service = TxtCallBarringAll;
1964
1965 cb_data->status = textId;
1966
1967 /*
1968 ** If there is more than one entry of a given type, ensure that an information
1969 ** screen is displayed only once
1970 */
1971 srvFound = FALSE;
1972
1973 for (j=0; j<found_entries && !srvFound; j++)
1974 {
1975 if (cb_data->service == out_list->ss[j].service)
1976 srvFound = TRUE;
1977 }
1978
1979 if (!srvFound)
1980 found_entries++;
1981 }
1982 }
1983
1984 /*
1985 * return the number of interesting entries
1986 */
1987 return found_entries;
1988 }
1989
1990
1991
1992 /*******************************************************************************
1993
1994 $Function: services_info_cb
1995
1996 $Description: Callback function from information dialog.
1997
1998 $Returns:
1999
2000 $Arguments:
2001
2002 *******************************************************************************/
2003
2004
2005
2006 static int services_info_cb(T_MFW_HND win, USHORT identifier, UBYTE reason)
2007 {
2008
2009 T_DISPLAY_DATA display_info; // Jun 16, 2005 REF: CRR 31543 x0021334
2010 // UBYTE PWD; // RAVI
2011 T_MFW_SS_RETURN sat_result_hangup; // Jun 16, 2005 REF: CRR 31543 x0021334
2012
2013 //Feb 17, 2005 REF : CRR 17657 x0012850 Divya.P.V
2014 //Bug : Unable to compose a one or two digit number
2015 //Fix : This bug is reproducible when a very long message is sent by the service provider when an invalid one or two digit number is dialled.
2016 //The read only editor with the service provider message that comes up when a one or two digit is dialled
2017 //was not handled properly. So altered the editor handling to cater for the long message.
2018 T_MFW_WIN *win_data;
2019 T_ss *data = NULL; // RAVI - Assigned NULL.
2020
2021 TRACE_EVENT_P1("Service Info CB %d", win);
2022
2023 ss_data.info_wait = 0;
2024
2025 //Feb 17, 2005 REF : CRR 17657 x0012850 Divya.P.V
2026 //Bug : Unable to compose a one or two digit number
2027 //Fix : This bug is reproducible when a very long message is sent by the service provider when an invalid one or two digit number is dialled.
2028 //The read only editor with the service provider message that comes up when a one or two digit is dialled
2029 //was not handled properly. So altered the editor handling to cater for the long message.
2030 if(win)
2031 {
2032 win_data = ((T_MFW_HDR *)win)->data;
2033 if(win_data)
2034 data = (T_ss * )win_data->user;
2035 }
2036
2037 /*
2038 * Who has initiated the information screen
2039 */
2040 switch (identifier)
2041 {
2042 case SS_WAIT:
2043
2044 break;
2045 case E_SS_IMEI:/* present IMEI */
2046 case ServicesOk:
2047 case ServicesFailed:
2048 case ServicesCheckCLI_OK:
2049 case ServicesCheckCW_OK:
2050 case ServicesIMEI_OK:
2051 case ServicesError:
2052 case ServicesUSSD_CNF_OK:
2053 #if 0
2054 case ServicesUSSDAlreadyFull: /* already full message screen */
2055 #endif
2056 case ServicesCFU_OK:
2057 case ServicesCB_OK:
2058
2059 case E_SS_NOTIFY:
2060 case E_SS_CLI_CNF:
2061 case E_SS_USSD_CNF:
2062 switch (reason)
2063 {
2064 case INFO_TIMEOUT:
2065 /* info dialog timed out, where to now? */
2066 /* no break; */
2067 case INFO_KCD_HUP:
2068 /* clear key in info dialog, where to now? */
2069 /* no break;*/
2070 case INFO_KCD_LEFT:
2071 /* left soft key in info dialog, where to now? */
2072 /* no break;*/
2073 case INFO_KCD_RIGHT:
2074 /* right soft key in info dialog, where to now? */
2075 //Feb 17, 2005 REF : CRR 17657 x0012850 Divya.P.V
2076 //Bug : Unable to compose a one or two digit number
2077 //Fix : This bug is reproducible when a very long message is sent by the service provider when an invalid one or two digit number is dialled.
2078 //The read only editor with the service provider message that comes up when a one or two digit is dialled
2079 //was not handled properly. So altered the editor handling to cater for the long message.
2080 if(data)
2081 {
2082 if(data->info_win)
2083 {
2084 AUI_edit_Destroy(data->info_win);
2085 data->info_win=NULL;
2086 }
2087 }
2088 services_destroy(win);
2089 break;
2090 }
2091 // May 12, 2005 REF: CRR 30892 x0021334
2092 // Set ss_data.info_win to NULL to pass the check in services_ss_cb() for notification
2093 ss_data.info_win = NULL;
2094 break;
2095
2096 case E_SS_CB_CNF:
2097 {
2098 T_MFW_WIN * win_data;
2099 T_ss * data;
2100
2101 win_data = ((T_MFW_HDR *)win)->data;
2102 data = (T_ss *)win_data->user;
2103
2104 switch (reason)
2105 {
2106 case INFO_TIMEOUT:
2107 //Jun 04,2004 CRR:13601 xpradipg - SASKEN
2108 //Timer is introduced for the information dialog, we are handling the time_out event
2109 case INFO_KCD_HUP:
2110 case INFO_KCD_LEFT:
2111 /*
2112 * stop the display of the results
2113 */
2114 if (data->mfw_ss_cb)
2115 {
2116 FREE_MEMORY ((void *)data->mfw_ss_cb, sizeof (T_ss_feature_cb));
2117 data->mfw_ss_cb = NULL;
2118 data->current_feature = 0;
2119
2120 TRACE_EVENT_P2("SS_data.win %d %d",ss_data.win, data);
2121 }
2122 break;
2123
2124 case INFO_KCD_RIGHT:
2125 if ((data->mfw_ss_cb) && (data->max_feature > 1))
2126 {
2127 if (data->max_feature > data->current_feature + 1)
2128 data->current_feature++;
2129 else
2130 data->current_feature = 0;
2131
2132 showCBStatus (win, data);
2133 //Jun 04,2004 CRR:13601 xpradipg - SASKEN
2134 //Restart the timer if the key was pressed. We handle only right key since left key destroys
2135 //the information dialog
2136 InfoDialogTimRestart(win);
2137 }
2138 break;
2139
2140 default:
2141 break;
2142 }
2143 // May 12, 2005 REF: CRR 30892 x0021334
2144 // Set ss_data.info_win to NULL to pass the check in services_ss_cb() for notification
2145 ss_data.info_win = NULL;
2146 }
2147 break;
2148
2149 case E_SS_CW_CNF:
2150 {
2151 T_MFW_WIN * win_data;
2152 T_ss * data;
2153
2154 win_data = ((T_MFW_HDR *)win)->data;
2155 data = (T_ss *)win_data->user;
2156
2157 switch (reason)
2158 {
2159 case INFO_TIMEOUT:
2160 //Jun 04,2004 CRR:13601 xpradipg - SASKEN
2161 //Timer is introduced for the information dialog, we are handling the time_out event
2162 case INFO_KCD_HUP:
2163 case INFO_KCD_LEFT:
2164 /*
2165 * stop the display of the results
2166 */
2167 if (data->mfw_ss_cw)
2168 {
2169 FREE_MEMORY ((void *)data->mfw_ss_cw, sizeof (T_ss_feature_cw));
2170 data->mfw_ss_cw = NULL;
2171 data->current_feature = 0;
2172 }
2173 break;
2174
2175 case INFO_KCD_RIGHT:
2176 if ((data->mfw_ss_cw) && (data->max_feature > 1))
2177 {
2178 if (data->max_feature > data->current_feature + 1)
2179 data->current_feature++;
2180 else
2181 data->current_feature = 0;
2182
2183 showCWStatus (win, data);
2184 //Jun 04,2004 CRR:13601 xpradipg - SASKEN
2185 //Restart the timer if the key was pressed. We handle only right key since left key destroys
2186 //the information dialog
2187 InfoDialogTimRestart(win);
2188
2189 }
2190 break;
2191
2192 default:
2193 break;
2194 }
2195 // May 12, 2005 REF: CRR 30892 x0021334
2196 // Set ss_data.info_win to NULL to pass the check in services_ss_cb() for notification
2197 ss_data.info_win = NULL;
2198 }
2199 break;
2200 case E_SS_CF_CNF:
2201 {
2202 T_MFW_WIN * win_data;
2203 T_ss * data;
2204
2205 win_data = ((T_MFW_HDR *)win)->data;
2206 data = (T_ss *)win_data->user;
2207
2208 switch (reason)
2209 {
2210 case INFO_TIMEOUT:
2211 //Jun 04,2004 CRR:13601 xpradipg - SASKEN
2212 //Timer is introduced for the information dialog, we are handling the time_out event
2213 case INFO_KCD_HUP:
2214 case INFO_KCD_LEFT:
2215 /*
2216 * stop the display of the results
2217 */
2218 if (data->mfw_ss_cf)
2219 {
2220 FREE_MEMORY ((void *)data->mfw_ss_cf, sizeof (T_ss_feature_cf));
2221 data->mfw_ss_cf = NULL;
2222 data->current_feature = 0;
2223 }
2224 break;
2225
2226 case INFO_KCD_RIGHT:
2227 if ((data->mfw_ss_cf) && (data->max_feature > 1))
2228 {
2229 if (data->max_feature > data->current_feature + 1)
2230 data->current_feature++;
2231 else
2232 data->current_feature = 0;
2233
2234 showCFStatus (win, data);
2235 //Jun 04,2004 CRR:13601 xpradipg - SASKEN
2236 //Restart the timer if the key was pressed. We handle only right key since left key destroys
2237 //the information dialog
2238 InfoDialogTimRestart(win);
2239 }
2240 break;
2241
2242 default:
2243 break;
2244 }
2245 // May 12, 2005 REF: CRR 30892 x0021334
2246 // Set ss_data.info_win to NULL to pass the check in services_ss_cb() for notification
2247 ss_data.info_win = NULL;
2248 break;
2249 }
2250 case ServicesUSSD_REQ_OK:
2251 switch (reason)
2252 {
2253 case INFO_KCD_HUP:
2254 // Jun 16, 2005 REF: CRR 31543 x0021334
2255 // Hangup key is pressed. End the USSD session.
2256 sat_result_hangup = satHangup (CMD_SRC_LCL);
2257 if (sat_result_hangup == MFW_SS_OK)
2258 {
2259 dlg_initDisplayData_TextId(&display_info, NULL, NULL, TxtCancelled, TxtNull, COLOUR_STATUS);
2260 dlg_initDisplayData_events(&display_info, (T_VOID_FUNC)NULL, THREE_SECS, KEY_LEFT | KEY_RIGHT);
2261 info_dialog (NULL, &display_info);
2262 }
2263 else
2264 {
2265 TRACE_ERROR("Error in SAT USSD abort");
2266 }
2267 // no break;
2268 case INFO_TIMEOUT:
2269 /* info dialog timed out, where to now? */
2270 // no break;
2271 case INFO_KCD_RIGHT:
2272 /* right soft key in info dialog, where to now?
2273 all above mean cancelled so go back to whatever was before (idle?)*/
2274 services_destroy(win);
2275 break;
2276
2277 case INFO_KCD_LEFT:
2278 /* left soft key in info dialog, where to now?
2279 This means confirm, so now go to USSD entry screen */
2280 SEND_EVENT(ss_data.win,ServicesUSSDEnter,0,0);
2281 break;
2282 default:
2283 break;
2284 }
2285 // May 12, 2005 REF: CRR 30892 x0021334
2286 // Set ss_data.info_win to NULL to pass the check in services_ss_cb() for notification
2287 ss_data.info_win = NULL;
2288 break;
2289
2290 case ServicesUSSDEnter:
2291 {
2292 T_MFW_SS_PARA ussd_data;
2293
2294
2295 ussd_data.ussd_info.len = strlen((char*)ss_data.edt_buf_number);
2296 ussd_data.ussd_info.dcs = ss_data.dcs;
2297 ussd_data.ussd_info.error = MFW_SS_NO_ERROR;
2298
2299 memcpy(ussd_data.ussd_info.ussd, ss_data.edt_buf_number, ussd_data.ussd_info.len);
2300
2301
2302 sendUSSD (&ussd_data);
2303 }
2304 break;
2305
2306 }
2307 return 1;
2308 }
2309
2310
2311 /*******************************************************************************
2312
2313 $Function: servicesNumbers
2314
2315 $Description:
2316
2317 $Returns:
2318
2319 $Arguments:
2320
2321 *******************************************************************************/
2322
2323
2324 int servicesNumbers(MfwMnu* m, MfwMnuItem* i){
2325 CFAction = CFActivate;
2326 servicesDoOtherNumber();
2327
2328 // ADDED BY RAVI - 28-11-2005
2329 return 1;
2330 //END RAVI - 28-11-2005
2331 }
2332
2333
2334 /*******************************************************************************
2335
2336 $Function: servicesInfraRed
2337
2338 $Description:
2339
2340 $Returns:
2341
2342 $Arguments:
2343
2344 *******************************************************************************/
2345
2346
2347 int servicesInfraRed(void){return 11;}
2348
2349
2350 /*******************************************************************************
2351
2352 $Function: servicesExec
2353
2354 $Description:
2355
2356 $Returns:
2357
2358 $Arguments:
2359
2360 *******************************************************************************/
2361
2362 void servicesExec (int reason, MmiState next)
2363 {
2364 // UBYTE PWD; // RAVI
2365 T_MFW_HND win = mfw_parent(mfw_header());
2366 // T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; // RAVI
2367
2368 nextState = next;
2369
2370
2371 if (!winIsFocussed(win))
2372 lastFocus = winFocus(win);
2373
2374 servicesState = reason; /* save reason now !! */
2375
2376 switch (reason)
2377 {
2378 case ServicesIdle: /* giving back control to last module*/
2379 winFocus(lastFocus);
2380 winShow(lastFocus);
2381 lastFocus = 0;
2382 return; /* return from module */
2383
2384 case ServicesOk:
2385 TRACE_FUNCTION("Service OK");
2386 winShow(win);
2387 timStart(times); /* start timer to go back in the submenu */
2388 break;
2389
2390 case ServicesFailed:
2391 TRACE_FUNCTION("Service Failed");
2392 winShow(win);
2393 timStart(times); /* start timer to go back in the submenu */
2394 break;
2395
2396 case ServicesError:
2397 TRACE_FUNCTION("Service Error");
2398 winShow(win);
2399 timStart(times); /* start timer to go back in the submenu */
2400 break;
2401
2402 case ServicesExecCF: /* all Call forwarding from menu */
2403 case ServicesActCF: /* show "Please Wait" screen/animation */
2404 case ServicesDeactCF:
2405 case ServicesCheckCF:
2406 case ServicesActCW:
2407 case ServicesDeactCW:
2408 case ServicesCheckCW:
2409 case ServicesActCLIR:
2410 case ServicesDeactCLIR:
2411 case ServicesCheckCLIR:
2412 winShow(win);
2413 timStart(times); /* start timer to go back in the submenu */
2414 break;
2415
2416 case ServicesCheckCW_OK:
2417 TRACE_FUNCTION(" ServicesCheckCW_OK");
2418 winShow(win);
2419 timStart(times); /* start timer to go back in the submenu */
2420 break;
2421
2422 case ServicesCheckCLI_OK:
2423 TRACE_FUNCTION("ServicesCheckCLI_OK");
2424 winShow(win);
2425 timStart(times);
2426 break;
2427
2428 case ServicesIMEI_OK:
2429 TRACE_FUNCTION("ServicesIMEI_OK");
2430 winShow(win);
2431 timStart(times);
2432 break;
2433 case ServicesResShow:
2434 TRACE_FUNCTION("ServicesResShow");
2435 winShow(win);
2436 timStart(times);
2437 break;
2438
2439 case ServicesCB_OK:
2440 TRACE_FUNCTION("ServicesCB_OK");
2441 lastFocus = winFocus(win);
2442 winShow(win);
2443 timStart(times);
2444 break;
2445
2446 case ServicesCFU_OK:
2447 TRACE_FUNCTION("ServicesCFUShow");
2448 lastFocus = winFocus(win);
2449 winShow(win);
2450 timStart(times);
2451 break;
2452
2453 case ServicesDoCallDivert:
2454 servicesSendCallDivert(0);
2455 break;
2456
2457 case PIN2_ABORT:
2458 TRACE_FUNCTION("ServicesPin2_Abort");
2459 break;
2460 default:
2461 break;
2462 }
2463 }
2464
2465
2466
2467
2468 /*******************************************************************************
2469
2470 $Function: showWait
2471
2472 $Description:
2473
2474 $Returns:
2475
2476 $Arguments:
2477
2478 *******************************************************************************/
2479
2480 static void showWait (T_MFW_HND win)
2481 {
2482
2483 T_DISPLAY_DATA display_info;
2484
2485 TRACE_FUNCTION("showWait");
2486
2487 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtRequesting, TxtNull, COLOUR_STATUS);
2488 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FOREVER, KEY_HUP| KEY_LEFT );
2489 display_info.Identifier = SS_WAIT;
2490
2491 /*
2492 * Call Info Screen
2493 */
2494
2495 ss_data.info_wait = info_dialog (win, &display_info);
2496 }
2497
2498
2499 /*******************************************************************************
2500
2501 $Function: showOk
2502
2503 $Description:
2504
2505 $Returns:
2506
2507 $Arguments:
2508
2509 *******************************************************************************/
2510
2511 static void showOk (T_MFW_HND win)
2512 {
2513
2514 T_DISPLAY_DATA display_info;
2515
2516 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, TxtDone, TxtNull, COLOUR_STATUS);
2517 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FOREVER, KEY_HUP| KEY_LEFT );
2518 display_info.Identifier = ServicesOk;
2519
2520 /*
2521 * Call Info Screen
2522 */
2523
2524 ss_data.info_win = info_dialog (ss_data.win, &display_info);
2525
2526 }
2527
2528 /*******************************************************************************
2529
2530 $Function: showFailed
2531
2532 $Description:
2533
2534 $Returns:
2535
2536 $Arguments:
2537
2538 *******************************************************************************/
2539
2540 static void showFailed (T_MFW_HND win)
2541 {
2542
2543 T_DISPLAY_DATA display_info;
2544
2545 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, TxtFailed, TxtNull, COLOUR_STATUS);
2546 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FOREVER, KEY_HUP| KEY_LEFT );
2547 display_info.Identifier = ServicesFailed;
2548
2549 /*
2550 * Call Info Screen
2551 */
2552 ss_data.info_win = info_dialog (ss_data.win, &display_info);
2553 }
2554
2555 /*******************************************************************************
2556
2557 $Function: showError
2558
2559 $Description:
2560
2561 $Returns:
2562
2563 $Arguments:
2564
2565 *******************************************************************************/
2566
2567 static void showError (T_MFW_HND win, T_MFW_SS_ERROR ss_error)
2568 {
2569
2570 T_DISPLAY_DATA display_info;
2571
2572 TRACE_FUNCTION("showError");
2573
2574 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, TxtFailed, serviceGetError(ss_error), COLOUR_STATUS);
2575 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FOREVER, KEY_HUP| KEY_LEFT );
2576 display_info.Identifier = ServicesError;
2577
2578 /*
2579 * Call Info Screen
2580 */
2581
2582 ss_data.info_win = info_dialog (ss_data.win, &display_info);
2583
2584 }
2585
2586
2587 /*******************************************************************************
2588
2589 $Function: showSSNotify
2590
2591 $Description: Show result from E_SS_NOTIFY being returned. Short ss-related
2592 notification window.
2593
2594 $Returns:
2595
2596 $Arguments:
2597
2598 *******************************************************************************/
2599
2600 static void showSSNotify (T_MFW_HND win, T_MFW_SS_NOTIFY * ss_notify)
2601 {
2602
2603 T_DISPLAY_DATA display_info;
2604 USHORT TxtId1,TxtId2;
2605
2606 TRACE_FUNCTION("++ showSSNotify");
2607
2608 TxtId1 = TxtNull;
2609 TxtId2 = TxtNull;
2610
2611 switch (ss_notify->code)
2612 {
2613 case MFW_SS_MO_unconFORWARD: /* CFU activated */
2614 {
2615 iconsSetState(iconIdCallFor);
2616 // Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
2617 // Storing the Current state of CF in Flash
2618 FFS_flashData.CFState=TRUE;
2619 flash_write();
2620 }
2621
2622 /* Activate the CFU icon */
2623 /* break; */ /***** NO BREAK ******/
2624 case MFW_SS_MO_conFORWARD: /* Conditional CF active */
2625 TxtId1 = TxtForward;
2626 TxtId2 = TxtActivated;
2627 break;
2628 case MFW_SS_MT_FORWARDED: /* incoming call fowarded */
2629 TxtId1 = TxtIncomingCall;
2630 TxtId2 = TxtForwarded;
2631 break;
2632
2633 case MFW_SS_MO_FORWARDED: /* our call is being forwarded */
2634 TxtId1 = TxtSoftCall;
2635 TxtId2 = TxtForwarded;
2636
2637 break;
2638
2639 case MFW_SS_MO_WAITING: /* outgoing call is waiting signal received */
2640 TxtId1 = TxtSoftCall;
2641 TxtId2 = TxtWaiting;
2642 break;
2643
2644 case MFW_SS_MO_moBARRED: /* outgoing calls barred */
2645 TxtId1 = TxtOutgoingCalls;
2646 TxtId2 = TxtBarred;
2647 break;
2648
2649 case MFW_SS_MO_mtBARRED: /* incoming calls barred */
2650 TxtId1 = TxtIncomingCall;
2651 TxtId2 = TxtBarred;
2652 break;
2653
2654 case MFW_SS_MO_DEFLECTED: /* incoming call diverted */
2655 TxtId1 = TxtIncomingCall;
2656 TxtId2 = TxtCallDivert;
2657 break;
2658
2659 default:
2660 break;
2661 }
2662
2663 if (TxtId1 != TxtNull )
2664 {
2665
2666 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, TxtId1, TxtId2, COLOUR_STATUS);
2667 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, THREE_SECS, KEY_CLEAR| KEY_LEFT );
2668 display_info.Identifier = E_SS_NOTIFY;
2669
2670 /*
2671 * Call Info Screen
2672 */
2673
2674 ss_data.info_win = info_dialog (ss_data.win, &display_info);
2675 }
2676 }
2677
2678 /*******************************************************************************
2679
2680 $Function: srv_display_status
2681
2682 $Description: Indicate a sensefull response to the user if only the .
2683
2684 $Returns:
2685
2686 $Arguments:
2687
2688 *******************************************************************************/
2689
2690
2691 static void srv_display_status (UBYTE ss_status)
2692 {
2693 T_DISPLAY_DATA display_info;
2694 USHORT TxtId2;
2695 TRACE_FUNCTION("srv_display_status()");
2696
2697
2698 //GW Swapped text strings over
2699 if (ss_status & SS_STAT_ACTIVE)
2700 TxtId2 = TxtActivated;
2701 /* Marcus: Issue 1652: 03/02/2003: Removed NDH 10/06/03 */
2702 else
2703 TxtId2 = TxtDeActivated;
2704
2705 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, TxtNull, TxtId2, COLOUR_STATUS);
2706 //Jun 04,2004 CRR:13601 xpradipg - SASKEN
2707 //Timer value changed from FOREVER to FIVE_SECS
2708 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FIVE_SECS, KEY_CLEAR| KEY_LEFT );
2709 display_info.Identifier = E_SS_CB_CNF; // can be used also for CF and CW
2710
2711 /*
2712 * Call Info Screen
2713 */
2714
2715 ss_data.info_win = info_dialog (ss_data.win, &display_info);
2716 }
2717
2718 /*******************************************************************************
2719
2720 $Function: ysrv_empty_list_result
2721
2722 $Description: Indicate a sensefull response to the user if an
2723 activation / deactivation or interrogation leads to an
2724 empty list.
2725
2726 $Returns:
2727
2728 $Arguments:
2729
2730 *******************************************************************************/
2731
2732
2733 static void srv_empty_list_result (UBYTE ss_category, USHORT event, UBYTE ss_status, UBYTE ss_code) /* Marcus: Issue 1652: 03/02/2002 */
2734 {
2735 T_DISPLAY_DATA display_info;
2736 USHORT TxtId1;
2737 USHORT TxtId2 = TxtNull;
2738 TRACE_FUNCTION("srv_empty_list_result");
2739
2740 switch (event)
2741 {
2742 case E_SS_CB_CNF:
2743 TxtId1 = TxtCallBarringAll;
2744 break;
2745
2746 case E_SS_CW_CNF:
2747 TxtId1 = TxtCallWaiting;
2748 break;
2749
2750 case E_SS_CF_CNF:
2751 TxtId1 = TxtCallDivert;
2752 break;
2753
2754 default:
2755 TxtId1 = TxtNull;
2756 }
2757
2758 /* Marcus: Issue 1652: 03/02/2002: Start */
2759 TRACE_EVENT_P3("ss_category %d, event %d, ss_status %d", ss_category, event, ss_status);
2760 switch (ss_category)
2761 {
2762 case SS_ACTIVATION:
2763 case SS_REGISTRATION:
2764 TRACE_FUNCTION ("ACTIVATED !");
2765 TxtId2 = TxtActivated;
2766 break;
2767 /* Marcus: Issue 1588: 23/01/2003: Start */
2768 case SS_INTERROGATION:
2769 if ((event == E_SS_CW_CNF) || (event == E_SS_CF_CNF))
2770 {
2771 if (ss_status & SS_STAT_ACTIVE)
2772 {
2773 TRACE_EVENT ("INTERROGATION:ACTIVATED !");
2774 TxtId2 = TxtActivated;
2775 }
2776 else /* Marcus: Issue 1651: 30/01/2003: Removed NDH 10/06/03 */
2777 {
2778 TRACE_EVENT ("INTERROGATION:DEACTIVATED !");
2779 TxtId2 = TxtDeActivated;
2780 }
2781 }
2782 else
2783 {
2784 TRACE_EVENT ("DEACTIVATED !");
2785 TxtId2 = TxtDeActivated;
2786 }
2787 break;
2788
2789 case SS_ERASURE:
2790 case SS_DEACTIVATION:
2791 TRACE_FUNCTION ("DEACTIVATED !");
2792 TxtId2 = TxtDeActivated;
2793 break;
2794 default:
2795 TxtId2 = TxtNull;
2796 break;
2797 }
2798 /* Marcus: Issue 1652: 03/02/2002: End */
2799
2800 if (TxtId2 != TxtNull )
2801 {
2802 /*CQ10690 - API - 23/06/03 - Set the icon state to show on this return */
2803 if ( (TxtId2 == TxtActivated) &&
2804 ( (ss_code == SS_CF_CFU) || (ss_code == SS_CF_ALL) ) )
2805 {
2806 iconsSetState(iconIdCallFor);
2807 // Jun 23, 2004 REF: CRR MMI-SPR-13599 Rashmi C N(Sasken)
2808 // Storing the Current state of CF in Flash
2809 FFS_flashData.CFState=TRUE;
2810 flash_write();
2811 }
2812 /*CQ10690 - END*/
2813 if(event==E_SS_CF_CNF)
2814 {
2815 // Jun 10, 2004 REF: CRR MMI-SPR-13614 Rashmi C N(Sasken)
2816 // We are now passing the type of CF as the first stringID for the dialog info screen
2817 // serviceGetType(ss_Code) this function would return the string id for the ss_code being passed
2818
2819 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, serviceGetType((T_MFW_SS_CODES)ss_code), TxtId2, COLOUR_STATUS);
2820 }
2821 else
2822 {
2823 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, TxtId1, TxtId2, COLOUR_STATUS);
2824 }
2825 //Jun 04,2004 CRR:13601 xpradipg - SASKEN
2826 //Timer value changed from FOREVER to FIVE_SECS
2827 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FIVE_SECS, KEY_CLEAR| KEY_LEFT );
2828 display_info.Identifier = E_SS_CB_CNF; // can be used also for CF and CW
2829
2830 /*
2831 * Call Info Screen
2832 */
2833
2834 ss_data.info_win = info_dialog (ss_data.win, &display_info);
2835 }
2836 }
2837
2838
2839 /*******************************************************************************
2840
2841 $Function: showCWState
2842
2843 $Description: display CW state
2844
2845 $Returns:
2846
2847 $Arguments:
2848
2849 *******************************************************************************/
2850
2851
2852 static void showCWStatus (T_MFW_HND win , T_ss * data)
2853
2854 {
2855 T_DISPLAY_DATA display_info;
2856 T_ss_feature_cw_data * pFeature;
2857
2858 TRACE_FUNCTION("showCWStatus");
2859
2860 //MC got rid of dodgy pointer arithmetic
2861 pFeature = &data->mfw_ss_cw->ss[data->current_feature];
2862
2863 if (data->max_feature == 1)
2864 {
2865 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, pFeature->service, data->mfw_ss_cw->status, COLOUR_STATUS);
2866 //Jun 04,2004 CRR:13601 xpradipg - SASKEN
2867 //Timer value changed from FOREVER to FIVE_SECS
2868 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FIVE_SECS, KEY_CLEAR| KEY_LEFT);
2869 }
2870 else
2871 {
2872 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtSoftNext, pFeature->service, data->mfw_ss_cw->status, COLOUR_STATUS);
2873 //Jun 04,2004 CRR:13601 xpradipg - SASKEN
2874 //Timer value changed from FOREVER to FIVE_SECS
2875 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FIVE_SECS, KEY_CLEAR| KEY_LEFT | KEY_RIGHT );
2876 }
2877
2878 display_info.Identifier = E_SS_CW_CNF;
2879
2880 /*
2881 * Call Info Screen
2882 */
2883
2884 ss_data.info_win = info_dialog (ss_data.win, &display_info);
2885
2886 if (ss_data.info_win EQ NULL)
2887 {
2888 TRACE_FUNCTION("NOT ENOUGH RESOURCES TO CREATE EXT INFO DIALOG");
2889 }
2890 }
2891
2892 /*******************************************************************************
2893
2894 $Function: showCLIStatus
2895
2896 $Description:
2897
2898 $Returns:
2899
2900 $Arguments:
2901
2902 *******************************************************************************/
2903
2904
2905 static void showCLIStatus(T_MFW_HND win, T_MFW_SS_PARA * ss_cnf)
2906 {
2907
2908 T_DISPLAY_DATA display_info;
2909
2910 TRACE_FUNCTION("showCLIStatus()");
2911
2912 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, serviceGetType(ss_cnf->cli_cnf.ss_code), TxtNull , COLOUR_STATUS);
2913 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FOREVER, KEY_CLEAR | KEY_LEFT );
2914 display_info.Identifier = ServicesCheckCLI_OK;
2915
2916 if (ss_cnf->cli_cnf.ss_status == SS_STAT_UNKNOWN)
2917 {
2918 // Unknown status. By defaut say that the id is sent
2919 display_info.TextId2 = TxtActivated;
2920 }
2921 else if (ss_cnf->cli_cnf.ss_status & SS_STAT_ACTIVE)
2922 {
2923 switch (ss_cnf->cli_cnf.ss_clir_option)
2924 {
2925 // By defaut the caller id is not sent
2926 case MFW_CL_TEMP_DEF_REST:
2927 switch (CFAction)
2928 {
2929 // ActivateCLIR, so deactivate the sending of caller id
2930 case CFActivate:
2931 // By defaut the caller id is not sent
2932 display_info.TextId2 = TxtActivated;
2933 // No CLIR suppress or invoke
2934 cm_mo_prefix(0x04);
2935 // Apr 22, 2004 REF: CRR MMI-SPR-16873 Rashmi C N(Sasken)
2936 // Maintaing the CLIR status in the flash.
2937 FFS_flashData.CLIR=TRUE;
2938 flash_write();
2939 break;
2940 // Deactivate CLIR, so activate the sending of caller id
2941 case CFDeactivate:
2942 // By defaut the caller id is not sent
2943 display_info.TextId2 = TxtDeActivated;
2944 // CLIR suppress needed
2945 cm_mo_prefix(0x08);
2946 // Apr 22, 2004 REF: CRR MMI-SPR-16873 Rashmi C N(Sasken)
2947 // Maintaing the CLIR status in the flash.
2948 FFS_flashData.CLIR=FALSE;
2949 flash_write();
2950 break;
2951 case CFCheck:
2952 default:
2953 /* // Check if CLIR suppress is activated: caller id sent
2954 if ((cm_mo_prefix(0) & 0x0c) == 0x08)
2955 display_info.TextId2 = TxtDeActivated;
2956 // By defaut the caller id is not sent
2957 else
2958 display_info.TextId2 = TxtActivated;*/
2959 // Check if CLIR suppress is activated: caller id sent
2960 // Apr 22, 2004 REF: CRR MMI-SPR-16873 Rashmi C N(Sasken)
2961 // Using the CLIR status maintained in the flash, when the status is checked
2962 if (!FFS_flashData.CLIR)
2963 {
2964 display_info.TextId2 = TxtDeActivated;
2965 }
2966 // By defaut the caller id is not sent
2967 else
2968 {
2969 display_info.TextId2 = TxtActivated;
2970 }
2971
2972 break;
2973 }
2974 break;
2975 // By defaut the caller id is sent
2976 case MFW_CL_TEMP_DEF_ALLOWED:
2977 switch (CFAction)
2978 {
2979 // ActivateCLIR, so deactivate the sending of caller id
2980 case CFActivate:
2981 // By defaut the caller id is sent
2982 display_info.TextId2 =TxtActivated;
2983 // CLIR invoke needed
2984 cm_mo_prefix(0x0c);
2985 // Apr 22, 2004 REF: CRR MMI-SPR-16873 Rashmi C N(Sasken)
2986 // Maintaing the CLIR status in the flash.
2987 FFS_flashData.CLIR=TRUE;
2988 flash_write();
2989 break;
2990 // Deactivate CLIR, so activate the sending of caller id
2991 case CFDeactivate:
2992 // By defaut the caller id is sent
2993 display_info.TextId2 = TxtDeActivated;
2994 // No CLIR suppress or invoke
2995 cm_mo_prefix(0x04);
2996 // Apr 22, 2004 REF: CRR MMI-SPR-16873 Rashmi C N(Sasken)
2997 // Maintaing the CLIR status in the flash.
2998 FFS_flashData.CLIR=FALSE;
2999 flash_write();
3000 break;
3001 case CFCheck:
3002 default:
3003 /* // Check if CLIR invoke is activated: caller id not sent
3004 if ((cm_mo_prefix(0) & 0x0c) == 0x0c)
3005 display_info.TextId2 = TxtActivated;
3006 // By defaut the caller id is sent
3007 else
3008 display_info.TextId2 = TxtDeActivated;*/
3009 // Check if CLIR invoke is activated: caller id not sent
3010 // Apr 22, 2004 REF: CRR MMI-SPR-16873 Rashmi C N(Sasken)
3011 // Using the CLIR status maintained in the flash, when the status is checked
3012 if (FFS_flashData.CLIR)
3013 {
3014 display_info.TextId2 = TxtActivated;
3015 }
3016 // By defaut the caller id is sent
3017 else
3018 {
3019 display_info.TextId2 = TxtDeActivated;
3020 }
3021
3022 }
3023 break;
3024 case MFW_CL_PERM:
3025 // No CLIR suppress or invoke
3026 cm_mo_prefix(0x04);
3027 // No break
3028 case MFW_CL_UNKNOWN:
3029 default:
3030 // The CLIR is active and permanent the caller id is not sent
3031 // Apr 22, 2004 REF: CRR MMI-SPR-16873 Rashmi C N(Sasken)
3032 // Maintaing the CLIR status in the flash.
3033 FFS_flashData.CLIR=TRUE;
3034 flash_write();
3035 display_info.TextId2 = TxtActivated;
3036 break;
3037 }
3038 }
3039 // CLIR service is not activated: The caller id is sent
3040 else
3041 {
3042 // Dec 07, 2005 REF: OMAPS00050087 x0039928
3043 // Fix: String "Not Activated" is displayed if the network doesn't permit CLIR
3044 switch(CFAction)
3045 {
3046 case CFActivate:
3047 display_info.TextId2 = TxtNotActivated;
3048 break;
3049 case CFDeactivate:
3050 case CFCheck:
3051 default:
3052 display_info.TextId2 = TxtDeActivated;
3053 break;
3054 }
3055 // No CLIR suppress or invoke
3056 // Apr 22, 2004 REF: CRR MMI-SPR-16873 Rashmi C N(Sasken)
3057 // Maintaing the CLIR status in the flash.
3058 FFS_flashData.CLIR=FALSE;
3059 flash_write();
3060 cm_mo_prefix(0x04);
3061 }
3062
3063 // Call Info Screen
3064 ss_data.info_win = info_dialog (ss_data.win, &display_info);
3065
3066 }
3067
3068
3069
3070 /*******************************************************************************
3071
3072 $Function: showIMEI2
3073
3074 $Description:
3075
3076 $Returns:
3077
3078 $Arguments:
3079
3080 *******************************************************************************/
3081
3082 static void showIMEI2 (T_MFW_HND win, T_MFW_SS_PARA * ss_cnf)
3083 {
3084 T_DISPLAY_DATA display_info;
3085
3086 // July 09, 2005 REF : MMI-22565 - a0876501
3087 // Increased the IMEI_LEN from 15 to 17 for displaying the Cd byte & SW version.
3088 #define IMEI_LEN 17 /* IMEI + check digit = 15, IMEI + SW version = 16, IMEI + check digit + SW version = 17*/
3089 static char imei_array[IMEI_LEN+1];
3090 //GW IMEI number is 26 chars long!
3091 memset(imei_array,0x00,IMEI_LEN+1);
3092 memcpy(imei_array, ss_cnf->imei_info.imei_number, IMEI_LEN);
3093
3094 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull,TxtIMEI, TxtNull , COLOUR_STATUS);
3095 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FOREVER, KEY_CLEAR | KEY_LEFT );
3096 display_info.TextString2 = imei_array;
3097 /*
3098 * Call Info Screen
3099 */
3100
3101 ss_data.info_win = info_dialog (ss_data.win, &display_info);
3102
3103 }
3104
3105 /*******************************************************************************
3106
3107 $Function: showUSSDInfo
3108
3109 $Description: this is used for both USSD types (confirm and request).
3110 The USSD request is keep going after "showUSSDInfo"
3111 function and open the editor to enter the string.
3112
3113 $Returns:
3114
3115 $Arguments:
3116
3117 *******************************************************************************/
3118
3119
3120
3121 static void showUSSDInfo (T_MFW_HND win, USHORT ident, T_MFW_SS_PARA * ss_cnf, USHORT sk1, USHORT sk2)
3122 {
3123 #ifdef NEW_EDITOR
3124 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
3125 #else
3126 T_EDITOR_DATA editor_data;
3127 #endif
3128
3129 TRACE_FUNCTION("showUSSDInfo");
3130
3131
3132 /* keep the dcs; need it later for sending */
3133 ss_data.dcs = ss_cnf->ussd_info.dcs;
3134
3135 /* SPR#1428 - SH - New Editor changes */
3136
3137 #ifdef NEW_EDITOR
3138 AUI_edit_SetDefault(&editor_data);
3139 AUI_edit_SetDisplay(&editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR_XX, EDITOR_FONT);
3140 AUI_edit_SetMode(&editor_data, ED_MODE_READONLY, ED_CURSOR_NONE);
3141 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)ss_cnf->ussd_info.ussd, MAX_USSD_LEN);
3142 if (ident EQ ServicesUSSD_REQ_OK)
3143 {
3144 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtSoftBack, TxtSsMsg, NULL);
3145 }
3146 else
3147 {
3148 AUI_edit_SetTextStr(&editor_data, TxtNull, TxtSoftBack, TxtSsMsg, NULL);
3149 }
3150 AUI_edit_SetEvents(&editor_data, ident, TRUE, FOREVER, (T_AUI_EDIT_CB)services_info_cb);
3151
3152 AUI_edit_Start(ss_data.win, &editor_data); /* start the editor */
3153 #else /* NEW_EDITOR */
3154 editor_data.editor_attr.win.px = 6;
3155 editor_data.editor_attr.win.py = 12;
3156 editor_data.editor_attr.win.sx = 80;
3157 editor_data.editor_attr.win.sy = 20;
3158 editor_data.editor_attr.edtCol = COLOUR_EDITOR_XX,
3159 editor_data.editor_attr.font = 0;
3160 editor_data.editor_attr.mode = edtCurNone;
3161 editor_data.editor_attr.controls = 0;
3162
3163 editor_data.hide = FALSE;
3164 editor_data.editor_attr.text = (char*)ss_cnf->ussd_info.ussd;
3165 editor_data.editor_attr.size = sizeof(ss_cnf->ussd_info.ussd);
3166
3167 if (ident EQ ServicesUSSD_REQ_OK)
3168 {
3169 editor_data.LeftSoftKey = TxtSoftOK;
3170 editor_data.RightSoftKey = TxtSoftBack;
3171 }
3172 else
3173 {
3174 editor_data.LeftSoftKey = TxtNull;
3175 editor_data.RightSoftKey = TxtSoftBack;
3176 }
3177
3178 editor_data.AlternateLeftSoftKey = TxtNull;
3179 editor_data.TextString = TxtNull;
3180 editor_data.TextId = TxtSsMsg;
3181 editor_data.Identifier = ident;
3182 editor_data.mode = READ_ONLY_MODE;
3183 editor_data.timeout = FOREVER;
3184 editor_data.min_enter = 1;
3185 editor_data.Callback = (T_EDIT_CB)services_info_cb;
3186 editor_data.destroyEditor = TRUE;
3187
3188 /* create the dialog handler */
3189 editor_start(ss_data.win, &editor_data); /* start the editor */
3190 #endif /* NEW_EDITOR */
3191
3192 }
3193
3194
3195 /*******************************************************************************
3196
3197 $Function: showUSSDREQ
3198
3199 $Description: show USSD info from Request, and then allow user to enter a response.
3200
3201 $Returns:
3202
3203 $Arguments:
3204
3205 *******************************************************************************/
3206
3207
3208 static void showUSSDREQ (T_MFW_HND win, T_MFW_SS_PARA * ss_cnf)
3209 {
3210 TRACE_FUNCTION("showUSSDREQ");
3211
3212 showUSSDInfo(win, ServicesUSSD_REQ_OK, ss_cnf, TxtSoftOK, TxtSoftBack);
3213
3214 }
3215
3216
3217
3218 /*******************************************************************************
3219
3220 $Function: showUSSDCNF
3221
3222 $Description: display USSD message
3223
3224 $Returns:
3225
3226 $Arguments:
3227
3228 *******************************************************************************/
3229
3230
3231 static void showUSSDCNF (T_MFW_HND win, T_MFW_SS_PARA * ss_cnf)
3232 {
3233
3234 T_DISPLAY_DATA display_info;
3235 int nPixels = 0;
3236 int nchar = 0;
3237
3238 //Feb 17, 2005 REF : CRR 17657 x0012850 Divya.P.V
3239 //Bug : Unable to compose a one or two digit number
3240 //Fix : This bug is reproducible when a very long message is sent by the service provider when an invalid one or two digit number is dialled.
3241 //The read only editor with the service provider message that comes up when a one or two digit is dialled
3242 //was not handled properly. So altered the editor handling to cater for the long message.
3243 T_MFW_WIN *win_data;
3244 T_ss *data = NULL;
3245 T_AUI_EDITOR_DATA display_editor_info;
3246
3247 TRACE_FUNCTION("showUSSDCNF");
3248 /* API - 09-07-03 - CQ10728 - Add this check to use either the editor or the bubble depending
3249 on the size of the returned string */
3250 /* API - 27-08-03 - CQ10728 - Update, calculate the length of the string in number of pixels */
3251
3252 //Feb 17, 2005 REF : CRR 17657 x0012850 Divya.P.V
3253 //Bug : Unable to compose a one or two digit number
3254 //Fix : This bug is reproducible when a very long message is sent by the service provider when an invalid one or two digit number is dialled.
3255 //The read only editor with the service provider message that comes up when a one or two digit is dialled
3256 //was not handled properly. So altered the editor handling to cater for the long message.
3257 if(win)
3258 {
3259 win_data = ((T_MFW_HDR *)win)->data;
3260 if(win_data)
3261 data = (T_ss * )win_data->user;
3262 }
3263
3264 nchar = strlen((char *)ss_cnf->ussd_info.ussd);
3265 nPixels = dspl_GetTextExtent( (char *)ss_cnf->ussd_info.ussd, nchar);
3266 /* API - 27-08-03 - CQ10728 - END */
3267
3268 if (nPixels >= SCREEN_SIZE_X)
3269 {
3270 //Feb 17, 2005 REF : CRR 17657 x0012850 Divya.P.V
3271 //Bug : Unable to compose a one or two digit number
3272 //Fix : This bug is reproducible when a very long message is sent by the service provider when an invalid one or two digit number is dialled.
3273 //The read only editor with the service provider message that comes up when a one or two digit is dialled
3274 //was not handled properly. So altered the editor handling to cater for the long message.
3275 AUI_edit_SetDefault(&display_editor_info);
3276 AUI_edit_SetMode(&display_editor_info, ED_MODE_READONLY, ED_CURSOR_UNDERLINE);
3277 AUI_edit_SetBuffer(&display_editor_info, ATB_DCS_ASCII, (UBYTE*)ss_cnf->ussd_info.ussd, (USHORT)ss_cnf->ussd_info.len);
3278 AUI_edit_SetTextStr(&display_editor_info, TxtNull, TxtSoftBack,TxtNull,NULL);
3279 AUI_edit_SetEvents(&display_editor_info, 0, FALSE, FOREVER, (T_AUI_EDIT_CB)services_info_cb);
3280 display_editor_info.Identifier = ServicesUSSD_CNF_OK;
3281 data->info_win = AUI_edit_Start(data->win, &display_editor_info);
3282 }
3283 else
3284 {
3285 if (strlen((char *)ss_cnf->ussd_info.ussd) == 0)
3286 {
3287 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, TxtCommand, TxtCompleted, COLOUR_STATUS);
3288 }
3289 else
3290 {
3291 dlg_initDisplayData_TextStr(&display_info, TxtSoftOK, TxtNull, (char *)ss_cnf->ussd_info.ussd, NULL, COLOUR_STATUS);
3292 }
3293
3294 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FOREVER, KEY_HUP| KEY_LEFT);
3295 display_info.Identifier = ServicesUSSD_CNF_OK;
3296
3297 /*
3298 * Display Dialog Info Screen
3299 */
3300
3301 ss_data.info_win = info_dialog (ss_data.win, &display_info);
3302 }
3303 /*API - 09-07-03 CQ10728- END*/
3304 }
3305
3306
3307 /*******************************************************************************
3308
3309 $Function: sendUSSD
3310
3311 $Description: Send USSD message
3312
3313 $Returns:
3314
3315 $Arguments:
3316
3317 *******************************************************************************/
3318
3319 static void sendUSSD (T_MFW_SS_PARA *ussd_senddata)
3320 {
3321
3322 // unsigned int tLen = ussd_senddata->ussd_info.len; // RAVI
3323
3324 ss_cnf = ussd_senddata;
3325
3326 if (ss_send_ussd( (T_MFW_SS_USSD *) ss_cnf ) == MFW_SS_FAIL)
3327 {
3328 /* ussd data is wrong */
3329 showFailed( ss_data.win );
3330 }
3331 else
3332 if (servicesState == ServicesUSSDSendEdit)
3333 servicesExec(ServicesUSSDSendEdit_Ok, 0);
3334 else
3335 servicesExec(ServicesUSSDEnter_Send, 0);
3336 }
3337
3338
3339 /*******************************************************************************
3340
3341 $Function: showCFStatus
3342
3343 $Description: display CFU state
3344
3345 $Returns:
3346
3347 $Arguments:
3348
3349 *******************************************************************************/
3350
3351
3352 static void showCFStatus (T_MFW_HND win , T_ss * data)
3353 {
3354 T_DISPLAY_DATA display_info;
3355 T_ss_feature_cf_data * pFeature;
3356 static char str[50];
3357
3358
3359 TRACE_FUNCTION("showCFStatus");
3360
3361 //MC got rid of dodgy pointer arithmetic
3362 pFeature = &data->mfw_ss_cf->ss[data->current_feature];
3363
3364 if (data->max_feature == 1)
3365 {
3366 // Jun 10, 2004 REF: CRR MMI-SPR-13614 Rashmi C N(Sasken)
3367 // We are now passing the type of CF as the first stringID for the dialog info screen
3368 // serviceGetType(ss_Code) this function would return the string id for the ss_code being passed
3369 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, serviceGetType((T_MFW_SS_CODES)ss_Code), TxtNull, COLOUR_STATUS);
3370
3371 // Jun 04,2004 CRR:13601 xpradipg - SASKEN
3372 //the time parameter is changed from FOREVER to FIVE_SECS
3373 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FIVE_SECS, KEY_CLEAR| KEY_LEFT);
3374 }
3375 else
3376 {
3377 // Jun 10, 2004 REF: CRR MMI-SPR-13614 Rashmi C N(Sasken)
3378 // We are now passing the type of CF as the first stringID for the dialog info screen
3379 // serviceGetType(ss_Code) this function would return the string id for the ss_code being passed
3380 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtSoftNext, serviceGetType((T_MFW_SS_CODES)ss_Code), TxtNull, COLOUR_STATUS);
3381 //Jun 04,2004 CRR:13601 xpradipg - SASKEN
3382 //the time parameter is changed from FOREVER to FIVE_SECS
3383 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FIVE_SECS, KEY_CLEAR| KEY_LEFT | KEY_RIGHT );
3384 }
3385
3386 display_info.Identifier = E_SS_CF_CNF;
3387 memset(str, 0, 50);
3388 //Only show the number when activating call diverts
3389 if (pFeature->status == TxtActivated)
3390 {
3391 // Jun 10, 2004 REF: CRR MMI-SPR-13614 Rashmi C N(Sasken)
3392 // When call forward is activated, the service(i.e voice, fax or data) and the number to which it is forwarded
3393 // is passed as the second string for the dialog display. Only two strings or string IDs can be given for a
3394 //dialog info screen. Hence, we are adding the service and the number into one string.
3395 strcat(str,(char*)MmiRsrcGetText(pFeature->service));
3396 strcat(str," ");
3397 strcat(str,pFeature->forwarded_to_number);
3398 display_info.TextString2=str;
3399 }
3400 else /* SPR#2252 - DS - Show status */
3401 {
3402 display_info.TextId2 = pFeature->status;
3403 }
3404
3405 /*
3406 * Call Info Screen
3407 */
3408
3409 ss_data.info_win = info_dialog (ss_data.win, &display_info);
3410
3411 if (ss_data.info_win EQ NULL)
3412 {
3413 TRACE_FUNCTION("NOT ENOUGH RESOURCES TO CREATE EXT INFO DIALOG");
3414 }
3415 }
3416
3417
3418 /*******************************************************************************
3419
3420 $Function: showCBStatus
3421
3422 $Description: display CB state
3423
3424 $Returns:
3425
3426 $Arguments:
3427
3428 *******************************************************************************/
3429
3430
3431
3432 static void showCBStatus (T_MFW_HND win , T_ss * data)
3433 {
3434 T_DISPLAY_DATA display_info;
3435 T_ss_feature_cb_data * pFeature;
3436
3437 TRACE_FUNCTION("showCBStatus");
3438
3439 //MC got rid of dodgy pointer arithmetic
3440 pFeature = &data->mfw_ss_cb->ss[data->current_feature];
3441
3442 if (data->max_feature == 1)
3443 {
3444 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtNull, pFeature->service, pFeature->status, COLOUR_STATUS);
3445 //Jun 04,2004 CRR:13601 xpradipg - SASKEN
3446 //Timer value changed from FOREVER to FIVE_SECS
3447 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FIVE_SECS, KEY_CLEAR| KEY_LEFT);
3448 }
3449 else
3450 {
3451 dlg_initDisplayData_TextId( &display_info, TxtSoftOK, TxtSoftNext, pFeature->service, pFeature->status, COLOUR_STATUS);
3452 //Jun 04,2004 CRR:13601 xpradipg - SASKEN
3453 //Timer value changed from FOREVER to FIVE_SECS
3454 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, FIVE_SECS, KEY_CLEAR| KEY_LEFT | KEY_RIGHT );
3455 }
3456 display_info.Identifier = E_SS_CB_CNF; // can be used also for CF and CW
3457
3458 /*
3459 * Call Info Screen
3460 */
3461
3462 ss_data.info_win = info_dialog (ss_data.win, &display_info);
3463
3464 if (ss_data.info_win EQ NULL)
3465 {
3466 TRACE_FUNCTION("NOT ENOUGH RESOURCES TO CREATE EXT INFO DIALOG");
3467 }
3468 }
3469
3470 /*******************************************************************************
3471
3472 $Function: getCFAction
3473
3474 $Description: To return a string corresponding to call forwarding action.
3475
3476 $Returns:
3477
3478 $Arguments:
3479
3480 *******************************************************************************/
3481
3482
3483 static void getCFAction(char * pSSstring)
3484 {
3485 switch (CFAction)
3486 {
3487 case CFActivate:
3488 strcpy(pSSstring, "**");
3489 break;
3490 case CFDeactivate:
3491 strcpy(pSSstring, "##");
3492 break;
3493 case CFCheck:
3494 strcpy(pSSstring, "*#");
3495 break;
3496 default:
3497 break;
3498 }
3499
3500 }
3501
3502
3503 /*******************************************************************************
3504
3505 $Function: getCFType
3506
3507 $Description: To return a string corresponding to call forwarding type:
3508 CFU, CFNRy, CFU, etc.
3509
3510 $Returns:
3511
3512 $Arguments:
3513
3514 *******************************************************************************/
3515
3516
3517 static void getCFType(char* pSSstring)
3518 {
3519 switch (CFType)
3520 {
3521 case CFBusy:
3522 strcat(pSSstring, "67*");
3523 break;
3524 case CFNoReply:
3525 strcat(pSSstring, "61*");
3526 break;
3527 case CFNoReach:
3528 strcat(pSSstring, "62*");
3529 break;
3530 case CFUnconditional:
3531 strcat(pSSstring, "21*");
3532 break;
3533 case CFAllConditional:
3534 strcat(pSSstring, "004*");
3535 break;
3536 case CFAllCalls:
3537 strcat(pSSstring, "002*");
3538 break;
3539 default:
3540 break;
3541 }
3542 }
3543
3544
3545
3546
3547 /*******************************************************************************
3548
3549 $Function: getCFNumber
3550
3551 $Description:
3552
3553 $Returns:
3554
3555 $Arguments:
3556
3557 *******************************************************************************/
3558
3559 static void getCFNumber(char * pSSstring)
3560 {
3561
3562 strcat(pSSstring, ss_data.edt_buf_number);
3563 }
3564
3565
3566
3567 /*******************************************************************************
3568
3569 $Function: getCFService
3570
3571 $Description:
3572
3573 $Returns:
3574
3575 $Arguments:
3576
3577 *******************************************************************************/
3578
3579
3580 static void getCFService(char * pSSstring)
3581 {
3582
3583 switch (CFService)
3584 {
3585 case CFVoice:
3586 strcat(pSSstring, "*11"); //SPR#0776 - DS -changed from 10 to 11
3587 break;
3588 /*MC SPR 742, handle line 2, auxiliary telephony*/
3589 case CFAuxVoice:
3590 strcat(pSSstring, "*89");
3591 break;
3592 case CFFax:
3593 strcat(pSSstring, "*13");
3594 break;
3595 case CFData:
3596 strcat(pSSstring, "*20");
3597 break;
3598 default:
3599 break;
3600 }
3601 }
3602
3603
3604
3605 /*******************************************************************************
3606
3607 $Function: servicesSendCallDivert
3608
3609 $Description: Send out Call Divert String to MFW according to static variables.
3610
3611 $Returns:
3612
3613 $Arguments:
3614
3615 *******************************************************************************/
3616
3617
3618
3619 static int servicesSendCallDivert( char * divert_number)
3620 {
3621 char SS_string[60] = {'\0'};
3622
3623 /* build up SS string according to menu selections */
3624 getCFAction(SS_string);
3625 getCFType(SS_string);
3626 if (divert_number)
3627 strcat(SS_string, divert_number);
3628 else
3629 getCFNumber(SS_string);
3630 getCFService(SS_string);
3631 strcat(SS_string, "#");
3632
3633 { //save the status to SIM
3634 if (CFAction == CFActivate && CFType == CFUnconditional || CFType == CFAllCalls)
3635 switch (CFService)
3636 {
3637 case (CFVoice): /*MC SPR 742, handle line 2, auxiliary telephony*/
3638 case CFAuxVoice:
3639
3640 if (GetAlsLine() == MFW_SERV_LINE1)
3641 cphs_set_divert_status(MFW_CFLAG_SET,0,0,0);
3642 else
3643 cphs_set_divert_status(0,MFW_CFLAG_SET,0,0);
3644 break;
3645 case (CFData): cphs_set_divert_status(0,0,0,MFW_CFLAG_SET);break;
3646 case (CFFax): cphs_set_divert_status(0,0,MFW_CFLAG_SET,0);break;
3647 case (CFAll): if (GetAlsLine() == MFW_SERV_LINE1)
3648 cphs_set_divert_status(MFW_CFLAG_SET,0,MFW_CFLAG_SET,MFW_CFLAG_SET);
3649 else
3650 cphs_set_divert_status(0,MFW_CFLAG_SET,MFW_CFLAG_SET,MFW_CFLAG_SET);
3651 break;
3652 }
3653 if (CFAction == CFDeactivate && CFType == CFUnconditional || CFType == CFAllCalls)
3654 switch (CFService)
3655 {
3656 case (CFVoice):
3657 /*MC SPR 742, handle line 2, auxiliary telephony*/
3658 case CFAuxVoice:
3659
3660 if (GetAlsLine() == MFW_SERV_LINE1)
3661 cphs_set_divert_status(MFW_CFLAG_NOTSet,0,0,0);
3662 else
3663 cphs_set_divert_status(0,MFW_CFLAG_NOTSet,0,0);
3664 break;
3665 case (CFData): cphs_set_divert_status(0,0,0,MFW_CFLAG_NOTSet);break;
3666 case (CFFax): cphs_set_divert_status(0,0,MFW_CFLAG_NOTSet,0);break;
3667 case (CFAll): if (GetAlsLine() == MFW_SERV_LINE1)
3668 cphs_set_divert_status(MFW_CFLAG_NOTSet,0,MFW_CFLAG_NOTSet,MFW_CFLAG_NOTSet);
3669 else
3670 cphs_set_divert_status(0,MFW_CFLAG_NOTSet,MFW_CFLAG_NOTSet,MFW_CFLAG_NOTSet);
3671 break;
3672 }
3673 }
3674
3675
3676 TRACE_FUNCTION(SS_string);
3677
3678 if (ss_execute_transaction((UBYTE*)SS_string, 0) == MFW_SS_FAIL)
3679 {
3680 showFailed( ss_data.win );
3681 }
3682 return 0;
3683 }
3684
3685
3686
3687 /*******************************************************************************
3688
3689 $Function: servicesActivateCLIR
3690
3691 $Description: activate CLIR
3692
3693 $Returns:
3694
3695 $Arguments:
3696
3697 *******************************************************************************/
3698
3699 int servicesActivateCLIR(MfwMnu* m, MfwMnuItem* i) {
3700 char actstr[8];
3701
3702 CFAction = CFActivate;
3703 strcpy(actstr, "#31#");
3704
3705 if (ss_execute_transaction((UBYTE*)actstr, 0) == MFW_SS_FAIL)
3706 showFailed( ss_data.win );
3707 else
3708 {
3709 strcpy(actstr, "*#31#");
3710
3711 if (ss_execute_transaction((UBYTE*)actstr, 0) == MFW_SS_FAIL)
3712 showFailed( ss_data.win );
3713 }
3714
3715
3716 return 0;
3717 }
3718
3719
3720 /*******************************************************************************
3721
3722 $Function: servicesSuppressCLIR
3723
3724 $Description: suppress CLIR
3725
3726 $Returns:
3727
3728 $Arguments:
3729
3730 *******************************************************************************/
3731
3732
3733 int servicesDeactivateCLIR(MfwMnu* m, MfwMnuItem* i) {
3734 char actstr[8];
3735
3736 CFAction = CFDeactivate;
3737 strcpy(actstr, "*31#");
3738
3739 if (ss_execute_transaction((UBYTE*)actstr, 0) == MFW_SS_FAIL)
3740 showFailed( ss_data.win );
3741 else
3742 {
3743 strcpy(actstr, "*#31#");
3744
3745 if (ss_execute_transaction((UBYTE*)actstr, 0) == MFW_SS_FAIL)
3746 showFailed( ss_data.win );
3747 }
3748
3749 return 0;
3750 }
3751
3752 /*******************************************************************************
3753
3754 $Function: servicesCheckCLIR
3755
3756 $Description:
3757
3758 $Returns:
3759
3760 $Arguments:
3761
3762 *******************************************************************************/
3763
3764
3765
3766 int servicesCheckCLIR(MfwMnu* m, MfwMnuItem* i) {
3767 char actstr[8];
3768
3769 CFAction = CFCheck;
3770
3771 strcpy(actstr, "*#31#");
3772
3773 if (ss_execute_transaction((UBYTE*)actstr, 0) == MFW_SS_FAIL)
3774 showFailed( ss_data.win );
3775
3776 return 0;
3777 }
3778
3779
3780 /*******************************************************************************
3781
3782 $Function: servicesCheckCWaiting
3783
3784 $Description:
3785
3786 $Returns:
3787
3788 $Arguments:
3789
3790 *******************************************************************************/
3791
3792 int servicesCheckCWaiting(MfwMnu* m, MfwMnuItem* i) {
3793 char actstr[8];
3794
3795 strcpy(actstr, "*#43#");
3796
3797 if (ss_execute_transaction((UBYTE*)actstr, 0) == MFW_SS_FAIL)
3798 showFailed( ss_data.win );
3799
3800 return 0;
3801 }
3802
3803
3804 /*******************************************************************************
3805
3806 $Function: servicesActivateCWaiting
3807
3808 $Description: activate CallWaiting functionality
3809
3810 $Returns:
3811
3812 $Arguments:
3813
3814 *******************************************************************************/
3815
3816
3817 int servicesActivateCWaiting(MfwMnu* m, MfwMnuItem* i) {
3818 char actstr[8];
3819
3820
3821 /* JVJ #1586 Changed *43*10# to *43*# */
3822 strcpy(actstr, "*43*#");
3823
3824 if (ss_execute_transaction((UBYTE*)actstr, 0) == MFW_SS_FAIL)
3825 showFailed( ss_data.win );
3826
3827 return MFW_EVENT_CONSUMED;
3828 }
3829
3830
3831 /*******************************************************************************
3832
3833 $Function: servicesDeactivateCWaiting
3834
3835 $Description: deactivate CallWaiting functionality
3836
3837 $Returns:
3838
3839 $Arguments:
3840
3841 *******************************************************************************/
3842
3843
3844
3845 int servicesDeactivateCWaiting(MfwMnu* m, MfwMnuItem* i) {
3846 char actstr[8];
3847
3848 /* JVJ #1586 Changed #43*10# to #43# */
3849 strcpy(actstr, "#43#");
3850
3851 if (ss_execute_transaction((UBYTE*)actstr, 0) == MFW_SS_FAIL)
3852 showFailed( ss_data.win );
3853
3854 return MFW_EVENT_CONSUMED;
3855 }
3856
3857
3858
3859
3860 /*******************************************************************************
3861
3862 $Function: servicesInterCFU
3863
3864 $Description: Interrogate the CFU functionality
3865
3866 $Returns:
3867
3868 $Arguments:
3869
3870 *******************************************************************************/
3871
3872
3873
3874
3875 int servicesInterCFU(void)
3876 {
3877 char actstr[8];
3878
3879 strcpy(actstr, "*#21#");
3880
3881 ss_execute_transaction((UBYTE*)actstr, 0);
3882
3883 return 0;
3884 }
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895 /*******************************************************************************
3896
3897 $Function: ServiceGetStatus
3898
3899 $Description: return the code for the MMI text string for the service status.
3900
3901 $Returns:
3902
3903 $Arguments:
3904
3905 *******************************************************************************/
3906
3907
3908 unsigned int ServiceGetStatus( UBYTE pStatus)
3909 {
3910 unsigned int strStatusCode = 0;
3911
3912 TRACE_FUNCTION("++ ServiceGetStatus");
3913
3914 if (pStatus & SS_STAT_ACTIVE)
3915 strStatusCode = TxtActivated;
3916 /* Marcus: Issue 1652: 03/02/2003: Removed NDH 10/06/03 */
3917 else
3918 strStatusCode = TxtDeActivated;
3919 return strStatusCode;
3920 }
3921
3922
3923 /*******************************************************************************
3924
3925 $Function: serviceGetServiceType
3926
3927 $Description: return the code for the MMI text string for the service type.
3928
3929 $Returns:
3930
3931 $Arguments:
3932
3933 *******************************************************************************/
3934
3935
3936 unsigned int serviceGetServiceType( UBYTE ss_telecom_type, UBYTE ss_telecom_service)
3937 {
3938 unsigned int strServCode = 0;
3939
3940 TRACE_FUNCTION("++ serviceGetServiceType");
3941 switch ( ss_telecom_type )
3942 {
3943 case MFW_BST_UNKNOWN:
3944 break;
3945
3946 case MFW_BST_TELE:
3947 switch ( ss_telecom_service )
3948 {
3949 case MFW_TS_ALL_TS: strServCode = TxtAllCalls; break;/* all teleservices */
3950 case MFW_TS_ALL_SPCH: /* All speech transmission services */
3951 case MFW_TS_TLPHNY: /* telephony */
3952 case MFW_TS_EMRGNCY: /* emergency calls */
3953 strServCode = TxtVoice;
3954 break;
3955 case MFW_TS_ALL_SMS: /* all SMS services */
3956 case MFW_TS_SMS_MT: /* SMS MT PP */
3957 case MFW_TS_SMS_MO: /* SMS MO PP */
3958 /*strServCode = TxtSMS;*/
3959 break;
3960 case MFW_TS_ALL_FAX: /* all FAX transmission services */
3961 case MFW_TS_FAX3_ALT_SPCH: /* FAX group 3 alter. speech */
3962 case MFW_TS_FAX3_AUTO: /* FAX group 3 automatic */
3963 case MFW_TS_FAX4: /* FAX group 4 */
3964 strServCode = TxtFax;
3965 break;
3966 case MFW_TS_ALL_DATA: strServCode = TxtData; break;/* all FAX and SMS services */
3967 case MFW_TS_ALL_XCPT_SMS: strServCode = TxtNotImplemented;
3968 TRACE_FUNCTION("all x SMS"); break;/* all FAX and speech services */
3969 case MFW_TS_ALL_PSSS: strServCode = 0; break;/* all PLMN specific TS */
3970 case MFW_TS_PLMN1: /* PLMN specific TS 1 */
3971 case MFW_TS_PLMN2: /* PLMN specific TS 2 */
3972 case MFW_TS_PLMN3: /* PLMN specific TS 3 */
3973 case MFW_TS_PLMN4: /* PLMN specific TS 4 */
3974 case MFW_TS_PLMN5: /* PLMN specific TS 5 */
3975 case MFW_TS_PLMN6: /* PLMN specific TS 6 */
3976 case MFW_TS_PLMN7: /* PLMN specific TS 7 */
3977 case MFW_TS_PLMN8: /* PLMN specific TS 8 */
3978 case MFW_TS_PLMN9: /* PLMN specific TS 9 */
3979 case MFW_TS_PLMNA: /* PLMN specific TS A */
3980 case MFW_TS_PLMNB: /* PLMN specific TS B */
3981 case MFW_TS_PLMNC: /* PLMN specific TS C */
3982 case MFW_TS_PLMND: /* PLMN specific TS D */
3983 case MFW_TS_PLMNE: /* PLMN specific TS E */
3984 case MFW_TS_PLMNF: /* PLMN specific TS F */
3985 strServCode = 0;
3986 break;
3987
3988 default: break;
3989
3990 }
3991 break;
3992
3993 /* NOTE that we are returning "Data" for all Bearer services until otherwise spec'ed */
3994 case MFW_BST_BEARER:
3995 switch ( ss_telecom_service )
3996 {
3997 case MFW_BS_ALL_BS : strServCode = TxtNotImplemented; /* strServCode = TxtAllServices; */ break; /* all bearer services */
3998 case MFW_BS_ALL_DATA_CDA : /* all data CDA services */
3999 case MFW_BS_CDA_300 : /* data CDA 300 bps */
4000 case MFW_BS_CDA_1200 : /* data CDA 1200 bps */
4001 case MFW_BS_CDA_1200_75 : /* data CDA 1200/75 bps */
4002 case MFW_BS_CDA_2400 : /* data CDA 2400 bps */
4003 case MFW_BS_CDA_4800 : /* data CDA 4800 bps */
4004 case MFW_BS_CDA_9600 : /* data CDA 9600 bps */
4005 case MFW_BS_ALL_DATA_CDS : /* all data CDS services */
4006 case MFW_BS_CDS_1200 : /* data CDS 1200 bps */
4007 case MFW_BS_CDS_2400 : /* data CDS 2400 bps */
4008 case MFW_BS_CDS_4800 : /* data CDS 4800 bps */
4009 case MFW_BS_CDS_9600 : /* data CDS 9600 bps */
4010 case MFW_BS_ALL_DATA_PAD : /* all data PAD services */
4011 case MFW_BS_PAD_300 : /* data PAD 300 bps */
4012 case MFW_BS_PAD_1200 : /* data PAD 1200 bps */
4013 case MFW_BS_PAD_1200_75 : /* data PAD 1200/75 bps */
4014 case MFW_BS_PAD_2400 : /* data PAD 2400 bps */
4015 case MFW_BS_PAD_4800 : /* data PAD 4800 bps */
4016 case MFW_BS_PAD_9600 : /* data PAD 9600 bps */
4017 case MFW_BS_ALL_DATA_PDS : /* all data PDS services */
4018 case MFW_BS_PDS_2400 : /* data PDS 2400 bps */
4019 case MFW_BS_PDS_4800 : /* data PDS 4800 bps */
4020 case MFW_BS_PDS_9600 : /* data PDS 9600 bps */
4021 case MFW_BS_SPCH_ALT_CDA : /* all data CDA alter. speech */
4022 case MFW_BS_SPCH_ALT_CDS : /* all data CDS alter. speech */
4023 case MFW_BS_SPCH_FLD_CDA : /* all data speech followed CDA */
4024 case MFW_BS_SPCH_FLD_CDS : /* all data speech followed CDA */
4025 case MFW_BS_ALL_DC_ASYN : /* all data circuit asynchronous */
4026 case MFW_BS_ALL_ASYN : /* all asynchronous services */
4027 case MFW_BS_ALL_DC_SYN : /* all data circuit synchronous */
4028 case MFW_BS_ALL_SYN : /* all synchronous services */
4029 case MFW_BS_ALL_PSSS : /* all PLMN specific BS */
4030 case MFW_BS_PLMN1 : /* PLMN specific 1 */
4031 case MFW_BS_PLMN2 : /* PLMN specific 2 */
4032 case MFW_BS_PLMN3 : /* PLMN specific 3 */
4033 case MFW_BS_PLMN4 : /* PLMN specific 4 */
4034 case MFW_BS_PLMN5 : /* PLMN specific 5 */
4035 case MFW_BS_PLMN6 : /* PLMN specific 6 */
4036 case MFW_BS_PLMN7 : /* PLMN specific 7 */
4037 case MFW_BS_PLMN8 : /* PLMN specific 8 */
4038 case MFW_BS_PLMN9 : /* PLMN specific 9 */
4039 case MFW_BS_PLMNA : /* PLMN specific A */
4040 case MFW_BS_PLMNB : /* PLMN specific B */
4041 case MFW_BS_PLMNC : /* PLMN specific C */
4042 case MFW_BS_PLMND : /* PLMN specific D */
4043 case MFW_BS_PLMNE : /* PLMN specific E */
4044 case MFW_BS_PLMNF : /* PLMN specific F */
4045 strServCode = 0; break;
4046
4047 default: break;
4048
4049 }
4050 break;
4051
4052 default:
4053 break;
4054 }
4055 return strServCode;
4056 }
4057
4058
4059 /*******************************************************************************
4060
4061 $Function: serviceGetError
4062
4063 $Description:
4064
4065 $Returns:
4066
4067 $Arguments:
4068
4069 *******************************************************************************/
4070
4071
4072
4073 static unsigned int serviceGetError( T_MFW_SS_ERROR ss_error )
4074 {
4075 unsigned int errStrCode = TxtNotAvailable;
4076 TRACE_FUNCTION("serviceGetError");
4077
4078 switch (ss_error)
4079 {
4080 case MFW_SS_ERR_UNKNOWN:
4081 errStrCode=TxtErrUnknown;
4082 break;
4083 case MFW_SS_ERROR:
4084 errStrCode=TxtSSErr;
4085 break;
4086 case MFW_SS_ERR_UNKNOWN_SUBSCRIBER:
4087 errStrCode=TxtUnknownSub;
4088 break;
4089 case MFW_SS_ERR_ILLEGAL_SUBSCRIBER:
4090 errStrCode=TxtIllSub;
4091 break;
4092 case MFW_SS_ERR_BEARER_SVC_NOT_PROV:
4093 case MFW_SS_ERR_TELE_SVC_NOT_PROV:
4094 errStrCode = TxtNotSubscribed;
4095 break;
4096 case MFW_SS_ERR_ILLEGAL_EQUIPMENT:
4097 errStrCode = TxtIllEqip;
4098 break;
4099 case MFW_SS_ERR_CALL_BARRED:
4100 errStrCode = TxtBarred;
4101 break;
4102 case MFW_SS_ERR_ILLEGAL_SS_OPERATION:
4103 errStrCode = TxtIllOp;
4104 break;
4105 case MFW_SS_ERR_SS_ERR_STATUS:
4106 errStrCode = TxtCheckStatus;
4107 break;
4108 case MFW_SS_ERR_SS_NOT_AVAIL:
4109 errStrCode = TxtNotAvailable;
4110 break;
4111 case MFW_SS_ERR_SS_SUBS_VIOLATION:
4112 errStrCode = TxtSubVil;
4113 break;
4114 case MFW_SS_ERR_SS_INCOMP:
4115 errStrCode = TxtInComp;
4116 break;
4117 case MFW_SS_ERR_FAC_NOT_SUPPORTED:
4118 errStrCode = TxtFacNoSup;
4119 break;
4120 case MFW_SS_ERR_ABSENT_SUBS:
4121 errStrCode = TxtAbsSub;
4122 break;
4123 case MFW_SS_ERR_SYSTEM_FAIL:
4124 errStrCode = TxtSysFail;
4125 break;
4126 case MFW_SS_ERR_DATA_MISSING:
4127 errStrCode = TxtMissDta;
4128 break;
4129 case MFW_SS_ERR_UNEXPECT_DATA:
4130 case MFW_SS_ERR_PROB_UNEXP_ERR:
4131 case MFW_SS_RES_PROB_RET_RES_UNEXP:
4132 case MFW_SS_ERR_PROB_RET_ERR_UNEXP:
4133 case MFW_SS_INV_PROB_LNK_RES_UNEXP:
4134 case MFW_SS_INV_PROB_UNEXP_LNK_OP:
4135 errStrCode = TxtUnexDta;
4136 break;
4137 case MFW_SS_ERR_PWD_REG_FAIL:
4138 errStrCode = TxtPwdErr;
4139 break;
4140 case MFW_SS_ERR_NEG_PWD_CHECK:
4141 errStrCode = TxtCodeInc;
4142 break;
4143 case MFW_SS_ERR_NUM_PWD_VIOLATION:
4144 errStrCode = TxtBlckPerm;
4145 break;
4146 case MFW_SS_ERR_UNKNOWN_ALPHA:
4147 errStrCode = TxtUnkAlph;
4148 break;
4149 case MFW_SS_ERR_USSD_BUSY:
4150 errStrCode = TxtNetworkBusy;
4151 break;
4152 case MFW_SS_ERR_MAX_NUM_MPTY_EXCEED:
4153 errStrCode = TxtMaxMpty;
4154 break;
4155 case MFW_SS_ERR_RESOURCE_NOT_AVAIL:
4156 errStrCode = TxtOperationNotAvail;
4157 break;
4158 case MFW_SS_RES_PROB_UNRECOG_INV_ID:
4159 case MFW_SS_INV_PROB_UNRECOG_LNK_ID:
4160 case MFW_SS_ERR_PROB_UNRECOG_INV_ID:
4161 case MFW_SS_GEN_PROB_UNRECOG_CMP:
4162 case MFW_SS_INV_PROB_UNRECOG_OP:
4163 case MFW_SS_ERR_PROB_UNRECOG_ERR:
4164 errStrCode = TxtUnRec;
4165 break;
4166 case MFW_SS_RES_PROB_MISTYPED_PAR:
4167 case MFW_SS_GEN_PROB_MISTYPED_CMP:
4168 case MFW_SS_INV_PROB_MISTYPED_PAR:
4169 case MFW_SS_ERR_PROB_MISTYPED_PAR:
4170 errStrCode = TxtMisTyp;
4171 break;
4172 case MFW_SS_GEN_PROB_BAD_STRUCT_CMP:
4173 errStrCode = TxtBadStruct;
4174 break;
4175 case MFW_SS_INV_PROB_DUPL_INV_ID:
4176 errStrCode = TxtDupInv;
4177 break;
4178 case MFW_SS_INV_PROB_RESOURCE_LIM:
4179 errStrCode = TxtResLim;
4180 break;
4181 case MFW_SS_INV_PROB_INIT_RELEASE:
4182 errStrCode = TxtIniRel;
4183 break;
4184 case MFW_SS_ERR_FATAL_INV_RESULT:
4185 case MFW_SS_ERR_FATAL_CCD_DEC:
4186 case MFW_SS_ERR_FATAL_SS_ENT:
4187 errStrCode = TxtFatRes;
4188 break;
4189 default:
4190 break;
4191 }
4192 return errStrCode;
4193 }
4194
4195 /*******************************************************************************
4196
4197 $Function: serviceGetType
4198
4199 $Description: Return code of text string that indicates the SS Type
4200 CW, CF, CFU, etc
4201
4202 $Returns:
4203
4204 $Arguments:
4205
4206 *******************************************************************************/
4207
4208
4209 unsigned int serviceGetType( T_MFW_SS_CODES type )
4210 {
4211 unsigned int strTypeCode = 0;
4212
4213 TRACE_FUNCTION("++ serviceGetType");
4214
4215 switch (type)
4216 {
4217 case SS_CODES_UNKNOWN:
4218 /* Marcus: Issue 1652: 03/02/2003: Start */
4219 TRACE_EVENT("SS_CODES_UNKNOWN");
4220 strTypeCode = TxtUnknown;
4221 /* Marcus: Issue 1652: 03/02/2003: End */
4222 break;
4223
4224 case SS_CF_ALL:
4225 strTypeCode = TxtAllDivert;
4226 break;
4227
4228 case SS_CF_ALL_COND:
4229 strTypeCode = TxtCondDivert;
4230 break;
4231
4232 case SS_CF_CFU:
4233 strTypeCode = TxtAllCallsDivert;
4234 break;
4235
4236 case SS_CF_CFNRy:
4237 strTypeCode = TxtNoAnsDivert ;
4238 break;
4239
4240 case SS_CF_CFNR:
4241 strTypeCode = TxtNoReachDivert;
4242 break;
4243
4244 case SS_CF_CFB:
4245 strTypeCode = TxtBusyDivert;
4246 break;
4247
4248 case SS_CB_BAOC:
4249 strTypeCode = TxtCallBAOC;
4250 break;
4251 case SS_CB_BAOIC:
4252 strTypeCode = TxtCallBAOIC;
4253 break;
4254 case SS_CB_BAOICexH:
4255 strTypeCode = TxtCallBAOICexH;
4256 break;
4257 case SS_CB_BAIC:
4258 strTypeCode = TxtCallBAIC;
4259 break;
4260 case SS_CB_BAICroam:
4261 strTypeCode = TxtCallBAICroam;
4262 break;
4263 case SS_CB_ALL:
4264 strTypeCode = TxtCallBarringAll;
4265 break;
4266 case SS_CB_ALL_BAOC:
4267 strTypeCode = TxtCallBAOCAll;
4268 break;
4269 case SS_CB_ALL_BAIC:
4270 strTypeCode = TxtCallBAICAll;
4271 break;
4272
4273 case SS_CW:
4274 strTypeCode = TxtCallWaiting;
4275 break;
4276
4277 case SS_CCBS:
4278 break;
4279
4280 case SS_CLIP:
4281 strTypeCode = TxtCLIP;
4282 break;
4283 case SS_CLIR:
4284 strTypeCode = TxtSendID;
4285 break;
4286
4287 case SS_COLP:
4288 strTypeCode = TxtCOLP;
4289 break;
4290 case SS_COLR:
4291 strTypeCode = TxtCOLR;
4292 break;
4293
4294 case SS_PIN1:
4295 case SS_PIN2:
4296 break;
4297
4298 default:
4299 break;
4300 }
4301 return strTypeCode;
4302 }
4303
4304
4305 /*******************************************************************************
4306
4307 $Function: serviceGetCategory
4308
4309 $Description: return the code for the MMI text string for the service category.
4310
4311 $Returns:
4312
4313 $Arguments:
4314
4315 *******************************************************************************/
4316
4317 unsigned int serviceGetCategory( T_MFW_SS_CATEGORY cat )
4318 {
4319 unsigned int strCatCode = 0;
4320
4321 TRACE_FUNCTION("++ serviceGetCategory");
4322
4323 switch ( cat )
4324 {
4325 case SS_CTG_UNKNOWN:
4326 break;
4327
4328 case SS_REGISTRATION:
4329 case SS_ACTIVATION:
4330 strCatCode = TxtActivated;
4331 break;
4332
4333 case SS_ERASURE:
4334 case SS_DEACTIVATION:
4335 strCatCode = TxtDeActivated;
4336 break;
4337
4338 case SS_INTERROGATION:
4339 TRACE_FUNCTION("SS Interrogation");
4340 break;
4341
4342 default:
4343 break;
4344 }
4345 return strCatCode;
4346 }
4347
4348
4349 /*******************************************************************************
4350
4351 $Function: servicesDivertActivate
4352
4353 $Description:
4354
4355 $Returns:
4356
4357 $Arguments:
4358
4359 *******************************************************************************/
4360
4361
4362
4363 void servicesDivertActivate(void)
4364 {
4365 TRACE_FUNCTION("servicesDivertActivate");
4366 CFAction = CFActivate;
4367 }
4368
4369 /*******************************************************************************
4370
4371 $Function: servicesDivertCheck
4372
4373 $Description:
4374
4375 $Returns:
4376
4377 $Arguments:
4378
4379 $History:
4380
4381 //SPR#0776 - DS -Now takes service type into account by calling getCFServiceCheck.
4382
4383 *******************************************************************************/
4384
4385
4386 void servicesDivertCheck(void)
4387 {
4388 char SS_string[60] = {'\0'};
4389 /*
4390 * Interrogate Call Divert
4391 */
4392 TRACE_FUNCTION("servicesDivertCheck");
4393
4394 CFAction = CFCheck;
4395
4396 getCFAction(SS_string);
4397 getCFType(SS_string);
4398 getCFService(SS_string); //SPR#929 - DS - Changed from getCFServiceCheck.
4399 strcat(SS_string, "#");
4400
4401 TRACE_FUNCTION(SS_string);
4402
4403 if (ss_execute_transaction((UBYTE*)SS_string, 0) == MFW_SS_FAIL)
4404 showFailed( ss_data.win );
4405
4406 }
4407
4408 /*******************************************************************************
4409
4410 $Function: servicesDivertDeactivate
4411
4412 $Description:
4413
4414 $Returns:
4415
4416 $Arguments:
4417
4418 $History
4419
4420 //SPR#0776 - DS -Now takes service type into account by calling getCFServiceCheck.
4421
4422 *******************************************************************************/
4423
4424
4425
4426 void servicesDivertDeactivate(void)
4427 {
4428 char SS_string[60] = {'\0'};
4429 /*
4430 * Deactivate Call Divert
4431 */
4432 TRACE_FUNCTION("servicesDivertDeactivate");
4433
4434 CFAction = CFDeactivate;
4435
4436 getCFAction(SS_string);
4437 getCFType(SS_string);
4438 getCFService(SS_string); //SPR#929 - DS - Changed from getCFServiceCheck.
4439 SS_string[strlen(SS_string)] = '#';
4440
4441 TRACE_FUNCTION(SS_string);
4442 if (CFAction == CFDeactivate && CFType == CFUnconditional || CFType == CFAllCalls)
4443 switch (CFService)
4444 {
4445 case (CFVoice):
4446 /*MC SPR 742, handle line 2, auxiliary telephony*/
4447 case CFAuxVoice:
4448
4449 if (GetAlsLine() == MFW_SERV_LINE1)
4450 cphs_set_divert_status(MFW_CFLAG_NOTSet,0,0,0);
4451 else
4452 cphs_set_divert_status(0,MFW_CFLAG_NOTSet,0,0);
4453 break;
4454 case (CFData): cphs_set_divert_status(0,0,0,MFW_CFLAG_NOTSet);break;
4455 case (CFFax): cphs_set_divert_status(0,0,MFW_CFLAG_NOTSet,0);break;
4456 case (CFAll):
4457 if (GetAlsLine() == MFW_SERV_LINE1)
4458 cphs_set_divert_status(MFW_CFLAG_NOTSet,0,MFW_CFLAG_NOTSet,MFW_CFLAG_NOTSet);
4459 else
4460 cphs_set_divert_status(0,MFW_CFLAG_NOTSet,MFW_CFLAG_NOTSet,MFW_CFLAG_NOTSet);
4461 break;
4462 }
4463 if (ss_execute_transaction((UBYTE*)SS_string, 0) == MFW_SS_FAIL)
4464 showFailed( ss_data.win );
4465
4466 }
4467
4468 /*******************************************************************************
4469
4470 $Function: servicesDivertVoice
4471
4472 $Description:
4473
4474 $Returns:
4475
4476 $Arguments:
4477
4478 *******************************************************************************/
4479
4480
4481
4482 void servicesDivertVoice(void)
4483 {
4484 TRACE_FUNCTION("servicesDivertVoice");
4485 /*mc SPR 742 check if line2 is the current line*/
4486 if (!ALSPresent(NULL, NULL, NULL) && GetAlsLine() == MFW_SERV_LINE2/*FFS_flashData.als_selLine == MFW_SERV_LINE2*/)
4487 CFService = CFAuxVoice;
4488 else /*mc end*/
4489 CFService = CFVoice;
4490 }
4491
4492 /*******************************************************************************
4493
4494 $Function: servicesDivertFax
4495
4496 $Description:
4497
4498 $Returns:
4499
4500 $Arguments:
4501
4502 *******************************************************************************/
4503
4504
4505
4506 void servicesDivertFax(void)
4507 {
4508 TRACE_FUNCTION("servicesDivertFax");
4509 CFService = CFFax;
4510 }
4511
4512
4513 /*******************************************************************************
4514
4515 $Function: servicesDivertData
4516
4517 $Description:
4518
4519 $Returns:
4520
4521 $Arguments:
4522
4523 *******************************************************************************/
4524
4525
4526 void servicesDivertData(void)
4527 {
4528 TRACE_FUNCTION("servicesDivertData");
4529 CFService = CFData;
4530 }
4531
4532 /*******************************************************************************
4533
4534 $Function: servicesDivertActionAll
4535
4536 $Description:
4537
4538 $Returns:
4539
4540 $Arguments:
4541
4542 *******************************************************************************/
4543
4544
4545
4546 void servicesDivertActionAll(void)
4547 {
4548 TRACE_FUNCTION("servicesDivertActionAll");
4549 CFService = CFAll;
4550 }
4551
4552
4553 /*******************************************************************************
4554
4555 $Function: servicesDivertBusy
4556
4557 $Description:
4558
4559 $Returns:
4560
4561 $Arguments:
4562
4563 *******************************************************************************/
4564
4565
4566 void servicesDivertBusy(void)
4567 {
4568 TRACE_FUNCTION("servicesDivertBusy");
4569 CFType = CFBusy;
4570 }
4571
4572 /*******************************************************************************
4573
4574 $Function: servicesDivertNoAnswer
4575
4576 $Description:
4577
4578 $Returns:
4579
4580 $Arguments:
4581
4582 *******************************************************************************/
4583
4584
4585 void servicesDivertNoAnswer(void)
4586 {
4587 TRACE_FUNCTION("servicesDivertNoAnswer");
4588 CFType = CFNoReply;
4589 }
4590
4591 /*******************************************************************************
4592
4593 $Function: servicesDivertNotReachable
4594
4595 $Description:
4596
4597 $Returns:
4598
4599 $Arguments:
4600
4601 *******************************************************************************/
4602
4603
4604 void servicesDivertNotReachable(void)
4605 {
4606 TRACE_FUNCTION("servicesDivertNotReachable");
4607 CFType = CFAllConditional;
4608 }
4609
4610 /*******************************************************************************
4611
4612 $Function: servicesDivertNoService
4613
4614 $Description:
4615
4616 $Returns:
4617
4618 $Arguments:
4619
4620 *******************************************************************************/
4621
4622
4623 void servicesDivertNoService(void)
4624 {
4625 TRACE_FUNCTION("servicesDivertNoService");
4626 CFType = CFNoReach;
4627 }
4628
4629
4630 /*******************************************************************************
4631
4632 $Function: servicesDivertAllCalls
4633
4634 $Description:
4635
4636 $Returns:
4637
4638 $Arguments:
4639
4640 *******************************************************************************/
4641
4642
4643 void servicesDivertAllCalls(void)
4644 {
4645 TRACE_FUNCTION("servicesDivertAllCalls");
4646 CFType = CFUnconditional;
4647 }
4648
4649 /*******************************************************************************
4650
4651 $Function: servicesDivertCancelAll
4652
4653 $Description:
4654
4655 $Returns:
4656
4657 $Arguments:
4658
4659 *******************************************************************************/
4660
4661
4662 void servicesDivertCancelAll(void)
4663 {
4664 TRACE_FUNCTION("servicesDivertCancelAll");
4665 CFType = CFAllCalls;
4666 CFAction = CFDeactivate;
4667 CFService = CFAll;
4668 servicesSendCallDivert(0);
4669 }
4670
4671 /*******************************************************************************
4672
4673 $Function: servicesBarringAllOutgoing
4674
4675 $Description:
4676
4677 $Returns:
4678
4679 $Arguments:
4680
4681 *******************************************************************************/
4682
4683
4684 void servicesBarringAllOutgoing(void)
4685 {
4686 TRACE_FUNCTION("servicesBarringAllOutgoing");
4687 CBType = CBAllOutgoing;
4688 }
4689
4690 /*******************************************************************************
4691
4692 $Function: servicesBarringInternational
4693
4694 $Description:
4695
4696 $Returns:
4697
4698 $Arguments:
4699
4700 *******************************************************************************/
4701
4702
4703
4704 void servicesBarringInternational(void)
4705 {
4706 TRACE_FUNCTION("servicesBarringInternational");
4707 CBType = CBInternational;
4708 }
4709
4710 /*******************************************************************************
4711
4712 $Function: servicesBarringInternationalHome
4713
4714 $Description:
4715
4716 $Returns:
4717
4718 $Arguments:
4719
4720 *******************************************************************************/
4721
4722
4723 void servicesBarringInternationalHome(void)
4724 {
4725 TRACE_FUNCTION("servicesBarringInternationalHome");
4726 CBType = CBInternationalHome;
4727 }
4728
4729
4730 /*******************************************************************************
4731
4732 $Function: servicesBarringAllIncoming
4733
4734 $Description:
4735
4736 $Returns:
4737
4738 $Arguments:
4739
4740 *******************************************************************************/
4741
4742
4743
4744 void servicesBarringAllIncoming(void)
4745 {
4746 TRACE_FUNCTION("servicesBarringAllIncoming");
4747 CBType = CBAllIncoming;
4748 }
4749
4750 /*******************************************************************************
4751
4752 $Function: servicesBarringIncomingRoaming
4753
4754 $Description:
4755
4756 $Returns:
4757
4758 $Arguments:
4759
4760 *******************************************************************************/
4761
4762
4763 void servicesBarringIncomingRoaming(void)
4764 {
4765 TRACE_FUNCTION("servicesBarringIncomingRoaming");
4766 CBType = CBIncomingRoaming;
4767 }
4768
4769
4770 /*******************************************************************************
4771
4772 $Function: services_get_voice_number_cb
4773
4774 $Description: callback function for the enter voicemail number window
4775
4776 $Returns:
4777
4778 $Arguments:
4779
4780 *******************************************************************************/
4781
4782
4783 #ifdef NEW_EDITOR
4784 static void services_get_voice_number_cb(T_MFW_HND win, USHORT identifier, SHORT reason)
4785 {
4786 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
4787 T_services_input * data = (T_services_input *)win_data->user;
4788
4789 TRACE_FUNCTION("services_get_voice_number_cb");
4790
4791 switch (reason)
4792 {
4793 case INFO_KCD_LEFT:
4794 TRACE_FUNCTION("SERVICES_INPUT_LEFT");
4795 services_input_destroy(ss_data.input_number_win);
4796 /* send number if one has been entered */
4797 if (strlen(ss_data.edt_buf_number) > 0 )
4798 SEND_EVENT(data->parent_win, SERVICES_DO_CALL_VOICE_DIVERT, 0, 0);
4799 break;
4800
4801 case INFO_KCD_ALTERNATELEFT:
4802 TRACE_FUNCTION("SERVICES_INPUT_ALTERNATELEFT");
4803 /* Go to phone book */
4804 if (bookPhoneBookLoading()==BOOK_SUCCESS)
4805 {
4806 // T_MFW_HND phbk_win; // RAVI
4807 bookPhonebookStart(win,PhbkFromDivert); // RAVI - Removed Assignment phbk_win = .
4808 }
4809
4810 break;
4811
4812 case INFO_KCD_HUP:
4813 case INFO_KCD_RIGHT:
4814 TRACE_FUNCTION("SERVICES_INPUT_RIGHT/HUP");
4815 services_input_destroy(ss_data.input_number_win);
4816 break;
4817 default:
4818 break;
4819 }
4820 }
4821
4822 #else /* NEW_EDITOR */
4823 static void services_get_voice_number_cb(T_MFW_HND win, USHORT reason)
4824 {
4825 TRACE_FUNCTION("services_get_voice_number_cb");
4826
4827 switch (reason){
4828 case SERVICES_INPUT_LEFT:
4829 TRACE_FUNCTION("SERVICES_INPUT_LEFT");
4830 /* send number if one has been entered */
4831 if (strlen(ss_data.edt_buf_number) > 0 )
4832 SEND_EVENT(win, SERVICES_DO_CALL_VOICE_DIVERT, 0, 0);
4833 break;
4834 default:
4835 break;
4836 }
4837 }
4838 #endif /* NEW_EDITOR */
4839
4840
4841 /*******************************************************************************
4842
4843 $Function: servicesDoVoiceMailNumber
4844
4845 $Description: this function should access voicemail number if it is already
4846 entered, otherwise allow access to voicemail editing window
4847
4848 $Returns:
4849
4850 $Arguments:
4851
4852 *******************************************************************************/
4853
4854
4855
4856
4857 void servicesDoVoiceMailNumber(void)
4858 {
4859 char voiceNum[30] = {'\0'};
4860
4861 TRACE_FUNCTION("servicesDoVoiceMailNumber");
4862
4863 //JVJEmsgsGetVoiceAddress(voiceNum);
4864
4865 /* instead of the above we should use something like: */
4866 if ( strlen(voiceNum) > 0)
4867 {
4868 servicesSendCallDivert(voiceNum);
4869 }
4870 else
4871 {
4872 T_ss * data = &ss_data;
4873 T_input_properties input;
4874
4875 memset(data->edt_buf_number,'\0',PHB_MAX_LEN);
4876 input.abc = FALSE;
4877 input.text = TxtEnterNumber;
4878 /* SPR#1428 - SH - New Editor changes - no longer required */
4879 #ifndef NEW_EDITOR
4880 input.edt_attr_input = &data->edt_attr_number;
4881 #endif /* ifndef NEW_EDITOR */
4882 input.left_soft_key = TxtSoftOK;
4883 input.right_soft_key = TxtSoftBack;
4884 input.callback = services_get_voice_number_cb;
4885 data->input_number_win = services_input_start(data->win,&input);
4886
4887 }
4888
4889 }
4890
4891
4892 /*******************************************************************************
4893
4894 $Function: services_get_number_cb
4895
4896 $Description: callback function for the enter other number window
4897
4898 $Returns:
4899
4900 $Arguments:
4901
4902 *******************************************************************************/
4903
4904 #ifdef NEW_EDITOR
4905 static void services_get_number_cb(T_MFW_HND win, USHORT identifier, SHORT reason)
4906 {
4907 // T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; // RAVI
4908 // T_services_input * data = (T_services_input *)win_data->user; // RAVI
4909
4910 TRACE_FUNCTION("services_get_voice_number_cb");
4911
4912 switch (reason)
4913 {
4914 case INFO_KCD_LEFT:
4915 TRACE_FUNCTION("SERVICES_INPUT_LEFT");
4916 /* send number if one has been entered */
4917 SEND_EVENT(ss_data.win, ServicesDoCallDivert, 0, 0);
4918 services_input_destroy(ss_data.input_number_win);
4919 ss_data.input_number_win = NULL;
4920 break;
4921
4922 case INFO_KCD_ALTERNATELEFT:
4923 TRACE_FUNCTION("SERVICES_INPUT_ALTERNATELEFT");
4924 /* Go to phone book */
4925 if (bookPhoneBookLoading()==BOOK_SUCCESS)
4926 {
4927 //T_MFW_HND phbk_win; // RAVI
4928 bookPhonebookStart(win,PhbkFromDivert); // RAVI - Removed assignment phbk_win =
4929 }
4930
4931 break;
4932
4933 case INFO_KCD_HUP:
4934 case INFO_KCD_RIGHT:
4935 TRACE_FUNCTION("SERVICES_INPUT_RIGHT/HUP");
4936 services_input_destroy(ss_data.input_number_win);
4937 ss_data.input_number_win = NULL;
4938 break;
4939 default:
4940 break;
4941 }
4942 }
4943
4944 #else /* NEW_EDITOR */
4945 static void services_get_number_cb(T_MFW_HND win,USHORT reason)
4946 {
4947 TRACE_FUNCTION("services_get_number_cb");
4948
4949 switch (reason){
4950 case SERVICES_INPUT_LEFT:
4951 TRACE_FUNCTION("SERVICES_INPUT_LEFT");
4952 SEND_EVENT(win, ServicesDoCallDivert, 0, 0);
4953 break;
4954 case SERVICES_INPUT_RIGHT:
4955 TRACE_FUNCTION("SERVICES_INPUT_RIGHT");
4956 SEND_EVENT(win, ServicesDoCallDivert, 0, 0);
4957 break;
4958 default:
4959 break;
4960 }
4961 }
4962 #endif /* NEW_EDITOR */
4963
4964 /*******************************************************************************
4965
4966 $Function: servicesGetOtherNumber
4967
4968 $Description: Sets up an editor for entering another number.
4969
4970 $Returns:
4971
4972 $Arguments:
4973
4974 *******************************************************************************/
4975
4976
4977
4978
4979 static void ServicesGetOtherNumber(T_MFW_HND win)
4980 {
4981 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
4982 T_ss * data = (T_ss *)win_data->user;
4983
4984 T_input_properties input;
4985
4986 TRACE_EVENT("ServicesGetOtherNumber");
4987
4988 memset(data->edt_buf_number,'\0',PHB_MAX_LEN);
4989 input.abc = FALSE;
4990 input.text = TxtEnterNumber;
4991 /* SPR#1428 - SH - New Editor changes - no longer required */
4992 #ifndef NEW_EDITOR
4993 input.edt_attr_input = &data->edt_attr_number;
4994 #endif /* ifndef NEW_EDITOR */
4995 input.left_soft_key = TxtSoftOK;
4996 //Oct 20, 2004 REF: CRR 25772 Deepa M.D
4997 //The RSK name has been set to Delete.
4998 input.right_soft_key = TxtDelete;
4999 input.callback = services_get_number_cb;
5000 data->input_number_win = services_input_start(win,&input);
5001 }
5002
5003 /*******************************************************************************
5004
5005 $Function: servicesDoOtherNumber
5006
5007 $Description:
5008
5009 $Returns:
5010
5011 $Arguments:
5012
5013 *******************************************************************************/
5014
5015
5016 void servicesDoOtherNumber(void)
5017 {
5018
5019 TRACE_FUNCTION("servicesDoOtherNumber");
5020
5021 SEND_EVENT(ss_data.win, ServicesOtherNumber, 0, 0);
5022
5023
5024 /* this is function called from menu, it will also send a signal to start
5025 window being displayed for editing or calling phonebook */
5026 /* set up and show edit field */
5027 }
5028
5029
5030 /*******************************************************************************
5031
5032 $Function: servicesStoreVoiceMailNumber
5033
5034 $Description: Store number to Voicemail number (currently in SMS, should be in PCM?)
5035
5036 $Returns:
5037
5038 $Arguments:
5039
5040 *******************************************************************************/
5041
5042 static void servicesStoreVoiceMailNumber( void )
5043 {
5044 char voiceNum[30] = {'\0'};
5045 TRACE_FUNCTION("servicesStoreVoiceMailNumber");
5046
5047 getCFNumber(voiceNum);
5048
5049 }
5050
5051
5052
5053 /*******************************************************************************
5054
5055 $Function: servicesStoreUSSD
5056
5057 $Description: Store selected USSD to NVM.
5058
5059 $Returns:
5060
5061 $Arguments:
5062
5063 *******************************************************************************/
5064
5065
5066
5067 static void servicesStoreUSSD(void)
5068 {
5069 TRACE_FUNCTION("servicesStoreUSSD");
5070 }
5071
5072 /*******************************************************************************
5073
5074 $Function: servicesActivateIRDA
5075
5076 $Description:
5077
5078 $Returns:
5079
5080 $Arguments:
5081
5082 *******************************************************************************/
5083
5084
5085 int servicesActivateIRDA(MfwMnu* m, MfwMnuItem* i)
5086 {
5087 // ADDED BY RAVI - 28-11-2005
5088 return 1;
5089 // END RAVI - 28-11-2005
5090 }
5091
5092 /*******************************************************************************
5093
5094 $Function: servicesDeactivateIRDA
5095
5096 $Description:
5097
5098 $Returns:
5099
5100 $Arguments:
5101
5102 *******************************************************************************/
5103
5104
5105 int servicesDeactivateIRDA(MfwMnu* m, MfwMnuItem* i)
5106 {
5107 // ADDED BY RAVI - 28-11-2005
5108 return 1;
5109 // END RAVI - 28-11-2005
5110 }
5111
5112
5113 static T_MFW_HND dialog_ext_info_create (T_MFW_HND parent_win);
5114 static void dialog_ext_info_destroy (T_MFW_HND own_window);
5115 void dialog_ext_info (T_MFW_HND win,
5116 USHORT event, SHORT value, void * parameter);
5117 static int dialog_ext_info_win_cb (T_MFW_EVENT event, T_MFW_WIN * win);
5118 static T_MFW_CB dialog_ext_info_tim_cb (T_MFW_EVENT event, T_MFW_TIM * tc);
5119 static int dialog_ext_info_kbd_cb (T_MFW_EVENT event, T_MFW_KBD * keyboard);
5120 static int dialog_ext_info_kbd_long_cb (T_MFW_EVENT e, T_MFW_KBD *k);
5121
5122
5123 /*******************************************************************************
5124
5125 $Function: dialog_ext_info_dialog
5126
5127 $Description:
5128
5129 $Returns:
5130
5131 $Arguments:
5132
5133 *******************************************************************************/
5134
5135
5136 T_MFW_HND dialog_ext_info_dialog (T_MFW_HND parent_win,
5137 T_dialog_ext_info * display_info)
5138 {
5139 T_MFW_HND win;
5140
5141 win = dialog_ext_info_create (parent_win);
5142
5143 if (win NEQ NULL)
5144 {
5145 SEND_EVENT (win, DIALOG_INIT, 0, display_info);
5146 }
5147 return win;
5148 }
5149
5150
5151 /*******************************************************************************
5152
5153 $Function: dialog_ext_info_create
5154
5155 $Description:
5156
5157 $Returns:
5158
5159 $Arguments:
5160
5161 *******************************************************************************/
5162
5163
5164 static T_MFW_HND dialog_ext_info_create (T_MFW_HND parent_win)
5165 {
5166 T_MFW_WIN * win_data;
5167 T_dialog_ext_info * data = (T_dialog_ext_info *)ALLOC_MEMORY (sizeof (T_dialog_ext_info));
5168
5169 TRACE_FUNCTION ("dialog_ext_info_create()");
5170
5171 if (data EQ 0)
5172 {
5173 TRACE_FUNCTION("NOT ENOUGH RESOURCES FOR DATA");
5174 return 0;
5175 }
5176 data->info_win = win_create (parent_win, 0, E_WIN_VISIBLE, (T_MFW_CB)dialog_ext_info_win_cb);
5177
5178 if (data->info_win EQ 0)
5179 {
5180 TRACE_FUNCTION("NOT ENOUGH RESOURCES FOR 4 line INFO WIN");
5181 return 0;
5182 }
5183
5184 /*
5185 * Create window handler
5186 */
5187 data->mmi_control.dialog = (T_DIALOG_FUNC)dialog_ext_info;
5188 data->mmi_control.data = data;
5189 data->parent_win = parent_win;
5190 win_data = ((T_MFW_HDR *)data->info_win)->data;
5191 win_data->user = (void *)data;
5192
5193
5194 win_show(data->info_win);
5195 /*
5196 * return window handle
5197 */
5198 return data->info_win;
5199 }
5200
5201 /*******************************************************************************
5202
5203 $Function: dialog_ext_info_destroy
5204
5205 $Description:
5206
5207 $Returns:
5208
5209 $Arguments:
5210
5211 *******************************************************************************/
5212
5213
5214 static void dialog_ext_info_destroy (T_MFW_HND own_window)
5215 {
5216 T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data;
5217 T_dialog_ext_info * data = (T_dialog_ext_info *)win->user;
5218
5219 TRACE_FUNCTION ("dialog_ext_info_destroy()");
5220
5221 if (own_window == NULL)
5222 {
5223 TRACE_EVENT ("Error : Called with NULL Pointer");
5224 return;
5225 }
5226
5227 if (data)
5228 {
5229 /*
5230 * Exit TIMER & KEYBOARD Handle
5231 */
5232 kbd_delete (data->info_kbd);
5233 kbd_delete (data->info_kbd_long);
5234 tim_delete (data->info_tim);
5235
5236 /*
5237 * Delete WIN Handler
5238 */
5239 win_delete (data->info_win);
5240 /*
5241 * Free Memory
5242 */
5243 FREE_MEMORY ((void *)data, sizeof (T_dialog_ext_info));
5244 }
5245 }
5246
5247 /*******************************************************************************
5248
5249 $Function: dialog_ext_info
5250
5251 $Description:
5252
5253 $Returns:
5254
5255 $Arguments:
5256
5257 *******************************************************************************/
5258
5259 void dialog_ext_info (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
5260 {
5261 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
5262 T_dialog_ext_info * data = (T_dialog_ext_info *)win_data->user;
5263 T_dialog_ext_info * display_info = (T_dialog_ext_info *)parameter;
5264
5265 TRACE_FUNCTION ("dialog_ext_info()");
5266
5267 switch (event)
5268 {
5269 case DIALOG_INIT:
5270 /*
5271 * Initialize dialog
5272 */
5273 /*
5274 * Store any other data
5275 */
5276 data->LeftSoftKey = display_info->LeftSoftKey;
5277 data->RightSoftKey = display_info->RightSoftKey;
5278 data->Time = display_info->Time;
5279 data->KeyEvents = display_info->KeyEvents;
5280 data->TextId1 = display_info->TextId1;
5281 data->TextId2 = display_info->TextId2;
5282 data->TextString4 = display_info->TextString4;
5283 data->Identifier = display_info->Identifier;
5284 data->Callback = display_info->Callback;
5285 /*
5286 * Create timer and keyboard handler
5287 */
5288 data->info_tim = tim_create (win, display_info->Time, (T_MFW_CB)dialog_ext_info_tim_cb);
5289 data->info_kbd = kbd_create (win, KEY_ALL, (T_MFW_CB)dialog_ext_info_kbd_cb);
5290 data->info_kbd_long = kbd_create (win, KEY_ALL|KEY_LONG, (T_MFW_CB)dialog_ext_info_kbd_long_cb);
5291
5292 if (display_info->Time NEQ FOREVER)
5293 tim_start (data->info_tim);
5294 win_show(win);
5295 break;
5296
5297 case DIALOG_DESTROY:
5298 dialog_ext_info_destroy(win);
5299 break;
5300 }
5301 }
5302
5303 /*******************************************************************************
5304
5305 $Function: dialog_ext_info_win_cb
5306
5307 $Description:
5308
5309 $Returns:
5310
5311 $Arguments:
5312
5313 *******************************************************************************/
5314
5315
5316
5317 static int dialog_ext_info_win_cb (T_MFW_EVENT event, T_MFW_WIN * win)
5318 {
5319 T_dialog_ext_info * data = (T_dialog_ext_info *)win->user;
5320
5321 TRACE_FUNCTION ("dialog_ext_info_win_cb()");
5322
5323 if (data EQ 0)
5324 return 1;
5325
5326 switch (event)
5327 {
5328 case E_WIN_VISIBLE:
5329 /*
5330 * Print the information dialog
5331 */
5332
5333 /*
5334 * Clear Screen
5335 */
5336 dspl_ClearAll();
5337 /*
5338 * Print softkeys
5339 */
5340 displaySoftKeys(data->LeftSoftKey, data->RightSoftKey);
5341 /*
5342 * Print information
5343 */
5344 if (data->TextId1 NEQ 0)
5345 {
5346 displayAlignedText(CENTER, Mmi_layout_line(1), 0, GET_TEXT(data->TextId1));
5347 }
5348
5349 if (data->TextId2 NEQ 0)
5350 {
5351 displayAlignedText(CENTER, Mmi_layout_line(2), 0, GET_TEXT(data->TextId2));
5352 }
5353
5354 if (data->TextString4)
5355 {
5356 displayAlignedText(CENTER, Mmi_layout_line(3), 0, data->TextString4);
5357 }
5358 break;
5359
5360 default:
5361 return 0;
5362 }
5363 return 1;
5364 }
5365
5366
5367 /*******************************************************************************
5368
5369 $Function: dialog_ext_info_tim_cb
5370
5371 $Description:
5372
5373 $Returns:
5374
5375 $Arguments:
5376
5377 *******************************************************************************/
5378
5379
5380 static T_MFW_CB dialog_ext_info_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc)
5381 {
5382 T_MFW_HND win = mfw_parent (mfw_header());
5383 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
5384 T_dialog_ext_info * data = (T_dialog_ext_info *)win_data->user;
5385
5386 T_MFW_HND parent_win = data->parent_win;
5387 USHORT Identifier = data->Identifier;
5388 void (* Callback)() = data->Callback;
5389
5390 dialog_ext_info_destroy (win);
5391
5392 if (Callback)
5393 (Callback) (parent_win, Identifier, INFO_TIMEOUT);
5394
5395 return 0;
5396 }
5397
5398 /*******************************************************************************
5399
5400 $Function: dialog_ext_info_kbd_cb
5401
5402 $Description:
5403
5404 $Returns:
5405
5406 $Arguments:
5407
5408 *******************************************************************************/
5409
5410 static int dialog_ext_info_kbd_cb (T_MFW_EVENT event, T_MFW_KBD *keyboard)
5411 {
5412 T_MFW_HND win = mfw_parent (mfw_header());
5413 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
5414 T_dialog_ext_info * data = (T_dialog_ext_info *)win_data->user;
5415 T_MFW_HND parent_win = data->parent_win;
5416 USHORT Identifier = data->Identifier;
5417 void (* Callback)() = data->Callback;
5418
5419 TRACE_FUNCTION("dialog_ext_info_kbd_cb");
5420
5421 switch (keyboard->code)
5422 {
5423 case KCD_LEFT:
5424 if (data->KeyEvents & KEY_LEFT)
5425 {
5426 dialog_ext_info_destroy (win);
5427 if (Callback)
5428 (Callback) (parent_win, Identifier, INFO_KCD_LEFT);
5429 }
5430 break;
5431
5432 case KCD_RIGHT:
5433 if (data->KeyEvents & KEY_RIGHT)
5434 {
5435 dialog_ext_info_destroy (win);
5436 if (Callback)
5437 (Callback) (parent_win, Identifier, INFO_KCD_RIGHT);
5438 }
5439 break;
5440
5441 case KCD_HUP:
5442 if (data->KeyEvents & KEY_CLEAR)
5443 {
5444 dialog_ext_info_destroy (win);
5445 if (Callback)
5446 (Callback) (parent_win, Identifier, INFO_KCD_HUP);
5447 }
5448 break;
5449 dialog_ext_info_destroy (win);
5450
5451 case KCD_MNUUP:
5452 dialog_ext_info_destroy (win);
5453 if (Callback)
5454 (Callback) (parent_win, Identifier, INFO_KCD_UP);
5455 break;
5456
5457 case KCD_MNUDOWN:
5458 dialog_ext_info_destroy (win);
5459 if (Callback)
5460 (Callback) (parent_win, Identifier, INFO_KCD_DOWN);
5461 break;
5462
5463 default:
5464 return MFW_EVENT_PASSED;
5465 }
5466 return MFW_EVENT_CONSUMED;
5467 }
5468
5469 /*******************************************************************************
5470
5471 $Function: dialog_ext_info_kbd_long_cb
5472
5473 $Description:
5474
5475 $Returns:
5476
5477 $Arguments:
5478
5479 *******************************************************************************/
5480
5481
5482
5483
5484
5485
5486 static int dialog_ext_info_kbd_long_cb (T_MFW_EVENT e, T_MFW_KBD *k)
5487 {
5488 T_MFW_HND win = mfw_parent (mfw_header());
5489 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
5490 T_dialog_ext_info * data = (T_dialog_ext_info *)win_data->user;
5491 T_MFW_HND parent_win = data->parent_win;
5492 USHORT Identifier = data->Identifier;
5493 void (* Callback)() = data->Callback;
5494
5495 TRACE_FUNCTION("dialog_ext_info_kbd_long_cb");
5496
5497 switch (k->code)
5498 {
5499 case KCD_MNUUP:
5500 dialog_ext_info_destroy (win);
5501 if (Callback)
5502 (Callback) (parent_win, Identifier, INFO_KCD_UP);
5503 break;
5504
5505 case KCD_MNUDOWN:
5506 dialog_ext_info_destroy (win);
5507 if (Callback)
5508 (Callback) (parent_win, Identifier, INFO_KCD_DOWN);
5509 break;
5510 }
5511 /*
5512 * Consume all long key presses
5513 */
5514 return MFW_EVENT_CONSUMED;
5515
5516 }
5517
5518 /*******************************************************************************
5519
5520 $Function: services_input_create
5521
5522 $Description:
5523
5524 $Returns:
5525
5526 $Arguments:
5527
5528 *******************************************************************************/
5529
5530
5531
5532
5533 static T_MFW_HND services_input_create(MfwHnd parent){
5534
5535
5536 T_MFW_WIN * win_data;
5537 T_services_input * data = (T_services_input *)ALLOC_MEMORY (sizeof (T_services_input));
5538
5539
5540
5541 TRACE_FUNCTION ("services_input_create()");
5542
5543 data->win = win_create (parent, 0, E_WIN_VISIBLE, (T_MFW_CB)services_input_win_cb);
5544
5545 if (data->win EQ 0)
5546 return 0;
5547
5548 /*
5549 * Create window handler
5550 */
5551 data->mmi_control.dialog = (T_DIALOG_FUNC)services_input;
5552 data->mmi_control.data = data;
5553 win_data = ((T_MFW_HDR *)data->win)->data;
5554 win_data->user = (void *)data;
5555
5556 /*
5557 * return window handle
5558 */
5559
5560 /* SPR#1428 - SH - New Editor changes - no longer required */
5561 #ifndef NEW_EDITOR
5562 data->kbd = kbdCreate(data->win,KEY_ALL,(MfwCb)services_input_kbd_cb);
5563 data->kbd_long = kbdCreate(data->win,KEY_ALL|KEY_LONG,(MfwCb)services_input_kbd_long_cb);
5564 #endif /* ifndef NEW_EDITOR */
5565
5566 data->parent_win = parent;
5567
5568 return data->win;
5569
5570 }
5571
5572
5573 /*******************************************************************************
5574
5575 $Function: services_input_destroy
5576
5577 $Description:
5578
5579 $Returns:
5580
5581 $Arguments:
5582
5583 *******************************************************************************/
5584
5585
5586
5587
5588
5589 static void services_input_destroy(MfwHnd window){
5590 T_MFW_WIN * win = ((T_MFW_HDR *)window)->data;
5591 T_services_input * data = (T_services_input *)win->user;
5592
5593 TRACE_FUNCTION ("services_input_destroy()");
5594
5595 if (window == NULL)
5596 {
5597 TRACE_EVENT ("Error : Called with NULL Pointer");
5598 return;
5599 }
5600
5601 if (data)
5602 {
5603 /* SPR#1428 - SH - Destroy new editor */
5604 #ifdef NEW_EDITOR
5605 AUI_edit_Destroy(data->edit_win);
5606 #else /* NEW_EDITOR */
5607 editDeactivate();
5608 #endif /* NEW_EDITOR */
5609
5610 winDelete (data->win);
5611 /* * Free Memory
5612 */
5613 FREE_MEMORY ((void *)data, sizeof (T_services_input));
5614 }
5615 }
5616
5617
5618 /*******************************************************************************
5619
5620 $Function: services_input_start
5621
5622 $Description:
5623
5624 $Returns:
5625
5626 $Arguments:
5627
5628 *******************************************************************************/
5629
5630
5631 static MfwHnd services_input_start(MfwHnd parent,T_input_properties *properties)
5632 {
5633
5634 T_MFW_HND win;
5635 TRACE_FUNCTION ("services_input_start()");
5636
5637 win = services_input_create (parent);
5638
5639 if (win NEQ NULL)
5640 {
5641 SEND_EVENT (win, SERVICES_INPUT_INIT, 0, properties);
5642 }
5643 return win;
5644 }
5645
5646
5647 /*******************************************************************************
5648
5649 $Function: services_input
5650
5651 $Description:
5652
5653 $Returns:
5654
5655 $Arguments:
5656
5657 *******************************************************************************/
5658
5659
5660 void services_input (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
5661 {
5662 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
5663 T_services_input * data = (T_services_input *)win_data->user;
5664
5665 T_input_properties* properties = (T_input_properties*) parameter;
5666 #ifdef NEW_EDITOR
5667 T_AUI_EDITOR_DATA editor_data;
5668 #endif /* NEW_EDITOR */
5669
5670 TRACE_FUNCTION ("T_services_input()");
5671
5672 switch (event)
5673 {
5674 case SERVICES_INPUT_INIT:
5675 /* SPR#1428 - SH - New Editor changes - replace old custom editor
5676 * with a standard AUI Editor */
5677 #ifdef NEW_EDITOR
5678 AUI_edit_SetDefault(&editor_data);
5679 AUI_edit_SetTextStr(&editor_data, properties->left_soft_key, properties->right_soft_key, properties->text, NULL);
5680 AUI_edit_SetEvents(&editor_data, 0, FALSE, FOREVER, properties->callback);
5681 //Oct 20, 2004 REF: CRR 25772 Deepa M.D
5682 //The alternate text string when the editor content is empty is set and
5683 //the change_rsk_on_empty flag is set to true.
5684 AUI_edit_SetAltTextStr(&editor_data, 1, TxtNames, TRUE, TxtSoftBack);
5685 AUI_edit_SetDisplay(&editor_data, SERVICE_CREATE_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT);
5686
5687 if (properties->abc)
5688 {
5689 AUI_edit_SetMode(&editor_data, ED_MODE_ALPHA, ED_CURSOR_BAR);
5690 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)ss_data.edt_buf_name, sizeof(ss_data.edt_buf_name));
5691 }
5692 else
5693 {
5694 AUI_edit_SetMode(&editor_data, 0, ED_CURSOR_UNDERLINE);
5695 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)ss_data.edt_buf_number, sizeof(ss_data.edt_buf_number));
5696
5697 }
5698 TRACE_EVENT("SERVICES_INPUT_INIT");
5699
5700 data->edit_win = AUI_edit_Start(data->win, &editor_data);
5701
5702 #else /*NEW_EDITOR*/
5703
5704 data->properties.abc = properties->abc;
5705 data->properties.text = properties->text;
5706 data->properties.edt_attr_input = properties->edt_attr_input;
5707 data->properties.left_soft_key = properties->left_soft_key;
5708 data->properties.right_soft_key = properties->right_soft_key;
5709 data->properties.callback = properties->callback;
5710 data->edt_input = edtCreate(data->win,data->properties.edt_attr_input,0,0);
5711 editDeactivate();
5712 editActivate (data->edt_input,properties->abc);
5713 edtUnhide(data->edt_input);
5714 winShow(data->win);
5715 #endif /* NEW_EDITOR */
5716 break;
5717
5718 case SERVICES_INPUT_DESTROY:
5719 TRACE_FUNCTION("SERVICES_INPUT_DESTROY");
5720 services_input_destroy(data->win);
5721 break;
5722
5723 case DIVERT_PHBK_NUMBER:
5724 /* SPR#1428 - SH - New Editor changes - buffer changed, send event to
5725 * update editors */
5726 #ifdef NEW_EDITOR
5727 {
5728 T_ATB_TEXT text;
5729 text.dcs = ATB_DCS_ASCII;
5730 text.data = (UBYTE *)parameter;
5731 text.len = ATB_string_Length(&text);
5732 SEND_EVENT(data->edit_win, E_ED_INSERT, 0, (void *)&text);
5733 }
5734 #else /* NEW_EDITOR */
5735 strncpy(ss_data.edt_buf_number, (char *)parameter, strlen((char *)parameter)+1);
5736 #endif /* NEW_EDITOR */
5737 break;
5738 default:
5739 return;
5740 }
5741
5742 }
5743
5744
5745 /*******************************************************************************
5746
5747 $Function: services_input_win_cb
5748
5749 $Description:
5750
5751 $Returns:
5752
5753 $Arguments:
5754
5755 *******************************************************************************/
5756
5757 static int services_input_win_cb (MfwEvt e, MfwWin *w){
5758
5759 T_services_input * data = (T_services_input *)w->user;
5760
5761 //int i =0; // RAVI
5762
5763 TRACE_FUNCTION ("services_input_win_cb()");
5764
5765 /* SPR#1428 - SH - New Editor changes - this window is now
5766 * invisible, AUI editor sits on top*/
5767 #ifdef NEW_EDITOR
5768 return 0;
5769 #else /* NEW_EDITOR */
5770 switch (e)
5771 {
5772 case MfwWinVisible:
5773 edtShow(data->edt_input);
5774 PROMPT(menuArea.px,menuArea.py,0,data->properties.text);
5775 displaySoftKeys(data->properties.left_soft_key,data->properties.right_soft_key);
5776 break;
5777 default:
5778 return 0;
5779 }
5780 #endif /* NEW_EDITOR */
5781
5782 return 1;
5783
5784 }
5785
5786
5787 /* SPR#1428 - SH - New Editor changes - no longer required*/
5788 #ifndef NEW_EDITOR
5789 /*******************************************************************************
5790
5791 $Function: services_input_kbd_cb
5792
5793 $Description:
5794
5795 $Returns:
5796
5797 $Arguments:
5798
5799 *******************************************************************************/
5800
5801 static int services_input_kbd_cb (MfwEvt e, MfwKbd *k){
5802
5803
5804 T_MFW_HND win = mfwParent(mfw_header());
5805 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
5806 T_services_input * data = (T_services_input *)win_data->user;
5807
5808 TRACE_FUNCTION ("services_input_kbd_cb()");
5809
5810 if (activeEditor() NEQ data->edt_input)
5811 editActivate(data->edt_input,data->properties.abc);
5812
5813 switch (k->code)
5814 {
5815 case KCD_MNUUP:
5816 edtChar(data->edt_input,ecRight);
5817 break;
5818
5819 case KCD_MNUDOWN:
5820 edtChar(data->edt_input,ecLeft);
5821 break;
5822
5823 case KCD_LEFT:
5824 TRACE_FUNCTION("left key pressed");
5825 data->properties.callback(data->parent_win,SERVICES_INPUT_LEFT);
5826 break;
5827
5828 case KCD_HUP:
5829 /* if edit field is empty then exit, else delete one char */
5830 data->properties.callback(data->parent_win,SERVICES_INPUT_CLEAR);
5831
5832 if (strlen(data->properties.edt_attr_input->text) > 0)
5833 {
5834 edtChar(data->edt_input,ecBack);
5835 if(strlen(data->properties.edt_attr_input->text) == 0)
5836 data->properties.right_soft_key=TxtContacts;
5837 else
5838 data->properties.right_soft_key=TxtDelete;
5839 winShow(data->win);
5840 }
5841 else
5842 services_input_destroy(data->win);
5843 break;
5844
5845 case KCD_RIGHT:
5846 // Check if there is a digit in the edit buffer softkey should be delete.
5847 if (strlen(data->properties.edt_attr_input->text) > 0)
5848 {
5849 edtChar(data->edt_input,ecBack);
5850 if(strlen(data->properties.edt_attr_input->text) == 0)
5851 {
5852 data->properties.right_soft_key=TxtContacts;
5853 winShow(data->win);
5854 }
5855 }
5856 else
5857 {
5858 // MZ 26/02/01 services_input_destroy(data->win);
5859 // Activate phone book .
5860 if (bookPhoneBookLoading()==BOOK_SUCCESS)
5861 {
5862 T_MFW_HND phbk_win;
5863 phbk_win = bookPhonebookStart(data->win,PhbkFromDivert);
5864 }
5865
5866 }
5867
5868 break;
5869 default:
5870 editEventKey (e,k);
5871 if(strlen(data->properties.edt_attr_input->text) > 0)
5872 data->properties.right_soft_key=TxtDelete;
5873 else
5874 data->properties.right_soft_key=TxtContacts;
5875 winShow(data->win);
5876
5877 break;
5878 }
5879 return MFW_EVENT_CONSUMED;
5880 }
5881
5882
5883 /*******************************************************************************
5884
5885 $Function: services_input_kbd_long_cb
5886
5887 $Description:
5888
5889 $Returns:
5890
5891 $Arguments:
5892
5893 *******************************************************************************/
5894
5895
5896
5897
5898 static int services_input_kbd_long_cb (MfwEvt e, MfwKbd *k){
5899
5900 T_MFW_HND win = mfwParent(mfw_header());
5901 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
5902 T_services_input * data = (T_services_input *)win_data->user;
5903
5904
5905 if ((e & KEY_CLEAR) && (e & KEY_LONG))
5906 {
5907 edtClear(data->edt_input);
5908 services_input_destroy(data->win);
5909 return MFW_EVENT_CONSUMED;
5910 }
5911 return MFW_EVENT_CONSUMED;
5912 }
5913
5914
5915 /*******************************************************************************
5916
5917 $Function: services_number_input_cb
5918
5919 $Description:
5920
5921 $Returns:
5922
5923 $Arguments:
5924
5925 *******************************************************************************/
5926
5927 void services_number_input_cb(T_MFW_HND win, UBYTE identifier, USHORT reason){
5928
5929 switch(reason){
5930
5931 case SERVICES_INPUT_LEFT:
5932 break;
5933 case SERVICES_INPUT_RIGHT:
5934 break;
5935 case SERVICES_INPUT_CLEAR:
5936 break;
5937 default:
5938 return;
5939 }
5940 }
5941
5942 #endif /* ifndef NEW_EDITOR */
5943
5944
5945 /*******************************************************************************
5946
5947 $Function: servicesCallBarringCheck
5948
5949 $Description:
5950
5951 $Returns:
5952
5953 $Arguments:
5954
5955 *******************************************************************************/
5956
5957
5958 void servicesCallBarringCheck(void)
5959 {
5960 char SS_string[60] = {'\0'};
5961
5962 TRACE_FUNCTION("servicesCallBarringCheck");
5963
5964 CBAction = CBCheck;
5965
5966 getCBAction(SS_string);
5967 getCBType(SS_string);
5968 SS_string[strlen(SS_string)-1] = '#';
5969
5970 TRACE_FUNCTION(SS_string);
5971
5972 if (ss_execute_transaction((UBYTE*)SS_string, 0) == MFW_SS_FAIL)
5973 showFailed( ss_data.win );
5974
5975 }
5976
5977 /*******************************************************************************
5978
5979 $Function: servicesCallBarringDeactivate
5980
5981 $Description:
5982
5983 $Returns:
5984
5985 $Arguments:
5986
5987 *******************************************************************************/
5988
5989
5990
5991 void servicesCallBarringDeactivate(void)
5992 {
5993 char SS_string[60] = {'\0'};
5994
5995 TRACE_FUNCTION("servicesCallBarringDeactivate");
5996
5997 CBAction = CBDeactivate;
5998
5999 getCBAction(SS_string);
6000 getCBType(SS_string);
6001 getCBPassword(SS_string);
6002 //June 21, 2004 - CRR:13650 - CBA : no basic service sent when using the menu
6003 //Adding the basic service code 10(all teleservices) to the SS string during deactivation
6004 strcat(SS_string,BASIC_SERVICE_CODE);
6005 SS_string[strlen(SS_string)] = '#';
6006
6007 TRACE_FUNCTION(SS_string);
6008
6009 if (ss_execute_transaction((UBYTE*)SS_string, 0) == MFW_SS_FAIL)
6010 showFailed( ss_data.win );
6011
6012
6013 }
6014
6015 //Jun 02,2004 CRR:13649 xpradipg-SASKEN
6016 /*******************************************************************************
6017
6018 $Function: servicesCallBarringDeactivatePassword
6019
6020 $Description: Sets the flag for deactivating the selected barring service and prompts for the password
6021
6022 $Returns:
6023
6024 $Arguments:
6025
6026 *******************************************************************************/
6027
6028 void servicesCallBarringDeactivatePassword(void)
6029 {
6030
6031 CBFlag=CBDeactivate;
6032 requestCBPassword();
6033 }
6034
6035 /*******************************************************************************
6036
6037 $Function: servicesCallBarringActivate
6038
6039 $Description:
6040
6041 $Returns:
6042
6043 $Arguments:
6044
6045 *******************************************************************************/
6046
6047
6048 void servicesCallBarringActivate(void)
6049 {
6050 char SS_string[60] = {'\0'};
6051
6052 TRACE_FUNCTION("servicesCallBarringActivate"); //SPR#1038 - DS - Changed from DeActivate to Activate.
6053
6054 CBAction = CBActivate;
6055
6056 getCBAction(SS_string);
6057 getCBType(SS_string);
6058 getCBPassword(SS_string);
6059 //June 21, 2004 - CRR:13650 - CBA : no basic service sent when using the menu
6060 //Adding the basic service code 10(all teleservices) to the SS string during activation
6061 strcat(SS_string,BASIC_SERVICE_CODE);
6062 SS_string[strlen(SS_string)] = '#';
6063
6064 TRACE_FUNCTION(SS_string);
6065
6066 if (ss_execute_transaction((UBYTE*)SS_string, 0) == MFW_SS_FAIL)
6067 showFailed( ss_data.win );
6068
6069 }
6070
6071 //Jun 02,2004 CRR:13649 xpradipg-SASKEN
6072 /*******************************************************************************
6073
6074 $Function: servicesCallBarringActivatePassword
6075
6076 $Description: Sets the flag for activating the selected barring service and prompts for the password
6077
6078 $Returns:
6079
6080 $Arguments:
6081
6082 *******************************************************************************/
6083
6084 void servicesCallBarringActivatePassword(void)
6085 {
6086
6087 CBFlag=CBActivate;
6088 requestCBPassword();
6089 }
6090
6091
6092 /*******************************************************************************
6093
6094 $Function: servicesCallBarringCancelAll
6095
6096 $Description:
6097
6098 $Returns:
6099
6100 $Arguments:
6101
6102 *******************************************************************************/
6103
6104
6105 void servicesCallBarringCancelAll(void)
6106 {
6107 char SS_string[60] = {'\0'};
6108
6109 TRACE_FUNCTION("servicesCallBarringCancelAll");
6110
6111
6112 strcat(SS_string, "#330*");
6113 getCBPassword(SS_string);
6114 SS_string[strlen(SS_string)-1] = '#';
6115
6116 TRACE_FUNCTION(SS_string);
6117
6118 if (ss_execute_transaction((UBYTE*)SS_string, 0) == MFW_SS_FAIL)
6119 showFailed( ss_data.win );
6120
6121 }
6122
6123 //Jun 02,2004 CRR:13649 xpradipg-SASKEN
6124 /*******************************************************************************
6125
6126 $Function: servicesCallBarringCancelAllPassword
6127
6128 $Description: Sets the flag for cancelling all barring service and prompts for the password
6129
6130 $Returns:
6131
6132 $Arguments:
6133
6134 *******************************************************************************/
6135 void servicesCallBarringCancelAllPassword(void)
6136 {
6137 CBFlag=CBCancelAll;
6138 requestCBPassword();
6139 }
6140
6141
6142 /*******************************************************************************
6143
6144 $Function: getCBAction
6145
6146 $Description:
6147
6148 $Returns:
6149
6150 $Arguments:
6151
6152 *******************************************************************************/
6153
6154
6155 static void getCBAction(char * pSSstring)
6156 {
6157 switch (CBAction)
6158 {
6159 case CBActivate:
6160 strcpy(pSSstring, "*");
6161 break;
6162 case CBDeactivate:
6163 strcpy(pSSstring, "#");
6164 break;
6165 case CBCheck:
6166 strcpy(pSSstring, "*#");
6167 break;
6168 default:
6169 break;
6170 }
6171 }
6172
6173 /*******************************************************************************
6174
6175 $Function: getCBType
6176
6177 $Description:
6178
6179 $Returns:
6180
6181 $Arguments:
6182
6183 *******************************************************************************/
6184
6185
6186 static void getCBType(char* pSSstring)
6187 {
6188
6189
6190 switch (CBType)
6191 {
6192 case CBAllOutgoing:
6193 strcat(pSSstring, "33*");
6194 break;
6195 case CBInternational:
6196 strcat(pSSstring, "331*");
6197 break;
6198 case CBAllIncoming:
6199 strcat(pSSstring, "35*");
6200 break;
6201 case CBInternationalHome:
6202 strcat(pSSstring, "332*");
6203 break;
6204 case CBIncomingRoaming:
6205 strcat(pSSstring, "351*");
6206 break;
6207 default:
6208 break;
6209 }
6210 }
6211
6212 /*******************************************************************************
6213
6214 $Function: getCBPassword
6215
6216 $Description:
6217
6218 $Returns:
6219
6220 $Arguments:
6221
6222 *******************************************************************************/
6223
6224
6225 static void getCBPassword(char* pSSstring)
6226 {
6227 TRACE_FUNCTION("getCBPassword");
6228 strcat(pSSstring, (char*)ss_data.edt_buf_cb_password);
6229 strcat(pSSstring, "*");
6230 }
6231
6232 //CQ-16432 start
6233 /*******************************************************************************
6234
6235 $Function: requestSatCBPassword
6236
6237 $Description:
6238
6239 $Returns:
6240
6241 $Arguments:
6242
6243 *******************************************************************************/
6244
6245
6246
6247 void requestSatCBPassword(void)
6248 {
6249
6250
6251 #ifdef NEW_EDITOR
6252 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor changes */
6253 #else /* NEW_EDITOR */
6254 T_EDITOR_DATA editor_data;
6255 #endif /* NEW_EDITOR */
6256 T_MFW_HND win = mfw_parent(mfw_header());
6257 T_MFW_HND satPswdWin;
6258 TRACE_FUNCTION("requestSatCBPassword");
6259 //SPR#1014 - DS - Reset editor data
6260 memset(&editor_data, '\0', sizeof(editor_data));
6261
6262 /*
6263 * Setup an editor to display a string
6264 */
6265
6266 memset(satPassword,'\0',sizeof(satPassword));
6267
6268 /* SPR#1428 - SH - New Editor changes */
6269 #ifdef NEW_EDITOR
6270 TRACE_FUNCTION("New editor is defined");
6271 AUI_edit_SetDefault(&editor_data);
6272 AUI_edit_SetDisplay(&editor_data, RPWD_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT);
6273 AUI_edit_SetMode(&editor_data, ED_MODE_HIDDEN, ED_CURSOR_UNDERLINE);
6274 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)satPassword, CB_PSW_LEN+1);
6275 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtSoftBack, TxtPassword, NULL);
6276 AUI_edit_SetAltTextStr(&editor_data, CB_PSW_LEN, TxtNull, FALSE, TxtNull);
6277 AUI_edit_SetEvents(&editor_data, CBEnterSatPassword, TRUE, FOREVER, (T_AUI_EDIT_CB)CB_password_cb);
6278 satPswdWin = AUI_edit_Start(win, &editor_data); /* start the editor */
6279 TRACE_EVENT_P1("satPassword contents: %s",satPassword);
6280 #else /* NEW_EDITOR */
6281 TRACE_FUNCTION("New editor is not defined");
6282 bookSetEditAttributes( RPWD_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0,
6283 (char*)ss_data.edt_buf_cb_password,CB_PSW_LEN+1, &editor_data.editor_attr );
6284 editor_data.LeftSoftKey = TxtSoftOK;
6285 editor_data.AlternateLeftSoftKey = TxtNull;
6286 editor_data.RightSoftKey = TxtSoftBack;
6287 editor_data.hide = TRUE;
6288 editor_data.mode = DIGITS_MODE;
6289 editor_data.timeout = FOREVER;
6290 editor_data.Identifier = CBCheckPassword;
6291 editor_data.destroyEditor = TRUE;
6292 editor_data.Callback = (T_EDIT_CB)CB_password_cb;
6293 editor_data.TextId = TxtPassword;
6294 editor_data.TextString = NULL;
6295 editor_data.min_enter = CB_PSW_LEN;
6296 editor_data.destroyEditor = TRUE;
6297 ss_data.info_win = editor_start(ss_data.win, &editor_data);
6298 #endif /* NEW_EDITOR */
6299
6300 }
6301 //CQ-16432 end
6302
6303 /*******************************************************************************
6304
6305 $Function: requestCBPassword
6306
6307 $Description:
6308
6309 $Returns:
6310
6311 $Arguments:
6312
6313 *******************************************************************************/
6314
6315
6316
6317 void requestCBPassword(void)
6318 {
6319 #ifdef NEW_EDITOR
6320 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor changes */
6321 #else /* NEW_EDITOR */
6322 T_EDITOR_DATA editor_data;
6323 #endif /* NEW_EDITOR */
6324 TRACE_FUNCTION("requestCBPassword");
6325 //SPR#1014 - DS - Reset editor data
6326 memset(&editor_data, '\0', sizeof(editor_data));
6327
6328 /*
6329 * Setup an editor to display a string
6330 */
6331
6332 memset(ss_data.edt_buf_cb_password,'\0',sizeof(ss_data.edt_buf_cb_password));
6333
6334 /* SPR#1428 - SH - New Editor changes */
6335 #ifdef NEW_EDITOR
6336 TRACE_FUNCTION("NEW_EDITOR");
6337 AUI_edit_SetDefault(&editor_data);
6338 AUI_edit_SetDisplay(&editor_data, RPWD_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT);
6339 AUI_edit_SetMode(&editor_data, ED_MODE_HIDDEN, ED_CURSOR_UNDERLINE);
6340 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)ss_data.edt_buf_cb_password, CB_PSW_LEN+1);
6341 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtSoftBack, TxtPassword, NULL);
6342 AUI_edit_SetAltTextStr(&editor_data, CB_PSW_LEN, TxtNull, FALSE, TxtNull);
6343 AUI_edit_SetEvents(&editor_data, CBCheckPassword, TRUE, FOREVER, (T_AUI_EDIT_CB)CB_password_cb);
6344
6345 ss_data.info_win = AUI_edit_Start(ss_data.win, &editor_data); /* start the editor */
6346 #else /* NEW_EDITOR */
6347 TRACE_FUNCTION("Old_editor");
6348 bookSetEditAttributes( RPWD_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0,
6349 (char*)ss_data.edt_buf_cb_password,CB_PSW_LEN+1, &editor_data.editor_attr );
6350 editor_data.LeftSoftKey = TxtSoftOK;
6351 editor_data.AlternateLeftSoftKey = TxtNull;
6352 editor_data.RightSoftKey = TxtSoftBack;
6353 editor_data.hide = TRUE;
6354 editor_data.mode = DIGITS_MODE;
6355 editor_data.timeout = FOREVER;
6356 editor_data.Identifier = CBCheckPassword;
6357 editor_data.destroyEditor = TRUE;
6358 editor_data.Callback = (T_EDIT_CB)CB_password_cb;
6359 editor_data.TextId = TxtPassword;
6360 editor_data.TextString = NULL;
6361 editor_data.min_enter = CB_PSW_LEN;
6362 editor_data.destroyEditor = TRUE;
6363 ss_data.info_win = editor_start(ss_data.win, &editor_data);
6364 #endif /* NEW_EDITOR */
6365 }
6366
6367 /*******************************************************************************
6368
6369 $Function: CB_password_cb
6370
6371 $Description:
6372
6373 $Returns:
6374
6375 $Arguments:
6376
6377 *******************************************************************************/
6378
6379
6380
6381 static void CB_password_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason)
6382 {
6383 //16432
6384 TRACE_FUNCTION("CB_password_cb");
6385 switch (identifier)
6386 {
6387 case CBCheckPassword:
6388 //Jun 02,2004 CRR:13649 xpradipg-SASKEN
6389 //keyevents right and hangup are handled initially
6390 switch (reason)
6391 {
6392 case INFO_KCD_HUP:
6393 // Change by Sasken ( VadiRaj) on March 29th 2004
6394 // Issue Number : MMI-SPR-12882
6395 // Subject: No functionality for the right softkey.
6396 // Bug : No functionality for the right softkey
6397 // Solution : Added functionality for the right "BACK" softeky
6398 case INFO_KCD_RIGHT:
6399 ss_data.info_win = 0;
6400 CBFlag=CBActionNone;;
6401 break;
6402 default:
6403 break;
6404 }
6405 //Jun 02,2004 CRR:13649 xpradipg-SASKEN
6406 //depending on the action selected by the user the respective functions are invoked
6407 switch(CBFlag)
6408 {
6409 case CBDeactivate:
6410 CBFlag=CBActionNone; //reset the flag
6411 servicesCallBarringDeactivate(); //initiates the callbarring deactivation for the selected service
6412 break;
6413 case CBActivate:
6414 CBFlag=CBActionNone; //reset the flag
6415 servicesCallBarringActivate(); //initiates the callbarring activation for the selected service
6416 break;
6417 case CBCancelAll:
6418 CBFlag=CBActionNone; //reset the flag
6419 servicesCallBarringCancelAll(); //initiates the cancelling of all barring services
6420 break;
6421 case CBNewPassword:
6422 CBFlag=CBActionNone; //reset the flag
6423 enterNewCBPassword(); //prompt for the new password
6424 break;
6425 default:
6426 CBFlag=CBActionNone;;
6427 break;
6428 }
6429 ss_data.info_win = 0;
6430 break;
6431 case CBNewPassword:
6432 ss_data.info_win = 0;
6433 switch (reason)
6434 {
6435 case INFO_KCD_LEFT:
6436 confirmNewCBPassword();
6437 break;
6438 default:
6439 break;
6440 }
6441 break;
6442 case CBConfirmNewPassword:
6443 ss_data.info_win = 0;
6444 switch (reason)
6445 {
6446 case INFO_KCD_LEFT:
6447 changeCBPassword();
6448 break;
6449 default:
6450 break;
6451 }
6452 break;
6453 //CQ-16432 start
6454 case CBEnterSatPassword:
6455 ss_set_clck(CLCK_FAC_Ox, CLCK_MOD_NotPresent, satPassword, CLASS_NotPresent, MFW_MODUL_UNKNOWN);
6456 //CQ-16432 end
6457 break;
6458 default:
6459 break;
6460 }
6461 }
6462
6463 //Jun 02,2004 CRR:13649 xpradipg-SASKEN
6464 /*******************************************************************************
6465
6466 $Function: enterOldCBPassword
6467
6468 $Description: sets flag for changing the barring password and prompts to enter the current
6469 barring password
6470 $Returns:
6471
6472 $Arguments:
6473
6474 *******************************************************************************/
6475
6476 void enterOldCBPassword(void)
6477 {
6478 CBFlag=CBNewPassword;
6479 requestCBPassword();
6480 }
6481
6482 /*******************************************************************************
6483
6484 $Function: enterNewCBPassword
6485
6486 $Description:
6487
6488 $Returns:
6489
6490 $Arguments:
6491
6492 *******************************************************************************/
6493
6494
6495 void enterNewCBPassword(void)
6496 {
6497 #ifdef NEW_EDITOR
6498 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
6499 #else
6500 T_EDITOR_DATA editor_data;
6501 #endif
6502
6503 //SPR#1014 - DS - Reset editor data
6504 memset(&editor_data, '\0', sizeof(editor_data));
6505 memset(ss_data.edt_buf_cb_new_password,'\0',sizeof(ss_data.edt_buf_cb_new_password));
6506
6507 /* SPR#1428 - SH - New Editor changes */
6508 #ifdef NEW_EDITOR
6509 AUI_edit_SetDefault(&editor_data);
6510 AUI_edit_SetDisplay(&editor_data, RPWD_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT);
6511 AUI_edit_SetMode(&editor_data, ED_MODE_HIDDEN, ED_CURSOR_UNDERLINE);
6512 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)ss_data.edt_buf_cb_new_password, CB_PSW_LEN+1);
6513 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtSoftBack, TxtNewPassword, NULL);
6514 AUI_edit_SetAltTextStr(&editor_data, CB_PSW_LEN, TxtNull, FALSE, TxtNull);
6515 AUI_edit_SetEvents(&editor_data, CBNewPassword, TRUE, FOREVER, (T_AUI_EDIT_CB)CB_password_cb);
6516
6517 ss_data.info_win = AUI_edit_Start(ss_data.win, &editor_data); /* start the editor */
6518 #else /* NEW_EDITOR */
6519 bookSetEditAttributes( RPWD_EDITOR, 0, 0, edtCurBar1, 0,
6520 (char*)ss_data.edt_buf_cb_new_password,CB_PSW_LEN+1, &editor_data.editor_attr );
6521 editor_data.LeftSoftKey = TxtSoftOK;
6522 editor_data.AlternateLeftSoftKey = TxtNull;
6523 editor_data.RightSoftKey = TxtDelete;
6524 editor_data.hide = TRUE;
6525 editor_data.mode = DIGITS_MODE;
6526 editor_data.timeout = FOREVER;
6527 editor_data.Identifier = CBNewPassword;
6528 editor_data.destroyEditor = TRUE;
6529 editor_data.Callback = (T_EDIT_CB)CB_password_cb;
6530 editor_data.TextId = TxtNewPassword;
6531 editor_data.TextString = NULL;
6532 editor_data.min_enter = CB_PSW_LEN;
6533 editor_data.destroyEditor = TRUE;
6534 ss_data.info_win = editor_start(ss_data.win, &editor_data);
6535 #endif /* NEW_EDITOR */
6536 }
6537
6538 /*******************************************************************************
6539
6540 $Function: confirmNewCBPassword
6541
6542 $Description:
6543
6544 $Returns:
6545
6546 $Arguments:
6547
6548 *******************************************************************************/
6549
6550
6551 void confirmNewCBPassword(void)
6552 {
6553 #ifdef NEW_EDITOR
6554 T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
6555 #else
6556 T_EDITOR_DATA editor_data;
6557 #endif
6558
6559 //SPR#1014 - DS - Reset editor data.
6560 memset(&editor_data, '\0', sizeof(editor_data));
6561
6562 memset(ss_data.edt_buf_cb_conf_new_password,'\0',sizeof(ss_data.edt_buf_cb_conf_new_password));
6563
6564 /* SPR#1428 - SH - New Editor changes */
6565 #ifdef NEW_EDITOR
6566 AUI_edit_SetDefault(&editor_data);
6567 AUI_edit_SetDisplay(&editor_data, RPWD_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT);
6568 AUI_edit_SetMode(&editor_data, ED_MODE_HIDDEN, ED_CURSOR_UNDERLINE);
6569 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)ss_data.edt_buf_cb_conf_new_password, CB_PSW_LEN+1);
6570 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtSoftBack, TxtConfirmPassword, NULL);
6571 AUI_edit_SetAltTextStr(&editor_data, CB_PSW_LEN, TxtNull, FALSE, TxtNull);
6572 AUI_edit_SetEvents(&editor_data, CBConfirmNewPassword, TRUE, FOREVER, (T_AUI_EDIT_CB)CB_password_cb);
6573
6574 ss_data.info_win = AUI_edit_Start(ss_data.win, &editor_data); /* start the editor */
6575 #else /* NEW_EDITOR */
6576 bookSetEditAttributes( RPWD_EDITOR, 0, 0, edtCurBar1, 0,
6577 (char*)ss_data.edt_buf_cb_conf_new_password,CB_PSW_LEN+1, &editor_data.editor_attr );
6578 editor_data.LeftSoftKey = TxtSoftOK;
6579 editor_data.AlternateLeftSoftKey = TxtNull;
6580 editor_data.RightSoftKey = TxtDelete;
6581 editor_data.hide = TRUE;
6582 editor_data.mode = DIGITS_MODE;
6583 editor_data.timeout = FOREVER;
6584 editor_data.Identifier = CBConfirmNewPassword;
6585 editor_data.destroyEditor = TRUE;
6586 editor_data.Callback = (T_EDIT_CB)CB_password_cb;
6587 editor_data.TextId = TxtConfirmPassword;
6588 editor_data.TextString = NULL;
6589 editor_data.min_enter = CB_PSW_LEN;
6590 editor_data.destroyEditor = TRUE;
6591 ss_data.info_win = editor_start(ss_data.win, &editor_data);
6592 #endif /* NEW_EDITOR */
6593
6594 }
6595
6596 /*******************************************************************************
6597
6598 $Function: changeCBPassword
6599
6600 $Description:
6601
6602 $Returns:
6603
6604 $Arguments:
6605
6606 *******************************************************************************/
6607
6608
6609 void changeCBPassword(void){
6610
6611 char SS_string[60] = {'\0'};
6612 T_DISPLAY_DATA display_info;
6613
6614 TRACE_FUNCTION("changeCBPassword");
6615
6616 if (strcmp((char*)ss_data.edt_buf_cb_new_password, (char*)ss_data.edt_buf_cb_conf_new_password))
6617 {
6618 /*
6619 ** The New and Confirm Passwords do not match, restart the process and display a dialog to
6620 ** explain. (The dialog is done second so that it will display on top of the new prompt)
6621 */
6622 enterNewCBPassword();
6623
6624 // Jul 23, 2004 REF: CRR 16107 xvilliva
6625 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtPasswords, TxtMismatch, COLOUR_STATUS);
6626 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)services_info_cb, THREE_SECS, 0);
6627 display_info.Identifier = ServicesFailed;
6628
6629 /*
6630 * Call Info Screen
6631 */
6632 ss_data.info_win = info_dialog (ss_data.win, &display_info);
6633 }
6634 else
6635 {
6636 strcat(SS_string, "**03*330*");
6637 strcat(SS_string,(char*)ss_data.edt_buf_cb_password);
6638 strcat(SS_string,"*");
6639 strcat(SS_string,(char*)ss_data.edt_buf_cb_new_password);
6640 strcat(SS_string,"*");
6641 strcat(SS_string,(char*)ss_data.edt_buf_cb_conf_new_password);
6642 strcat(SS_string,"#");
6643
6644 TRACE_FUNCTION(SS_string);
6645
6646 if (ss_execute_transaction((UBYTE*)SS_string, 0) == MFW_SS_FAIL)
6647 showFailed( ss_data.win );
6648 }
6649
6650
6651 }
6652
6653
6654 /*******************************************************************************
6655
6656 $Function: featurePlaceholder
6657
6658 $Description: Display screen dialog for not-yet-implemented features
6659
6660 $Returns: None
6661
6662 $Arguments: None
6663
6664 //SPR#1113 - DS - Created function.
6665
6666 *******************************************************************************/
6667
6668 void featurePlaceholder(void){
6669
6670 T_DISPLAY_DATA display_info ;
6671
6672 TRACE_FUNCTION("featurePlaceholder");
6673
6674 display_info.LeftSoftKey = TxtSoftOK;
6675 display_info.RightSoftKey = 0;
6676 display_info.TextId = 0;
6677 display_info.TextId2 = 0;
6678 display_info.TextString = "Feature";
6679 display_info.TextString2 = "Not Available";
6680 display_info.Time = THREE_SECS;
6681 display_info.Identifier = 0;
6682 display_info.Callback = NULL;
6683 display_info.KeyEvents = KEY_CLEAR | KEY_LEFT | KEY_MNUUP | KEY_MNUDOWN;
6684
6685 /*
6686 * Call Info Screen
6687 */
6688
6689 info_dialog(win, &display_info);
6690
6691 }