presence tweak

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9363 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2008-08-25 16:30:28 +00:00
1 parent 24d4819b50
commit ca79084134
7 files changed
+38 -12

No files matched your search

@@ -606,6 +606,26 @@ SWITCH_STANDARD_APP(answer_function)
switch_channel_answer(switch_core_session_get_channel(session));
}
SWITCH_STANDARD_APP(presence_function)
{
char *argv[6] = { 0 };
int argc;
char *mydata = NULL;
switch_channel_t *channel = switch_core_session_get_channel(session);
if (switch_strlen_zero(data) || !(mydata = switch_core_session_strdup(session, data))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID ARGS!\n");
return;
}
if ((argc = switch_separate_string(mydata, ' ', argv, sizeof(argv) / sizeof(argv[0]))) < 2) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID ARGS!\n");
return;
}
switch_channel_presence(channel, argv[0], argv[1], argv[2]);
}
SWITCH_STANDARD_APP(pre_answer_function)
{
switch_channel_pre_answer(switch_core_session_get_channel(session));
@@ -2248,6 +2268,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SWITCH_ADD_APP(app_interface, "answer", "Answer the call", "Answer the call for a channel.", answer_function, "", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "hangup", "Hangup the call", "Hangup the call for a channel.", hangup_function, "[<cause>]", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "set_name", "Name the channel", "Name the channel", set_name_function, "<name>", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "presence", "Send Presence", "Send Presence.", presence_function, "<rpid> <status> [<id>]", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "log", "Logs to the logger", LOG_LONG_DESC, log_function, "<log_level> <log_string>", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "info", "Display Call Info", "Display Call Info", info_function, "", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "event", "Fire an event", "Fire an event", event_function, "", SAF_SUPPORT_NOMEDIA);
+1 -1
View File
@@ -242,7 +242,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
if (tech_pvt->max_missed_packets) {
switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets);
}
switch_channel_presence(tech_pvt->channel, "unknown", "unhold");
switch_channel_presence(tech_pvt->channel, "unknown", "unhold", NULL);
if ((buuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
if ((bsession = switch_core_session_locate(buuid))) {
+2 -2
View File
@@ -2389,11 +2389,11 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if (switch_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
if (!switch_stristr("sendonly", r_sdp)) {
switch_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
switch_channel_presence(tech_pvt->channel, "unknown", "unhold");
switch_channel_presence(tech_pvt->channel, "unknown", "unhold", NULL);
}
} else if (switch_stristr("sendonly", r_sdp)) {
switch_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
switch_channel_presence(tech_pvt->channel, "unknown", "hold");
switch_channel_presence(tech_pvt->channel, "unknown", "hold", NULL);
}
+2 -2
View File
@@ -2087,7 +2087,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
const char *stream;
switch_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
switch_channel_presence(tech_pvt->channel, "unknown", "hold");
switch_channel_presence(tech_pvt->channel, "unknown", "hold", NULL);
if (tech_pvt->max_missed_hold_packets) {
switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_hold_packets);
@@ -2134,7 +2134,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
}
switch_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
switch_channel_presence(tech_pvt->channel, "unknown", "unhold");
switch_channel_presence(tech_pvt->channel, "unknown", "unhold", NULL);
}
}