[bugfix]when get call state fail,continue loop
Change-Id: Ie215406cb04ce243d76c89affae36fceb1e6ad22
diff --git a/lib/liblynq-call/lynq_call.cpp b/lib/liblynq-call/lynq_call.cpp
index 7ec88db..bca0ea6 100755
--- a/lib/liblynq-call/lynq_call.cpp
+++ b/lib/liblynq-call/lynq_call.cpp
@@ -357,8 +357,8 @@
ret = lynq_get_current_call_list(call_list);
if(ret != 0)
{
- printf("get current call list failure!!!\n");
- break;
+ LYDBGLOG("get current call list failure!!!\n");
+ continue;
}
for(int i = 0;i < LYNQ_CALL_MAX;i++)
{
@@ -449,7 +449,7 @@
/*
if(inet_pton(AF_INET,"127.0.0.1", &lynq_socket_server_addr.sin_addr) <= 0)
{
- printf("[%s] is not a valid IPaddress\n", argv[1]);
+ LYDBGLOG("[%s] is not a valid IPaddress\n", argv[1]);
exit(1);
}
*/
@@ -617,7 +617,7 @@
void lynq_call_state_change_test(int soc_id)
{
- printf("call state change,sim:%d\n",soc_id);
+ LYDBGLOG("call state change,sim:%d\n",soc_id);
}
int lynq_init_call(int uToken)
{
@@ -704,7 +704,7 @@
client.paramLen = 5;
bzero(client.param,LYNQ_REQUEST_PARAM_BUF);
sprintf(client.param,"%d %d %s %s", ecall_cat, ecall_variant, addr, msd_data);
- printf("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
+ LYDBGLOG("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
if(send_request(lynq_call_client_sockfd, &client)==-1)
{
@@ -714,7 +714,7 @@
get_response(lynq_call_client_sockfd, p);
JumpHeader(p,&resp_type,&request,&slot_id,&error);
- printf("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
+ LYDBGLOG("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
lynq_call_id = updateAddr(addr);
if(error==0)
@@ -749,7 +749,7 @@
client.paramLen = 2;
bzero(client.param,LYNQ_REQUEST_PARAM_BUF);
sprintf(client.param, "%d", enable);
- printf("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
+ LYDBGLOG("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
if(send_request(lynq_call_client_sockfd,&client)==-1)
{
@@ -759,7 +759,7 @@
get_response(lynq_call_client_sockfd,p);
JumpHeader(p,&resp_type,&request,&slot_id,&error);
- printf("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
+ LYDBGLOG("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
return error;
}
@@ -780,7 +780,7 @@
client.request = 9008;
client.paramLen = 1;
bzero(client.param,LYNQ_REQUEST_PARAM_BUF);
- printf("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
+ LYDBGLOG("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
if(send_request(lynq_call_client_sockfd,&client)==-1)
{
@@ -790,7 +790,7 @@
get_response(lynq_call_client_sockfd,p);
JumpHeader(p,&resp_type,&request,&slot_id,&error);
- printf("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
+ LYDBGLOG("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
return error;
}
@@ -810,7 +810,7 @@
client.paramLen = 2;
bzero(client.param,LYNQ_REQUEST_PARAM_BUF);
sprintf(client.param, "%d", type);
- printf("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
+ LYDBGLOG("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
if(send_request(lynq_call_client_sockfd,&client)==-1)
{
@@ -820,7 +820,7 @@
get_response(lynq_call_client_sockfd,p);
JumpHeader(p,&resp_type,&request,&slot_id,&error);
- printf("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
+ LYDBGLOG("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
return error;
}
@@ -842,7 +842,7 @@
client.paramLen = 3;
bzero(client.param,LYNQ_REQUEST_PARAM_BUF);
sprintf(client.param, "%d %s", call_id, msd_data);
- printf("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
+ LYDBGLOG("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
if(send_request(lynq_call_client_sockfd,&client)==-1)
{
@@ -852,7 +852,7 @@
get_response(lynq_call_client_sockfd,p);
JumpHeader(p,&resp_type,&request,&slot_id,&error);
- printf("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
+ LYDBGLOG("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
return error;
}
@@ -873,7 +873,7 @@
client.paramLen = 2;
bzero(client.param,LYNQ_REQUEST_PARAM_BUF);
sprintf(client.param, "%d", enable);
- printf("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
+ LYDBGLOG("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
if(send_request(lynq_call_client_sockfd,&client)==-1)
{
@@ -883,7 +883,7 @@
get_response(lynq_call_client_sockfd,p);
JumpHeader(p,&resp_type,&request,&slot_id,&error);
- printf("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
+ LYDBGLOG("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
return error;
}
@@ -903,7 +903,7 @@
client.request = 9012;
client.paramLen = 1;
bzero(client.param,LYNQ_REQUEST_PARAM_BUF);
- printf("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
+ LYDBGLOG("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
if(send_request(lynq_call_client_sockfd,&client)==-1)
{
@@ -913,7 +913,7 @@
get_response(lynq_call_client_sockfd,p);
JumpHeader(p,&resp_type,&request,&slot_id,&error);
- printf("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
+ LYDBGLOG("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
return error;
}
@@ -934,7 +934,7 @@
client.paramLen = 1;
bzero(client.param,LYNQ_REQUEST_PARAM_BUF);
// sprintf(client.param, "%d", enable);
- printf("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
+ LYDBGLOG("[%s-%d] uToken=%d, request=%d, paralen=%d, param=%s\n", __FUNCTION__, __LINE__, client.uToken, client.request, client.paramLen, client.param);
if(send_request(lynq_call_client_sockfd,&client)==-1)
{
@@ -944,7 +944,7 @@
get_response(lynq_call_client_sockfd,p);
JumpHeader(p,&resp_type,&request,&slot_id,&error);
- printf("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
+ LYDBGLOG("[%s-%d] resp_type=%d,request=%d,slot_id=%d,error_code=%d", __FUNCTION__, __LINE__, resp_type, request, slot_id, error);
return error;
}
@@ -1282,10 +1282,10 @@
n = lynq_init_call(lynq_call_state_change_test,2222);
if(n<0)
{
- printf("lynq init call fail!!!\n");
+ LYDBGLOG("lynq init call fail!!!\n");
return -1;
}
- printf("lynq call init success!!!\n");
+ LYDBGLOG("lynq call init success!!!\n");
char phoneNum[LYNQ_PHONE_NUMBER_MAX];
sprintf(phoneNum,"18180053406 0",strlen("18180053406 0")+1);
lynq_call(phoneNum);