#include "interfaces.h"
typedef struct
{
char * name;
TestFunc ptrfunc;
} myStruct;
static void HangUpTimerHandler
(
)
{
}
static void MyCallEventHandler
(
void* contextPtr
)
{
static bool firstConnectCall = true;
LE_INFO(
"MCC TEST: New Call event: %d for Call %p", callEvent, callRef);
{
LE_INFO(
"Check MyCallEventHandler passed, event is LE_MCC_EVENT_ALERTING.");
if (firstConnectCall)
{
LE_INFO(
"---!!!! PLEASE CHECK ON THE REMOTE SIDE IF THE PHONE NUMBER IS %s !!!!---",
((ClirStatus == LE_ON) ? "HIDED" : "DISPLAYED"));
LE_INFO(
"---!!!! PLEASE HANG UP ON THE REMOTE SIDE !!!!---");
}
}
{
LE_INFO(
"Check MyCallEventHandler passed, event is LE_MCC_EVENT_CONNECTED.");
if (firstConnectCall)
{
LE_INFO(
"---!!!! PLEASE TERMINATE THE CALL on THE REMOTE SIDE !!!!---");
firstConnectCall = false;
}
}
{
LE_INFO(
"Check MyCallEventHandler passed, event is LE_MCC_EVENT_TERMINATED.");
switch(term)
{
LE_ERROR(
"Termination reason is LE_MCC_TERM_NETWORK_FAIL");
exit(EXIT_FAILURE);
break;
LE_ERROR(
"Termination reason is LE_MCC_TERM_UNASSIGNED_NUMBER");
exit(EXIT_FAILURE);
break;
LE_ERROR(
"Termination reason is LE_MCC_TERM_USER_BUSY");
exit(EXIT_FAILURE);
break;
LE_INFO(
"Termination reason is LE_MCC_TERM_LOCAL_ENDED");
LE_INFO(
"mccTest Sequence SUCCESS");
exit(EXIT_SUCCESS);
break;
LE_INFO(
"Termination reason is LE_MCC_TERM_REMOTE_ENDED");
LE_INFO(
"---!!!! PLEASE CREATE AN INCOMING CALL !!!!---");
break;
LE_INFO(
"Termination reason is LE_MCC_TERM_NO_SERVICE");
exit(EXIT_FAILURE);
break;
LE_INFO(
"Termination reason is LE_MCC_TERM_OPERATOR_DETERMINED_BARRING");
exit(EXIT_FAILURE);
break;
LE_ERROR(
"Termination reason is LE_MCC_TERM_UNDEFINED");
LE_ERROR(
"---!!!! PLEASE CREATE AN INCOMING CALL !!!!---");
break;
default:
LE_ERROR(
"Termination reason is %d", term);
exit(EXIT_FAILURE);
break;
}
LE_INFO(
"Termination code is 0x%X", code);
if (HangUpTimer)
{
}
}
{
LE_INFO(
"Check MyCallEventHandler passed, event is LE_MCC_EVENT_INCOMING.");
if (res == LE_OK)
{
LE_INFO(
"Check MyCallEventHandler passed, I answered the call");
LE_INFO(
"All calls will be hung-up in 10 seconds");
}
else
{
LE_ERROR(
"Check MyCallEventHandler failed to answer the call.");
}
}
{
LE_INFO(
"Check MyCallEventHandler passed, event is LE_MCC_EVENT_ORIGINATING.");
}
{
LE_INFO(
"Check MyCallEventHandler passed, event is LE_MCC_EVENT_SETUP.");
}
else
{
LE_ERROR(
"Check MyCallEventHandler failed, unknowm event %d.", callEvent);
}
}
(
void
)
{
if (TestCallRef == NULL)
{
}
if (res != LE_OK)
{
LE_ERROR(
"Failed to set Caller Id Restriction");
return res;
}
if (res != LE_OK)
{
LE_ERROR(
"Failed to set Caller Id Restriction");
return res;
}
if (localClirStatus != ClirStatus)
{
LE_ERROR(
"CLIR status doesn't match with CLIR set");
}
if (res != LE_OK)
{
switch(reason)
{
LE_ERROR(
"Term reason LE_MCC_TERM_FDN_ACTIVE");
break;
LE_ERROR(
"Term reason LE_MCC_TERM_NOT_ALLOWED");
break;
LE_ERROR(
"Term reason LE_MCC_TERM_UNDEFINED");
break;
default:
}
}
}
(
void
)
{
}
{
int i, nbArgument = 0;
myStruct mcctest[] =
{
{ "Test le_mcc_Call()", Testle_mcc_Call },
{ "Test le_mcc_HangUpAll()", Testle_mcc_HangUpAll },
{ "", NULL }
};
if (nbArgument == 2)
{
if (clirStatusStr)
{
if (strcmp(clirStatusStr, "CLIR_ON") == 0)
{
ClirStatus = LE_ON;
}
else
{
ClirStatus = LE_OFF;
}
}
LE_INFO(
"Phone number %s, CLIR %s", DestinationNumber, ((ClirStatus == LE_ON) ?
"ON" :
"OFF"));
for (i=0; mcctest[i].ptrfunc != NULL; i++)
{
LE_INFO(
"Test %s STARTED\n", mcctest[i].name);
res = mcctest[i].ptrfunc();
if (res != LE_OK)
{
LE_ERROR(
"Test %s FAILED\n", mcctest[i].name);
LE_INFO(
"mccTest sequence FAILED");
exit(EXIT_FAILURE);
}
else
{
LE_INFO(
"Test %s PASSED\n", mcctest[i].name);
}
}
}
else
{
LE_ERROR(
"PRINT USAGE => execInApp mccTest mccTest <Destination phone number>" " <CLIR_ON | CLIR_OFF>");
exit(EXIT_SUCCESS);
}
}