summaryrefslogtreecommitdiff
path: root/pjsip-apps/src/pjsua
diff options
context:
space:
mode:
Diffstat (limited to 'pjsip-apps/src/pjsua')
-rw-r--r--pjsip-apps/src/pjsua/pjsua_app.c42
-rw-r--r--pjsip-apps/src/pjsua/pjsua_app_cli.c60
-rw-r--r--pjsip-apps/src/pjsua/pjsua_app_legacy.c42
3 files changed, 72 insertions, 72 deletions
diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c
index 912d986f..af34ac91 100644
--- a/pjsip-apps/src/pjsua/pjsua_app.c
+++ b/pjsip-apps/src/pjsua/pjsua_app.c
@@ -138,7 +138,7 @@ static void call_timeout_callback(pj_timer_heap_t *timer_heap,
struct pj_timer_entry *entry)
{
pjsua_call_id call_id = entry->id;
- pjsua_msg_data msg_data;
+ pjsua_msg_data msg_data_;
pjsip_generic_string_hdr warn;
pj_str_t hname = pj_str("Warning");
pj_str_t hvalue = pj_str("399 pjsua \"Call duration exceeded\"");
@@ -151,16 +151,16 @@ static void call_timeout_callback(pj_timer_heap_t *timer_heap,
}
/* Add warning header */
- pjsua_msg_data_init(&msg_data);
+ pjsua_msg_data_init(&msg_data_);
pjsip_generic_string_hdr_init2(&warn, &hname, &hvalue);
- pj_list_push_back(&msg_data.hdr_list, &warn);
+ pj_list_push_back(&msg_data_.hdr_list, &warn);
/* Call duration has been exceeded; disconnect the call */
PJ_LOG(3,(THIS_FILE, "Duration (%d seconds) has been exceeded "
"for call %d, disconnecting the call",
app_config.duration, call_id));
entry->id = PJSUA_INVALID_ID;
- pjsua_call_hangup(call_id, 200, NULL, &msg_data);
+ pjsua_call_hangup(call_id, 200, NULL, &msg_data_);
}
/*
@@ -293,13 +293,13 @@ static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id,
ring_start(call_id);
if (app_config.auto_answer > 0) {
- pjsua_call_setting call_opt;
+ pjsua_call_setting opt;
- pjsua_call_setting_default(&call_opt);
- call_opt.aud_cnt = app_config.aud_cnt;
- call_opt.vid_cnt = app_config.vid.vid_cnt;
+ pjsua_call_setting_default(&opt);
+ opt.aud_cnt = app_config.aud_cnt;
+ opt.vid_cnt = app_config.vid.vid_cnt;
- pjsua_call_answer2(call_id, &call_opt, app_config.auto_answer, NULL,
+ pjsua_call_answer2(call_id, &opt, app_config.auto_answer, NULL,
NULL);
}
@@ -667,7 +667,7 @@ static void on_incoming_subscribe(pjsua_acc_id acc_id,
pjsip_rx_data *rdata,
pjsip_status_code *code,
pj_str_t *reason,
- pjsua_msg_data *msg_data)
+ pjsua_msg_data *msg_data_)
{
/* Just accept the request (the default behavior) */
PJ_UNUSED_ARG(acc_id);
@@ -677,7 +677,7 @@ static void on_incoming_subscribe(pjsua_acc_id acc_id,
PJ_UNUSED_ARG(rdata);
PJ_UNUSED_ARG(code);
PJ_UNUSED_ARG(reason);
- PJ_UNUSED_ARG(msg_data);
+ PJ_UNUSED_ARG(msg_data_);
}
@@ -1412,26 +1412,26 @@ static pj_status_t app_init()
pjmedia_port *tport;
char name[80];
pj_str_t label;
- pj_status_t status;
+ pj_status_t status2;
pj_ansi_snprintf(name, sizeof(name), "tone-%d,%d",
app_config.tones[i].freq1,
app_config.tones[i].freq2);
label = pj_str(name);
- status = pjmedia_tonegen_create2(app_config.pool, &label,
- 8000, 1, 160, 16,
- PJMEDIA_TONEGEN_LOOP, &tport);
- if (status != PJ_SUCCESS) {
+ status2 = pjmedia_tonegen_create2(app_config.pool, &label,
+ 8000, 1, 160, 16,
+ PJMEDIA_TONEGEN_LOOP, &tport);
+ if (status2 != PJ_SUCCESS) {
pjsua_perror(THIS_FILE, "Unable to create tone generator", status);
goto on_error;
}
- status = pjsua_conf_add_port(app_config.pool, tport,
+ status2 = pjsua_conf_add_port(app_config.pool, tport,
&app_config.tone_slots[i]);
- pj_assert(status == PJ_SUCCESS);
+ pj_assert(status2 == PJ_SUCCESS);
- status = pjmedia_tonegen_play(tport, 1, &app_config.tones[i], 0);
- pj_assert(status == PJ_SUCCESS);
+ status2 = pjmedia_tonegen_play(tport, 1, &app_config.tones[i], 0);
+ pj_assert(status2 == PJ_SUCCESS);
}
/* Optionally create recorder file, if any. */
@@ -1448,7 +1448,7 @@ static pj_status_t app_init()
/* Create ringback tones */
if (app_config.no_tones == PJ_FALSE) {
- unsigned i, samples_per_frame;
+ unsigned samples_per_frame;
pjmedia_tone_desc tone[RING_CNT+RINGBACK_CNT];
pj_str_t name;
diff --git a/pjsip-apps/src/pjsua/pjsua_app_cli.c b/pjsip-apps/src/pjsua/pjsua_app_cli.c
index 0ba15979..4d6b1d41 100644
--- a/pjsip-apps/src/pjsua/pjsua_app_cli.c
+++ b/pjsip-apps/src/pjsua/pjsua_app_cli.c
@@ -1748,9 +1748,9 @@ static pj_status_t cmd_transfer_call(pj_cli_cmd_val *cval)
pjsua_call_xfer( current_call, &binfo.uri, &msg_data);
}
} else if (result.uri_result) {
- pj_str_t tmp;
- tmp = pj_str(result.uri_result);
- pjsua_call_xfer( current_call, &tmp, &msg_data);
+ pj_str_t tmp2;
+ tmp2 = pj_str(result.uri_result);
+ pjsua_call_xfer( current_call, &tmp2, &msg_data);
}
}
return PJ_SUCCESS;
@@ -1768,7 +1768,7 @@ static pj_status_t cmd_transfer_replace_call(pj_cli_cmd_val *cval)
pj_str_t STR_REFER_SUB = { "Refer-Sub", 9 };
pj_str_t STR_FALSE = { "false", 5 };
pjsua_call_id ids[PJSUA_MAX_CALLS];
- pjsua_msg_data msg_data;
+ pjsua_msg_data msg_data_;
char buf[8] = {0};
pj_str_t tmp = pj_str(buf);
unsigned count;
@@ -1822,17 +1822,17 @@ static pj_status_t cmd_transfer_replace_call(pj_cli_cmd_val *cval)
return PJ_SUCCESS;
}
- pjsua_msg_data_init(&msg_data);
+ pjsua_msg_data_init(&msg_data_);
if (app_config.no_refersub) {
/* Add Refer-Sub: false in outgoing REFER request */
pjsip_generic_string_hdr_init2(&refer_sub, &STR_REFER_SUB,
&STR_FALSE);
- pj_list_push_back(&msg_data.hdr_list, &refer_sub);
+ pj_list_push_back(&msg_data_.hdr_list, &refer_sub);
}
pjsua_call_xfer_replaces(call, dst_call,
PJSUA_XFER_NO_REQUIRE_REPLACES,
- &msg_data);
+ &msg_data_);
}
return PJ_SUCCESS;
}
@@ -2661,7 +2661,7 @@ static pj_status_t cmd_restart_handler(pj_cli_cmd_val *cval)
return PJ_SUCCESS;
}
-static pj_status_t add_call_command(pj_cli_t *cli)
+static pj_status_t add_call_command(pj_cli_t *c)
{
char* call_command =
"<CMD name='call' id='100' desc='Call related commands'>"
@@ -2733,12 +2733,12 @@ static pj_status_t add_call_command(pj_cli_t *cli)
"</CMD>";
pj_str_t xml = pj_str(call_command);
- return pj_cli_add_cmd_from_xml(cli, NULL,
+ return pj_cli_add_cmd_from_xml(c, NULL,
&xml, cmd_call_handler,
NULL, get_choice_value);
}
-static pj_status_t add_presence_command(pj_cli_t *cli)
+static pj_status_t add_presence_command(pj_cli_t *c)
{
char* presence_command =
"<CMD name='im' id='200' desc='IM and Presence Commands'>"
@@ -2789,12 +2789,12 @@ static pj_status_t add_presence_command(pj_cli_t *cli)
pj_str_t xml = pj_str(presence_command);
- return pj_cli_add_cmd_from_xml(cli, NULL,
+ return pj_cli_add_cmd_from_xml(c, NULL,
&xml, cmd_presence_handler,
NULL, get_choice_value);
}
-static pj_status_t add_account_command(pj_cli_t *cli)
+static pj_status_t add_account_command(pj_cli_t *c)
{
char* account_command =
"<CMD name='acc' id='300' desc='Account commands'>"
@@ -2834,12 +2834,12 @@ static pj_status_t add_account_command(pj_cli_t *cli)
"</CMD>";
pj_str_t xml = pj_str(account_command);
- return pj_cli_add_cmd_from_xml(cli, NULL,
+ return pj_cli_add_cmd_from_xml(c, NULL,
&xml, cmd_account_handler,
NULL, get_choice_value);
}
-static pj_status_t add_media_command(pj_cli_t *cli)
+static pj_status_t add_media_command(pj_cli_t *c)
{
char* media_command =
"<CMD name='audio' id='400' desc='Conference and Media commands'>"
@@ -2869,12 +2869,12 @@ static pj_status_t add_media_command(pj_cli_t *cli)
"</CMD>";
pj_str_t xml = pj_str(media_command);
- return pj_cli_add_cmd_from_xml(cli, NULL,
+ return pj_cli_add_cmd_from_xml(c, NULL,
&xml, cmd_media_handler,
NULL, get_choice_value);
}
-static pj_status_t add_config_command(pj_cli_t *cli)
+static pj_status_t add_config_command(pj_cli_t *c)
{
char* config_command =
"<CMD name='stat' id='500' desc='Status and config commands'>"
@@ -2890,7 +2890,7 @@ static pj_status_t add_config_command(pj_cli_t *cli)
"</CMD>";
pj_str_t xml = pj_str(config_command);
- return pj_cli_add_cmd_from_xml(cli, NULL,
+ return pj_cli_add_cmd_from_xml(c, NULL,
&xml, cmd_config_handler,
NULL, get_choice_value);
}
@@ -3041,7 +3041,7 @@ static pj_status_t add_video_command(pj_cli_t *cli)
}
#endif
-static pj_status_t add_other_command(pj_cli_t *cli)
+static pj_status_t add_other_command(pj_cli_t *c)
{
char* sleep_command =
"<CMD name='sleep' id='700' desc='Suspend keyboard input'>"
@@ -3068,63 +3068,63 @@ static pj_status_t add_other_command(pj_cli_t *cli)
pj_str_t shutdown_xml = pj_str(shutdown_command);
pj_str_t restart_xml = pj_str(restart_command);
- status = pj_cli_add_cmd_from_xml(cli, NULL,
+ status = pj_cli_add_cmd_from_xml(c, NULL,
&sleep_xml, cmd_sleep_handler,
NULL, NULL);
if (status != PJ_SUCCESS)
return status;
- status = pj_cli_add_cmd_from_xml(cli, NULL,
+ status = pj_cli_add_cmd_from_xml(c, NULL,
&network_xml, cmd_network_handler,
NULL, NULL);
if (status != PJ_SUCCESS)
return status;
- status = pj_cli_add_cmd_from_xml(cli, NULL,
+ status = pj_cli_add_cmd_from_xml(c, NULL,
&shutdown_xml, cmd_quit_handler,
NULL, NULL);
if (status != PJ_SUCCESS)
return status;
- status = pj_cli_add_cmd_from_xml(cli, NULL,
+ status = pj_cli_add_cmd_from_xml(c, NULL,
&restart_xml, cmd_restart_handler,
NULL, NULL);
return status;
}
-pj_status_t cli_setup_command(pj_cli_t *cli)
+pj_status_t cli_setup_command(pj_cli_t *c)
{
pj_status_t status;
- status = add_call_command(cli);
+ status = add_call_command(c);
if (status != PJ_SUCCESS)
return status;
- status = add_presence_command(cli);
+ status = add_presence_command(c);
if (status != PJ_SUCCESS)
return status;
- status = add_account_command(cli);
+ status = add_account_command(c);
if (status != PJ_SUCCESS)
return status;
- status = add_media_command(cli);
+ status = add_media_command(c);
if (status != PJ_SUCCESS)
return status;
- status = add_config_command(cli);
+ status = add_config_command(c);
if (status != PJ_SUCCESS)
return status;
#if PJSUA_HAS_VIDEO
- status = add_video_command(cli);
+ status = add_video_command(c);
if (status != PJ_SUCCESS)
return status;
#endif
- status = add_other_command(cli);
+ status = add_other_command(c);
return status;
}
diff --git a/pjsip-apps/src/pjsua/pjsua_app_legacy.c b/pjsip-apps/src/pjsua/pjsua_app_legacy.c
index d687aded..dab8bfb9 100644
--- a/pjsip-apps/src/pjsua/pjsua_app_legacy.c
+++ b/pjsip-apps/src/pjsua/pjsua_app_legacy.c
@@ -606,7 +606,7 @@ on_error:
static void ui_make_new_call()
{
char buf[128];
- pjsua_msg_data msg_data;
+ pjsua_msg_data msg_data_;
input_result result;
pj_str_t tmp;
@@ -631,10 +631,10 @@ static void ui_make_new_call()
tmp.slen = 0;
}
- pjsua_msg_data_init(&msg_data);
- TEST_MULTIPART(&msg_data);
+ pjsua_msg_data_init(&msg_data_);
+ TEST_MULTIPART(&msg_data_);
pjsua_call_make_call(current_acc, &tmp, &call_opt, NULL,
- &msg_data, &current_call);
+ &msg_data_, &current_call);
}
static void ui_make_multi_call()
@@ -757,7 +757,7 @@ static void ui_answer_call()
{
pjsua_call_info call_info;
char buf[128];
- pjsua_msg_data msg_data;
+ pjsua_msg_data msg_data_;
if (current_call != -1) {
pjsua_call_get_info(current_call, &call_info);
@@ -789,7 +789,7 @@ static void ui_answer_call()
if (st_code < 100)
return;
- pjsua_msg_data_init(&msg_data);
+ pjsua_msg_data_init(&msg_data_);
if (st_code/100 == 3) {
if (!simple_input("Enter URL to be put in Contact",
@@ -798,7 +798,7 @@ static void ui_answer_call()
hvalue = pj_str(contact);
pjsip_generic_string_hdr_init2(&hcontact, &hname, &hvalue);
- pj_list_push_back(&msg_data.hdr_list, &hcontact);
+ pj_list_push_back(&msg_data_.hdr_list, &hcontact);
}
/*
@@ -812,7 +812,7 @@ static void ui_answer_call()
return;
}
- pjsua_call_answer2(current_call, &call_opt, st_code, NULL, &msg_data);
+ pjsua_call_answer2(current_call, &call_opt, st_code, NULL, &msg_data_);
}
}
@@ -1079,7 +1079,7 @@ static void ui_call_transfer(pj_bool_t no_refersub)
pj_str_t STR_FALSE = { "false", 5 };
pjsua_call_info ci;
input_result result;
- pjsua_msg_data msg_data;
+ pjsua_msg_data msg_data_;
pjsua_call_get_info(current_call, &ci);
printf("Transferring current call [%d] %.*s\n", current_call,
@@ -1094,12 +1094,12 @@ static void ui_call_transfer(pj_bool_t no_refersub)
return;
}
- pjsua_msg_data_init(&msg_data);
+ pjsua_msg_data_init(&msg_data_);
if (no_refersub) {
/* Add Refer-Sub: false in outgoing REFER request */
pjsip_generic_string_hdr_init2(&refer_sub, &STR_REFER_SUB,
&STR_FALSE);
- pj_list_push_back(&msg_data.hdr_list, &refer_sub);
+ pj_list_push_back(&msg_data_.hdr_list, &refer_sub);
}
if (result.nb_result != PJSUA_APP_NO_NB) {
if (result.nb_result == -1 || result.nb_result == 0) {
@@ -1107,13 +1107,13 @@ static void ui_call_transfer(pj_bool_t no_refersub)
} else {
pjsua_buddy_info binfo;
pjsua_buddy_get_info(result.nb_result-1, &binfo);
- pjsua_call_xfer( current_call, &binfo.uri, &msg_data);
+ pjsua_call_xfer( current_call, &binfo.uri, &msg_data_);
}
} else if (result.uri_result) {
pj_str_t tmp;
tmp = pj_str(result.uri_result);
- pjsua_call_xfer( current_call, &tmp, &msg_data);
+ pjsua_call_xfer( current_call, &tmp, &msg_data_);
}
}
}
@@ -1130,7 +1130,7 @@ static void ui_call_transfer_replaces(pj_bool_t no_refersub)
pj_str_t STR_FALSE = { "false", 5 };
pjsua_call_id ids[PJSUA_MAX_CALLS];
pjsua_call_info ci;
- pjsua_msg_data msg_data;
+ pjsua_msg_data msg_data_;
char buf[128];
unsigned i, count;
@@ -1189,17 +1189,17 @@ static void ui_call_transfer_replaces(pj_bool_t no_refersub)
return;
}
- pjsua_msg_data_init(&msg_data);
+ pjsua_msg_data_init(&msg_data_);
if (no_refersub) {
/* Add Refer-Sub: false in outgoing REFER request */
pjsip_generic_string_hdr_init2(&refer_sub, &STR_REFER_SUB,
&STR_FALSE);
- pj_list_push_back(&msg_data.hdr_list, &refer_sub);
+ pj_list_push_back(&msg_data_.hdr_list, &refer_sub);
}
pjsua_call_xfer_replaces(call, dst_call,
PJSUA_XFER_NO_REQUIRE_REPLACES,
- &msg_data);
+ &msg_data_);
}
}
@@ -1262,19 +1262,19 @@ static void ui_send_dtmf_info()
digits = pj_str(buf);
for (i=0; i<digits.slen; ++i) {
char body[80];
- pjsua_msg_data msg_data;
+ pjsua_msg_data msg_data_;
pjsua_msg_data_init(&msg_data);
- msg_data.content_type = pj_str("application/dtmf-relay");
+ msg_data_.content_type = pj_str("application/dtmf-relay");
pj_ansi_snprintf(body, sizeof(body),
"Signal=%c\r\n"
"Duration=160",
buf[i]);
- msg_data.msg_body = pj_str(body);
+ msg_data_.msg_body = pj_str(body);
status = pjsua_call_send_request(current_call, &SIP_INFO,
- &msg_data);
+ &msg_data_);
if (status != PJ_SUCCESS) {
return;
}