Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch

This commit is contained in:
Michael S Collins 2012-01-20 16:23:49 -08:00
commit 9371329d12
8 changed files with 52 additions and 14 deletions

View File

@ -234,10 +234,10 @@ temp-action : Change url to submit to. just for the next loop.
<log level clean action>
: Exit the httapi application and continue in the dialplan.
: Write a log line to fs_cli, console, logs, etc.
ATTRS:
level : The log level to use.
clean : If true do not pring log prefix.
clean : If true do not print log prefix.
action : Change url to submit to.
temp-action : Change url to submit to. just for the next loop.
@ -259,7 +259,7 @@ permanent : Add as a permanent param or just once.
<voicemail action temp-action check auth-only profile domain id/>
: Get a Channel variable (depends on permissions)
: Call the voicemail app without requiring "execute" permissions
ATTRS:
action : Change url to submit to.

View File

@ -428,6 +428,9 @@ SWITCH_STANDARD_APP(valet_parking_function)
char *dest;
int in = -1;
const char *timeout, *orbit_exten, *orbit_dialplan, *orbit_context;
char *timeout_str = "", *orbit_exten_str = "", *orbit_dialplan_str = "", *orbit_context_str = "";
lot = valet_find_lot(lot_name, SWITCH_TRUE);
switch_assert(lot);
@ -586,7 +589,28 @@ SWITCH_STANDARD_APP(valet_parking_function)
music = "silence_stream://-1";
}
dest = switch_core_session_sprintf(session, "set:valet_ticket=%s,set:valet_hold_music=%s,sleep:1000,valet_park:%s %s",
if ((orbit_exten = switch_channel_get_variable(channel, "valet_parking_orbit_exten"))) {
orbit_exten_str = switch_core_session_sprintf(session, "set:valet_parking_orbit_exten=%s,", orbit_exten);
}
if ((orbit_dialplan = switch_channel_get_variable(channel, "valet_parking_orbit_dialplan"))) {
orbit_dialplan_str = switch_core_session_sprintf(session, "set:valet_parking_orbit_dialplan=%s,", orbit_dialplan);
}
if ((orbit_context = switch_channel_get_variable(channel, "valet_parking_orbit_context"))) {
orbit_context_str = switch_core_session_sprintf(session, "set:valet_parking_orbit_context=%s,", orbit_context);
}
if ((timeout = switch_channel_get_variable(channel, "valet_parking_timeout"))) {
timeout_str = switch_core_session_sprintf(session, "set:valet_parking_timeout=%s,", timeout);
}
dest = switch_core_session_sprintf(session, "%s%s%s%s"
"set:valet_ticket=%s,set:valet_hold_music=%s,sleep:1000,valet_park:%s %s",
timeout_str,
orbit_exten_str,
orbit_dialplan_str,
orbit_context_str,
token->uuid, music, lot_name, ext);
switch_channel_set_variable(channel, "inline_destination", dest);

View File

@ -2521,6 +2521,7 @@ static void voicemail_check_main(switch_core_session_t *session, vm_profile_t *p
if (auth_only) {
if (authed) {
switch_channel_set_variable(channel, "user_pin_authenticated", "true");
switch_channel_set_variable(channel, "user_pin_authenticated_user", myid);
if (!zstr(myid)) switch_ivr_set_user(session, myid);
} else {
switch_channel_hangup(channel, SWITCH_CAUSE_USER_CHALLENGE);

View File

@ -6033,7 +6033,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
break;
case nua_callstate_ready:
if (r_sdp && !is_dup_sdp && switch_rtp_ready(tech_pvt->rtp_session)) {
if (r_sdp && !is_dup_sdp && switch_rtp_ready(tech_pvt->rtp_session) && !sofia_test_flag(tech_pvt, TFLAG_NOSDP_REINVITE)) {
/* sdp changed since 18X w sdp, we're supposed to ignore it but we, of course, were pressured into supporting it */
uint8_t match = 0;

View File

@ -812,7 +812,7 @@ static void do_dialog_probe(sofia_profile_t *profile, switch_event_t *event)
sql = switch_mprintf("update sip_subscriptions set version=version+1 "
"where expires > -1 and hostname='%q' "
"and sub_to_user='%q' and sub_to_host='%q' " "and (event='dialog') and "
"and sub_to_user='%q' and sub_to_host='%q' " "and (event!='fuck-dialog') and "
"call_id='%q'",
mod_sofia_globals.hostname, probe_euser, probe_host, sub_call_id);
@ -1115,7 +1115,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_sub_callback, &helper);
switch_safe_free(sql);
sql = switch_mprintf("update sip_subscriptions set version=version+1 where event='dialog' and sub_to_user='%q' "
sql = switch_mprintf("update sip_subscriptions set version=version+1 where event!='fuck-dialog' and sub_to_user='%q' "
"and (sub_to_host='%q' or presence_hosts like '%%%q%%') "
"and (profile_name = '%q' or presence_hosts != sub_to_host)",
euser, host, host, profile->name);
@ -2067,6 +2067,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
port = argv[27];
}
if (!zstr(presence_id) && strchr(presence_id, '@')) {
char *p;
@ -2494,8 +2495,6 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
}
}
send_presence_notify(profile, full_to, full_from, contact, expires, call_id, event, ip, port, ct, pl, NULL);
switch_safe_free(free_me);
@ -2957,7 +2956,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
sstr = switch_mprintf("active;expires=%ld", exp_delta);
sql = switch_mprintf("update sip_subscriptions "
"set expires=%ld "
"set expires=%ld,version=0 "
"where call_id='%q'",
(long) switch_epoch_time_now(NULL) + exp_delta,
call_id);

View File

@ -119,9 +119,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_real_read_codec(switch_c
}
} else { /* replace real_read_codec */
switch_codec_t *cur_codec;
if (session->real_read_codec == session->read_codec) {
goto end;
}
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Original read codec replaced with %s:%d\n",
switch_channel_get_name(session->channel), codec->implementation->iananame, codec->implementation->ianacode);
/* Set real_read_codec to front of the list of read_codecs */
@ -145,6 +142,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_real_read_codec(switch_c
}
}
}
/* force media bugs to copy the read codec from the next frame */
switch_thread_rwlock_wrlock(session->bug_rwlock);
if (switch_core_codec_ready(&session->bug_codec)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Destroying BUG Codec %s:%d\n",
session->bug_codec.implementation->iananame, session->bug_codec.implementation->ianacode);
switch_core_codec_destroy(&session->bug_codec);
}
switch_thread_rwlock_unlock(session->bug_rwlock);
} else {
status = SWITCH_STATUS_FALSE;
goto end;

View File

@ -337,6 +337,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
}
if (!switch_core_codec_ready(&session->bug_codec)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Setting BUG Codec %s:%d\n",
read_frame->codec->implementation->iananame, read_frame->codec->implementation->ianacode);
switch_core_codec_copy(read_frame->codec, &session->bug_codec, NULL);
}
use_codec = &session->bug_codec;

View File

@ -2344,7 +2344,13 @@ SWITCH_DECLARE(int) switch_event_check_permission_list(switch_event_t *list, con
{
const char *v;
int r = 0;
int default_allow = switch_test_flag(list, EF_DEFAULT_ALLOW);
int default_allow = 0;
if (!list) {
return 1;
}
default_allow = switch_test_flag(list, EF_DEFAULT_ALLOW);
if (!list->headers) {
return default_allow;