Merge "[Bugfix][T106BUG-567]add gpio suspend/resume power management"
diff --git a/ap/app/zte_comm/zte_mainctrl/netdev_proc.c b/ap/app/zte_comm/zte_mainctrl/netdev_proc.c
index f7c0954..15b3c0e 100755
--- a/ap/app/zte_comm/zte_mainctrl/netdev_proc.c
+++ b/ap/app/zte_comm/zte_mainctrl/netdev_proc.c
@@ -2402,7 +2402,11 @@
 		defwan_change = 1;
 
 	//Êý¾ÝÏÈͨ£¬ºó×öÆäËûÅäÖã¬×¢Òâµã: ·À»ðǽ¶Ìʱ¼äÄÚ¿ÉÄÜδÉúЧ
+//xf.li@20240327 modify for T106BUG-578 start
+#ifndef USE_CAP_SUPPORT
 	if (defwan_change)
+#endif
+//xf.li@20240327 modify for T106BUG-578 end
 		system_cmd_ex("nat.sh");
 	defwan_set(defwan_if);
 
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
index d6ddaf1..41c5c97 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
@@ -24,12 +24,14 @@
     {3,   "qser_voice_call_answer"},

     {4,   "qser_voice_set_speech_volume"},

     {5,   "qser_voice_get_speech_volume"},

-    {6,   "qser_voice_set_dtmf"},

+    {6,   "qser_voice_set_dtmf"},    

+#ifdef ECALL_SUPPORT

+    {7,   "qser_voice_set_test_num"},

+    {8,   "qser_voice_fast_ecall"},

+#endif

     {-1,    NULL}

 };

 

-

-

 typedef uint32_t voice_client_handle_type;

 

 

@@ -50,6 +52,37 @@
 int (*qser_voice_get_speech_volume)(int *volume);

 int (*qser_voice_set_dtmf)(const char callnum);

 

+#ifdef ECALL_SUPPORT

+int (*qser_voice_set_test_num)(voice_client_handle_type*       h_voice,E_QSER_VOICE_ECALL_SET_TYPE_T type, const char *test_num, int test_num_length);

+int (*qser_voice_fast_ecall)(voice_client_handle_type*       h_voice,

+                        int                         *call_id,

+                        E_QSER_VOICE_ECALL_CATEGORY_T cat,

+                        E_QSER_VOICE_ECALL_VARIANT_T variant,

+                        const char *addr, 

+                        int addr_length, 

+                        const unsigned char *msd_data,

+                        int msd_length); //msd_length should <= QSER_MSD_MAX_LENGTH

+int (*qser_voice_set_msd)(int callid, const unsigned char *msd_data, int msd_length); //msd_length should <= QSER_MSD_MAX_LENGTH

+int (*qser_voice_add_ecall_indhandler)(voice_client_handle_type*          h_voice,

+                                  QSER_ECall_IndHandlerFunc_t   handlerPtr,

+                                  void*  contextPtr);

+

+static void yk_voice_ecall_cb_func(int         callid,  E_QSER_VOICE_ECALL_INDICATION_T ind, void* contextPtr)

+{   

+    unsigned char msd_data[QSER_MSD_MAX_LENGTH]={1,1,2,2,3,3,4,4};

+

+    printf("######### Call id=%d, event=%d!  ######\n", callid, ind);

+    

+    if(ind == E_QSER_VOICE_ECALL_IND_SENDING_START_IN_VOICE || ind == E_QSER_VOICE_ECALL_IND_PSAP_CALLBACK_START)

+    {

+        /*customer should construct msd including GPS data, here use msd_data for illustrate,*/

+        qser_voice_set_msd(callid,msd_data,8);                

+    }

+}

+

+#endif

+

+

 void *dlHandle_call = NULL;

 

 static void yk_voice_call_cb_func(int                     call_id,

@@ -62,6 +95,8 @@
     printf("######### Call id=%d, PhoneNum:%s, event=%s!  ######\n", call_id, phone_num, call_state[state]);

 }

 

+

+

 void print_help(void)

 {

     int i;

@@ -76,6 +111,8 @@
     }

 }

 

+

+

 int main(int argc, char const *argv[])

 {

     int cmdIdx = 0;

@@ -164,6 +201,36 @@
             printf("qser_voice_set_dtmf not defined or exported in %s\n", lynqLibPath_Call);

             return -1;

     }

+

+#ifdef ECALL_SUPPORT

+    qser_voice_fast_ecall = (int (*)(voice_client_handle_type*, int*, E_QSER_VOICE_ECALL_CATEGORY_T, E_QSER_VOICE_ECALL_VARIANT_T, const char*, int, const unsigned char*, int))dlsym(dlHandle_call,"qser_voice_fast_ecall");

+    if(qser_voice_fast_ecall == NULL)    

+    {

+            printf("qser_voice_fast_ecall not defined or exported in %s\n", lynqLibPath_Call);

+            return -1;

+    }

+

+    qser_voice_set_test_num = (int (*)(voice_client_handle_type*, E_QSER_VOICE_ECALL_SET_TYPE_T, const char* , int))dlsym(dlHandle_call,"qser_voice_set_test_num");

+    if(qser_voice_set_test_num == NULL)    

+    {

+            printf("qser_voice_set_test_num not defined or exported in %s\n", lynqLibPath_Call);

+            return -1;

+    }    

+

+    qser_voice_set_msd = (int (*)(int , const unsigned char *, int))dlsym(dlHandle_call,"qser_voice_set_msd");

+    if(qser_voice_set_msd == NULL)    

+    {

+        printf("qser_voice_set_msd not defined or exported in %s\n", lynqLibPath_Call);

+        return -1;

+    }

+

+    qser_voice_add_ecall_indhandler = (int (*)(voice_client_handle_type* h_voice, QSER_ECall_IndHandlerFunc_t, void*))dlsym(dlHandle_call,"qser_voice_add_ecall_indhandler");

+    if(qser_voice_add_ecall_indhandler == NULL)    

+    {

+            printf("qser_voice_add_ecall_indhandler not defined or exported in %s\n", lynqLibPath_Call);

+            return -1;

+    }

+#endif

     

     ret = qser_voice_call_client_init(&h_voice);

     if(ret != 0 )

@@ -179,6 +246,14 @@
         return -1;

     }

 

+#ifdef ECALL_SUPPORT

+    ret = qser_voice_add_ecall_indhandler(&h_voice, yk_voice_ecall_cb_func, NULL);

+    if(ret != 0)

+    {

+        printf("qser_voice_add_ecall_indhandler FAIL\n");

+        return -1;

+    }

+#endif

 

     print_help();

     while(1)

@@ -270,7 +345,39 @@
                }

               break;

             }

-            

+#ifdef ECALL_SUPPORT

+            case 7:

+            {                

+                char PhoneNum[32] = {0};                 

+                printf("please input test phone number: \n");

+                scanf("%s", PhoneNum);                            

+                ret = qser_voice_set_test_num(&h_voice, E_QSER_VOICE_ECALL_SET_NUMBER, PhoneNum, strlen(PhoneNum)+1);

+                printf("qser_voice_set_test_num ret = %d\n", ret);

+                break;

+            }            

+            case 8:

+            {   

+                int call_id = -1;

+                int cat;

+                int var;

+                int length;

+                unsigned char  msd[QSER_MSD_MAX_LENGTH]={0};

+

+                printf("please input ecall cat: 0 manual, 1 auto\n");

+                scanf("%d", &cat);

+                printf("please input ecall type: 0 test, 1 emergency\n");

+                scanf("%d", &var);

+                printf("please input msd content length (max length is 140)\n");

+                scanf("%d", &length);

+                printf("please input %d unsigned char (0-255):\n", length);  

+                for (int i = 0; i < length; i++) {  

+                    scanf("%hhu", &msd[i]); 

+                }                               

+                ret = qser_voice_fast_ecall(&h_voice, &call_id, (E_QSER_VOICE_ECALL_CATEGORY_T) cat, (E_QSER_VOICE_ECALL_VARIANT_T) var, "null",5,msd,length);

+                printf("qser_voice_fast_ecall ret = %d, call id is %d\n", ret, call_id);

+                break;

+            }            

+#endif

             default:

                 print_help();

                 break;

diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.h b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.h
index 79977b9..82bf388 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.h
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.h
@@ -29,3 +29,69 @@
     void                    *contextPtr

 );

 

+

+#ifdef ECALL_SUPPORT

+

+#define QSER_MSD_MAX_LENGTH  140

+

+typedef enum{ 

+    E_QSER_VOICE_ECALL_SET_NUMBER = 0,     /* Set Number */

+    E_QSER_VOICE_ECALL_SET_URI = 1,      /* Set Uri */   

+}E_QSER_VOICE_ECALL_SET_TYPE_T; 

+

+typedef enum{

+    E_QSER_VOICE_ECALL_CAT_MANUAL = 0,      /* Manual Emergency eCall */

+    E_QSER_VOICE_ECALL_CAT_AUTO = 1,     /*  Automatic Emergency eCall */

+}E_QSER_VOICE_ECALL_CATEGORY_T;

+

+

+typedef enum{

+    E_QSER_VOICE_ECALL_TEST = 0,     /* Test eCall */

+    E_QSER_VOICE_ECALL_EMERGENCY = 1,      /* Emergency eCall */

+    E_QSER_VOICE_ECALL_RECONFIG = 2,     /*  Reconfiguration eCall */

+}E_QSER_VOICE_ECALL_VARIANT_T;

+

+typedef enum{

+    E_QSER_VOICE_ECALL_IND_SENDING_START = 1,

+    E_QSER_VOICE_ECALL_IND_SENDING_MSD = 2,

+    E_QSER_VOICE_ECALL_IND_LLACK_RECEIVED = 3,

+    E_QSER_VOICE_ECALL_IND_ALACK_POSITIVE_RECEIVED = 4,

+    E_QSER_VOICE_ECALL_IND_ALACK_CLEARDOWN_RECEIVED = 5,

+    E_QSER_VOICE_ECALL_IND_DAILING = 9,

+    E_QSER_VOICE_ECALL_IND_ALERTING = 10,

+    E_QSER_VOICE_ECALL_IND_ACTIVE = 11,

+    E_QSER_VOICE_ECALL_IND_DISCONNECTED = 12,

+    E_QSER_VOICE_ECALL_IND_IMS_ACTIVE = 13,

+    E_QSER_VOICE_ECALL_IND_IMS_DISCONNECTED = 14,

+    E_QSER_VOICE_ECALL_IND_ABNORMAL_HANGUP=15,

+    E_QSER_VOICE_ECALL_IND_IMS_MSD_ACK = 20,

+    E_QSER_VOICE_ECALL_IND_IMS_UPDATE_MSD = 21,

+    E_QSER_VOICE_ECALL_IND_IMS_IN_BAND_TRANSFER = 22,

+    E_QSER_VOICE_ECALL_IND_IMS_MSD_NACK = 23,

+    E_QSER_VOICE_ECALL_IND_IMS_SRVCC = 24,

+    E_QSER_VOICE_ECALL_IND_ONLY_DEREGISTRATION = 31,

+    E_QSER_VOICE_ECALL_IND_MAY_DEREGISTER = 32,

+    E_QSER_VOICE_ECALL_IND_PSAP_CALLBACK_START = 40,

+    E_QSER_VOICE_ECALL_IND_PSAP_CALLBACK_IMS_UPDATE_MSD = 41,

+    E_QSER_VOICE_ECALL_IND_SENDING_START_IN_VOICE=8000,    

+    E_QSER_VOICE_ECALL_IND_T2_TIMER_OUT = 9000,

+    E_QSER_VOICE_ECALL_IND_T5_TIMER_OUT = 9001,

+    E_QSER_VOICE_ECALL_IND_T6_TIMER_OUT = 9002,

+    E_QSER_VOICE_ECALL_IND_T7_TIMER_OUT = 9003,

+    E_QSER_VOICE_ECALL_IND_REDIAL_TIMER_OUT = 9004,    

+    E_QSER_VOICE_ECALL_IND_AUTO_ANS_TIMER_OUT = 9005,

+    E_QSER_VOICE_ECALL_IND_AUTO_ANS_IMS_TIMER_OUT = 9006,

+    E_QSER_VOICE_ECALL_IND_UNSPECIFIED = 0xffff,

+}E_QSER_VOICE_ECALL_INDICATION_T;

+

+typedef void (*QSER_ECall_IndHandlerFunc_t)

+(

+    int                     callid,   

+    E_QSER_VOICE_ECALL_INDICATION_T ind,

+    void                    *contextPtr

+);

+

+

+

+#endif

+

diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/lynq-qser-voice-demo.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/lynq-qser-voice-demo.bb
old mode 100644
new mode 100755
index 1fb0142..480d42f
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/lynq-qser-voice-demo.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/lynq-qser-voice-demo.bb
@@ -24,7 +24,7 @@
 #INHIBIT_PACKAGE_STRIP = "1"
 do_compile () {
 
-	${CXX} -Wall lynq-qser-voice-demo.cpp ${LOCAL_LIBS} ${LOCAL_C_INCLUDES} -o lynq-qser-voice-demo
+	${CXX} -Wall lynq-qser-voice-demo.cpp ${LOCAL_LIBS} -DECALL_SUPPORT ${LOCAL_C_INCLUDES} -o lynq-qser-voice-demo 
 }
 
 do_install() {
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h
index 1fb0e01..8de497a 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h
@@ -116,6 +116,83 @@
 
 
 */
+
+#ifdef ECALL_SUPPORT
+
+#define QSER_MSD_MAX_LENGTH  140
+
+typedef enum{ 
+    E_QSER_VOICE_ECALL_SET_NUMBER = 0,     /* Set Number */
+    E_QSER_VOICE_ECALL_SET_URI = 1,      /* Set Uri */   
+}E_QSER_VOICE_ECALL_SET_TYPE_T; 
+
+typedef enum{
+    E_QSER_VOICE_ECALL_CAT_MANUAL = 0,      /* Manual Emergency eCall */
+    E_QSER_VOICE_ECALL_CAT_AUTO = 1,     /*  Automatic Emergency eCall */
+}E_QSER_VOICE_ECALL_CATEGORY_T;
+
+
+typedef enum{
+    E_QSER_VOICE_ECALL_TEST = 0,     /* Test eCall */
+    E_QSER_VOICE_ECALL_EMERGENCY = 1,      /* Emergency eCall */
+    E_QSER_VOICE_ECALL_RECONFIG = 2,     /*  Reconfiguration eCall */
+}E_QSER_VOICE_ECALL_VARIANT_T;
+
+typedef enum{
+    E_QSER_VOICE_ECALL_IND_SENDING_START = 1,
+    E_QSER_VOICE_ECALL_IND_SENDING_MSD = 2,
+    E_QSER_VOICE_ECALL_IND_LLACK_RECEIVED = 3,
+    E_QSER_VOICE_ECALL_IND_ALACK_POSITIVE_RECEIVED = 4,
+    E_QSER_VOICE_ECALL_IND_ALACK_CLEARDOWN_RECEIVED = 5,
+    E_QSER_VOICE_ECALL_IND_DAILING = 9,
+    E_QSER_VOICE_ECALL_IND_ALERTING = 10,
+    E_QSER_VOICE_ECALL_IND_ACTIVE = 11,
+    E_QSER_VOICE_ECALL_IND_DISCONNECTED = 12,
+    E_QSER_VOICE_ECALL_IND_IMS_ACTIVE = 13,
+    E_QSER_VOICE_ECALL_IND_IMS_DISCONNECTED = 14,
+    E_QSER_VOICE_ECALL_IND_ABNORMAL_HANGUP=15,
+    E_QSER_VOICE_ECALL_IND_IMS_MSD_ACK = 20,
+    E_QSER_VOICE_ECALL_IND_IMS_UPDATE_MSD = 21,
+    E_QSER_VOICE_ECALL_IND_IMS_IN_BAND_TRANSFER = 22,
+    E_QSER_VOICE_ECALL_IND_IMS_MSD_NACK = 23,
+    E_QSER_VOICE_ECALL_IND_IMS_SRVCC = 24,
+    E_QSER_VOICE_ECALL_IND_ONLY_DEREGISTRATION = 31,
+    E_QSER_VOICE_ECALL_IND_MAY_DEREGISTER = 32,
+    E_QSER_VOICE_ECALL_IND_PSAP_CALLBACK_START = 40,
+    E_QSER_VOICE_ECALL_IND_PSAP_CALLBACK_IMS_UPDATE_MSD = 41,
+    E_QSER_VOICE_ECALL_IND_SENDING_START_IN_VOICE=8000,    
+    E_QSER_VOICE_ECALL_IND_T2_TIMER_OUT = 9000,
+    E_QSER_VOICE_ECALL_IND_T5_TIMER_OUT = 9001,
+    E_QSER_VOICE_ECALL_IND_T6_TIMER_OUT = 9002,
+    E_QSER_VOICE_ECALL_IND_T7_TIMER_OUT = 9003,
+    E_QSER_VOICE_ECALL_IND_REDIAL_TIMER_OUT = 9004,    
+    E_QSER_VOICE_ECALL_IND_AUTO_ANS_TIMER_OUT = 9005,
+    E_QSER_VOICE_ECALL_IND_AUTO_ANS_IMS_TIMER_OUT = 9006,
+    E_QSER_VOICE_ECALL_IND_UNSPECIFIED = 0xffff,
+}E_QSER_VOICE_ECALL_INDICATION_T;
+
+typedef void (*QSER_ECall_IndHandlerFunc_t)
+(
+    int                     callid,   
+    E_QSER_VOICE_ECALL_INDICATION_T ind,
+    void                    *contextPtr
+);
+
+int qser_voice_set_test_num(voice_client_handle_type*       h_voice,E_QSER_VOICE_ECALL_SET_TYPE_T type, const char *test_num, int test_num_length);
+int qser_voice_fast_ecall(voice_client_handle_type*       h_voice,
+                        int                         *call_id,
+                        E_QSER_VOICE_ECALL_CATEGORY_T cat,
+                        E_QSER_VOICE_ECALL_VARIANT_T variant,
+                        const char *addr, 
+                        int addr_length, 
+                        const unsigned char *msd_data,
+                        int msd_length);  //msd_length should <= QSER_MSD_MAX_LENGTH
+int qser_voice_set_msd( int callid, const unsigned char *msd_data, int msd_length); // msd_length should <= QSER_MSD_MAX_LENGTH
+int qser_voice_add_ecall_indhandler(voice_client_handle_type*          h_voice,
+                                  QSER_ECall_IndHandlerFunc_t   handlerPtr,
+                                  void*                             contextPtr);
+
+#endif
     
 #ifdef __cplusplus
 }
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp
index d32a69e..7d68695 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp
@@ -19,6 +19,11 @@
 #define MIN_VOLUME 0
 #define MAX_VOLUME 5
 
+#ifdef ECALL_SUPPORT
+static pthread_t s_lynq_ecall_tid = -1;
+static QSER_ECall_IndHandlerFunc_t   s_ecall_cb = NULL;
+static int s_ecall_thread_status = 0;
+#endif
 
 static pthread_t s_lynq_voice_tid = -1;
 static QSER_VoiceCall_StateHandlerFunc_t   s_voice_cb = NULL;
@@ -112,6 +117,24 @@
         LYERRLOG("init first");
         return RESULT_ERROR;
     }
+
+
+#ifdef ECALL_SUPPORT    
+    s_ecall_thread_status = 0;
+
+    if(s_lynq_ecall_tid!=-1)
+    {
+        int ret = pthread_cancel(s_lynq_ecall_tid);
+        LYINFLOG("pthread cancel waiting urc thread, ret = %d",ret);            
+  
+        ret = pthread_join(s_lynq_ecall_tid,NULL);
+        LYINFLOG("pthread join waiting urc thread ret = %d",ret);
+        s_lynq_ecall_tid =-1;
+    }
+	
+    s_ecall_cb=NULL;
+#endif
+
     return lynq_deinit_call();
 }
 
@@ -235,5 +258,89 @@
 
 }
 
+#ifdef ECALL_SUPPORT
+int qser_voice_fast_ecall(voice_client_handle_type*       h_voice,
+                        int                         *call_id,
+                        E_QSER_VOICE_ECALL_CATEGORY_T cat,
+                        E_QSER_VOICE_ECALL_VARIANT_T variant,
+                        const char *addr, 
+                        int addr_length, 
+                        const unsigned char *msd_data,
+                        int msd_length)
+{ 
+    if(h_voice == NULL || (*h_voice) == 0 )
+    {
+        LYERRLOG("%s input error", __func__);
+        return RESULT_ERROR;
+    }
+
+    return lynq_fast_ecall(call_id,(LYNQ_ECall_Category) cat,(LYNQ_ECall_Variant) variant,addr,addr_length,msd_data,msd_length);
+}
+
+int qser_voice_set_test_num(voice_client_handle_type*       h_voice,E_QSER_VOICE_ECALL_SET_TYPE_T type, const char *test_num, int test_num_length)
+{
+    if(h_voice == NULL || (*h_voice) == 0 )
+    {
+        LYERRLOG("%s input error", __func__);
+        return RESULT_ERROR;
+    }              
+
+    return lynq_set_test_num((LYNQ_ECall_Set_Type) type, test_num, test_num_length);
+}
+
+int qser_voice_set_msd(int callid, const unsigned char *msd_data, int msd_length)
+{           
+    return lynq_set_msd(callid, msd_data, msd_length);
+}
+
+void *ecall_thread_recv(void *context)
+{
+    int handle = 0;
+    LYNQ_ECall_Indication eCall_Indication;
+    while (s_ecall_thread_status)
+    {
+        lynq_wait_ecall_indication(&handle, &eCall_Indication);
+        if(s_ecall_thread_status == 0)
+        {
+            return NULL;
+        }       
+       
+        if (s_ecall_cb != NULL)
+        {
+            s_ecall_cb(&handle,(E_QSER_VOICE_ECALL_INDICATION_T) eCall_Indication,context);
+        }
+    }
+    return NULL;
+}
+
+int qser_voice_add_ecall_indhandler(voice_client_handle_type*          h_voice,
+                                  QSER_ECall_IndHandlerFunc_t   handlerPtr,                                  
+                                  void*                             contextPtr)
+{
+    if(h_voice == NULL || (*h_voice) == 0 || handlerPtr== NULL)
+    {
+        LYERRLOG("input error");
+        return RESULT_ERROR;
+    }
+    if (s_ecall_cb != NULL)
+    {
+        LYERRLOG("The existing state handle does not need to be added");
+        return RESULT_ERROR;
+    }
+    s_ecall_cb = handlerPtr;
+    s_ecall_thread_status = 1;
+    int rt = pthread_create(&s_lynq_ecall_tid, NULL, ecall_thread_recv, contextPtr);
+    if(rt < 0)
+    {
+        LYDBGLOG("qser_voice_call_addstatehandler pthread_create error!!!\n");
+        s_ecall_cb = NULL;
+        s_ecall_thread_status = 0;
+        s_lynq_ecall_tid = -1;
+        return RESULT_ERROR;
+    }
+    return RESULT_OK;
+}
+#endif
+
 DEFINE_LYNQ_LIB_LOG(LYNQ_QSER_CALL)
 
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/makefile
old mode 100644
new mode 100755
index b5b7d36..241cdec
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/makefile
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/makefile
@@ -7,6 +7,7 @@
                 -flto \
                 -fPIC \
                 -fpermissive \
+                -DECALL_SUPPORT \