helper->pos++;
if (helper->pos == atoi(argv[0])) { /* wanted_position */
helper->button->number = helper->pos;
- strncpy(helper->button->name, argv[2], 24); /* label */
- strncpy(helper->button->shortname, argv[3], 40); /* value */
- strncpy(helper->button->displayname, argv[4], 44); /* caller_name */
+ switch_copy_string(helper->button->name, argv[2], 24); /* label */
+ switch_copy_string(helper->button->shortname, argv[3], 40); /* value */
+ switch_copy_string(helper->button->displayname, argv[4], 44); /* caller_name */
}
return 0;
}
helper->pos++;
if (helper->pos == atoi(argv[0])) { /* wanted_position */
helper->button->number = helper->pos; /* value */
- strncpy(helper->button->line, argv[3], 24); /* value */
- strncpy(helper->button->label, argv[2], 40); /* label */
+ switch_copy_string(helper->button->line, argv[3], 24); /* value */
+ switch_copy_string(helper->button->label, argv[2], 40); /* label */
}
return 0;
}
helper->pos++;
if (helper->pos == atoi(argv[0])) { /* wanted_position */
helper->button->index = helper->pos;
- strncpy(helper->button->url, argv[3], 256); /* value */
- strncpy(helper->button->display_name, argv[2], 40); /* label */
+ switch_copy_string(helper->button->url, argv[3], 256); /* value */
+ switch_copy_string(helper->button->display_name, argv[2], 40); /* label */
}
return 0;
}
if (helper->pos == atoi(argv[0])) { /* wanted_position */
helper->button->index = helper->pos;
helper->button->id = helper->pos;
- strncpy(helper->button->text_label, argv[2], 40); /* label */
+ switch_copy_string(helper->button->text_label, argv[2], 40); /* label */
helper->button->status = atoi(argv[3]); /* value */
}
return 0;
skinny_create_message(message, REGISTER_ACK_MESSAGE, reg_ack);
message->data.reg_ack.keep_alive = keep_alive;
- strncpy(message->data.reg_ack.date_format, date_format, 6);
- strncpy(message->data.reg_ack.reserved, reserved, 2);
+ switch_copy_string(message->data.reg_ack.date_format, date_format, 6);
+ switch_copy_string(message->data.reg_ack.reserved, reserved, 2);
message->data.reg_ack.secondary_keep_alive = keep_alive;
- strncpy(message->data.reg_ack.reserved2, reserved2, 4);
+ switch_copy_string(message->data.reg_ack.reserved2, reserved2, 4);
skinny_log_l_ffl(listener, file, func, line, SWITCH_LOG_DEBUG,
"Sending Register Ack with Keep Alive (%d), Date Format (%s), Secondary Keep Alive (%d)\n",
skinny_create_message(message, SPEED_DIAL_STAT_RES_MESSAGE, speed_dial_res);
message->data.speed_dial_res.number = number;
- strncpy(message->data.speed_dial_res.line, speed_line, 24);
- strncpy(message->data.speed_dial_res.label, speed_label, 40);
+ switch_copy_string(message->data.speed_dial_res.line, speed_line, 24);
+ switch_copy_string(message->data.speed_dial_res.label, speed_label, 40);
skinny_log_l_ffl(listener, file, func, line, SWITCH_LOG_DEBUG,
"Sending Speed Dial Stat Res with Number (%d), Line (%s), Label (%s)\n",
message->data.forward_stat.forward_busy_active = 1;
message->data.forward_stat.forward_noanswer_active = 1;
- strncpy(message->data.forward_stat.forward_all_number, number, sizeof(message->data.forward_stat.forward_all_number));
- strncpy(message->data.forward_stat.forward_busy_number, number, sizeof(message->data.forward_stat.forward_all_number));
- strncpy(message->data.forward_stat.forward_noanswer_number, number, sizeof(message->data.forward_stat.forward_all_number));
+ switch_copy_string(message->data.forward_stat.forward_all_number, number, sizeof(message->data.forward_stat.forward_all_number));
+ switch_copy_string(message->data.forward_stat.forward_busy_number, number, sizeof(message->data.forward_stat.forward_all_number));
+ switch_copy_string(message->data.forward_stat.forward_noanswer_number, number, sizeof(message->data.forward_stat.forward_all_number));
skinny_log_l_ffl(listener, file, func, line, SWITCH_LOG_DEBUG,
"Sending ForwardStat with Number (%s)\n", number);
}
skinny_create_message(message, CALL_INFO_MESSAGE, call_info);
- strncpy(message->data.call_info.calling_party_name, calling_party_name, 40);
- strncpy(message->data.call_info.calling_party, calling_party, 24);
- strncpy(message->data.call_info.called_party_name, called_party_name, 40);
- strncpy(message->data.call_info.called_party, called_party, 24);
+ switch_copy_string(message->data.call_info.calling_party_name, calling_party_name, 40);
+ switch_copy_string(message->data.call_info.calling_party, calling_party, 24);
+ switch_copy_string(message->data.call_info.called_party_name, called_party_name, 40);
+ switch_copy_string(message->data.call_info.called_party, called_party, 24);
message->data.call_info.line_instance = line_instance;
message->data.call_info.call_id = call_id;
message->data.call_info.call_type = call_type;
- strncpy(message->data.call_info.original_called_party_name, original_called_party_name, 40);
- strncpy(message->data.call_info.original_called_party, original_called_party, 24);
- strncpy(message->data.call_info.last_redirecting_party_name, last_redirecting_party_name, 40);
- strncpy(message->data.call_info.last_redirecting_party, last_redirecting_party, 24);
+ switch_copy_string(message->data.call_info.original_called_party_name, original_called_party_name, 40);
+ switch_copy_string(message->data.call_info.original_called_party, original_called_party, 24);
+ switch_copy_string(message->data.call_info.last_redirecting_party_name, last_redirecting_party_name, 40);
+ switch_copy_string(message->data.call_info.last_redirecting_party, last_redirecting_party, 24);
message->data.call_info.original_called_party_redirect_reason = original_called_party_redirect_reason;
message->data.call_info.last_redirecting_reason = last_redirecting_reason;
- strncpy(message->data.call_info.calling_party_voice_mailbox, calling_party_voice_mailbox, 24);
- strncpy(message->data.call_info.called_party_voice_mailbox, called_party_voice_mailbox, 24);
- strncpy(message->data.call_info.original_called_party_voice_mailbox, original_called_party_voice_mailbox, 24);
- strncpy(message->data.call_info.last_redirecting_voice_mailbox, last_redirecting_voice_mailbox, 24);
+ switch_copy_string(message->data.call_info.calling_party_voice_mailbox, calling_party_voice_mailbox, 24);
+ switch_copy_string(message->data.call_info.called_party_voice_mailbox, called_party_voice_mailbox, 24);
+ switch_copy_string(message->data.call_info.original_called_party_voice_mailbox, original_called_party_voice_mailbox, 24);
+ switch_copy_string(message->data.call_info.last_redirecting_voice_mailbox, last_redirecting_voice_mailbox, 24);
message->data.call_info.call_instance = call_instance;
message->data.call_info.call_security_status = call_security_status;
message->data.call_info.party_pi_restriction_bits = party_pi_restriction_bits;
skinny_create_message(message, VERSION_MESSAGE, version);
- strncpy(message->data.version.version, version, 16);
+ switch_copy_string(message->data.version.version, version, 16);
skinny_log_l_ffl(listener, file, func, line, SWITCH_LOG_DEBUG,
"Send Version with Version(%s)\n", version);
skinny_create_message(message, REGISTER_REJECT_MESSAGE, reg_rej);
- strncpy(message->data.reg_rej.error, error, 33);
+ switch_copy_string(message->data.reg_rej.error, error, 33);
skinny_log_l_ffl(listener, file, func, line, SWITCH_LOG_DEBUG,
"Send Register Reject with Error (%s)\n", error);
skinny_create_message(message, DISPLAY_PROMPT_STATUS_MESSAGE, display_prompt_status);
message->data.display_prompt_status.timeout = timeout;
- strncpy(message->data.display_prompt_status.display, display, 32);
+ switch_copy_string(message->data.display_prompt_status.display, display, 32);
message->data.display_prompt_status.line_instance = line_instance;
message->data.display_prompt_status.call_id = call_id;
message->data.display_prompt_status.timeout = timeout;
label = skinny_textid2raw(display_textid);
- strncpy(message->data.display_prompt_status.display, label, 32);
+ switch_copy_string(message->data.display_prompt_status.display, label, 32);
switch_safe_free(label);
message->data.display_prompt_status.line_instance = line_instance;
skinny_create_message(message, DIALED_NUMBER_MESSAGE, dialed_number);
- strncpy(message->data.dialed_number.called_party, called_party, 24);
+ switch_copy_string(message->data.dialed_number.called_party, called_party, 24);
message->data.dialed_number.line_instance = line_instance;
message->data.dialed_number.call_id = call_id;
message->data.display_pri_notify.message_timeout = message_timeout;
message->data.display_pri_notify.priority = priority;
- strncpy(message->data.display_pri_notify.notify, notify, 32);
+ switch_copy_string(message->data.display_pri_notify.notify, notify, 32);
tmp = skinny_format_message(notify);
message->data.data.call_id = call_id;
message->data.data.transaction_id = transaction_id;
message->data.data.data_length = data_length;
- strncpy(message->data.data.data, data, data_length);
+ switch_copy_string(message->data.data.data, data, data_length);
skinny_log_l_ffl(listener, file, func, line, SWITCH_LOG_DEBUG,
"Send Data with Data Length (%d)\n", data_length);
message->data.extended_data.conference_id = conference_id;
message->data.extended_data.app_instance_id = app_instance_id;
message->data.extended_data.routing_id = routing_id;
- strncpy(message->data.extended_data.data, data, data_length);
+ switch_copy_string(message->data.extended_data.data, data, data_length);
skinny_log_l_ffl(listener, file, func, line, SWITCH_LOG_DEBUG,
"Send Extended Data with Application ID (%d), Line Instance (%d), Call ID (%d), ...\n",
}
- strncpy(listener->device_name, request->data.reg.device_name, 16);
+ switch_copy_string(listener->device_name, request->data.reg.device_name, 16);
listener->device_instance = request->data.reg.instance;
listener->device_type = request->data.reg.device_type;
const char *name = switch_xml_attr_soft(xparam, "name");
const char *value = switch_xml_attr_soft(xparam, "value");
if (!strcasecmp(name, "skinny-firmware-version")) {
- strncpy(listener->firmware_version, value, 16);
+ switch_copy_string(listener->firmware_version, value, 16);
} else if (!strcasecmp(name, "skinny-soft-key-set-set")) {
listener->soft_key_set_set = switch_core_strdup(profile->pool, value);
} else if (!strcasecmp(name, "ext-voicemail")) {
int number_lines = atoi(argv[5]);
int number_speed_dials = atoi(argv[6]);
- strncpy(message->data.config_res.device_name, device_name, 16);
+ switch_copy_string(message->data.config_res.device_name, device_name, 16);
message->data.config_res.user_id = user_id;
message->data.config_res.instance = instance;
- strncpy(message->data.config_res.user_name, user_name, 40);
- strncpy(message->data.config_res.server_name, server_name, 40);
+ switch_copy_string(message->data.config_res.user_name, user_name, 40);
+ switch_copy_string(message->data.config_res.server_name, server_name, 40);
message->data.config_res.number_lines = number_lines;
message->data.config_res.number_speed_dials = number_speed_dials;
saw_entry = 1;
if (!zstr(params->firmware_version)) {
- strncpy(listener->firmware_version, params->firmware_version, 16);
+ switch_copy_string(listener->firmware_version, params->firmware_version, 16);
}
}
}
for (i=0; i < sizeof(soft_key_template_default_textids)/4; i++) {
char *label = skinny_textid2raw(soft_key_template_default_textids[i]);
- strncpy(message->data.soft_key_template.soft_key[i].soft_key_label, label, sizeof(message->data.soft_key_template.soft_key[i].soft_key_label));
+ switch_copy_string(message->data.soft_key_template.soft_key[i].soft_key_label, label, sizeof(message->data.soft_key_template.soft_key[i].soft_key_label));
switch_safe_free(label);
message->data.soft_key_template.soft_key[i].soft_key_event = soft_key_template_default_events[i];