Fix ecall timer set/get

Change-Id: I5438c8d382411a18951c3575923479b1c3d28f39
diff --git a/mbtk/include/mbtk/mbtk_info_api.h b/mbtk/include/mbtk/mbtk_info_api.h
index 245af6a..41b11a9 100755
--- a/mbtk/include/mbtk/mbtk_info_api.h
+++ b/mbtk/include/mbtk/mbtk_info_api.h
@@ -59,6 +59,40 @@
     MBTK_OFFERING,

 } mbtk_call_stat_enum;

 

+typedef enum {

+    MBTK_ECALL_CFG_ITEM_T3 = 0,         // ms

+    MBTK_ECALL_CFG_ITEM_T5,             // ms

+    MBTK_ECALL_CFG_ITEM_T6,             // ms

+    MBTK_ECALL_CFG_ITEM_T7,             // ms

+    MBTK_ECALL_CFG_ITEM_TH,             // ms

+    MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK,     // T9       // 5

+    MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN,     // T2

+    MBTK_ECALL_CFG_ITEM_TIMER_DEREG,    // T10

+    MBTK_ECALL_CFG_ITEM_TIMER_DIAL,     // "dial"

+    MBTK_ECALL_CFG_ITEM_TIMER_REDIAL,   // "redialtmr"

+    MBTK_ECALL_CFG_ITEM_TIMER_SMS,      // "sms"        // 10

+    MBTK_ECALL_CFG_ITEM_REDIALCNT,      // "redialcnt"

+    MBTK_ECALL_CFG_ITEM_SMSPROCESS,     // "smsprocess"

+    MBTK_ECALL_CFG_ITEM_SMSMSDCNT,       // "smsmsdcnt"

+

+    MBTK_ECALL_CFG_ITEM_MAX

+} mbtk_ecall_cfg_item_enum;

+

+#define MBTK_ECALL_CFG_T3   (1 << MBTK_ECALL_CFG_ITEM_T3)       // ms

+#define MBTK_ECALL_CFG_T5   (1 << MBTK_ECALL_CFG_ITEM_T5)       // ms

+#define MBTK_ECALL_CFG_T6   (1 << MBTK_ECALL_CFG_ITEM_T6)       // ms

+#define MBTK_ECALL_CFG_T7   (1 << MBTK_ECALL_CFG_ITEM_T7)       // ms

+#define MBTK_ECALL_CFG_TH   (1 << MBTK_ECALL_CFG_ITEM_TH)       // ms

+#define MBTK_ECALL_CFG_TIMER_CALLBACK   (1 << MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK)   // T9

+#define MBTK_ECALL_CFG_TIMER_CLEARDOWN  (1 << MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN)  // T2

+#define MBTK_ECALL_CFG_TIMER_DEREG  (1 << MBTK_ECALL_CFG_ITEM_TIMER_DEREG)      // T10

+#define MBTK_ECALL_CFG_TIMER_DIAL   (1 << MBTK_ECALL_CFG_ITEM_TIMER_DIAL)     // "dial"

+#define MBTK_ECALL_CFG_TIMER_REDIAL (1 << MBTK_ECALL_CFG_ITEM_TIMER_REDIAL)  // "redialtmr"

+#define MBTK_ECALL_CFG_TIMER_SMS    (1 << MBTK_ECALL_CFG_ITEM_TIMER_SMS)  // "sms"        // 10

+#define MBTK_ECALL_CFG_REDIALCNT    (1 << MBTK_ECALL_CFG_ITEM_REDIALCNT)  // "redialcnt"

+#define MBTK_ECALL_CFG_SMSPROCESS   (1 << MBTK_ECALL_CFG_ITEM_SMSPROCESS)  // "smsprocess"

+#define MBTK_ECALL_CFG_SMSMSDCNT    (1 << MBTK_ECALL_CFG_ITEM_SMSMSDCNT)  // "smsmsdcnt"

+

 /*

     0 : GSM only

     1 : UMTS only

@@ -613,29 +647,29 @@
     MBTK_ECALL_MODE_TYPE_ERA
 } mbtk_ecall_mode_type_enum;
 
-typedef enum {
-    MBTK_ECALL_CFG_ITEM_T3 = 0,         // ms

-    MBTK_ECALL_CFG_ITEM_T5,             // ms

-    MBTK_ECALL_CFG_ITEM_T6,             // ms

-    MBTK_ECALL_CFG_ITEM_T7,             // ms

-    MBTK_ECALL_CFG_ITEM_TH,             // ms

-    MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK,     // T9       // 5

-    MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN,     // T2
-    MBTK_ECALL_CFG_ITEM_TIMER_DEREG,    // T10
-    MBTK_ECALL_CFG_ITEM_TIMER_DIAL,     // "dial"
-    MBTK_ECALL_CFG_ITEM_TIMER_REDIAL,   // "redialtmr"
-    MBTK_ECALL_CFG_ITEM_TIMER_SMS,      // "sms"        // 10

-    MBTK_ECALL_CFG_ITEM_REDIALCNT,      // "redialcnt"
-    MBTK_ECALL_CFG_ITEM_SMSPROCESS,     // "smsprocess"
-    MBTK_ECALL_CFG_ITEM_SMSMSDCNT,       // "smsmsdcnt"

-

-    MBTK_ECALL_CFG_ITEM_MAX

-} mbtk_ecall_cfg_item_enum;
-
 typedef struct {
-    mbtk_ecall_cfg_item_enum type;
+    uint32 type;            // mbtk_ecall_cfg_item_enum

 

-    uint32 data;
+#if 0

+    uint32 timer_t3;    // ms

+    uint32 timer_t5;    // ms

+    uint32 timer_t6;    // ms

+    uint32 timer_t7;    // ms

+    uint32 timer_th;    // ms

+

+    uint32 timer_callback; // s (T9)
+    uint32 timer_cleardown; // s (T2)

+    uint32 timer_dereg;     // s (T10)

+    uint32 timer_dial;  // s

+    uint32 timer_redialtmr; // s

+    uint32 timer_sms;   // s

+

+    uint32 redialcnt;
+    uint32 smsprocess;

+    uint32 smsmsdcnt;

+#else

+    uint32 data[MBTK_ECALL_CFG_ITEM_MAX];

+#endif

 } mbtk_ecall_cfg_info_t;
 
 typedef enum {
diff --git a/mbtk/include/mbtk/mbtk_ril_api.h b/mbtk/include/mbtk/mbtk_ril_api.h
index 2ffe0f9..047f534 100755
--- a/mbtk/include/mbtk/mbtk_ril_api.h
+++ b/mbtk/include/mbtk/mbtk_ril_api.h
@@ -164,6 +164,42 @@
     MBTK_DEV_MODEM_TURN_OFF_FULL_SECONDARY_RECEIVE,           //Modem 完全禁用辅助接收
 } MBTK_DEV_MODEM_FUNCTION;
 
+
+typedef enum {
+    MBTK_ECALL_CFG_ITEM_T3 = 0,         // ms
+    MBTK_ECALL_CFG_ITEM_T5,             // ms
+    MBTK_ECALL_CFG_ITEM_T6,             // ms
+    MBTK_ECALL_CFG_ITEM_T7,             // ms
+    MBTK_ECALL_CFG_ITEM_TH,             // ms
+    MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK,     // T9       // 5
+    MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN,     // T2
+    MBTK_ECALL_CFG_ITEM_TIMER_DEREG,    // T10
+    MBTK_ECALL_CFG_ITEM_TIMER_DIAL,     // "dial"
+    MBTK_ECALL_CFG_ITEM_TIMER_REDIAL,   // "redialtmr"
+    MBTK_ECALL_CFG_ITEM_TIMER_SMS,      // "sms"        // 10
+    MBTK_ECALL_CFG_ITEM_REDIALCNT,      // "redialcnt"
+    MBTK_ECALL_CFG_ITEM_SMSPROCESS,     // "smsprocess"
+    MBTK_ECALL_CFG_ITEM_SMSMSDCNT,       // "smsmsdcnt"
+
+    MBTK_ECALL_CFG_ITEM_MAX
+} mbtk_ecall_cfg_item_enum;
+
+#define MBTK_ECALL_CFG_T3   (1 << MBTK_ECALL_CFG_ITEM_T3)       // ms
+#define MBTK_ECALL_CFG_T5   (1 << MBTK_ECALL_CFG_ITEM_T5)       // ms
+#define MBTK_ECALL_CFG_T6   (1 << MBTK_ECALL_CFG_ITEM_T6)       // ms
+#define MBTK_ECALL_CFG_T7   (1 << MBTK_ECALL_CFG_ITEM_T7)       // ms
+#define MBTK_ECALL_CFG_TH   (1 << MBTK_ECALL_CFG_ITEM_TH)       // ms
+#define MBTK_ECALL_CFG_TIMER_CALLBACK   (1 << MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK)   // T9
+#define MBTK_ECALL_CFG_TIMER_CLEARDOWN  (1 << MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN)  // T2
+#define MBTK_ECALL_CFG_TIMER_DEREG  (1 << MBTK_ECALL_CFG_ITEM_TIMER_DEREG)      // T10
+#define MBTK_ECALL_CFG_TIMER_DIAL   (1 << MBTK_ECALL_CFG_ITEM_TIMER_DIAL)     // "dial"
+#define MBTK_ECALL_CFG_TIMER_REDIAL (1 << MBTK_ECALL_CFG_ITEM_TIMER_REDIAL)  // "redialtmr"
+#define MBTK_ECALL_CFG_TIMER_SMS    (1 << MBTK_ECALL_CFG_ITEM_TIMER_SMS)  // "sms"        // 10
+#define MBTK_ECALL_CFG_REDIALCNT    (1 << MBTK_ECALL_CFG_ITEM_REDIALCNT)  // "redialcnt"
+#define MBTK_ECALL_CFG_SMSPROCESS   (1 << MBTK_ECALL_CFG_ITEM_SMSPROCESS)  // "smsprocess"
+#define MBTK_ECALL_CFG_SMSMSDCNT    (1 << MBTK_ECALL_CFG_ITEM_SMSMSDCNT)  // "smsmsdcnt"
+
+
 /*
     0 : GSM only
     1 : UMTS only
@@ -719,29 +755,29 @@
     MBTK_ECALL_MODE_TYPE_ERA
 } mbtk_ecall_mode_type_enum;
 
-typedef enum {
-    MBTK_ECALL_CFG_ITEM_T3 = 0,         // ms
-    MBTK_ECALL_CFG_ITEM_T5,             // ms
-    MBTK_ECALL_CFG_ITEM_T6,             // ms
-    MBTK_ECALL_CFG_ITEM_T7,             // ms
-    MBTK_ECALL_CFG_ITEM_TH,             // ms
-    MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK,     // T9       // 5
-    MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN,     // T2
-    MBTK_ECALL_CFG_ITEM_TIMER_DEREG,    // T10
-    MBTK_ECALL_CFG_ITEM_TIMER_DIAL,     // "dial"
-    MBTK_ECALL_CFG_ITEM_TIMER_REDIAL,   // "redialtmr"
-    MBTK_ECALL_CFG_ITEM_TIMER_SMS,      // "sms"        // 10
-    MBTK_ECALL_CFG_ITEM_REDIALCNT,      // "redialcnt"
-    MBTK_ECALL_CFG_ITEM_SMSPROCESS,     // "smsprocess"
-    MBTK_ECALL_CFG_ITEM_SMSMSDCNT,       // "smsmsdcnt"
-
-    MBTK_ECALL_CFG_ITEM_MAX
-} mbtk_ecall_cfg_item_enum;
-
 typedef struct {
-    mbtk_ecall_cfg_item_enum type;
+    uint32 type;            // mbtk_ecall_cfg_item_enum
 
-    uint32 data;
+#if 0
+    uint32 timer_t3;    // ms
+    uint32 timer_t5;    // ms
+    uint32 timer_t6;    // ms
+    uint32 timer_t7;    // ms
+    uint32 timer_th;    // ms
+
+    uint32 timer_callback; // s (T9)
+    uint32 timer_cleardown; // s (T2)
+    uint32 timer_dereg;     // s (T10)
+    uint32 timer_dial;  // s
+    uint32 timer_redialtmr; // s
+    uint32 timer_sms;   // s
+
+    uint32 redialcnt;
+    uint32 smsprocess;
+    uint32 smsmsdcnt;
+#else
+    uint32 data[MBTK_ECALL_CFG_ITEM_MAX];
+#endif
 } mbtk_ecall_cfg_info_t;
 
 typedef enum {
diff --git a/mbtk/libmbtk_lib/ril/mbtk_info_api.c b/mbtk/libmbtk_lib/ril/mbtk_info_api.c
index b751aa6..b5fc96d 100755
--- a/mbtk/libmbtk_lib/ril/mbtk_info_api.c
+++ b/mbtk/libmbtk_lib/ril/mbtk_info_api.c
@@ -2764,7 +2764,7 @@
         return -1;
     }
 
-    if(cfg == NULL || cfg->type >= MBTK_ECALL_CFG_ITEM_MAX)
+    if(cfg == NULL || cfg->type == 0)
     {
         LOGE("ARG error.");
         return -1;
@@ -2788,14 +2788,14 @@
         return -1;
     }
 
-    if(cfg == NULL || cfg->type >= MBTK_ECALL_CFG_ITEM_MAX)
+    if(cfg == NULL || cfg->type == 0)
     {
         LOGE("ARG error.");
         return -1;
     }
-    mbtk_ecall_cfg_item_enum type = cfg->type;
+    uint32 type = cfg->type;
 
-    if(info_item_process(handle, RIL_MSG_ID_ECALL_CFG_REQ, &type, 1, cfg) >= 0) {
+    if(info_item_process(handle, RIL_MSG_ID_ECALL_CFG_REQ, &type, sizeof(uint32), cfg) >= 0) {
         return 0;
     } else {
         return handle->info_err;
diff --git a/mbtk/libmbtk_lib_v2/ril/mbtk_ril_api.c b/mbtk/libmbtk_lib_v2/ril/mbtk_ril_api.c
index b6b61ca..9e8fc3a 100755
--- a/mbtk/libmbtk_lib_v2/ril/mbtk_ril_api.c
+++ b/mbtk/libmbtk_lib_v2/ril/mbtk_ril_api.c
@@ -2360,7 +2360,7 @@
         return MBTK_RIL_ERR_NOT_INIT;
     }
 
-    if(cfg == NULL || cfg->type >= MBTK_ECALL_CFG_ITEM_MAX)
+    if(cfg == NULL || cfg->type == 0)
     {
         LOGE("ARG error.");
         return MBTK_RIL_ERR_PARAMETER;
@@ -2380,14 +2380,14 @@
         return MBTK_RIL_ERR_NOT_INIT;
     }
 
-    if(cfg == NULL || cfg->type >= MBTK_ECALL_CFG_ITEM_MAX)
+    if(cfg == NULL || cfg->type == 0)
     {
         LOGE("ARG error.");
         return MBTK_RIL_ERR_PARAMETER;
     }
-    mbtk_ecall_cfg_item_enum type = cfg->type;
+    uint32 type = cfg->type;
 
-    return ril_req_process(RIL_MSG_ID_ECALL_CFG, &type, 1, cfg, FALSE);
+    return ril_req_process(RIL_MSG_ID_ECALL_CFG, &type, sizeof(uint32), cfg, FALSE);
 }
 
 /*
diff --git a/mbtk/libmbtk_lib_v2/ril/ril_utils.c b/mbtk/libmbtk_lib_v2/ril/ril_utils.c
index 371275d..9c39019 100755
--- a/mbtk/libmbtk_lib_v2/ril/ril_utils.c
+++ b/mbtk/libmbtk_lib_v2/ril/ril_utils.c
@@ -276,8 +276,8 @@
             return "PB_STATE";
         // IND Information
          // <uint8>  State
-        case RIL_MSG_ID_IND_SER_READY:
-            return "IND_SER_READY";
+        case RIL_MSG_ID_IND_SER_STATE_CHANGE:
+            return "IND_SER_STATE";
         // <uint8>  State
         case RIL_MSG_ID_IND_NET_REG_STATE_CHANGE:
             return "IND_NET_REG_STATE";
diff --git a/mbtk/mbtk_rild/src/ril_ecall.c b/mbtk/mbtk_rild/src/ril_ecall.c
index 8d7a5e8..3854f7e 100755
--- a/mbtk/mbtk_rild/src/ril_ecall.c
+++ b/mbtk/mbtk_rild/src/ril_ecall.c
@@ -21,6 +21,93 @@
 
 void pack_rsp_send(int fd, int info_id, const void* data, int data_len);
 
+static int cfg_ecalldata_get(mbtk_ecall_cfg_item_enum type, uint32 *value, int *cme_err)
+{
+    ATResponse *response = NULL;
+    char *tmp_ptr = NULL;
+    int tmp_int;
+    char cmd[100] = {0};
+    int err = 0;
+
+    snprintf(cmd, sizeof(cmd), "AT*ECALLDATA=5,%d", type);
+    err = at_send_command_singleline(cmd, "*ECALLDATA:", &response);
+
+    if (err < 0 || response->success == 0 || !response->p_intermediates){
+        *cme_err = at_get_cme_error(response);
+        goto exit;
+    }
+
+    char *line = response->p_intermediates->line;
+    err = at_tok_start(&line);
+    if (err < 0)
+    {
+        goto exit;
+    }
+
+    err = at_tok_nextint(&line, &tmp_int);
+    if (err < 0)
+    {
+        goto exit;
+    }
+
+    err = at_tok_nextint(&line, &tmp_int);
+    if (err < 0)
+    {
+        goto exit;
+    }
+
+    err = at_tok_nextint(&line, &tmp_int);
+    if (err < 0)
+    {
+        goto exit;
+    }
+
+    *value = (uint32)(tmp_int * 20);   // ms
+
+    goto exit;
+exit:
+    at_response_free(response);
+    return err;
+}
+
+static int cfg_ecalldata_set(mbtk_ecall_cfg_item_enum type, uint32 value, int *cme_err)
+{
+    ATResponse *response = NULL;
+    char cmd[100] = {0};
+    int err = 0;
+
+    snprintf(cmd, sizeof(cmd), "AT*ECALLDATA=5,%d,%d", type, value / 20);
+    err = at_send_command(cmd, &response);
+    if (err < 0 || response->success == 0){
+        *cme_err = at_get_cme_error(response);
+        goto exit;
+    }
+
+    goto exit;
+exit:
+    at_response_free(response);
+    return err;
+}
+
+static int cfg_ecalltimer_set(const char* type, uint32 value, int *cme_err)
+{
+    ATResponse *response = NULL;
+    char cmd[100] = {0};
+    int err = 0;
+
+    snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=%s,%d", type, value);
+    err = at_send_command(cmd, &response);
+    if (err < 0 || response->success == 0){
+        *cme_err = at_get_cme_error(response);
+        goto exit;
+    }
+
+    goto exit;
+exit:
+    at_response_free(response);
+    return err;
+}
+
 static int req_ecall_msdcfg(mbtk_ecall_msd_cfg_info_t *cfg_info, int *cme_err)
 {
     ATResponse *response = NULL;
@@ -371,66 +458,71 @@
 OK
 
 */
-static int req_ecall_cfg_get(mbtk_ecall_cfg_item_enum type, mbtk_ecall_cfg_info_t *cfg, int *cme_err)
+static int req_ecall_cfg_get(uint32 type, mbtk_ecall_cfg_info_t *cfg, int *cme_err)
 {
     ATResponse *response = NULL;
     char *tmp_ptr = NULL;
     int tmp_int;
-    char cmd[1024] = {0};
     int err = 0;
 
     cfg->type = type;
-    switch(type)
-    {
-        case MBTK_ECALL_CFG_ITEM_T3:
-        case MBTK_ECALL_CFG_ITEM_T5:
-        case MBTK_ECALL_CFG_ITEM_T6:
-        case MBTK_ECALL_CFG_ITEM_T7:
-        case MBTK_ECALL_CFG_ITEM_TH:
-            snprintf(cmd, sizeof(cmd), "AT*ECALLDATA=5,%d", type);
 
-            err = at_send_command_singleline(cmd, "*ECALLDATA:", &response);
-            break;
-        default:
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER?");
-
-            err = at_send_command_singleline(cmd, "*ECALLTIMER:", &response);
-            break;
+    if(type & MBTK_ECALL_CFG_T3) {
+        if(cfg_ecalldata_get(MBTK_ECALL_CFG_ITEM_T3, &(cfg->data[MBTK_ECALL_CFG_ITEM_T3]), cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON)
+        {
+            goto exit;
+        }
     }
 
-    if (err < 0 || response->success == 0 || !response->p_intermediates){
-        *cme_err = at_get_cme_error(response);
-        goto exit;
+    if(type & MBTK_ECALL_CFG_T5) {
+        if(cfg_ecalldata_get(MBTK_ECALL_CFG_ITEM_T5, &(cfg->data[MBTK_ECALL_CFG_ITEM_T5]), cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON)
+        {
+            goto exit;
+        }
     }
 
-    char *line = response->p_intermediates->line;
-    err = at_tok_start(&line);
-    if (err < 0)
-    {
-        goto exit;
+    if(type & MBTK_ECALL_CFG_T6) {
+        if(cfg_ecalldata_get(MBTK_ECALL_CFG_ITEM_T6, &(cfg->data[MBTK_ECALL_CFG_ITEM_T6]), cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON)
+        {
+            goto exit;
+        }
     }
 
-    if(strstr(cmd, "AT*ECALLDATA")) {
-        err = at_tok_nextint(&line, &tmp_int);
+    if(type & MBTK_ECALL_CFG_T7) {
+        if(cfg_ecalldata_get(MBTK_ECALL_CFG_ITEM_T7, &(cfg->data[MBTK_ECALL_CFG_ITEM_T7]), cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON)
+        {
+            goto exit;
+        }
+    }
+
+    if(type & MBTK_ECALL_CFG_TH) {
+        if(cfg_ecalldata_get(MBTK_ECALL_CFG_ITEM_TH, &(cfg->data[MBTK_ECALL_CFG_ITEM_TH]), cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON)
+        {
+            goto exit;
+        }
+    }
+
+    if(type & (MBTK_ECALL_CFG_TIMER_CALLBACK | MBTK_ECALL_CFG_TIMER_CLEARDOWN | MBTK_ECALL_CFG_TIMER_DEREG
+                | MBTK_ECALL_CFG_TIMER_DIAL | MBTK_ECALL_CFG_TIMER_REDIAL | MBTK_ECALL_CFG_TIMER_SMS
+                | MBTK_ECALL_CFG_REDIALCNT | MBTK_ECALL_CFG_SMSPROCESS | MBTK_ECALL_CFG_SMSMSDCNT)) {
+        err = at_send_command_singleline("AT*ECALLTIMER?", "*ECALLTIMER:", &response);
+        if (err < 0 || response->success == 0 || !response->p_intermediates){
+            *cme_err = at_get_cme_error(response);
+            goto exit;
+        }
+
+        char *line = response->p_intermediates->line;
+        err = at_tok_start(&line);
         if (err < 0)
         {
             goto exit;
         }
 
-        err = at_tok_nextint(&line, &tmp_int);
-        if (err < 0)
-        {
-            goto exit;
-        }
-
-        err = at_tok_nextint(&line, &tmp_int);
-        if (err < 0)
-        {
-            goto exit;
-        }
-
-        cfg->data = (uint32)(tmp_int * 20);   // ms
-    } else {
         // *ECALLTIMER: ERA mode, callback timer: 1200s,
         // dial setup timer: 30s, NAD deregister timer: 7200s,
         // cleardown timer: 3600s, redial attempts count: 10,
@@ -443,80 +535,73 @@
             ecall_mode = MBTK_ECALL_MODE_TYPE_EU;
         }
 
-        switch(type)
+        if(type & MBTK_ECALL_CFG_TIMER_CALLBACK)
         {
-            case MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK:
-            {
-                if((tmp_ptr = strstr(line, "callback timer: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 16);   // s
-                    cfg->data *= 1000; // s -> ms
-                }
-                break;
+            if((tmp_ptr = strstr(line, "callback timer: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK] = (uint32)atoi(tmp_ptr + 16);   // s
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK] *= 1000; // s -> ms
             }
-            case MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN:
-            {
-                if((tmp_ptr = strstr(line, "cleardown timer: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 17);   // s
-                    cfg->data *= 1000; // s -> ms
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_TIMER_CLEARDOWN)
+        {
+            if((tmp_ptr = strstr(line, "cleardown timer: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN] = (uint32)atoi(tmp_ptr + 17);   // s
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN] *= 1000; // s -> ms
             }
-            case MBTK_ECALL_CFG_ITEM_TIMER_DEREG:
-            {
-                if((tmp_ptr = strstr(line, "deregister timer: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 18);   // s
-                    cfg->data *= 1000; // s -> ms
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_TIMER_DEREG)
+        {
+            if((tmp_ptr = strstr(line, "deregister timer: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_DEREG] = (uint32)atoi(tmp_ptr + 18);   // s
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_DEREG] *= 1000; // s -> ms
             }
-            case MBTK_ECALL_CFG_ITEM_TIMER_DIAL:
-            {
-                if((tmp_ptr = strstr(line, "dial setup timer: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 18);   // s
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_TIMER_DIAL)
+        {
+            if((tmp_ptr = strstr(line, "dial setup timer: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_DIAL] = (uint32)atoi(tmp_ptr + 18);   // s
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_DIAL] *= 1000; // s -> ms
             }
-            case MBTK_ECALL_CFG_ITEM_TIMER_REDIAL:
-            {
-                if((tmp_ptr = strstr(line, "redial wait timer: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 19);   // s
-                    cfg->data *= 1000; // s -> ms
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_TIMER_REDIAL)
+        {
+            if((tmp_ptr = strstr(line, "redial wait timer: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL] = (uint32)atoi(tmp_ptr + 19);   // s
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL] *= 1000; // s -> ms
             }
-            case MBTK_ECALL_CFG_ITEM_TIMER_SMS:
-            {
-                if((tmp_ptr = strstr(line, "SMS resend timer: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 18);
-                    cfg->data *= 1000; // s -> ms
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_TIMER_SMS)
+        {
+            if((tmp_ptr = strstr(line, "SMS resend timer: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_SMS] = (uint32)atoi(tmp_ptr + 18);
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_SMS] *= 1000; // s -> ms
             }
-            case MBTK_ECALL_CFG_ITEM_REDIALCNT:
-            {
-                if((tmp_ptr = strstr(line, "redial attempts count: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 23);
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_REDIALCNT)
+        {
+            if((tmp_ptr = strstr(line, "redial attempts count: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_REDIALCNT] = (uint32)atoi(tmp_ptr + 23);
             }
-            case MBTK_ECALL_CFG_ITEM_SMSPROCESS:
-            {
-                if((tmp_ptr = strstr(line, "smsprocess: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 12);
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_SMSPROCESS)
+        {
+            if((tmp_ptr = strstr(line, "smsprocess: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_SMSPROCESS] = (uint32)atoi(tmp_ptr + 12);
             }
-            case MBTK_ECALL_CFG_ITEM_SMSMSDCNT:
-            {
-                if((tmp_ptr = strstr(line, "sms msd send count: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 20);
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_SMSMSDCNT)
+        {
+            if((tmp_ptr = strstr(line, "sms msd send count: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_SMSMSDCNT] = (uint32)atoi(tmp_ptr + 20);
             }
-            default:
-                LOGE("Unknown config item : %d", type);
-                err = -1;
-                break;
         }
     }
 
@@ -535,88 +620,123 @@
 */
 static int req_ecall_cfg_set(const mbtk_ecall_cfg_info_t *cfg_info, int *cme_err)
 {
-    ATResponse *response = NULL;
-    char cmd[1024] = {0};
     int err = 0;
-
     if(ecall_mode == MBTK_ECALL_MODE_TYPE_EU) {
-        if(cfg_info->type != MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK
-            && cfg_info->type != MBTK_ECALL_CFG_ITEM_TIMER_DIAL
-            && cfg_info->type != MBTK_ECALL_CFG_ITEM_TIMER_DEREG
-            && cfg_info->type != MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN){
+        if((cfg_info->type & MBTK_ECALL_CFG_TIMER_REDIAL)
+            || (cfg_info->type & MBTK_ECALL_CFG_TIMER_SMS)
+            || (cfg_info->type & MBTK_ECALL_CFG_REDIALCNT)
+            || (cfg_info->type & MBTK_ECALL_CFG_SMSPROCESS)
+            || (cfg_info->type & MBTK_ECALL_CFG_SMSMSDCNT)){
             LOGW("No support for EU.");
             return -1;
         }
     }
 
-    switch(cfg_info->type)
-    {
-        case MBTK_ECALL_CFG_ITEM_T3:
-        case MBTK_ECALL_CFG_ITEM_T5:
-        case MBTK_ECALL_CFG_ITEM_T6:
-        case MBTK_ECALL_CFG_ITEM_T7:
-        case MBTK_ECALL_CFG_ITEM_TH:
-            snprintf(cmd, sizeof(cmd), "AT*ECALLDATA=5,%d,%d", cfg_info->type, cfg_info->data / 20);
-            break;
-        case MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK:
+    if(cfg_info->type & MBTK_ECALL_CFG_T3) {
+        if(cfg_ecalldata_set(MBTK_ECALL_CFG_ITEM_T3, cfg_info->data[MBTK_ECALL_CFG_ITEM_T3], cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON)
         {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=callback,%d", cfg_info->data / 1000);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=cleardown,%d", cfg_info->data / 1000);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_TIMER_DEREG:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=dereg,%d", cfg_info->data / 1000);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_TIMER_DIAL:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=dial,%d", cfg_info->data / 1000);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_TIMER_REDIAL:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=redialtmr,%d", cfg_info->data / 1000);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_TIMER_SMS:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=sms,%d", cfg_info->data / 1000);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_REDIALCNT:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=redialcnt,%d", cfg_info->data);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_SMSPROCESS:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=smsprocess,%d", cfg_info->data);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_SMSMSDCNT:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=smsmsdcnt,%d", cfg_info->data);
-            break;
-        }
-        default:
-            LOGE("Unknown config item : %d", cfg_info->type);
-            err = -1;
             goto exit;
+        }
     }
 
-    err = at_send_command(cmd, &response);
-    if (err < 0 || response->success == 0){
-        *cme_err = at_get_cme_error(response);
-        goto exit;
+    if(cfg_info->type & MBTK_ECALL_CFG_T5) {
+        if(cfg_ecalldata_set(MBTK_ECALL_CFG_ITEM_T5, cfg_info->data[MBTK_ECALL_CFG_ITEM_T5], cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON)
+        {
+            goto exit;
+        }
+    }
+
+    if(cfg_info->type & MBTK_ECALL_CFG_T6) {
+        if(cfg_ecalldata_set(MBTK_ECALL_CFG_ITEM_T6, cfg_info->data[MBTK_ECALL_CFG_ITEM_T6], cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON)
+        {
+            goto exit;
+        }
+    }
+
+    if(cfg_info->type & MBTK_ECALL_CFG_T7) {
+        if(cfg_ecalldata_set(MBTK_ECALL_CFG_ITEM_T7, cfg_info->data[MBTK_ECALL_CFG_ITEM_T7], cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON)
+        {
+            goto exit;
+        }
+    }
+
+    if(cfg_info->type & MBTK_ECALL_CFG_TH) {
+        if(cfg_ecalldata_set(MBTK_ECALL_CFG_ITEM_TH, cfg_info->data[MBTK_ECALL_CFG_ITEM_TH], cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON)
+        {
+            goto exit;
+        }
+    }
+
+    if(cfg_info->type & MBTK_ECALL_CFG_TIMER_CALLBACK)
+    {
+        if(cfg_ecalltimer_set("callback", cfg_info->data[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK] / 1000, cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_TIMER_CLEARDOWN)
+    {
+        if(cfg_ecalltimer_set("cleardown", cfg_info->data[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN] / 1000, cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_TIMER_DEREG)
+    {
+        if(cfg_ecalltimer_set("dereg", cfg_info->data[MBTK_ECALL_CFG_ITEM_TIMER_DEREG] / 1000, cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_TIMER_DIAL)
+    {
+        if(cfg_ecalltimer_set("dial", cfg_info->data[MBTK_ECALL_CFG_ITEM_TIMER_DIAL] / 1000, cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_TIMER_REDIAL)
+    {
+        if(cfg_ecalltimer_set("redialtmr", cfg_info->data[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL] / 1000, cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_TIMER_SMS)
+    {
+        if(cfg_ecalltimer_set("sms", cfg_info->data[MBTK_ECALL_CFG_ITEM_TIMER_SMS] / 1000, cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_REDIALCNT)
+    {
+        if(cfg_ecalltimer_set("redialcnt", cfg_info->data[MBTK_ECALL_CFG_ITEM_REDIALCNT], cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_SMSPROCESS)
+    {
+        if(cfg_ecalltimer_set("smsprocess", cfg_info->data[MBTK_ECALL_CFG_ITEM_SMSPROCESS], cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_SMSMSDCNT)
+    {
+        if(cfg_ecalltimer_set("smsmsdcnt", cfg_info->data[MBTK_ECALL_CFG_ITEM_SMSMSDCNT], cme_err)
+            || *cme_err != MBTK_INFO_ERR_CME_NON) {
+            goto exit;
+        }
     }
 
 exit:
-    at_response_free(response);
     return err;
 }
 
@@ -1003,7 +1123,7 @@
                         } else {
                             err = MBTK_INFO_ERR_UNKNOWN;
                         }
-                        LOG("Set ecall config[%d] fail.", cfg_info->type);
+                        LOG("Set ecall config[%x] fail.", cfg_info->type);
                     }
                     else
                     {
@@ -1012,15 +1132,15 @@
                 } else { // Get
                     mbtk_ecall_cfg_info_t cfg_info;
                     memset(&cfg_info, 0, sizeof(mbtk_ecall_cfg_info_t));
-                    mbtk_ecall_cfg_item_enum type = (mbtk_ecall_cfg_item_enum)pack->data[0];
-                    if(req_ecall_cfg_get(type, &cfg_info, &cme_err) || cme_err != MBTK_INFO_ERR_CME_NON)
+                    uint32 *type = (uint32*)(pack->data);
+                    if(req_ecall_cfg_get(*type, &cfg_info, &cme_err) || cme_err != MBTK_INFO_ERR_CME_NON)
                     {
                         if(cme_err != MBTK_INFO_ERR_CME_NON) {
                             err = MBTK_INFO_ERR_CME + cme_err;
                         } else {
                             err = MBTK_INFO_ERR_UNKNOWN;
                         }
-                        LOG("Get ecall config[%d] fail.", type);
+                        LOG("Get ecall config[%x] fail.", *type);
                     }
                     else
                     {
diff --git a/mbtk/mbtk_rild_v2/src/ril_ecall.c b/mbtk/mbtk_rild_v2/src/ril_ecall.c
index dfb4ace..c86f922 100755
--- a/mbtk/mbtk_rild_v2/src/ril_ecall.c
+++ b/mbtk/mbtk_rild_v2/src/ril_ecall.c
@@ -21,6 +21,93 @@
 
 void ril_rsp_pack_send(int fd, int ril_id, int msg_index, const void* data, int data_len);
 
+static int cfg_ecalldata_get(mbtk_ecall_cfg_item_enum type, uint32 *value, int *cme_err)
+{
+    ATResponse *response = NULL;
+    char *tmp_ptr = NULL;
+    int tmp_int;
+    char cmd[100] = {0};
+    int err = 0;
+
+    snprintf(cmd, sizeof(cmd), "AT*ECALLDATA=5,%d", type);
+    err = at_send_command_singleline(cmd, "*ECALLDATA:", &response);
+
+    if (err < 0 || response->success == 0 || !response->p_intermediates){
+        *cme_err = at_get_cme_error(response);
+        goto exit;
+    }
+
+    char *line = response->p_intermediates->line;
+    err = at_tok_start(&line);
+    if (err < 0)
+    {
+        goto exit;
+    }
+
+    err = at_tok_nextint(&line, &tmp_int);
+    if (err < 0)
+    {
+        goto exit;
+    }
+
+    err = at_tok_nextint(&line, &tmp_int);
+    if (err < 0)
+    {
+        goto exit;
+    }
+
+    err = at_tok_nextint(&line, &tmp_int);
+    if (err < 0)
+    {
+        goto exit;
+    }
+
+    *value = (uint32)(tmp_int * 20);   // ms
+
+    goto exit;
+exit:
+    at_response_free(response);
+    return err;
+}
+
+static int cfg_ecalldata_set(mbtk_ecall_cfg_item_enum type, uint32 value, int *cme_err)
+{
+    ATResponse *response = NULL;
+    char cmd[100] = {0};
+    int err = 0;
+
+    snprintf(cmd, sizeof(cmd), "AT*ECALLDATA=5,%d,%d", type, value / 20);
+    err = at_send_command(cmd, &response);
+    if (err < 0 || response->success == 0){
+        *cme_err = at_get_cme_error(response);
+        goto exit;
+    }
+
+    goto exit;
+exit:
+    at_response_free(response);
+    return err;
+}
+
+static int cfg_ecalltimer_set(const char* type, uint32 value, int *cme_err)
+{
+    ATResponse *response = NULL;
+    char cmd[100] = {0};
+    int err = 0;
+
+    snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=%s,%d", type, value);
+    err = at_send_command(cmd, &response);
+    if (err < 0 || response->success == 0){
+        *cme_err = at_get_cme_error(response);
+        goto exit;
+    }
+
+    goto exit;
+exit:
+    at_response_free(response);
+    return err;
+}
+
 static int req_ecall_msdcfg(mbtk_ecall_msd_cfg_info_t *cfg_info, int *cme_err)
 {
     ATResponse *response = NULL;
@@ -371,66 +458,71 @@
 OK
 
 */
-static int req_ecall_cfg_get(mbtk_ecall_cfg_item_enum type, mbtk_ecall_cfg_info_t *cfg, int *cme_err)
+static int req_ecall_cfg_get(uint32 type, mbtk_ecall_cfg_info_t *cfg, int *cme_err)
 {
     ATResponse *response = NULL;
     char *tmp_ptr = NULL;
     int tmp_int;
-    char cmd[1024] = {0};
     int err = 0;
 
     cfg->type = type;
-    switch(type)
-    {
-        case MBTK_ECALL_CFG_ITEM_T3:
-        case MBTK_ECALL_CFG_ITEM_T5:
-        case MBTK_ECALL_CFG_ITEM_T6:
-        case MBTK_ECALL_CFG_ITEM_T7:
-        case MBTK_ECALL_CFG_ITEM_TH:
-            snprintf(cmd, sizeof(cmd), "AT*ECALLDATA=5,%d", type);
 
-            err = at_send_command_singleline(cmd, "*ECALLDATA:", &response);
-            break;
-        default:
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER?");
-
-            err = at_send_command_singleline(cmd, "*ECALLTIMER:", &response);
-            break;
+    if(type & MBTK_ECALL_CFG_T3) {
+        if(cfg_ecalldata_get(MBTK_ECALL_CFG_ITEM_T3, &(cfg->data[MBTK_ECALL_CFG_ITEM_T3]), cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON)
+        {
+            goto exit;
+        }
     }
 
-    if (err < 0 || response->success == 0 || !response->p_intermediates){
-        *cme_err = at_get_cme_error(response);
-        goto exit;
+    if(type & MBTK_ECALL_CFG_T5) {
+        if(cfg_ecalldata_get(MBTK_ECALL_CFG_ITEM_T5, &(cfg->data[MBTK_ECALL_CFG_ITEM_T5]), cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON)
+        {
+            goto exit;
+        }
     }
 
-    char *line = response->p_intermediates->line;
-    err = at_tok_start(&line);
-    if (err < 0)
-    {
-        goto exit;
+    if(type & MBTK_ECALL_CFG_T6) {
+        if(cfg_ecalldata_get(MBTK_ECALL_CFG_ITEM_T6, &(cfg->data[MBTK_ECALL_CFG_ITEM_T6]), cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON)
+        {
+            goto exit;
+        }
     }
 
-    if(strstr(cmd, "AT*ECALLDATA")) {
-        err = at_tok_nextint(&line, &tmp_int);
+    if(type & MBTK_ECALL_CFG_T7) {
+        if(cfg_ecalldata_get(MBTK_ECALL_CFG_ITEM_T7, &(cfg->data[MBTK_ECALL_CFG_ITEM_T7]), cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON)
+        {
+            goto exit;
+        }
+    }
+
+    if(type & MBTK_ECALL_CFG_TH) {
+        if(cfg_ecalldata_get(MBTK_ECALL_CFG_ITEM_TH, &(cfg->data[MBTK_ECALL_CFG_ITEM_TH]), cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON)
+        {
+            goto exit;
+        }
+    }
+
+    if(type & (MBTK_ECALL_CFG_TIMER_CALLBACK | MBTK_ECALL_CFG_TIMER_CLEARDOWN | MBTK_ECALL_CFG_TIMER_DEREG
+                | MBTK_ECALL_CFG_TIMER_DIAL | MBTK_ECALL_CFG_TIMER_REDIAL | MBTK_ECALL_CFG_TIMER_SMS
+                | MBTK_ECALL_CFG_REDIALCNT | MBTK_ECALL_CFG_SMSPROCESS | MBTK_ECALL_CFG_SMSMSDCNT)) {
+        err = at_send_command_singleline("AT*ECALLTIMER?", "*ECALLTIMER:", &response);
+        if (err < 0 || response->success == 0 || !response->p_intermediates){
+            *cme_err = at_get_cme_error(response);
+            goto exit;
+        }
+
+        char *line = response->p_intermediates->line;
+        err = at_tok_start(&line);
         if (err < 0)
         {
             goto exit;
         }
 
-        err = at_tok_nextint(&line, &tmp_int);
-        if (err < 0)
-        {
-            goto exit;
-        }
-
-        err = at_tok_nextint(&line, &tmp_int);
-        if (err < 0)
-        {
-            goto exit;
-        }
-
-        cfg->data = (uint32)(tmp_int * 20);   // ms
-    } else {
         // *ECALLTIMER: ERA mode, callback timer: 1200s,
         // dial setup timer: 30s, NAD deregister timer: 7200s,
         // cleardown timer: 3600s, redial attempts count: 10,
@@ -443,80 +535,73 @@
             ecall_mode = MBTK_ECALL_MODE_TYPE_EU;
         }
 
-        switch(type)
+        if(type & MBTK_ECALL_CFG_TIMER_CALLBACK)
         {
-            case MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK:
-            {
-                if((tmp_ptr = strstr(line, "callback timer: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 16);   // s
-                    cfg->data *= 1000; // s -> ms
-                }
-                break;
+            if((tmp_ptr = strstr(line, "callback timer: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK] = (uint32)atoi(tmp_ptr + 16);   // s
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK] *= 1000; // s -> ms
             }
-            case MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN:
-            {
-                if((tmp_ptr = strstr(line, "cleardown timer: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 17);   // s
-                    cfg->data *= 1000; // s -> ms
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_TIMER_CLEARDOWN)
+        {
+            if((tmp_ptr = strstr(line, "cleardown timer: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN] = (uint32)atoi(tmp_ptr + 17);   // s
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN] *= 1000; // s -> ms
             }
-            case MBTK_ECALL_CFG_ITEM_TIMER_DEREG:
-            {
-                if((tmp_ptr = strstr(line, "deregister timer: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 18);   // s
-                    cfg->data *= 1000; // s -> ms
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_TIMER_DEREG)
+        {
+            if((tmp_ptr = strstr(line, "deregister timer: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_DEREG] = (uint32)atoi(tmp_ptr + 18);   // s
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_DEREG] *= 1000; // s -> ms
             }
-            case MBTK_ECALL_CFG_ITEM_TIMER_DIAL:
-            {
-                if((tmp_ptr = strstr(line, "dial setup timer: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 18);   // s
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_TIMER_DIAL)
+        {
+            if((tmp_ptr = strstr(line, "dial setup timer: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_DIAL] = (uint32)atoi(tmp_ptr + 18);   // s
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_DIAL] *= 1000; // s -> ms
             }
-            case MBTK_ECALL_CFG_ITEM_TIMER_REDIAL:
-            {
-                if((tmp_ptr = strstr(line, "redial wait timer: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 19);   // s
-                    cfg->data *= 1000; // s -> ms
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_TIMER_REDIAL)
+        {
+            if((tmp_ptr = strstr(line, "redial wait timer: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL] = (uint32)atoi(tmp_ptr + 19);   // s
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL] *= 1000; // s -> ms
             }
-            case MBTK_ECALL_CFG_ITEM_TIMER_SMS:
-            {
-                if((tmp_ptr = strstr(line, "SMS resend timer: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 18);
-                    cfg->data *= 1000; // s -> ms
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_TIMER_SMS)
+        {
+            if((tmp_ptr = strstr(line, "SMS resend timer: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_SMS] = (uint32)atoi(tmp_ptr + 18);
+                cfg->data[MBTK_ECALL_CFG_ITEM_TIMER_SMS] *= 1000; // s -> ms
             }
-            case MBTK_ECALL_CFG_ITEM_REDIALCNT:
-            {
-                if((tmp_ptr = strstr(line, "redial attempts count: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 23);
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_REDIALCNT)
+        {
+            if((tmp_ptr = strstr(line, "redial attempts count: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_REDIALCNT] = (uint32)atoi(tmp_ptr + 23);
             }
-            case MBTK_ECALL_CFG_ITEM_SMSPROCESS:
-            {
-                if((tmp_ptr = strstr(line, "smsprocess: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 12);
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_SMSPROCESS)
+        {
+            if((tmp_ptr = strstr(line, "smsprocess: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_SMSPROCESS] = (uint32)atoi(tmp_ptr + 12);
             }
-            case MBTK_ECALL_CFG_ITEM_SMSMSDCNT:
-            {
-                if((tmp_ptr = strstr(line, "sms msd send count: ")) != NULL) {
-                    cfg->data = (uint32)atoi(tmp_ptr + 20);
-                }
-                break;
+        }
+
+        if(type & MBTK_ECALL_CFG_SMSMSDCNT)
+        {
+            if((tmp_ptr = strstr(line, "sms msd send count: ")) != NULL) {
+                cfg->data[MBTK_ECALL_CFG_ITEM_SMSMSDCNT] = (uint32)atoi(tmp_ptr + 20);
             }
-            default:
-                LOGE("Unknown config item : %d", type);
-                err = -1;
-                break;
         }
     }
 
@@ -535,88 +620,123 @@
 */
 static int req_ecall_cfg_set(const mbtk_ecall_cfg_info_t *cfg_info, int *cme_err)
 {
-    ATResponse *response = NULL;
-    char cmd[1024] = {0};
     int err = 0;
-
     if(ecall_mode == MBTK_ECALL_MODE_TYPE_EU) {
-        if(cfg_info->type != MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK
-            && cfg_info->type != MBTK_ECALL_CFG_ITEM_TIMER_DIAL
-            && cfg_info->type != MBTK_ECALL_CFG_ITEM_TIMER_DEREG
-            && cfg_info->type != MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN){
+        if((cfg_info->type & MBTK_ECALL_CFG_TIMER_REDIAL)
+            || (cfg_info->type & MBTK_ECALL_CFG_TIMER_SMS)
+            || (cfg_info->type & MBTK_ECALL_CFG_REDIALCNT)
+            || (cfg_info->type & MBTK_ECALL_CFG_SMSPROCESS)
+            || (cfg_info->type & MBTK_ECALL_CFG_SMSMSDCNT)){
             LOGW("No support for EU.");
             return -1;
         }
     }
 
-    switch(cfg_info->type)
-    {
-        case MBTK_ECALL_CFG_ITEM_T3:
-        case MBTK_ECALL_CFG_ITEM_T5:
-        case MBTK_ECALL_CFG_ITEM_T6:
-        case MBTK_ECALL_CFG_ITEM_T7:
-        case MBTK_ECALL_CFG_ITEM_TH:
-            snprintf(cmd, sizeof(cmd), "AT*ECALLDATA=5,%d,%d", cfg_info->type, cfg_info->data / 20);
-            break;
-        case MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK:
+    if(cfg_info->type & MBTK_ECALL_CFG_T3) {
+        if(cfg_ecalldata_set(MBTK_ECALL_CFG_ITEM_T3, cfg_info->data[MBTK_ECALL_CFG_ITEM_T3], cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON)
         {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=callback,%d", cfg_info->data / 1000);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=cleardown,%d", cfg_info->data / 1000);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_TIMER_DEREG:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=dereg,%d", cfg_info->data / 1000);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_TIMER_DIAL:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=dial,%d", cfg_info->data / 1000);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_TIMER_REDIAL:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=redialtmr,%d", cfg_info->data / 1000);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_TIMER_SMS:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=sms,%d", cfg_info->data / 1000);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_REDIALCNT:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=redialcnt,%d", cfg_info->data);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_SMSPROCESS:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=smsprocess,%d", cfg_info->data);
-            break;
-        }
-        case MBTK_ECALL_CFG_ITEM_SMSMSDCNT:
-        {
-            snprintf(cmd, sizeof(cmd), "AT*ECALLTIMER=smsmsdcnt,%d", cfg_info->data);
-            break;
-        }
-        default:
-            LOGE("Unknown config item : %d", cfg_info->type);
-            err = -1;
             goto exit;
+        }
     }
 
-    err = at_send_command(cmd, &response);
-    if (err < 0 || response->success == 0){
-        *cme_err = at_get_cme_error(response);
-        goto exit;
+    if(cfg_info->type & MBTK_ECALL_CFG_T5) {
+        if(cfg_ecalldata_set(MBTK_ECALL_CFG_ITEM_T5, cfg_info->data[MBTK_ECALL_CFG_ITEM_T5], cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON)
+        {
+            goto exit;
+        }
+    }
+
+    if(cfg_info->type & MBTK_ECALL_CFG_T6) {
+        if(cfg_ecalldata_set(MBTK_ECALL_CFG_ITEM_T6, cfg_info->data[MBTK_ECALL_CFG_ITEM_T6], cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON)
+        {
+            goto exit;
+        }
+    }
+
+    if(cfg_info->type & MBTK_ECALL_CFG_T7) {
+        if(cfg_ecalldata_set(MBTK_ECALL_CFG_ITEM_T7, cfg_info->data[MBTK_ECALL_CFG_ITEM_T7], cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON)
+        {
+            goto exit;
+        }
+    }
+
+    if(cfg_info->type & MBTK_ECALL_CFG_TH) {
+        if(cfg_ecalldata_set(MBTK_ECALL_CFG_ITEM_TH, cfg_info->data[MBTK_ECALL_CFG_ITEM_TH], cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON)
+        {
+            goto exit;
+        }
+    }
+
+    if(cfg_info->type & MBTK_ECALL_CFG_TIMER_CALLBACK)
+    {
+        if(cfg_ecalltimer_set("callback", cfg_info->data[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK] / 1000, cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_TIMER_CLEARDOWN)
+    {
+        if(cfg_ecalltimer_set("cleardown", cfg_info->data[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN] / 1000, cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_TIMER_DEREG)
+    {
+        if(cfg_ecalltimer_set("dereg", cfg_info->data[MBTK_ECALL_CFG_ITEM_TIMER_DEREG] / 1000, cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_TIMER_DIAL)
+    {
+        if(cfg_ecalltimer_set("dial", cfg_info->data[MBTK_ECALL_CFG_ITEM_TIMER_DIAL] / 1000, cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_TIMER_REDIAL)
+    {
+        if(cfg_ecalltimer_set("redialtmr", cfg_info->data[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL] / 1000, cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_TIMER_SMS)
+    {
+        if(cfg_ecalltimer_set("sms", cfg_info->data[MBTK_ECALL_CFG_ITEM_TIMER_SMS] / 1000, cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_REDIALCNT)
+    {
+        if(cfg_ecalltimer_set("redialcnt", cfg_info->data[MBTK_ECALL_CFG_ITEM_REDIALCNT], cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_SMSPROCESS)
+    {
+        if(cfg_ecalltimer_set("smsprocess", cfg_info->data[MBTK_ECALL_CFG_ITEM_SMSPROCESS], cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON) {
+            goto exit;
+        }
+    }
+    if(cfg_info->type & MBTK_ECALL_CFG_ITEM_SMSMSDCNT)
+    {
+        if(cfg_ecalltimer_set("smsmsdcnt", cfg_info->data[MBTK_ECALL_CFG_ITEM_SMSMSDCNT], cme_err)
+            || *cme_err != MBTK_RIL_ERR_CME_NON) {
+            goto exit;
+        }
     }
 
 exit:
-    at_response_free(response);
     return err;
 }
 
@@ -1003,7 +1123,7 @@
                         } else {
                             err = MBTK_RIL_ERR_UNKNOWN;
                         }
-                        LOG("Set ecall config[%d] fail.", cfg_info->type);
+                        LOG("Set ecall config[%x] fail.", cfg_info->type);
                     }
                     else
                     {
@@ -1012,15 +1132,15 @@
                 } else { // Get
                     mbtk_ecall_cfg_info_t cfg_info;
                     memset(&cfg_info, 0, sizeof(mbtk_ecall_cfg_info_t));
-                    mbtk_ecall_cfg_item_enum type = (mbtk_ecall_cfg_item_enum)pack->data[0];
-                    if(req_ecall_cfg_get(type, &cfg_info, &cme_err) || cme_err != MBTK_RIL_ERR_CME_NON)
+                    uint32 *type = (uint32*)(pack->data);
+                    if(req_ecall_cfg_get(*type, &cfg_info, &cme_err) || cme_err != MBTK_RIL_ERR_CME_NON)
                     {
                         if(cme_err != MBTK_RIL_ERR_CME_NON) {
                             err = MBTK_RIL_ERR_CME + cme_err;
                         } else {
                             err = MBTK_RIL_ERR_UNKNOWN;
                         }
-                        LOG("Get ecall config[%d] fail.", type);
+                        LOG("Get ecall config[%x] fail.", *type);
                     }
                     else
                     {
diff --git a/mbtk/test/libmbtk_ecall/mbtk_ecall_test_v1.c b/mbtk/test/libmbtk_ecall/mbtk_ecall_test_v1.c
index d6b2b32..a1b8f01 100755
--- a/mbtk/test/libmbtk_ecall/mbtk_ecall_test_v1.c
+++ b/mbtk/test/libmbtk_ecall/mbtk_ecall_test_v1.c
@@ -26,7 +26,8 @@
     printf("reg 0/1: Set ecall reg mode.\n");
     printf("dial <0-5>: Get/Start ecall dial.\n");
     printf("mode EU/ERA: Get/Set ecall mode\n");
-    printf("cfg <type> <value>: Get/Set ecall config item.\n");
+    printf("cfg_get <type1> ... <type14>: Get ecall config item.\n");
+    printf("cfg_set <value1> ... <value14>: Set ecall config item.\n");
     printf("sms_num <number>: Get/Set sms number.\n");
     printf("mute_spk <0/1>: Set spk mute or not.\n");
     printf("gain <0/1/2> <gain>: Set ecall DSP gain.\n");
@@ -259,28 +260,127 @@
                         printf("Set mode ERA\n");
                     }
                 }
-            } else if(!strncasecmp(cmd, "cfg", 3)){ // cfg <type> <value>
-                int tmp1 = -1, tmp2 = -1;
-                int count = sscanf(cmd, "cfg %d %d", &tmp1, &tmp2);
+            } else if(!strncasecmp(cmd, "cfg_get", 7)){ // cfg_get <type1> ... <type14>
+                int tmp[MBTK_ECALL_CFG_ITEM_MAX] = {0};
+                int count = sscanf(cmd, "cfg_get %d %d %d %d %d %d %d %d %d %d %d %d %d %d",
+                                &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5], &tmp[6], &tmp[7],
+                                &tmp[8], &tmp[9], &tmp[10], &tmp[11], &tmp[12], &tmp[13]);
                 mbtk_ecall_cfg_info_t cfg;
-                if(count == 1 && tmp1 >= 0) { // Get
+                if(count == MBTK_ECALL_CFG_ITEM_MAX) { // Get
                     memset(&cfg, 0, sizeof(cfg));
-                    cfg.type = (mbtk_ecall_cfg_item_enum)tmp1;
+                    cfg.type = 0;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T3])
+                        cfg.type |= MBTK_ECALL_CFG_T3;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T5])
+                        cfg.type |= MBTK_ECALL_CFG_T5;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T6])
+                        cfg.type |= MBTK_ECALL_CFG_T6;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T7])
+                        cfg.type |= MBTK_ECALL_CFG_T7;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TH])
+                        cfg.type |= MBTK_ECALL_CFG_TH;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK])
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_CALLBACK;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN])
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_CLEARDOWN;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_DEREG])
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_DEREG;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_DIAL])
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_DIAL;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL])
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_REDIAL;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_SMS])
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_SMS;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_REDIALCNT])
+                        cfg.type |= MBTK_ECALL_CFG_REDIALCNT;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_SMSPROCESS])
+                        cfg.type |= MBTK_ECALL_CFG_SMSPROCESS;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_SMSMSDCNT])
+                        cfg.type |= MBTK_ECALL_CFG_SMSMSDCNT;
+
                     err = mbtk_ecall_cfg_get(info_handle, &cfg);
                     if(err) {
                         printf("Error : %d\n", err);
                     } else {
-                        printf("Ecall config[%d] is %d\n", cfg.type, cfg.data);
+                        printf("Ecall config[%d]:\n", cfg.type);
+                        int i = 0;
+                        while(i < MBTK_ECALL_CFG_ITEM_MAX) {
+                            printf("Item(%d) - %d\n", i, cfg.data[i]);
+                            i++;
+                        }
                     }
-                } else if(count == 2 && tmp1 >= 0 && tmp2 >= 0) { // Set
+                }
+            } else if(!strncasecmp(cmd, "cfg_set", 7)){ // cfg_set <value1> ... <value14>
+                int tmp[MBTK_ECALL_CFG_ITEM_MAX] = {-1};
+                int count = sscanf(cmd, "cfg_set %d %d %d %d %d %d %d %d %d %d %d %d %d %d",
+                                &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5], &tmp[6], &tmp[7],
+                                &tmp[8], &tmp[9], &tmp[10], &tmp[11], &tmp[12], &tmp[13]);
+                mbtk_ecall_cfg_info_t cfg;
+                if(count == MBTK_ECALL_CFG_ITEM_MAX) { // Set
                     memset(&cfg, 0, sizeof(cfg));
-                    cfg.type = (mbtk_ecall_cfg_item_enum)tmp1;
-                    cfg.data = (uint32)tmp2;
+                    cfg.type = 0;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T3] >= 0) {
+                        cfg.type |= MBTK_ECALL_CFG_T3;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_T3] = tmp[MBTK_ECALL_CFG_ITEM_T3];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T5] >= 0) {
+                        cfg.type |= MBTK_ECALL_CFG_T5;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_T5] = tmp[MBTK_ECALL_CFG_ITEM_T5];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T6] >= 0) {
+                        cfg.type |= MBTK_ECALL_CFG_T6;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_T6] = tmp[MBTK_ECALL_CFG_ITEM_T6];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T7] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_T7;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_T7] = tmp[MBTK_ECALL_CFG_ITEM_T7];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TH] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TH;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TH] = tmp[MBTK_ECALL_CFG_ITEM_TH];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_CALLBACK;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK] = tmp[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_CLEARDOWN;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN] = tmp[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_DEREG] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_DEREG;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TIMER_DEREG] = tmp[MBTK_ECALL_CFG_ITEM_TIMER_DEREG];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_DIAL] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_DIAL;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TIMER_DIAL] = tmp[MBTK_ECALL_CFG_ITEM_TIMER_DIAL];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_REDIAL;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL] = tmp[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_SMS] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_SMS;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TIMER_SMS] = tmp[MBTK_ECALL_CFG_ITEM_TIMER_SMS];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_REDIALCNT] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_REDIALCNT;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_REDIALCNT] = tmp[MBTK_ECALL_CFG_ITEM_REDIALCNT];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_SMSPROCESS] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_SMSPROCESS;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_SMSPROCESS] = tmp[MBTK_ECALL_CFG_ITEM_SMSPROCESS];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_SMSMSDCNT] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_SMSMSDCNT;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_SMSMSDCNT] = tmp[MBTK_ECALL_CFG_ITEM_SMSMSDCNT];
+                    }
+
                     err = mbtk_ecall_cfg_set(info_handle, &cfg);
                     if(err) {
                         printf("Error : %d\n", err);
                     } else {
-                        printf("Set ecall config[%d] to %d success\n", cfg.type, cfg.data);
+                        printf("Set ecall config[%d] success\n", cfg.type);
                     }
                 }
             } else if(!strncasecmp(cmd, "sms_num", 7)){ // sms_num <number>
diff --git a/mbtk/test/libmbtk_ecall/mbtk_ecall_test_v2.c b/mbtk/test/libmbtk_ecall/mbtk_ecall_test_v2.c
index 6f8149a..f625369 100755
--- a/mbtk/test/libmbtk_ecall/mbtk_ecall_test_v2.c
+++ b/mbtk/test/libmbtk_ecall/mbtk_ecall_test_v2.c
@@ -34,7 +34,8 @@
     printf("reg 0/1: Set ecall reg mode.\n");
     printf("dial <0-5>: Get/Start ecall dial.\n");
     printf("mode EU/ERA: Get/Set ecall mode\n");
-    printf("cfg <type> <value>: Get/Set ecall config item.\n");
+    printf("cfg_get <type1> ... <type14>: Get ecall config item.\n");
+    printf("cfg_set <value1> ... <value14>: Set ecall config item.\n");
     printf("sms_num <number>: Get/Set sms number.\n");
     printf("mute_spk <0/1>: Set spk mute or not.\n");
     printf("gain <0/1/2> <gain>: Set ecall DSP gain.\n");
@@ -325,28 +326,125 @@
                         printf("Set mode ERA\n");
                     }
                 }
-            } else if(!strncasecmp(cmd, "cfg", 3)){ // cfg <type> <value>
-                int tmp1 = -1, tmp2 = -1;
-                int count = sscanf(cmd, "cfg %d %d", &tmp1, &tmp2);
+            } else if(!strncasecmp(cmd, "cfg_get", 7)){ // cfg <type> <value>
+                int tmp[MBTK_ECALL_CFG_ITEM_MAX] = {0};
+                int count = sscanf(cmd, "cfg_get %d %d %d %d %d %d %d %d %d %d %d %d %d %d",
+                                &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5], &tmp[6], &tmp[7],
+                                &tmp[8], &tmp[9], &tmp[10], &tmp[11], &tmp[12], &tmp[13]);
                 mbtk_ecall_cfg_info_t cfg;
-                if(count == 1 && tmp1 >= 0) { // Get
+                if(count == MBTK_ECALL_CFG_ITEM_MAX) { // Get
                     memset(&cfg, 0, sizeof(cfg));
-                    cfg.type = (mbtk_ecall_cfg_item_enum)tmp1;
+                    cfg.type = 0;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T3])
+                        cfg.type |= MBTK_ECALL_CFG_T3;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T5])
+                        cfg.type |= MBTK_ECALL_CFG_T5;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T6])
+                        cfg.type |= MBTK_ECALL_CFG_T6;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T7])
+                        cfg.type |= MBTK_ECALL_CFG_T7;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TH])
+                        cfg.type |= MBTK_ECALL_CFG_TH;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK])
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_CALLBACK;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN])
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_CLEARDOWN;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_DEREG])
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_DEREG;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_DIAL])
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_DIAL;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL])
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_REDIAL;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_SMS])
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_SMS;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_REDIALCNT])
+                        cfg.type |= MBTK_ECALL_CFG_REDIALCNT;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_SMSPROCESS])
+                        cfg.type |= MBTK_ECALL_CFG_SMSPROCESS;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_SMSMSDCNT])
+                        cfg.type |= MBTK_ECALL_CFG_SMSMSDCNT;
                     err = mbtk_ecall_cfg_get(&cfg);
                     if(err != MBTK_RIL_ERR_SUCCESS) {
                         printf("Error : %d\n", err);
                     } else {
-                        printf("Ecall config[%d] is %d\n", cfg.type, cfg.data);
+                        printf("Ecall config[%d]:\n", cfg.type);
+                        int i = 0;
+                        while(i < MBTK_ECALL_CFG_ITEM_MAX) {
+                            printf("Item(%d) - %d\n", i, cfg.data[i]);
+                            i++;
+                        }
                     }
-                } else if(count == 2 && tmp1 >= 0 && tmp2 >= 0) { // Set
+                }
+            } else if(!strncasecmp(cmd, "cfg_set", 7)){ // cfg_set <value1> ... <value14>
+                int tmp[MBTK_ECALL_CFG_ITEM_MAX] = {-1};
+                int count = sscanf(cmd, "cfg_set %d %d %d %d %d %d %d %d %d %d %d %d %d %d",
+                                &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5], &tmp[6], &tmp[7],
+                                &tmp[8], &tmp[9], &tmp[10], &tmp[11], &tmp[12], &tmp[13]);
+                mbtk_ecall_cfg_info_t cfg;
+                if(count == MBTK_ECALL_CFG_ITEM_MAX) { // Set
                     memset(&cfg, 0, sizeof(cfg));
-                    cfg.type = (mbtk_ecall_cfg_item_enum)tmp1;
-                    cfg.data = (uint32)tmp2;
+                    cfg.type = 0;
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T3] >= 0) {
+                        cfg.type |= MBTK_ECALL_CFG_T3;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_T3] = tmp[MBTK_ECALL_CFG_ITEM_T3];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T5] >= 0) {
+                        cfg.type |= MBTK_ECALL_CFG_T5;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_T5] = tmp[MBTK_ECALL_CFG_ITEM_T5];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T6] >= 0) {
+                        cfg.type |= MBTK_ECALL_CFG_T6;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_T6] = tmp[MBTK_ECALL_CFG_ITEM_T6];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_T7] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_T7;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_T7] = tmp[MBTK_ECALL_CFG_ITEM_T7];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TH] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TH;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TH] = tmp[MBTK_ECALL_CFG_ITEM_TH];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_CALLBACK;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK] = tmp[MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_CLEARDOWN;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN] = tmp[MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_DEREG] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_DEREG;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TIMER_DEREG] = tmp[MBTK_ECALL_CFG_ITEM_TIMER_DEREG];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_DIAL] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_DIAL;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TIMER_DIAL] = tmp[MBTK_ECALL_CFG_ITEM_TIMER_DIAL];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_REDIAL;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL] = tmp[MBTK_ECALL_CFG_ITEM_TIMER_REDIAL];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_TIMER_SMS] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_TIMER_SMS;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_TIMER_SMS] = tmp[MBTK_ECALL_CFG_ITEM_TIMER_SMS];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_REDIALCNT] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_REDIALCNT;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_REDIALCNT] = tmp[MBTK_ECALL_CFG_ITEM_REDIALCNT];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_SMSPROCESS] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_SMSPROCESS;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_SMSPROCESS] = tmp[MBTK_ECALL_CFG_ITEM_SMSPROCESS];
+                    }
+                    if(tmp[MBTK_ECALL_CFG_ITEM_SMSMSDCNT] >= 0){
+                        cfg.type |= MBTK_ECALL_CFG_SMSMSDCNT;
+                        cfg.data[MBTK_ECALL_CFG_ITEM_SMSMSDCNT] = tmp[MBTK_ECALL_CFG_ITEM_SMSMSDCNT];
+                    }
                     err = mbtk_ecall_cfg_set(&cfg);
                     if(err != MBTK_RIL_ERR_SUCCESS) {
                         printf("Error : %d\n", err);
                     } else {
-                        printf("Set ecall config[%d] to %d success\n", cfg.type, cfg.data);
+                        printf("Set ecall config[%d] success\n", cfg.type);
                     }
                 }
             } else if(!strncasecmp(cmd, "sms_num", 7)){ // sms_num <number>