Confirmed users
214
edits
Line 95: | Line 95: | ||
needs to loop around <code>cprGetMessage()</tt>, as in <tt>ccap_task.c</tt>: | needs to loop around <code>cprGetMessage()</tt>, as in <tt>ccap_task.c</tt>: | ||
/** | |||
* | |||
* CCApp Provider main routine. | |||
* | |||
* @param arg - CCApp msg queue | |||
* | |||
* @return void | |||
* | |||
* @pre None | |||
*/ | |||
void CCApp_task(void * arg) | |||
{ | |||
static const char fname[] = "CCApp_task"; | |||
phn_syshdr_t *syshdr = NULL; | |||
appListener *listener = NULL; | |||
void * msg; | |||
//initialize the listener list | |||
sll_lite_init(&sll_list); | |||
CCAppInit(); | |||
while (1) { | |||
msg = cprGetMessage(ccapp_msgq, TRUE, (void **) &syshdr); | |||
if ( msg) { | |||
CCAPP_DEBUG(DEB_F_PREFIX"Received Cmd[%d] for app[%d]\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), | |||
syshdr->Cmd, syshdr->Usr.UsrInfo); | |||
listener = getCcappListener(syshdr->Usr.UsrInfo); | |||
if (listener != NULL) { | |||
(* ((appListener)(listener)))(msg, syshdr->Cmd); | |||
} else { | |||
CCAPP_DEBUG(DEB_F_PREFIX"Event[%d] doesn't have a dedicated listener.\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), | |||
syshdr->Usr.UsrInfo); | |||
} | |||
cprReleaseSysHeader(syshdr); | |||
cprReleaseBuffer(msg); | |||
} | |||
} | |||
} | |||
=== Important threads === | === Important threads === |