/** * Add/Get ccapp task listener */ void addCcappListener(appListener* listener, int type) { listener_t *alistener = NULL; CCAPP_DEBUG(DEB_F_PREFIX"Entered: listenr=0x%x, type=%d\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "addCcappListener"), listener, type); if (listener == NULL) { CCAPP_ERROR(DEB_F_PREFIX"listener is NULL, returning\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "addCcappListener")); return; } alistener = cpr_malloc(sizeof(listener_t)); if (alistener == NULL) { CCAPP_ERROR(DEB_F_PREFIX"alistener is NULL, returning\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "addCcappListener")); return; } alistener->type = type; alistener->listener_p = listener; sll_lite_link_tail(&sll_list, (sll_lite_node_t *)alistener); CCAPP_DEBUG(DEB_F_PREFIX"Added: listenr=0x%x, type=%d\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "addCcappListener"), alistener->listener_p, alistener->type); }
void conf_roster_copy_call_conferance (cc_call_conference_Info_t *dest, cc_call_conference_Info_t * src) { cc_call_conferenceParticipant_Info_t *destParticipant; cc_call_conferenceParticipant_Info_t *srcParticipant; sll_lite_node_t *iterator; sll_lite_return_e sll_ret_val; CCAPP_DEBUG(DEB_F_PREFIX"in copy_call_confrerence \n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONFPARSE")); iterator = src->currentParticipantsList.head_p; conf_roster_init_call_conference(dest); dest->participantMax = src->participantMax; dest->participantCount = src->participantCount; dest->myParticipantId = strlib_copy(src->myParticipantId); while (iterator) { srcParticipant = (cc_call_conferenceParticipant_Info_t *)iterator; destParticipant = cpr_malloc(sizeof(cc_call_conferenceParticipant_Info_t)); if (destParticipant == NULL) { CCAPP_ERROR(DEB_F_PREFIX" Malloc failure for participant\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONFPARSE")); return; } else { destParticipant->participantName = strlib_copy(srcParticipant->participantName); destParticipant->endpointUri = strlib_copy(srcParticipant->endpointUri); destParticipant->callid = strlib_copy(srcParticipant->callid); destParticipant->participantNumber = strlib_copy(srcParticipant->participantNumber); destParticipant->participantSecurity = srcParticipant->participantSecurity; destParticipant->participantStatus = srcParticipant->participantStatus; destParticipant->canRemoveOtherParticipants = srcParticipant->canRemoveOtherParticipants; } sll_ret_val = sll_lite_link_tail(&dest->currentParticipantsList, (sll_lite_node_t *)destParticipant); if (sll_ret_val != SLL_LITE_RET_SUCCESS) { CCAPP_ERROR(DEB_F_PREFIX" Error while trying to insert in the linked list\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONFPARSE")); cpr_free(destParticipant); return; } iterator = iterator->next_p; } }
/* * parse_user_node * * Do user node specific parsing. * * Assumes a_node, info are not null. */ static void parse_user_node (xmlNode * a_node, cc_call_conference_Info_t *info) { xmlChar *data; xmlNode *cur_node; cc_call_conferenceParticipant_Info_t *participant; sll_lite_return_e sll_ret_val; //allocate a new participant participant = cpr_malloc(sizeof(cc_call_conferenceParticipant_Info_t)); if (participant == NULL) { CCAPP_ERROR(DEB_F_PREFIX" Malloc failure for participant\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONFPARSE")); return; } else { participant->participantName = strlib_empty(); participant->endpointUri = strlib_empty(); participant->callid = strlib_empty(); participant->participantNumber = strlib_empty(); participant->participantSecurity = CC_SECURITY_NONE; participant->participantStatus = CCAPI_CONFPARTICIPANT_UNKNOWN; participant->canRemoveOtherParticipants = FALSE; } sll_ret_val = sll_lite_link_tail(&info->currentParticipantsList, (sll_lite_node_t *)participant); if (sll_ret_val != SLL_LITE_RET_SUCCESS) { CCAPP_ERROR(DEB_F_PREFIX" Error while trying to insert in the linked list\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONFPARSE")); cpr_free(participant); return; } data = xmlGetProp(a_node, (const xmlChar *) "entity"); if (data != NULL) { char *tmp2; char *tmp1; participant->endpointUri = strlib_update(participant->endpointUri, (const char*)data); // Parse the endpoint URI, to get the Participant number tmp1 = (char *) strstr((const char*)data, "sip:"); if (tmp1) { tmp1 += 4; tmp2 = (char *) strchr(tmp1, '@'); if (tmp2) { *tmp2 = 0; participant->participantNumber = strlib_update(participant->participantNumber, (const char*)tmp1); } } xmlFree(data); } else { //continue parsing other elements CCAPP_ERROR(DEB_F_PREFIX" Error while trying to find the endpoint URI\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONFPARSE")); } for (cur_node = a_node->children; cur_node != NULL; cur_node = cur_node->next) { if (cur_node->type == XML_ELEMENT_NODE) { if (xmlStrcmp(cur_node->name, (const xmlChar *) "endpoint") == 0) { parse_user_endpoint_node(cur_node, participant, info); } else if (xmlStrcmp(cur_node->name, (const xmlChar *) "display-text") == 0) { data = xmlNodeGetContent(cur_node); if (data != NULL) { participant->participantName = strlib_update(participant->participantName, (const char*)data); xmlFree(data); } else { //No display text - continue parsing other elements - CCAPP_ERROR(DEB_F_PREFIX" Error while trying to get the display text\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONFPARSE")); } } } } }