[Bugfix][T106][bug-view-1347] for intest, no voice for second ecall

    Only Configure: No
    Affected branch: unknown
    Affected module: network
    Is it affected on both ZXIC and MTK: both
    Self-test: yes
    Doc Update: no

Change-Id: Ibde25bb3cdfe0311fbf787d01d4b1e6d2df887da
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call.cpp
index d42142e..c45f5f8 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call.cpp
@@ -46,18 +46,6 @@
  */

 int g_module_init_flag = 0;

 

- typedef enum {

-     LYNQ_CALL_ACTIVE = 0,

-     LYNQ_CALL_HOLDING = 1,

-     LYNQ_CALL_DIALING = 2,    /* MO call only */

-     LYNQ_CALL_ALERTING = 3,   /* MO call only */

-     LYNQ_CALL_INCOMING = 4,   /* MT call only */

-     LYNQ_CALL_WAITING = 5,    /* MT call only */

-     /*warren add for T800 platform 2022/04/26 start*/

-     LYNQ_CALL_END = 6,         /*CALL END*/

-     /*warren add for T800 platform 2022/04/26 end*/

-}lynq_call_state_t;

-

 typedef struct

 {

     int used;

@@ -325,14 +313,15 @@
     }

     return INVALID_ID;

 }

-int addAddr(char addr[], int call_id)

+int addAddr(char addr[], int call_id, int call_state)

 {

     int ret = 0;

     ret = getUnusedElement();

     memcpy(s_call_lists[ret].addr,addr,strlen(addr)+1);

     s_call_lists[ret].call_id=call_id;

     s_call_lists[ret].used = 1;

-    LYINFLOG("add local idx is %d addr is %s",ret,addr);

+    s_call_lists[ret].call_state = call_state;

+    LYINFLOG("add local idx is %d addr is %s state is %d",ret,addr,call_state);

     return ret;

 }

 void updateCallList(lynq_call_list_e_t *callList,    int call_id,int call_state,int toa,int direction)

@@ -521,7 +510,7 @@
                 n = find_call_id_with_addr(call_list[i].addr);

                 if(n ==INVALID_ID)

                 {

-                    n = addAddr(call_list[i].addr,call_list[i].call_id);

+                    n = addAddr(call_list[i].addr,call_list[i].call_id,call_list[i].call_state);

                     updateCallList(&s_call_lists[n],call_list[i].call_id,call_list[i].call_state,call_list[i].toa,call_list[i].direction);

                     send_call_state_change(call_list[i].call_id);

                 }

@@ -969,7 +958,7 @@
     }

 #endif   

     Parcel* p=NULL;

-    lynq_call_id = addAddr(addr,0);

+    lynq_call_id = addAddr(addr,0,LYNQ_CALL_END);

     int ret=lynq_send_common_request(p,g_wait_time,RIL_REQUEST_DIAL,2,"%s %d",addr, 0);

     if(ret!=0)

     {

diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call_common.h b/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call_common.h
index e65f243..355725a 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call_common.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call_common.h
@@ -4,7 +4,20 @@
 #define INVALID_ID (-1)

 

 int find_call_id_with_call_id(int call_id);

-int addAddr(char addr[], int call_id);

+

+ typedef enum {

+     LYNQ_CALL_ACTIVE = 0,

+     LYNQ_CALL_HOLDING = 1,

+     LYNQ_CALL_DIALING = 2,    /* MO call only */

+     LYNQ_CALL_ALERTING = 3,   /* MO call only */

+     LYNQ_CALL_INCOMING = 4,   /* MT call only */

+     LYNQ_CALL_WAITING = 5,    /* MT call only */

+     /*warren add for T800 platform 2022/04/26 start*/

+     LYNQ_CALL_END = 6,         /*CALL END*/

+     /*warren add for T800 platform 2022/04/26 end*/

+}lynq_call_state_t;

+

+int addAddr(char addr[], int call_id,int call_state);

 int waitCallstateChange(int mtime);

 void sendSignalToWaitCallStateChange();

 void lynqNoticeGetModuleCallList();

diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call_ecall.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call_ecall.cpp
index 15dc6dc..b90b4bc 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call_ecall.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-call/lynq_call_ecall.cpp
@@ -613,7 +613,7 @@
                    if(find_call_id_with_call_id(ecallId)==INVALID_ID)

                    {

                         LYINFLOG("add ecall in loacl list");                             	 

-                        addAddr("ecall",ecallId);               

+                        addAddr("ecall",ecallId,LYNQ_CALL_ACTIVE);               

                    }	

                    s_ecallId = ecallId; //API-871 ecall id maybe exists in local list as noraml call to be replaced

                }