Exemplo n.º 1
0
void ccsnap_handle_mnc_reached (cc_line_info_t *line_info, cc_boolean mnc_reached, cc_cucm_mode_t mode) 
{
    cc_call_handle_t handles[MAX_CALLS];
    int count = MAX_CALLS, i;
    session_data_t *cinfo;

    if (mnc_reached) {
 	line_info->allowed_features[CCAPI_CALL_CAP_NEWCALL] = FALSE;
        line_info->allowed_features[CCAPI_CALL_CAP_REDIAL] = FALSE;
        line_info->allowed_features[CCAPI_CALL_CAP_CALLFWD] = FALSE;
    } else {
         capset_get_idleset(mode, line_info->allowed_features);
    }

    // update connected calls caps on this line
    CCAPI_LineInfo_getCallsByState(line_info->line_id, CONNECTED, handles, &count);
    for ( i=0; i<count; i++) {
	cinfo = CCAPI_Call_getCallInfo(handles[i]);
	if (cinfo) {
	    if ( cinfo->attr == (cc_call_attr_t) CONF_CONSULT ||
	         cinfo->attr == (cc_call_attr_t) XFR_CONSULT ) {
	       CCAPI_Call_releaseCallInfo(cinfo);
	       continue;
	    }
            cinfo->allowed_features[CCAPI_CALL_CAP_TRANSFER] = mnc_reached?FALSE:TRUE;
            cinfo->allowed_features[CCAPI_CALL_CAP_CONFERENCE] = mnc_reached?FALSE:TRUE;
            //print call info
            if (g_CCAppDebug) {
                printCallInfo(cinfo, "ccsnap_handle_mnc_reached");
            }
            CCAPI_CallListener_onCallEvent(CCAPI_CALL_EV_CAPABILITY, handles[i], cinfo, "");
	}
    }
    // update RIU call caps on this line
    CCAPI_LineInfo_getCallsByState(line_info->line_id, REMINUSE, handles, &count);
    for ( i=0; i<count; i++) {
        cinfo = CCAPI_Call_getCallInfo(handles[i]);
        if (cinfo) {
            cinfo->allowed_features[CCAPI_CALL_CAP_BARGE] = mnc_reached?FALSE:TRUE;
            //print call info
            if (g_CCAppDebug) {
                printCallInfo(cinfo, "ccsnap_handle_mnc_reached");
            }
            CCAPI_CallListener_onCallEvent(CCAPI_CALL_EV_CAPABILITY, handles[i], cinfo, "");
        }
    }
}
Exemplo n.º 2
0
/**
 * end Consult leg
 * @param [in] handle - call handle
 * @return SUCCESS or FAILURE
 */
cc_return_t CCAPI_Call_endConsultativeCall(cc_call_handle_t handle){
  cc_callinfo_ref_t info_handle = CCAPI_Call_getCallInfo(handle);
  cc_call_attr_t attr = CCAPI_CallInfo_getCallAttr(info_handle);
  if (attr != CC_ATTR_CONF_CONSULT &&
    attr != CC_ATTR_XFR_CONSULT &&
    attr != CC_ATTR_LOCAL_CONF_CONSULT &&
    attr != CC_ATTR_LOCAL_XFER_CONSULT) {
    DEF_DEBUG(DEB_F_PREFIX"This method only calls on a consultative call, handle %u",
      DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI_Call_endConsultativeCall"), handle);
    return CC_FAILURE;
  }

  return CC_CallFeature_endConsultativeCall(handle);
}
Exemplo n.º 3
0
void ccsnap_gen_callEvent(ccapi_call_event_e event, cc_call_handle_t handle){

    session_data_t *call_info = CCAPI_Call_getCallInfo(handle);

    if ( call_info == NULL ) {
        call_info = getDeepCopyOfSessionData(NULL);
    }

    //print all info
    if (g_CCAppDebug) {
        printCallInfo(call_info, "ccsnap_gen_callEvent");
    }

    CCAPI_CallListener_onCallEvent(event, handle, call_info, gROAPSDP.answerSDP);
    CCAPI_Call_releaseCallInfo(call_info);
}