diff --git a/src/mod/applications/mod_httapi/mod_httapi_doc.txt b/src/mod/applications/mod_httapi/mod_httapi_doc.txt index 92f24409a4..7e45896bd3 100644 --- a/src/mod/applications/mod_httapi/mod_httapi_doc.txt +++ b/src/mod/applications/mod_httapi/mod_httapi_doc.txt @@ -234,10 +234,10 @@ temp-action : Change url to submit to. just for the next loop. - : 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. - : Get a Channel variable (depends on permissions) + : Call the voicemail app without requiring "execute" permissions ATTRS: action : Change url to submit to. diff --git a/src/mod/applications/mod_valet_parking/mod_valet_parking.c b/src/mod/applications/mod_valet_parking/mod_valet_parking.c index e51192809f..9a237ac44a 100644 --- a/src/mod/applications/mod_valet_parking/mod_valet_parking.c +++ b/src/mod/applications/mod_valet_parking/mod_valet_parking.c @@ -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); diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 9fc68c657e..53007a3abc 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -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); diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 61936af0ed..822c6b85b6 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -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; diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 3bdcb8fa57..c8d00aff03 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -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); diff --git a/src/switch_core_codec.c b/src/switch_core_codec.c index 6b78ed66f9..fd3c5e37f4 100644 --- a/src/switch_core_codec.c +++ b/src/switch_core_codec.c @@ -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; diff --git a/src/switch_core_io.c b/src/switch_core_io.c index 6be402824e..c55b891864 100644 --- a/src/switch_core_io.c +++ b/src/switch_core_io.c @@ -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; diff --git a/src/switch_event.c b/src/switch_event.c index f17ec08e5c..7e8a8676ba 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -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;