]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Make bypass-media-after-hold a media-option
authorTravis Cross <tc@traviscross.com>
Wed, 5 Feb 2014 19:35:02 +0000 (19:35 +0000)
committerTravis Cross <tc@traviscross.com>
Wed, 5 Feb 2014 19:36:15 +0000 (19:36 +0000)
FS-6186 --resolve

Thanks-to: Matteo Brancaleoni <mbrancaleoni@voismart.it>
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c

index ea3bdbc08423a973085e19e86f130643e465382d..e307a005ba34cb31d8b3e9eb2296405ef71cb597 100644 (file)
@@ -319,7 +319,6 @@ typedef enum {
        TFLAG_CAPTURE,
        TFLAG_REINVITED,
        TFLAG_PASS_ACK,
-       TFLAG_BYPASS_MEDIA_AFTER_HOLD,
        /* No new flags below this line */
        TFLAG_MAX
 } TFLAGS;
@@ -509,7 +508,8 @@ typedef enum {
 typedef enum {
        MEDIA_OPT_NONE = 0,
        MEDIA_OPT_MEDIA_ON_HOLD = (1 << 0),
-       MEDIA_OPT_BYPASS_AFTER_ATT_XFER = (1 << 1)
+       MEDIA_OPT_BYPASS_AFTER_ATT_XFER = (1 << 1),
+       MEDIA_OPT_BYPASS_AFTER_HOLD = (1 << 2)
 } sofia_media_options_t;
 
 typedef enum {
index c59d4487388f8eb392d7785fdb5fc068d881b43f..753a8e4a401f7eaca8a3da69c42c978ca66dbb54 100644 (file)
@@ -4305,13 +4305,13 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
                                                        profile->media_options |= MEDIA_OPT_MEDIA_ON_HOLD;
                                                } else if (!strcasecmp(val, "bypass-media-after-att-xfer")) {
                                                        profile->media_options |= MEDIA_OPT_BYPASS_AFTER_ATT_XFER;
-                                               }
-                                       } else if (!strcasecmp(var, "bypass-media-after-hold") && switch_true(val)) {
-                                               if(profile->media_options & MEDIA_OPT_MEDIA_ON_HOLD) {
-                                                       sofia_set_flag(profile, TFLAG_BYPASS_MEDIA_AFTER_HOLD);
-                                               } else {
-                                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
-                                                                               "bypass-media-after-hold can be set only with resume-media-on-hold media-option\n");
+                                               } else if (!strcasecmp(val, "bypass-media-after-hold")) {
+                                                       if (profile->media_options & MEDIA_OPT_MEDIA_ON_HOLD) {
+                                                               profile->media_options |= MEDIA_OPT_BYPASS_AFTER_HOLD;
+                                                       } else {
+                                                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
+                                                                                                 "bypass-media-after-hold can be set only with resume-media-on-hold media-option\n");
+                                                       }
                                                }
                                        } else if (!strcasecmp(var, "pnp-provision-url")) {
                                                profile->pnp_prov_url = switch_core_strdup(profile->pool, val);
@@ -8548,7 +8548,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
                switch_channel_set_flag(channel, CF_PROXY_MODE);
        }
 
-       if (sofia_test_flag(tech_pvt, TFLAG_BYPASS_MEDIA_AFTER_HOLD)) {
+       if (profile->media_options & MEDIA_OPT_BYPASS_AFTER_HOLD) {
                switch_channel_set_flag(channel, CF_BYPASS_MEDIA_AFTER_HOLD);
        }