]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
these aren't the droids you're looking for....
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 9 May 2007 19:44:15 +0000 (19:44 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 9 May 2007 19:44:15 +0000 (19:44 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5115 d0543943-73ff-0310-b7d9-9358b9ac24b2

13 files changed:
libs/curl/lib/config.h.in
libs/curl/mkinstalldirs
src/include/switch_types.h
src/mod/applications/mod_bridgecall/mod_bridgecall.c
src/mod/applications/mod_esf/mod_esf.c
src/switch_channel.c
src/switch_core_session.c
src/switch_core_state_machine.c
src/switch_ivr.c
src/switch_ivr_async.c
src/switch_ivr_bridge.c
src/switch_ivr_originate.c
src/switch_rtp.c

index 8602189707771fc5967cc202d5692b079195dda1..4bc60b0df18042938b2435bfe78e445fc9ee644c 100644 (file)
 /* Define to the function return type for send. */
 #undef SEND_TYPE_RETV
 
-/* The size of `curl_off_t', as computed by sizeof. */
+/* The size of `curl_off_t', as computed by sizeof. */
 #undef SIZEOF_CURL_OFF_T
 
-/* The size of `long', as computed by sizeof. */
+/* The size of `long', as computed by sizeof. */
 #undef SIZEOF_LONG
 
-/* The size of `size_t', as computed by sizeof. */
+/* The size of `size_t', as computed by sizeof. */
 #undef SIZEOF_SIZE_T
 
-/* The size of `time_t', as computed by sizeof. */
+/* The size of `time_t', as computed by sizeof. */
 #undef SIZEOF_TIME_T
 
 /* Define to 1 if you have the ANSI C header files. */
 /* type to use in place of in_addr_t if not defined */
 #undef in_addr_t
 
-/* Define to `unsigned' if <sys/types.h> does not define. */
+/* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
 
 /* type to use in place of socklen_t if not defined */
index 436c03c699814362bd1970c0d0bbfcfa4a9c961d..6fbe5e117629c75a723710efc4b2e0341c17c895 100755 (executable)
 #! /bin/sh
 # mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain
 
-# $Id: mkinstalldirs,v 1.2 2000/01/10 23:36:14 bagder Exp $
+scriptversion=2004-02-15.20
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
 
 errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage"
+      exit 0
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --version)
+      echo "$0 $scriptversion"
+      exit 0
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
+done
 
 for file
 do
-   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
-   shift
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+  0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error.  This is a problem when calling mkinstalldirs
+# from a parallel make.  We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+  '')
+    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    else
+      # On NextStep and OpenStep, the `mkdir' command does not
+      # recognize any option.  It will interpret all options as
+      # directories to create, and then abort because `.' already
+      # exists.
+      test -d ./-p && rmdir ./-p
+      test -d ./--version && rmdir ./--version
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+       test ! -d ./--version; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    else
+      # Clean up after NextStep and OpenStep mkdir.
+      for d in ./-m ./-p ./--version "./$dirmode";
+      do
+        test -d $d && rmdir $d
+      done
+    fi
+    ;;
+esac
+
+for file
+do
+  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+  shift
+
+  pathcomp=
+  for d
+  do
+    pathcomp="$pathcomp$d"
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
 
-   pathcomp=
-   for d
-   do
-     pathcomp="$pathcomp$d"
-     case "$pathcomp" in
-       -* ) pathcomp=./$pathcomp ;;
-     esac
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
 
-     if test ! -d "$pathcomp"; then
-        echo "mkdir $pathcomp" 1>&2
+      mkdir "$pathcomp" || lasterr=$?
 
-        mkdir "$pathcomp" || lasterr=$?
+      if test ! -d "$pathcomp"; then
+       errstatus=$lasterr
+      else
+       if test ! -z "$dirmode"; then
+         echo "chmod $dirmode $pathcomp"
+         lasterr=""
+         chmod "$dirmode" "$pathcomp" || lasterr=$?
 
-        if test ! -d "$pathcomp"; then
-         errstatus=$lasterr
-        fi
-     fi
+         if test ! -z "$lasterr"; then
+           errstatus=$lasterr
+         fi
+       fi
+      fi
+    fi
 
-     pathcomp="$pathcomp/"
-   done
+    pathcomp="$pathcomp/"
+  done
 done
 
 exit $errstatus
 
-# mkinstalldirs ends here
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
index 27885a061db4cd5113e787260e1a45dec27465f3..9485ca75433f5de7e1c8a6bd9ab530dc4d7ff873 100644 (file)
@@ -95,6 +95,7 @@ SWITCH_BEGIN_EXTERN_C
 #define SWITCH_PATH_SEPARATOR "/"
 #endif
 #define SWITCH_URL_SEPARATOR "://"
+#define SWITCH_BYPASS_MEDIA_VARIABLE "bypass_media"
 #define SWITCH_ENDPOINT_DISPOSITION_VARIABLE "endpoint_disposition"
 #define SWITCH_HOLD_MUSIC_VARIABLE "hold_music"
 #define SWITCH_EXPORT_VARS_VARIABLE "export_vars"
@@ -544,7 +545,7 @@ CF_SERVICE          = (1 <<  9) - Channel has a service thread
 CF_TAGGED              = (1 << 10) - Channel is tagged
 CF_WINNER              = (1 << 11) - Channel is the winner
 CF_CONTROLLED  = (1 << 12) - Channel is under control
-CF_NOMEDIA             = (1 << 13) - Channel has no media
+CF_BYPASS_MEDIA                = (1 << 13) - Channel has no media
 CF_SUSPEND             = (1 << 14) - Suspend i/o
 CF_EVENT_PARSE  = (1 << 15) - Suspend control events
 CF_REPEAT_STATE = (1 << 16) - Tell the state machine to repeat a state
@@ -571,7 +572,7 @@ typedef enum {
        CF_TAGGED = (1 << 10),
        CF_WINNER = (1 << 11),
        CF_CONTROLLED = (1 << 12),
-       CF_NOMEDIA = (1 << 13),
+       CF_BYPASS_MEDIA = (1 << 13),
        CF_SUSPEND = (1 << 14),
        CF_EVENT_PARSE = (1 << 15),
        CF_REPEAT_STATE = (1 << 16),
index db6ae161abdc4dfce9b6bcbf578e475d4586e94e..884bbb7ec3fb8c1720bde68e2fa33deb9c118ec0 100644 (file)
@@ -61,11 +61,11 @@ static void audio_bridge_function(switch_core_session_t *session, char *data)
                do_continue = switch_true(var);
        }
 
-       if (switch_channel_test_flag(caller_channel, CF_NOMEDIA)
-               || ((var = switch_channel_get_variable(caller_channel, "no_media")) && switch_true(var))) {
+       if (switch_channel_test_flag(caller_channel, CF_BYPASS_MEDIA)
+               || ((var = switch_channel_get_variable(caller_channel, SWITCH_BYPASS_MEDIA_VARIABLE)) && switch_true(var))) {
                if (!switch_channel_test_flag(caller_channel, CF_ANSWERED)
                        && !switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)) {
-                       switch_channel_set_flag(caller_channel, CF_NOMEDIA);
+                       switch_channel_set_flag(caller_channel, CF_BYPASS_MEDIA);
                } else {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel is already up, delaying point-to-point mode 'till both legs are up.\n");
                        no_media_bridge = 1;
@@ -107,7 +107,7 @@ static void audio_bridge_function(switch_core_session_t *session, char *data)
                        switch_ivr_nomedia(switch_core_session_get_uuid(peer_session), SMF_FORCE);
                        switch_ivr_signal_bridge(session, peer_session);
                } else {
-                       if (switch_channel_test_flag(caller_channel, CF_NOMEDIA)) {
+                       if (switch_channel_test_flag(caller_channel, CF_BYPASS_MEDIA)) {
                                switch_ivr_signal_bridge(session, peer_session);
                        } else {
                                switch_ivr_multi_threaded_bridge(session, peer_session, NULL, NULL, NULL);
index 53b47624b9a871fa33a69ab3f79d78ff56000efd..a52b664dc14adf2faa9690035bf5ddc7df671fbb 100644 (file)
@@ -102,7 +102,7 @@ static void bcast_function(switch_core_session_t *session, char *data)
        }
 
        
-       if (switch_true(switch_channel_get_variable(channel, "no_media"))) {
+       if (switch_true(switch_channel_get_variable(channel, SWITCH_BYPASS_MEDIA_VARIABLE))) {
                switch_core_session_message_t msg = { 0 };
 
                ready = SEND_TYPE_NOMEDIA;
index 32d61bdcb1dc754f7c5da45bf10ad37cbd893678..2cbed3759fb8ee25d247f47a74ec624e7ad59f22 100644 (file)
@@ -431,7 +431,7 @@ SWITCH_DECLARE(switch_bool_t) switch_channel_set_flag_partner(switch_channel_t *
 
        assert(channel != NULL);
 
-       if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE))) {
+       if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
                switch_core_session_t *session;
                if ((session = switch_core_session_locate(uuid))) {
                        switch_channel_set_flag(switch_core_session_get_channel(session), flags);
@@ -449,7 +449,7 @@ SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t
 
        assert(channel != NULL);
 
-       if ((uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE))) {
+       if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
                switch_core_session_t *session;
                if ((session = switch_core_session_locate(uuid))) {
                        switch_channel_clear_flag(switch_core_session_get_channel(session), flags);
index 052e4f2cd3bb9ee28c97143a1488120314fd0718..ce83cb3b6503299f716924cd9b408989653a2538 100644 (file)
@@ -296,8 +296,8 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
                                switch_channel_set_variable(peer_channel, SWITCH_MAX_FORWARDS_VARIABLE, val);
                        }
 
-                       if (switch_channel_test_flag(channel, CF_NOMEDIA)) {
-                               switch_channel_set_flag(peer_channel, CF_NOMEDIA);
+                       if (switch_channel_test_flag(channel, CF_BYPASS_MEDIA)) {
+                               switch_channel_set_flag(peer_channel, CF_BYPASS_MEDIA);
                        }
 
                        if (profile) {
@@ -606,6 +606,7 @@ SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session)
        switch_ivr_deactivate_unicast(session);
 
        switch_channel_clear_flag(channel, CF_BREAK);
+
 }
 
 
@@ -996,7 +997,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
                        goto done;
                }
 
-               if (switch_channel_test_flag(session->channel, CF_NOMEDIA) && !switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA)) {
+               if (switch_channel_test_flag(session->channel, CF_BYPASS_MEDIA) && !switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA)) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Application %s Cannot be used with NO_MEDIA mode!\n",
                                                          extension->current_application->application_name);
                        status = SWITCH_STATUS_FALSE;
index 4ce4d64198c5a43a39742be6dedeced8dda01a7c..b80c8e79d05f1e905448e357baf1feebc31f8624 100644 (file)
@@ -129,7 +129,7 @@ static void switch_core_standard_on_execute(switch_core_session_t *session)
                        return;
                }
 
-               if (switch_channel_test_flag(session->channel, CF_NOMEDIA) && !switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA)) {
+               if (switch_channel_test_flag(session->channel, CF_BYPASS_MEDIA) && !switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA)) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Application %s Cannot be used with NO_MEDIA mode!\n",
                                                          extension->current_application->application_name);
                        switch_channel_hangup(session->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
index e6cc981770ec6ec4f3d17b05bfac77b13676d0f0..b32c365eafd2eeb91d30dfe0e08e7872f26457c3 100644 (file)
@@ -271,7 +271,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
        unsigned long CMD_HANGUP = switch_hashfunc_default("hangup", &hlen);
        unsigned long CMD_NOMEDIA = switch_hashfunc_default("nomedia", &hlen);
        unsigned long CMD_UNICAST = switch_hashfunc_default("unicast", &hlen);
-
+       char *lead_frames = switch_event_get_header(event, "lead-frames");
+       
        assert(channel != NULL);
        assert(event != NULL);
 
@@ -285,6 +286,21 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
 
        switch_channel_set_flag(channel, CF_EVENT_PARSE);
 
+       if (lead_frames) {
+               switch_frame_t *read_frame;
+               int frame_count = atoi(lead_frames);
+               switch_status_t status;
+
+               while(frame_count > 0) {
+                       status = switch_core_session_read_frame(session, &read_frame, -1, 0);
+                       if (!SWITCH_READ_ACCEPTABLE(status)) {
+                               return status;
+                       }
+                       if (!switch_test_flag(read_frame, SFF_CNG)) {
+                               frame_count--;
+                       }
+               }
+       }
 
        if (cmd_hash == CMD_EXECUTE) {
                const switch_application_interface_t *application_interface;
@@ -304,7 +320,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
                                        switch_channel_set_flag(channel, CF_BROADCAST);
                                        for (x = 0; x < loops || loops < 0; x++) {
                                                switch_core_session_exec(session, application_interface, app_arg);
-                                               if (!switch_channel_test_flag(channel, CF_BROADCAST)) {
+                                               if (!switch_channel_ready(channel) || !switch_channel_test_flag(channel, CF_BROADCAST)) {
                                                        break;
                                                }
                                        }
@@ -718,9 +734,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_media(char *uuid, switch_media_flag_t
                        swap = 1;
                }
 
-               if (switch_channel_test_flag(channel, CF_NOMEDIA)) {
+               if (switch_channel_test_flag(channel, CF_BYPASS_MEDIA)) {
                        status = SWITCH_STATUS_SUCCESS;
-                       switch_channel_clear_flag(channel, CF_NOMEDIA);
+                       switch_channel_clear_flag(channel, CF_BYPASS_MEDIA);
                        switch_core_session_receive_message(session, &msg);
 
                        if ((flags & SMF_REBRIDGE)
@@ -773,8 +789,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(char *uuid, switch_media_flag
                        swap = 1;
                }
 
-               if ((flags & SMF_FORCE) || !switch_channel_test_flag(channel, CF_NOMEDIA)) {
-                       switch_channel_set_flag(channel, CF_NOMEDIA);
+               if ((flags & SMF_FORCE) || !switch_channel_test_flag(channel, CF_BYPASS_MEDIA)) {
+                       switch_channel_set_flag(channel, CF_BYPASS_MEDIA);
                        switch_core_session_receive_message(session, &msg);
                        if ((flags & SMF_REBRIDGE) && (other_uuid = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE)) &&
                                (other_session = switch_core_session_locate(other_uuid))) {
index dad19053d9f9ef824e4957a0690fda2ba70a72a7..09013dac909a19545ae1c0bb0e8b2e44dfaaa9b8 100644 (file)
@@ -779,10 +779,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(char *uuid, char *path, swi
                channel = switch_core_session_get_channel(session);
                assert(channel != NULL);
 
-               if ((nomedia = switch_channel_test_flag(channel, CF_NOMEDIA))) {
+               if ((nomedia = switch_channel_test_flag(channel, CF_BYPASS_MEDIA))) {
                        switch_ivr_media(uuid, SMF_REBRIDGE);
                }
-
+               
                if ((p = strchr(mypath, ':'))) {
                        app = mypath;
                        *p++ = '\0';
@@ -802,10 +802,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(char *uuid, char *path, swi
                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-name", "%s", app);
                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-arg", "%s", path);
+                               switch_event_add_header(event, SWITCH_STACK_BOTTOM, "lead-frames", "%d", 5);
                                if ((flags & SMF_LOOP)) {
                                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "loops", "%d", -1);
                                }
-
+                               
                                switch_core_session_queue_private_event(other_session, &event);
                        }
                        
@@ -819,6 +820,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(char *uuid, char *path, swi
                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-name", "%s", app);
                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-arg", "%s", path);
+                               switch_event_add_header(event, SWITCH_STACK_BOTTOM, "lead-frames", "%d", 5);
                                if ((flags & SMF_LOOP)) {
                                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "loops", "%d", -1);
                                }
index 0235a6113840f0b8e19a49d8c9e9c3d5a33ac247..935e1d6c095455d5446ae01268d62f7014e3a832 100644 (file)
@@ -52,7 +52,6 @@ static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
        switch_input_callback_function_t input_callback;
        switch_core_session_message_t *message, msg = { 0 };
        void *user_data;
-
        switch_channel_t *chan_a, *chan_b;
        switch_frame_t *read_frame;
        switch_core_session_t *session_a, *session_b;
@@ -81,7 +80,7 @@ static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
                switch_channel_state_t b_state;
                switch_status_t status;
                switch_event_t *event;
-               
+
                /* if you really want to make sure it's not ready, test it twice because it might be just a break */
                if (!switch_channel_ready(chan_a) && !switch_channel_ready(chan_a)) {
                        break;
@@ -97,12 +96,24 @@ static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
                        break;
                }
 
+               if (switch_channel_test_flag(chan_a, CF_SUSPEND) || switch_channel_test_flag(chan_b, CF_SUSPEND)) {
+                       switch_yield(100000);
+                       continue;
+               }
+
                if (switch_core_session_dequeue_private_event(session_a, &event) == SWITCH_STATUS_SUCCESS) {
                        switch_channel_set_flag(chan_b, CF_SUSPEND);
+                       msg.string_arg = data->b_uuid;
+                       msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE;
+                       msg.from = __FILE__;
+                       switch_core_session_receive_message(session_a, &msg);
                        switch_ivr_parse_event(session_a, event);
+                       msg.message_id = SWITCH_MESSAGE_INDICATE_BRIDGE;
+                       switch_core_session_receive_message(session_a, &msg);
                        switch_channel_clear_flag(chan_b, CF_SUSPEND);
                        switch_event_destroy(&event);
                }
+               
 
                /* if 1 channel has DTMF pass it to the other */
                if (switch_channel_has_dtmf(chan_a)) {
@@ -154,11 +165,6 @@ static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
                }
 
 
-               if (switch_channel_test_flag(chan_a, CF_SUSPEND) || switch_channel_test_flag(chan_b, CF_SUSPEND)) {
-                       switch_yield(10000);
-                       continue;
-               }
-
                /* read audio from 1 channel and write it to the other */
                status = switch_core_session_read_frame(session_a, &read_frame, -1, stream_id);
 
@@ -180,6 +186,7 @@ static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
        msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE;
        msg.from = __FILE__;
        switch_core_session_receive_message(session_a, &msg);
+
        switch_core_session_kill_channel(session_b, SWITCH_SIG_BREAK);
 
        switch_channel_set_variable(chan_a, SWITCH_BRIDGE_VARIABLE, NULL);
index f60009af5c02d7c683625a638fbe08d5074242cf..3f4e88580536705db7e2595ca3cbd989179d2710 100644 (file)
@@ -607,7 +607,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                        }
 
                        if (session && (read_codec = switch_core_session_get_read_codec(session)) &&
-                               (ringback_data || !switch_channel_test_flag(caller_channel, CF_NOMEDIA))) {
+                               (ringback_data || !switch_channel_test_flag(caller_channel, CF_BYPASS_MEDIA))) {
 
                                if (!(pass = (uint8_t) switch_test_flag(read_codec, SWITCH_CODEC_FLAG_PASSTHROUGH))) {
                                        if (switch_core_codec_init(&write_codec,
@@ -713,7 +713,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                }
 
                                /* read from the channel while we wait if the audio is up on it */
-                               if (session && (ringback_data || !switch_channel_test_flag(caller_channel, CF_NOMEDIA)) &&
+                               if (session && (ringback_data || !switch_channel_test_flag(caller_channel, CF_BYPASS_MEDIA)) &&
                                        (switch_channel_test_flag(caller_channel, CF_ANSWERED)
                                         || switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA))) {
                                        switch_status_t status = switch_core_session_read_frame(session, &read_frame, 1000, 0);
@@ -777,7 +777,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                idx = IDX_CANCEL;
                        }
 
-                       if (session && (ringback_data || !switch_channel_test_flag(caller_channel, CF_NOMEDIA))) {
+                       if (session && (ringback_data || !switch_channel_test_flag(caller_channel, CF_BYPASS_MEDIA))) {
                                switch_core_session_reset(session);
                        }
 
index ecfa437c0e35949351a64c7e6b736467c554cb6f..9fc9a64a3b3f32d39e7f7f2228dce1be483c6e07 100644 (file)
@@ -375,7 +375,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_set_local_address(switch_rtp_t *rtp_s
   done:
 
        if (status != SWITCH_STATUS_SUCCESS) {
-               rtp_session->ready = 0;
+               rtp_session->ready = 1;
        }
 
        if (new_sock) {
@@ -817,7 +817,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
        switch_status_t status;
        uint8_t check = 1;
        stfu_frame_t *jb_frame;
-
+       
        if (!rtp_session->timer.interval) {
                rtp_session->last_time = switch_time_now();
        }
@@ -825,7 +825,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
        while (switch_rtp_ready(rtp_session)) {
                bytes = sizeof(rtp_msg_t);
                status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock, 0, (void *) &rtp_session->recv_msg, &bytes);
-               
+
                if (!SWITCH_STATUS_IS_BREAK(status) && rtp_session->timer.interval) {
                        switch_core_timer_step(&rtp_session->timer);
                }