Exemplo n.º 1
0
void ccsnap_set_line_label(int btn, cc_string_t label) {
   
   CCAPP_ERROR(DEB_F_PREFIX"btn=%d label=%s\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "ccsnap_set_line_label"), btn, label);
   if ( btn > 0 && btn <= MAX_CONFIG_LINES+1 ) {
       if ( label == NULL ) {
         label = strlib_empty();
       }
       if ( lineLabels[btn] == NULL ) {
         lineLabels[btn] = strlib_empty();
       }
       lineLabels[btn] = strlib_update(lineLabels[btn], label);
   }
}
Exemplo n.º 2
0
/*
 *  Function: strlib_update
 *
 *  PARAMETERS:string_t    : destination string
 *             const char* : source string
 *
 *  DESCRIPTION:like strcpy but returns const char* to a string in pool
 *
 *  RETURNS: string_t:Pointer to a new string
 *
 */
string_t
strlib_update (string_t destination, const char *source,
              const char *calling_fname, int line)
{
    const char *fname = "strlib_udpate";
    string_t ret_str;

    /* Bogus destination */
    if (!destination) {
        /* Should never happen, so report it */
        err_msg("%s: Destination String is invalid: %s:%d", fname,
                calling_fname, line);
        /* bad input, bad output */
        return NULL;
    }

    /* Bogus source */
    if (!source) {
        /* Should never happen, so report it and return something */
        err_msg("%s: Source String is invalid: %s:%d", fname,
                calling_fname, line);
        strlib_free(destination);
        return strlib_empty();
    }

    if (source[0] == '\0') {
        /* Source is NULL string, use string empty */
        strlib_free(destination);
        return strlib_empty();
    }

    ret_str = strlib_malloc(source, LEN_UNKNOWN, calling_fname, line);

    if (!ret_str) {
        /*
         * If a malloc error occurred, give them back what they had.
         * It's not right, but it's better than nothing.
         */
        ret_str = destination;
    } else {
        strlib_free(destination);
    }

    return (ret_str);
}
Exemplo n.º 3
0
void conf_roster_init_call_conference (cc_call_conference_Info_t *info)
{
    CCAPP_DEBUG(DEB_F_PREFIX"in init_call_conference \n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONFPARSE"));
    
    info->participantMax = 0;
    info->participantCount = 0;
    info->myParticipantId = strlib_empty();
    
    sll_lite_init(&info->currentParticipantsList); 
}
Exemplo n.º 4
0
/**
* Get Participant Number
* @param [in] handle - handle of call
* @param [in] participantHandle - handle of conference participant
* @return display number of the conference participant
*/
cc_string_t CCAPI_CallInfo_getConfParticipantNumber (cc_callinfo_ref_t handle, cc_participant_ref_t participantHandle)
{  
    cc_call_conference_participant_ref_t participant = getConferenceParticipantRef (handle, participantHandle);
    if (participant == NULL)
    {
        return strlib_empty();
    }

    return (participant->participantNumber);
}
Exemplo n.º 5
0
void ccsnap_device_init() {
   char temp[MAX_SIP_URL_LENGTH];

   /* clean up structure if need be */
   ccsnap_device_pre_init();

   memset (&g_deviceInfo, 0, sizeof(g_deviceInfo));
   g_deviceInfo.name =strlib_empty();
   g_deviceInfo.not_prompt =strlib_empty();

   g_deviceInfo.not_prompt_prio = 0;
   g_deviceInfo.not_prompt_prog = 0;
   g_deviceInfo.mwi_lamp = FALSE;
   g_deviceInfo.cucm_mode = CC_MODE_CCM;
   g_deviceInfo.ins_state = CC_STATE_IDLE;
   g_deviceInfo.ins_cause = CC_CREATED_IDLE;
   g_deviceInfo.reg_time  = 0;

   config_get_string(CFGID_CCM1_ADDRESS, temp, MAX_SIP_URL_LENGTH);
   g_deviceInfo.ucm[0].name = strlib_malloc(temp, strlen(temp));
   g_deviceInfo.ucm[0].type = CC_MODE_CCM;
   g_deviceInfo.ucm[0].status = CC_CCM_STATUS_NONE;

   config_get_string(CFGID_CCM2_ADDRESS, temp, MAX_SIP_URL_LENGTH);
   g_deviceInfo.ucm[1].name = strlib_malloc(temp, strlen(temp));
   g_deviceInfo.ucm[1].type = CC_MODE_CCM;
   g_deviceInfo.ucm[1].status = CC_CCM_STATUS_NONE;

   config_get_string(CFGID_CCM3_ADDRESS, temp, MAX_SIP_URL_LENGTH);
   g_deviceInfo.ucm[2].name = strlib_malloc(temp, strlen(temp));
   g_deviceInfo.ucm[2].type = CC_MODE_CCM;
   g_deviceInfo.ucm[2].status = CC_CCM_STATUS_NONE;

   config_get_string(CFGID_CCM_TFTP_IP_ADDR, temp, MAX_SIP_URL_LENGTH);
   g_deviceInfo.ucm[3].name = strlib_malloc(temp, strlen(temp));
   g_deviceInfo.ucm[3].type = CC_MODE_CCM;
   g_deviceInfo.ucm[3].status = CC_CCM_STATUS_NONE;

   g_accessoryCfgInfo.camera = ACCSRY_CFGD_CFG;
   g_accessoryCfgInfo.video = ACCSRY_CFGD_CFG;
}
/**
 * get placed call party name
 * @param handle - call handle
 * @return placed party name
 */
cc_string_t CCAPI_CallInfo_getPlacedCallPartyName(cc_callinfo_ref_t handle){
  static const char *fname="CCAPI_CallInfo_getPlacedCallPartyName";
  session_data_t *data = (session_data_t *)handle;
  CCAPP_DEBUG(DEB_F_PREFIX"Entering", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));

  if ( data != NULL){
     CCAPP_DEBUG(DEB_F_PREFIX"returned %s", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), data->plcd_name);
     return data->plcd_name;
  }

  return strlib_empty();
}
/**
 * get Original Called party number
 * @param handle - call handle
 * @return original called party number
 */
cc_string_t CCAPI_CallInfo_getOriginalCalledPartyNumber(cc_callinfo_ref_t handle){
  static const char *fname="CCAPI_CallInfo_getOriginalCalledPartyNumber";
  session_data_t *data = (session_data_t *)handle;
  CCAPP_DEBUG(DEB_F_PREFIX"Entering", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));

  if ( data != NULL){
     CCAPP_DEBUG(DEB_F_PREFIX"returned %s", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), data->orig_called_number);
     return data->orig_called_number;
  }

  return strlib_empty();
}
Exemplo n.º 8
0
/**
 * get GCID
 * @param handle - call handle
 * @return GCID
 */
cc_string_t CCAPI_CallInfo_getGCID(cc_callinfo_ref_t handle){
  static const char *fname="CCAPI_CallInfo_getGCID";
  session_data_t *data = (session_data_t *)handle;
  CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));

  if ( data != NULL){
     CCAPP_DEBUG(DEB_F_PREFIX"returned %s\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), data->gci);
     return data->gci;
  }

  return strlib_empty();
}
Exemplo n.º 9
0
/**
 * gets call server name
 * @param handle - handle of call server
 * @returns name of the call server
 * NOTE: The memory for the string will be freed once the device info reference is freed. No need to free this memory explicitly.
 */
cc_string_t CCAPI_DeviceInfo_getCallServerName (cc_callserver_ref_t handle)
{
    static const char *fname="CCAPI_DeviceInfo_getCallServerName";
    cc_call_server_t *ref = (cc_call_server_t *) handle;
    CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));

    if (ref != NULL && ref->name != 0) {
        CCAPP_DEBUG(DEB_F_PREFIX"returned %s\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), ref->name);
	    return ref->name;
    }
    return strlib_empty();
}
Exemplo n.º 10
0
/**
 * get past redirecting party number
 * @param handle - call handle
 * @return last redirecting party number
 */
cc_string_t CCAPI_CallInfo_getLastRedirectingPartyNumber(cc_callinfo_ref_t handle){
  static const char *fname="CCAPI_CallInfo_getLastRedirectingPartyNumber";
  session_data_t *data = (session_data_t *)handle;
  CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));

  if ( data != NULL){
     CCAPP_DEBUG(DEB_F_PREFIX"returned %s\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), data->last_redir_number);
     return data->last_redir_number;
  }

  return strlib_empty();
}
Exemplo n.º 11
0
/**
 * Get the line Label
 * @param [in] line - line reference handle
 * @return cc_string_t - line Label
 * NOTE: The memory for return string doesn't need to be freed it will be freed when the info reference is freed
 */
cc_string_t CCAPI_lineInfo_getLabel(cc_lineinfo_ref_t line) {
   static const char *fname="CCAPI_lineInfo_getLabel";
   cc_line_info_t  *info = (cc_line_info_t *) line;
   cc_string_t label = strlib_empty();

   CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));

   if ( info != NULL ) {
       label = ccsnap_get_line_label(info->button);
       CCAPP_DEBUG(DEB_F_PREFIX"returned %s\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), label);
   }
   return label;
}
Exemplo n.º 12
0
/**
 * gets the device name
 * @returns - a pointer to the device name
 */
cc_string_t CCAPI_DeviceInfo_getDeviceName (cc_deviceinfo_ref_t handle) 
{
  static const char *fname="CCAPI_DeviceInfo_getDeviceName";
  cc_device_info_t *device = handle;
  CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));

  if ( device != NULL ) {
     CCAPP_DEBUG(DEB_F_PREFIX"returned %s\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), device->name);
     return device->name;
  }

  return strlib_empty();
}
Exemplo n.º 13
0
/**
 * get the NOTIFICATION PROMPT
 * @param [in] handle - reference to device info
 * @returns
 */
cc_string_t CCAPI_DeviceInfo_getNotifyPrompt (cc_deviceinfo_ref_t handle)
{
    static const char *fname="CCAPI_DeviceInfo_getNotifyPrompt";
    cc_device_info_t *ref = (cc_device_info_t *) handle;
    CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));

    if (ref != NULL) {
        CCAPP_DEBUG(DEB_F_PREFIX"returned %02X\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), (ref->not_prompt));
        return ref->not_prompt;
    }

    return strlib_empty();
}
Exemplo n.º 14
0
/**
 * get call status prompt
 * @param handle - call handle
 * @return call status
 */
cc_string_t CCAPI_CallInfo_getStatus(cc_callinfo_ref_t handle){
  static const char *fname="CCAPI_CallInfo_getStatus";
  session_data_t *data = (session_data_t *)handle;
  CCAPP_DEBUG(DEB_F_PREFIX"Entering", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));

  if (data && data->status){
     CCAPP_DEBUG(DEB_F_PREFIX"returned %s", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), data->status);
     return data->status;
  }

  return strlib_empty();

}
Exemplo n.º 15
0
cc_participant_ref_t CCAPI_CallInfo_getConfSelfParticipant (cc_callinfo_ref_t handle)
{  
   cc_call_conference_ref_t callConference;    // conference reference (from call info)

   // get conference reference from the call info
   callConference = getCallConferenceRef(handle);
   if (callConference == NULL)
   {
      // unexpected error
      CCAPP_ERROR(DEB_F_PREFIX"Unable to get conference reference\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "CCAPI-CONF"));
      return strlib_empty();
   }
   
   return (callConference->myParticipantId);
}
Exemplo n.º 16
0
void sip_cc_setup (callid_t call_id, line_t line,
                   string_t calling_name, string_t calling_number, string_t alt_calling_number,
                   boolean display_calling_number,
                   string_t called_name,  string_t called_number,
                   boolean display_called_number,
                   string_t orig_called_name, string_t orig_called_number,
                   string_t last_redirect_name, string_t last_redirect_number,
                   cc_call_type_e   call_type,
                   cc_alerting_type alert_info,
                   vcm_ring_mode_t alerting_ring,
                   vcm_tones_t alerting_tone, cc_call_info_t *call_info_p,
                   boolean replaces, string_t recv_info_list, sipMessage_t *sip_msg)
{
    cc_caller_id_t caller_id;
    cc_msgbody_info_t cc_body_info;

    caller_id.calling_name = calling_name;
    caller_id.calling_number = calling_number;
    caller_id.alt_calling_number = alt_calling_number;
    caller_id.display_calling_number = display_calling_number;
    caller_id.called_name = called_name;
    caller_id.called_number = called_number;
    caller_id.display_called_number = display_called_number;
    caller_id.last_redirect_name = last_redirect_name;
    caller_id.last_redirect_number = last_redirect_number;
    caller_id.orig_called_name = orig_called_name;
    caller_id.orig_called_number = orig_called_number;
    caller_id.orig_rpid_number = strlib_empty();
    caller_id.call_type = call_type;

    /* Move the SIP body parts to the CCAPI msg. body information block */
    sip_cc_mv_msg_body_to_cc_msg(&cc_body_info, sip_msg);

// Check with CraigB
    cc_setup(CC_SRC_SIP, call_id, line, &caller_id, alert_info,
             alerting_ring, alerting_tone, NULL, call_info_p, replaces,
             recv_info_list, &cc_body_info);
}
Exemplo n.º 17
0
/**
 * Inserts localized strings into existing strings with escape characters.
 * @param destination the return phrase holder
 * @param source the phrase with escape characters.
 * @param len the input length to cap the maximum value
 * @return pointer to the new string
 */
cc_string_t ccsnap_EscapeStrToLocaleStr(cc_string_t destination, cc_string_t source, int len)
{
	static const char *fname="ccsnap_EscapeStrToLocaleStr";
	char phrase_collector[MAX_LOCALE_STRING_LEN] = { '\0' };
	char* phrase_collector_ptr = phrase_collector;
	char* esc_string_itr = (char*)source;
	int remaining_length = 0;
	cc_string_t ret_str = strlib_empty();

	if(destination == NULL){
		CCAPP_DEBUG(DEB_F_PREFIX"Error: destination is NULL\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));
		return NULL;
	}

	if(source == NULL){
		CCAPP_DEBUG(DEB_F_PREFIX"Error: source is NULL\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));
		strlib_free(destination);
		return strlib_empty();
	}

	if(source[0] == '\0'){
		strlib_free(destination);
		return strlib_empty();
	}

	if (len == LEN_UNKNOWN) {
		len = strlen(source) + MAX_LOCALE_PHRASE_LEN;
	}

	if (len <= 0){
		CCAPP_DEBUG(DEB_F_PREFIX"Error: cannot write string of length <= 0\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));
		strlib_free(destination);
		return strlib_empty();
	}

	if (len > MAX_LOCALE_STRING_LEN){
		len = MAX_LOCALE_STRING_LEN;
	}

	remaining_length = len;
	while(  *esc_string_itr != NUL    &&
			remaining_length > 0     &&
			strlen(phrase_collector_ptr) < (size_t)(len-1))
	{
		int rtn = CC_SUCCESS;
		int phrase_index = 0;
                char* phrase_bucket_ptr = (char*)cpr_malloc(remaining_length * sizeof(char));

                if (phrase_bucket_ptr == NULL) {
                    CCAPP_ERROR(DEB_F_PREFIX"Error: phrase_bucket_ptr is NULL\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));
                    strlib_free(destination);
                    return NULL;
                }
                phrase_bucket_ptr[0] = '\0';
		switch(*esc_string_itr){
		case OLD_CUCM_DICTIONARY_ESCAPE_TAG:
			phrase_index += CALL_CONTROL_PHRASE_OFFSET;
			// Do not set break to combine common code
		case NEW_CUCM_DICTIONARY_ESCAPE_TAG:
			esc_string_itr++;
			phrase_index += (int)(*esc_string_itr);
			rtn = platGetPhraseText(phrase_index, phrase_bucket_ptr, remaining_length-1);
			if(rtn == CC_FAILURE) break;
			sstrncat(phrase_collector_ptr, (cc_string_t)phrase_bucket_ptr, remaining_length);
			remaining_length--;
			break;
		default:
			// We need length 2 to concat 1 char and a terminating char
			sstrncat(phrase_collector_ptr, esc_string_itr, 1 + sizeof(char));
			remaining_length--;
			break;
		}
		esc_string_itr++;
                cpr_free(phrase_bucket_ptr);
	}

    ret_str = strlib_malloc(phrase_collector_ptr, len);

    if (!ret_str) {
        /*
         * If a malloc error occurred, give them back what they had.
         * It's not right, but it's better than nothing.
         */
        ret_str = destination;
    } else {
        strlib_free(destination);
    }

    CCAPP_DEBUG(DEB_F_PREFIX"Localization String returning %s\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), ret_str);
    return (ret_str);
}
Exemplo n.º 18
0
cc_string_t ccsnap_get_line_label(int btn) {
   if ( btn > 0 && btn <= MAX_CONFIG_LINES+1 ) {
     return lineLabels[btn];
   }
   return strlib_empty();
}
Exemplo n.º 19
0
/*
 * 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"));
                }
            }
        }
    }
}
Exemplo n.º 20
0
/**
 * gets the device name
 * @returns - a pointer to the device name
 */
cc_string_t CCAPI_DeviceInfo_getDeviceName (cc_deviceinfo_ref_t handle)
{
  CSFLogDebug(logTag, "Call to deprecated function %s, returning empty string", __FUNCTION__);
  return strlib_empty();
}
Exemplo n.º 21
0
void
strlib_init (void)
{
  (void) strlib_empty(); // force it to allocate the empty string buffer
}
Exemplo n.º 22
0
/**
 * Initialize lineinfo and featureinfo arrays
 */
void ccsnap_line_init() {
   int i;
   cc_uint32_t tmpInt;
   char tempStr[MAX_URL_LENGTH];
   char maskStr[MAX_EXTERNAL_NUMBER_MASK_SIZE];

   /* clean up structure if need be */
   ccsnap_line_pre_init();

   memset(lineInfo, 0, MAX_CONFIG_LINES*sizeof(cc_line_info_t));
   memset(featureInfo, 0, MAX_CONFIG_LINES*sizeof(cc_feature_info_t));
   for (i=1;i<=MAX_CONFIG_LINES;i++) {
      config_get_line_value(CFGID_LINE_FEATURE, &tmpInt, sizeof(tmpInt), i);
      if ( tmpInt == cfgLineFeatureDN ) {
          lineInfo[i].button = i;
          lineInfo[i].line_type = tmpInt;
          config_get_line_value(CFGID_LINE_INDEX,  &tmpInt, sizeof(tmpInt), i);
          lineInfo[i].line_id = tmpInt;
          config_get_line_value(CFGID_LINE_DISPLAYNAME_STRING, tempStr,
                          MAX_URL_LENGTH, i);
          lineInfo[i].dn = strlib_malloc(tempStr, strlen(tempStr));
          config_get_line_value(CFGID_LINE_NAME_STRING, tempStr,
                          MAX_URL_LENGTH, i);
          lineInfo[i].name = strlib_malloc(tempStr, strlen(tempStr));
          config_get_line_value(CFGID_LINE_CFWDALL, tempStr,
                          MAX_URL_LENGTH, i);
          lineInfo[i].cfwd_dest = strlib_malloc(tempStr, strlen(tempStr));
          config_get_line_value(CFGID_LINE_SPEEDDIAL_NUMBER_STRING, tempStr,
                          MAX_URL_LENGTH, i);
          memset(maskStr, 0, sizeof(maskStr));
          config_get_string(CFGID_CCM_EXTERNAL_NUMBER_MASK, maskStr, MAX_EXTERNAL_NUMBER_MASK_SIZE);
          if (strlen(maskStr) > 0) {
              lineInfo[i].externalNumber = CCAPI_ApplyTranslationMask(lineInfo[i].name, maskStr);
              CCAPP_DEBUG("Setting lineInfo[i].externalNumber to %s\n", lineInfo[i].externalNumber);
          } else {
              lineInfo[i].externalNumber = strlib_empty();
          }
      } else {
          lineInfo[i].line_id = MAX_CONFIG_LINES+1; // invalid line id
          lineInfo[i].button = i;
          lineInfo[i].dn = strlib_empty();
          lineInfo[i].name = strlib_empty();
          lineInfo[i].cfwd_dest = strlib_empty();
          lineInfo[i].externalNumber = strlib_empty();
      }
      capset_get_idleset(CC_MODE_CCM, lineInfo[i].allowed_features);

      // get feature again because it might have been changed if it is a DN
      // and the tmpInt might have a different value
      config_get_line_value(CFGID_LINE_FEATURE, &tmpInt, sizeof(tmpInt), i);

      // features which have no properties
      if ( tmpInt == cfgLineFeatureAllCalls ||
    		  tmpInt == cfgLineFeatureMaliciousCallID ||
    		  tmpInt == cfgLineFeatureRedial || tmpInt == cfgLineFeatureAnswerOldest || tmpInt == cfgLineFeatureServices ) {
    	  featureInfo[i].feature_id = tmpInt;
    	  featureInfo[i].button = i;
          featureInfo[i].speedDialNumber = strlib_empty();
          featureInfo[i].contact = strlib_empty();
          featureInfo[i].name = strlib_empty();
          featureInfo[i].retrievalPrefix = strlib_empty();
          featureInfo[i].featureOptionMask = 0;
      } else if ( tmpInt == cfgLineFeatureSpeedDialBLF || tmpInt == cfgLineFeatureSpeedDial){
    	  featureInfo[i].feature_id = tmpInt;
    	  featureInfo[i].button = i;
          config_get_line_value(CFGID_LINE_SPEEDDIAL_NUMBER_STRING, tempStr,
                          MAX_URL_LENGTH, i);
          featureInfo[i].speedDialNumber = strlib_malloc(tempStr, strlen(tempStr));
          featureInfo[i].contact = strlib_empty();
          config_get_line_value(CFGID_LINE_NAME_STRING, tempStr,
                          MAX_URL_LENGTH, i);
          featureInfo[i].name = strlib_malloc(tempStr, strlen(tempStr));
          featureInfo[i].retrievalPrefix = strlib_empty();
          config_get_line_value(CFGID_LINE_FEATURE_OPTION_MASK,  &tmpInt, sizeof(tmpInt), i);
          featureInfo[i].featureOptionMask = tmpInt;
          featureInfo[i].blf_state = CC_SIP_BLF_UNKNOWN;
      } else {
          featureInfo[i].feature_id = 0;
          featureInfo[i].button = MAX_CONFIG_LINES+1; // invalid button value
          featureInfo[i].speedDialNumber = strlib_empty();
          featureInfo[i].contact = strlib_empty();
          featureInfo[i].name = strlib_empty();
          featureInfo[i].retrievalPrefix = strlib_empty();
          featureInfo[i].featureOptionMask = 0;
      }
   }
}