<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][15565] </title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=15565">15565</a></dd>
<dt>Author</dt> <dd>anthm</dd>
<dt>Date</dt> <dd>2009-11-19 20:17:08 -0600 (Thu, 19 Nov 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>refactor enterprise_originate</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcincludeswitch_coreh">freeswitch/trunk/src/include/switch_core.h</a></li>
<li><a href="#freeswitchtrunksrcincludeswitch_ivrh">freeswitch/trunk/src/include/switch_ivr.h</a></li>
<li><a href="#freeswitchtrunksrcincludeswitch_module_interfacesh">freeswitch/trunk/src/include/switch_module_interfaces.h</a></li>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_commandsmod_commandsc">freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c</a></li>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_conferencemod_conferencec">freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c</a></li>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_dptoolsmod_dptoolsc">freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c</a></li>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_fifomod_fifoc">freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c</a></li>
<li><a href="#freeswitchtrunksrcmoddialplansmod_dialplan_asteriskmod_dialplan_asteriskc">freeswitch/trunk/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_alsamod_alsac">freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_dingalingmod_dingalingc">freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_iaxmod_iaxc">freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_loopbackmod_loopbackc">freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_portaudiomod_portaudioc">freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_referencemod_referencec">freeswitch/trunk/src/mod/endpoints/mod_reference/mod_reference.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_skypiaxmod_skypiaxc">freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_sofiamod_sofiac">freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_sofiasofiac">freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_sofiasofia_gluec">freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_unicallmod_unicallc">freeswitch/trunk/src/mod/endpoints/mod_unicall/mod_unicall.c</a></li>
<li><a href="#freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkeyc">freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_core_sessionc">freeswitch/trunk/src/switch_core_session.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_cppcpp">freeswitch/trunk/src/switch_cpp.cpp</a></li>
<li><a href="#freeswitchtrunksrcswitch_ivr_originatec">freeswitch/trunk/src/switch_ivr_originate.c</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunksrcincludeswitch_coreh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_core.h (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_core.h        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/include/switch_core.h        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -908,7 +908,7 @@
</span><span class="cx">                                                                                                                                                  _In_z_ const char *endpoint_name,
</span><span class="cx">                                                                                                                                                  _In_ switch_caller_profile_t *caller_profile,
</span><span class="cx">                                                                                                                                                  _Inout_ switch_core_session_t **new_session,
</span><del>-                                                                                                                                                 _Inout_ switch_memory_pool_t **pool, _In_ switch_originate_flag_t flags);
</del><ins>+                                                                                                                                                 _Inout_ switch_memory_pool_t **pool, _In_ switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> 
</span><span class="cx"> SWITCH_DECLARE(switch_call_cause_t) switch_core_session_resurrect_channel(_In_z_ const char *endpoint_name,
</span><span class="cx">                                                                                                                                                   _Inout_ switch_core_session_t **new_session,
</span></span></pre></div>
<a id="freeswitchtrunksrcincludeswitch_ivrh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_ivr.h (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_ivr.h        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/include/switch_ivr.h        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -406,7 +406,8 @@
</span><span class="cx">                                                                                                          const char *cid_num_override,
</span><span class="cx">                                                                                                          switch_caller_profile_t *caller_profile_override, 
</span><span class="cx">                                                                                                          switch_event_t *ovars,
</span><del>-                                                                                                         switch_originate_flag_t flags
</del><ins>+                                                                                                         switch_originate_flag_t flags,
+                                                                                                         switch_call_cause_t *cancel_cause
</ins><span class="cx">                                                                                                          );
</span><span class="cx"> 
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_session_t *session,
</span></span></pre></div>
<a id="freeswitchtrunksrcincludeswitch_module_interfacesh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_module_interfaces.h (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_module_interfaces.h        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/include/switch_module_interfaces.h        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> typedef switch_call_cause_t (*switch_io_outgoing_channel_t)
</span><del>-(switch_core_session_t *, switch_event_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **, switch_originate_flag_t);
</del><ins>+(switch_core_session_t *, switch_event_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **, switch_originate_flag_t, switch_call_cause_t *);
</ins><span class="cx"> typedef switch_status_t (*switch_io_read_frame_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
</span><span class="cx"> typedef switch_status_t (*switch_io_write_frame_t) (switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int);
</span><span class="cx"> typedef switch_status_t (*switch_io_kill_channel_t) (switch_core_session_t *, int);
</span></span></pre></div>
<a id="freeswitchtrunksrcmodapplicationsmod_commandsmod_commandsc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -2448,7 +2448,7 @@
</span><span class="cx">                 timeout = atoi(argv[6]);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (switch_ivr_originate(NULL, &amp;caller_session, &amp;cause, aleg, timeout, NULL, cid_name, cid_num, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS
</del><ins>+        if (switch_ivr_originate(NULL, &amp;caller_session, &amp;cause, aleg, timeout, NULL, cid_name, cid_num, NULL, NULL, SOF_NONE, NULL) != SWITCH_STATUS_SUCCESS
</ins><span class="cx">                 || !caller_session) {
</span><span class="cx">                 if (machine) {
</span><span class="cx">                         stream-&gt;write_function(stream, &quot;-ERR %s\n&quot;, switch_channel_cause2str(cause));
</span></span></pre></div>
<a id="freeswitchtrunksrcmodapplicationsmod_conferencemod_conferencec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -4448,7 +4448,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (conference == NULL) {
</span><span class="cx">                 char *dialstr = switch_mprintf(&quot;{ignore_early_media=true}%s&quot;, bridgeto);
</span><del>-                status = switch_ivr_originate(NULL, &amp;peer_session, cause, dialstr, 60, NULL, cid_name, cid_num, NULL, NULL, SOF_NONE);
</del><ins>+                status = switch_ivr_originate(NULL, &amp;peer_session, cause, dialstr, 60, NULL, cid_name, cid_num, NULL, NULL, SOF_NONE, NULL);
</ins><span class="cx">                 switch_safe_free(dialstr);
</span><span class="cx"> 
</span><span class="cx">                 if (status != SWITCH_STATUS_SUCCESS) {
</span><span class="lines">@@ -4481,7 +4481,7 @@
</span><span class="cx"> 
</span><span class="cx">         /* establish an outbound call leg */
</span><span class="cx"> 
</span><del>-        if (switch_ivr_originate(session, &amp;peer_session, cause, bridgeto, timeout, NULL, cid_name, cid_num, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) {
</del><ins>+        if (switch_ivr_originate(session, &amp;peer_session, cause, bridgeto, timeout, NULL, cid_name, cid_num, NULL, NULL, SOF_NONE, NULL) != SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, &quot;Cannot create outgoing channel, cause: %s\n&quot;, switch_channel_cause2str(*cause));
</span><span class="cx">                 if (caller_channel) {
</span><span class="cx">                         switch_channel_hangup(caller_channel, *cause);
</span></span></pre></div>
<a id="freeswitchtrunksrcmodapplicationsmod_dptoolsmod_dptoolsc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -1565,7 +1565,7 @@
</span><span class="cx">         switch_channel_set_variable(channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE, bond);
</span><span class="cx">         switch_channel_set_flag(channel, CF_XFER_ZOMBIE);
</span><span class="cx"> 
</span><del>-        if (switch_ivr_originate(session, &amp;peer_session, &amp;cause, data, 0, NULL, NULL, NULL, NULL, NULL, SOF_NONE) 
</del><ins>+        if (switch_ivr_originate(session, &amp;peer_session, &amp;cause, data, 0, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL) 
</ins><span class="cx">                 != SWITCH_STATUS_SUCCESS || !peer_session) {
</span><span class="cx">                 goto end;
</span><span class="cx">         }
</span><span class="lines">@@ -2223,7 +2223,7 @@
</span><span class="cx"> 
</span><span class="cx">                 do {
</span><span class="cx">                         fail = 0;
</span><del>-                        status = switch_ivr_originate(NULL, &amp;peer_session, &amp;cause, camp_data, campon_timeout, NULL, NULL, NULL, NULL, NULL, SOF_NONE);
</del><ins>+                        status = switch_ivr_originate(NULL, &amp;peer_session, &amp;cause, camp_data, campon_timeout, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL);
</ins><span class="cx">                         
</span><span class="cx">                         if (!switch_channel_ready(caller_channel)) {
</span><span class="cx">                                 fail = 1;
</span><span class="lines">@@ -2286,7 +2286,7 @@
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">         } else {
</span><del>-                if ((status = switch_ivr_originate(session, &amp;peer_session, &amp;cause, data, 0, NULL, NULL, NULL, NULL, NULL, SOF_NONE)) != SWITCH_STATUS_SUCCESS) {
</del><ins>+                if ((status = switch_ivr_originate(session, &amp;peer_session, &amp;cause, data, 0, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL)) != SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                         fail = 1;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -2403,7 +2403,7 @@
</span><span class="cx"> static switch_call_cause_t error_outgoing_channel(switch_core_session_t *session,
</span><span class="cx">                                                                                                  switch_event_t *var_event,
</span><span class="cx">                                                                                                  switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
</del><ins>+                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> switch_io_routines_t error_io_routines = {
</span><span class="cx">         /*.outgoing_channel */ error_outgoing_channel
</span><span class="cx"> };
</span><span class="lines">@@ -2411,7 +2411,7 @@
</span><span class="cx"> static switch_call_cause_t error_outgoing_channel(switch_core_session_t *session,
</span><span class="cx">                                                                                                  switch_event_t *var_event,
</span><span class="cx">                                                                                                  switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx">         switch_call_cause_t cause = switch_channel_str2cause(outbound_profile-&gt;destination_number);
</span><span class="cx">         if (cause == SWITCH_CAUSE_NONE) {
</span><span class="lines">@@ -2427,7 +2427,7 @@
</span><span class="cx"> static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session,
</span><span class="cx">                                                                                                  switch_event_t *var_event,
</span><span class="cx">                                                                                                  switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
</del><ins>+                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> switch_io_routines_t group_io_routines = {
</span><span class="cx">         /*.outgoing_channel */ group_outgoing_channel
</span><span class="cx"> };
</span><span class="lines">@@ -2435,7 +2435,7 @@
</span><span class="cx"> static switch_call_cause_t group_outgoing_channel(switch_core_session_t *session,
</span><span class="cx">                                                                                                  switch_event_t *var_event,
</span><span class="cx">                                                                                                  switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx">         char *group = NULL;
</span><span class="cx">         switch_call_cause_t cause = SWITCH_CAUSE_NONE;
</span><span class="lines">@@ -2507,7 +2507,7 @@
</span><span class="cx">         
</span><span class="cx">         
</span><span class="cx">         if (switch_ivr_originate(session, new_session, &amp;cause, dest, timelimit, NULL, 
</span><del>-                                                         cid_name_override, cid_num_override, NULL, var_event, myflags) == SWITCH_STATUS_SUCCESS) {
</del><ins>+                                                         cid_name_override, cid_num_override, NULL, var_event, myflags, cancel_cause) == SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                 const char *context;
</span><span class="cx">                 switch_caller_profile_t *cp;
</span><span class="cx">                 
</span><span class="lines">@@ -2545,7 +2545,7 @@
</span><span class="cx"> static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
</span><span class="cx">                                                                                                  switch_event_t *var_event,
</span><span class="cx">                                                                                                  switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
</del><ins>+                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> switch_io_routines_t user_io_routines = {
</span><span class="cx">         /*.outgoing_channel */ user_outgoing_channel
</span><span class="cx"> };
</span><span class="lines">@@ -2553,7 +2553,7 @@
</span><span class="cx"> static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
</span><span class="cx">                                                                                                  switch_event_t *var_event,
</span><span class="cx">                                                                                                  switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx">         switch_xml_t x_domain = NULL, xml = NULL, x_user = NULL, x_group = NULL, x_param, x_params;
</span><span class="cx">         char *user = NULL, *domain = NULL;
</span><span class="lines">@@ -2717,7 +2717,7 @@
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, &quot;Waddya Daft? You almost called '%s' in an infinate loop!\n&quot;, stupid);
</span><span class="cx">                         cause = SWITCH_CAUSE_INVALID_IE_CONTENTS;
</span><span class="cx">                 } else if (switch_ivr_originate(session, new_session, &amp;cause, d_dest, timelimit, NULL, 
</span><del>-                                                                 cid_name_override, cid_num_override, NULL, var_event, myflags) == SWITCH_STATUS_SUCCESS) {
</del><ins>+                                                                                cid_name_override, cid_num_override, outbound_profile, var_event, myflags, cancel_cause) == SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                         const char *context;
</span><span class="cx">                         switch_caller_profile_t *cp;
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcmodapplicationsmod_fifomod_fifoc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -492,7 +492,7 @@
</span><span class="cx">         switch_assert(ovars);
</span><span class="cx">         switch_event_add_header(ovars, SWITCH_STACK_BOTTOM, &quot;originate_timeout&quot;, &quot;%d&quot;, h-&gt;timeout);
</span><span class="cx">         
</span><del>-        if (switch_ivr_originate(NULL, &amp;session, &amp;cause, h-&gt;originate_string, h-&gt;timeout, NULL, NULL, NULL, NULL, ovars, SOF_NONE) != SWITCH_STATUS_SUCCESS) {
</del><ins>+        if (switch_ivr_originate(NULL, &amp;session, &amp;cause, h-&gt;originate_string, h-&gt;timeout, NULL, NULL, NULL, NULL, ovars, SOF_NONE, NULL) != SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                 switch_snprintf(sql, sizeof(sql), &quot;update fifo_outbound set use_count=use_count-1, outbound_fail_count=outbound_fail_count+1, next_avail=%ld + lag where uuid='%s'&quot;, 
</span><span class="cx">                                                 (long)switch_epoch_time_now(NULL), h-&gt;uuid);
</span><span class="cx">                 fifo_execute_sql(sql, globals.sql_mutex);
</span><span class="lines">@@ -1307,7 +1307,7 @@
</span><span class="cx">                                         switch_ivr_play_file(session, NULL, o_announce, NULL);
</span><span class="cx">                                 }
</span><span class="cx"> 
</span><del>-                                if (switch_ivr_originate(session, &amp;other_session, &amp;cause, url, 120, NULL, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) {
</del><ins>+                                if (switch_ivr_originate(session, &amp;other_session, &amp;cause, url, 120, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL) != SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                                         other_session = NULL;
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, &quot;Originate to [%s] failed, cause: %s\n&quot;, url, switch_channel_cause2str(cause));
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcmoddialplansmod_dialplan_asteriskmod_dialplan_asteriskc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -297,14 +297,14 @@
</span><span class="cx"> switch_endpoint_interface_t *sip_endpoint_interface;
</span><span class="cx"> static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                 switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
</del><ins>+                                                                                                switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> switch_io_routines_t sip_io_routines = {
</span><span class="cx">         /*.outgoing_channel */ sip_outgoing_channel
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static switch_call_cause_t sip_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                 switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx">         const char *profile;
</span><span class="cx"> 
</span><span class="lines">@@ -321,7 +321,7 @@
</span><span class="cx"> 
</span><span class="cx">         UNPROTECT_INTERFACE(sip_endpoint_interface);
</span><span class="cx"> 
</span><del>-        return switch_core_session_outgoing_channel(session, var_event, &quot;sofia&quot;, outbound_profile, new_session, pool, SOF_NONE);
</del><ins>+        return switch_core_session_outgoing_channel(session, var_event, &quot;sofia&quot;, outbound_profile, new_session, pool, SOF_NONE, cancel_cause);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -331,18 +331,18 @@
</span><span class="cx"> switch_endpoint_interface_t *iax2_endpoint_interface;
</span><span class="cx"> static switch_call_cause_t iax2_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                  switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
</del><ins>+                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> switch_io_routines_t iax2_io_routines = {
</span><span class="cx">         /*.outgoing_channel */ iax2_outgoing_channel
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static switch_call_cause_t iax2_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                  switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                 switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx">         UNPROTECT_INTERFACE(iax2_endpoint_interface);
</span><span class="cx"> 
</span><del>-        return switch_core_session_outgoing_channel(session, var_event, &quot;iax&quot;, outbound_profile, new_session, pool, SOF_NONE);
</del><ins>+        return switch_core_session_outgoing_channel(session, var_event, &quot;iax&quot;, outbound_profile, new_session, pool, SOF_NONE, cancel_cause);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_alsamod_alsac"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
</span><span class="lines">@@ -761,7 +761,7 @@
</span><span class="cx"> */
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx"> 
</span><span class="cx">         if ((*new_session = switch_core_session_request(&amp;channel_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_dingalingmod_dingalingc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -206,7 +206,7 @@
</span><span class="cx"> static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
</span><span class="lines">@@ -1618,7 +1618,7 @@
</span><span class="cx"> */
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx">         if ((*new_session = switch_core_session_request(dingaling_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
</span><span class="cx">                 struct private_object *tech_pvt;
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_iaxmod_iaxc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -435,7 +435,7 @@
</span><span class="cx"> static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
</span><span class="lines">@@ -744,7 +744,7 @@
</span><span class="cx"> */
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx">         if ((*new_session = switch_core_session_request(iax_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
</span><span class="cx">                 private_t *tech_pvt;
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_loopbackmod_loopbackc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx"> static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
</span><span class="lines">@@ -778,7 +778,7 @@
</span><span class="cx"> 
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx">         char name[128];
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_portaudiomod_portaudioc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -156,7 +156,7 @@
</span><span class="cx"> static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
</span><span class="lines">@@ -725,7 +725,7 @@
</span><span class="cx"> */
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx"> 
</span><span class="cx">         if ((*new_session = switch_core_session_request(portaudio_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_referencemod_referencec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_reference/mod_reference.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_reference/mod_reference.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/endpoints/mod_reference/mod_reference.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx"> static switch_status_t channel_on_soft_execute(switch_core_session_t *session);
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
</span><span class="lines">@@ -414,7 +414,7 @@
</span><span class="cx"> */
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx">         if ((*new_session = switch_core_session_request(reference_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
</span><span class="cx">                 private_t *tech_pvt;
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_skypiaxmod_skypiaxc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -193,7 +193,7 @@
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
</span><span class="cx">                                                                                                         switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags);
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
</span><span class="lines">@@ -864,7 +864,7 @@
</span><span class="cx"> static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
</span><span class="cx">                                                                                                         switch_event_t *var_event,
</span><span class="cx">                                                                                                         switch_caller_profile_t *outbound_profile,
</span><del>-                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                        switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx">         private_t *tech_pvt = NULL;
</span><span class="cx">         if ((*new_session = switch_core_session_request(skypiax_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_sofiamod_sofiac"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx"> static switch_status_t sofia_on_soft_execute(switch_core_session_t *session);
</span><span class="cx"> static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                   switch_caller_profile_t *outbound_profile, switch_core_session_t **new_session,
</span><del>-                                                                                                  switch_memory_pool_t **pool, switch_originate_flag_t flags);
</del><ins>+                                                                                                  switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t sofia_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t sofia_read_video_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
</span><span class="lines">@@ -2870,7 +2870,7 @@
</span><span class="cx"> 
</span><span class="cx"> static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
</span><span class="cx">                                                                                                   switch_caller_profile_t *outbound_profile, switch_core_session_t **new_session,
</span><del>-                                                                                                  switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                  switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx">         switch_call_cause_t cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
</span><span class="cx">         switch_core_session_t *nsession = NULL;
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_sofiasofiac"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -4292,7 +4292,7 @@
</span><span class="cx">                         switch_channel_t *channel_a = switch_core_session_get_channel(session);
</span><span class="cx"> 
</span><span class="cx">                         status = switch_ivr_originate(NULL, &amp;tsession, &amp;cause, nhelper-&gt;exten, timeout, NULL, NULL, NULL,
</span><del>-                                          switch_channel_get_caller_profile(channel_a), nhelper-&gt;vars, SOF_NONE);
</del><ins>+                                          switch_channel_get_caller_profile(channel_a), nhelper-&gt;vars, SOF_NONE, NULL);
</ins><span class="cx"> 
</span><span class="cx">                         if ((switch_channel_up(channel_a))) {
</span><span class="cx">                                 if (status != SWITCH_STATUS_SUCCESS || cause != SWITCH_CAUSE_SUCCESS) {
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_sofiasofia_gluec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -2536,88 +2536,89 @@
</span><span class="cx">           video:
</span><span class="cx"> 
</span><span class="cx">                 sofia_glue_check_video_codecs(tech_pvt);
</span><ins>+                if (sofia_test_flag(tech_pvt, TFLAG_VIDEO) &amp;&amp; tech_pvt-&gt;video_rm_encoding &amp;&amp; tech_pvt-&gt;remote_sdp_video_port) {
+                        
+                        /******************************************************************************************/
+                        if (tech_pvt-&gt;video_rtp_session &amp;&amp; sofia_test_flag(tech_pvt, TFLAG_REINVITE)) {
+                                //const char *ip = switch_channel_get_variable(tech_pvt-&gt;channel, SWITCH_LOCAL_MEDIA_IP_VARIABLE);
+                                //const char *port = switch_channel_get_variable(tech_pvt-&gt;channel, SWITCH_LOCAL_MEDIA_PORT_VARIABLE);
+                                char *remote_host = switch_rtp_get_remote_host(tech_pvt-&gt;video_rtp_session);
+                                switch_port_t remote_port = switch_rtp_get_remote_port(tech_pvt-&gt;video_rtp_session);
</ins><span class="cx"> 
</span><del>-                /******************************************************************************************/
-                if (tech_pvt-&gt;video_rtp_session &amp;&amp; sofia_test_flag(tech_pvt, TFLAG_REINVITE)) {
-                        //const char *ip = switch_channel_get_variable(tech_pvt-&gt;channel, SWITCH_LOCAL_MEDIA_IP_VARIABLE);
-                        //const char *port = switch_channel_get_variable(tech_pvt-&gt;channel, SWITCH_LOCAL_MEDIA_PORT_VARIABLE);
-                        char *remote_host = switch_rtp_get_remote_host(tech_pvt-&gt;video_rtp_session);
-                        switch_port_t remote_port = switch_rtp_get_remote_port(tech_pvt-&gt;video_rtp_session);
</del><ins>+                                if (remote_host &amp;&amp; remote_port &amp;&amp; !strcmp(remote_host, tech_pvt-&gt;remote_sdp_video_ip) &amp;&amp; remote_port == tech_pvt-&gt;remote_sdp_video_port) {
+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_DEBUG, &quot;Video params are unchanged for %s.\n&quot;, switch_channel_get_name(tech_pvt-&gt;channel));
+                                        goto video_up;
+                                } else {
+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_DEBUG, &quot;Video params changed for %s from %s:%d to %s:%d\n&quot;, 
+                                                                          switch_channel_get_name(tech_pvt-&gt;channel),
+                                                                          remote_host, remote_port, tech_pvt-&gt;remote_sdp_video_ip, tech_pvt-&gt;remote_sdp_video_port);
+                                }
+                        }
</ins><span class="cx"> 
</span><del>-                        if (remote_host &amp;&amp; remote_port &amp;&amp; !strcmp(remote_host, tech_pvt-&gt;remote_sdp_video_ip) &amp;&amp; remote_port == tech_pvt-&gt;remote_sdp_video_port) {
-                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_DEBUG, &quot;Video params are unchanged for %s.\n&quot;, switch_channel_get_name(tech_pvt-&gt;channel));
-                                goto video_up;
-                        } else {
-                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_DEBUG, &quot;Video params changed for %s from %s:%d to %s:%d\n&quot;, 
</del><ins>+                        if (!switch_channel_test_flag(tech_pvt-&gt;channel, CF_PROXY_MEDIA)) {
+                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_DEBUG, &quot;VIDEO RTP [%s] %s port %d -&gt; %s port %d codec: %u ms: %d\n&quot;,
</ins><span class="cx">                                                                   switch_channel_get_name(tech_pvt-&gt;channel),
</span><del>-                                                                  remote_host, remote_port, tech_pvt-&gt;remote_sdp_video_ip, tech_pvt-&gt;remote_sdp_video_port);
</del><ins>+                                                                  tech_pvt-&gt;local_sdp_audio_ip,
+                                                                  tech_pvt-&gt;local_sdp_video_port,
+                                                                  tech_pvt-&gt;remote_sdp_video_ip,
+                                                                  tech_pvt-&gt;remote_sdp_video_port, tech_pvt-&gt;video_agreed_pt, tech_pvt-&gt;read_impl.microseconds_per_packet / 1000);
</ins><span class="cx">                         }
</span><del>-                }
</del><span class="cx"> 
</span><del>-                if (!switch_channel_test_flag(tech_pvt-&gt;channel, CF_PROXY_MEDIA)) {
-                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_DEBUG, &quot;VIDEO RTP [%s] %s port %d -&gt; %s port %d codec: %u ms: %d\n&quot;,
-                                                          switch_channel_get_name(tech_pvt-&gt;channel),
-                                                          tech_pvt-&gt;local_sdp_audio_ip,
-                                                          tech_pvt-&gt;local_sdp_video_port,
-                                                          tech_pvt-&gt;remote_sdp_video_ip,
-                                                          tech_pvt-&gt;remote_sdp_video_port, tech_pvt-&gt;video_agreed_pt, tech_pvt-&gt;read_impl.microseconds_per_packet / 1000);
-                }
</del><ins>+                        switch_snprintf(tmp, sizeof(tmp), &quot;%d&quot;, tech_pvt-&gt;local_sdp_video_port);
+                        switch_channel_set_variable(tech_pvt-&gt;channel, SWITCH_LOCAL_MEDIA_IP_VARIABLE, tech_pvt-&gt;adv_sdp_audio_ip);
+                        switch_channel_set_variable(tech_pvt-&gt;channel, SWITCH_LOCAL_MEDIA_PORT_VARIABLE, tmp);
</ins><span class="cx"> 
</span><del>-                switch_snprintf(tmp, sizeof(tmp), &quot;%d&quot;, tech_pvt-&gt;local_sdp_video_port);
-                switch_channel_set_variable(tech_pvt-&gt;channel, SWITCH_LOCAL_MEDIA_IP_VARIABLE, tech_pvt-&gt;adv_sdp_audio_ip);
-                switch_channel_set_variable(tech_pvt-&gt;channel, SWITCH_LOCAL_MEDIA_PORT_VARIABLE, tmp);
</del><ins>+                        if (tech_pvt-&gt;video_rtp_session &amp;&amp; sofia_test_flag(tech_pvt, TFLAG_REINVITE)) {
+                                sofia_clear_flag_locked(tech_pvt, TFLAG_REINVITE);
+                
+                                if (switch_rtp_set_remote_address(tech_pvt-&gt;video_rtp_session, tech_pvt-&gt;remote_sdp_video_ip, tech_pvt-&gt;remote_sdp_video_port, SWITCH_TRUE, &amp;err) !=
+                                        SWITCH_STATUS_SUCCESS) {
+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_ERROR, &quot;VIDEO RTP REPORTS ERROR: [%s]\n&quot;, err);
+                                } else {
+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_DEBUG, &quot;VIDEO RTP CHANGING DEST TO: [%s:%d]\n&quot;,
+                                                                          tech_pvt-&gt;remote_sdp_video_ip, tech_pvt-&gt;remote_sdp_video_port);
+                                        if (!sofia_test_pflag(tech_pvt-&gt;profile, PFLAG_DISABLE_RTP_AUTOADJ) &amp;&amp;
+                                                !((val = switch_channel_get_variable(tech_pvt-&gt;channel, &quot;disable_rtp_auto_adjust&quot;)) &amp;&amp; switch_true(val))) {
+                                                /* Reactivate the NAT buster flag. */
+                                                switch_rtp_set_flag(tech_pvt-&gt;video_rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
+                                        }
+                                }
+                                goto video_up;
+                        }
</ins><span class="cx"> 
</span><del>-                if (tech_pvt-&gt;video_rtp_session &amp;&amp; sofia_test_flag(tech_pvt, TFLAG_REINVITE)) {
-                        sofia_clear_flag_locked(tech_pvt, TFLAG_REINVITE);
-                
-                        if (switch_rtp_set_remote_address(tech_pvt-&gt;video_rtp_session, tech_pvt-&gt;remote_sdp_video_ip, tech_pvt-&gt;remote_sdp_video_port, SWITCH_TRUE, &amp;err) !=
-                                SWITCH_STATUS_SUCCESS) {
-                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_ERROR, &quot;VIDEO RTP REPORTS ERROR: [%s]\n&quot;, err);
-                        } else {
-                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_DEBUG, &quot;VIDEO RTP CHANGING DEST TO: [%s:%d]\n&quot;,
-                                                                  tech_pvt-&gt;remote_sdp_video_ip, tech_pvt-&gt;remote_sdp_video_port);
</del><ins>+                        if (switch_channel_test_flag(tech_pvt-&gt;channel, CF_PROXY_MEDIA)) {
+                                if ((status = sofia_glue_tech_proxy_remote_addr(tech_pvt)) != SWITCH_STATUS_SUCCESS) {
+                                        goto end;
+                                }
+
</ins><span class="cx">                                 if (!sofia_test_pflag(tech_pvt-&gt;profile, PFLAG_DISABLE_RTP_AUTOADJ) &amp;&amp;
</span><span class="cx">                                         !((val = switch_channel_get_variable(tech_pvt-&gt;channel, &quot;disable_rtp_auto_adjust&quot;)) &amp;&amp; switch_true(val))) {
</span><del>-                                        /* Reactivate the NAT buster flag. */
-                                        switch_rtp_set_flag(tech_pvt-&gt;video_rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
</del><ins>+                                        flags = (switch_rtp_flag_t) (SWITCH_RTP_FLAG_PROXY_MEDIA | SWITCH_RTP_FLAG_AUTOADJ | SWITCH_RTP_FLAG_DATAWAIT);
+                                } else {
+                                        flags = (switch_rtp_flag_t) (SWITCH_RTP_FLAG_PROXY_MEDIA | SWITCH_RTP_FLAG_DATAWAIT);
</ins><span class="cx">                                 }
</span><del>-                        }
-                        goto video_up;
-                }
</del><ins>+                                timer_name = NULL;
</ins><span class="cx"> 
</span><del>-                if (switch_channel_test_flag(tech_pvt-&gt;channel, CF_PROXY_MEDIA)) {
-                        if ((status = sofia_glue_tech_proxy_remote_addr(tech_pvt)) != SWITCH_STATUS_SUCCESS) {
-                                goto end;
-                        }
</del><ins>+                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_DEBUG,
+                                                                  &quot;PROXY VIDEO RTP [%s] %s:%d-&gt;%s:%d codec: %u ms: %d\n&quot;,
+                                                                  switch_channel_get_name(tech_pvt-&gt;channel),
+                                                                  tech_pvt-&gt;local_sdp_audio_ip,
+                                                                  tech_pvt-&gt;local_sdp_video_port,
+                                                                  tech_pvt-&gt;remote_sdp_video_ip,
+                                                                  tech_pvt-&gt;remote_sdp_video_port, tech_pvt-&gt;video_agreed_pt, tech_pvt-&gt;read_impl.microseconds_per_packet / 1000);
</ins><span class="cx"> 
</span><del>-                        if (!sofia_test_pflag(tech_pvt-&gt;profile, PFLAG_DISABLE_RTP_AUTOADJ) &amp;&amp;
-                                !((val = switch_channel_get_variable(tech_pvt-&gt;channel, &quot;disable_rtp_auto_adjust&quot;)) &amp;&amp; switch_true(val))) {
-                                flags = (switch_rtp_flag_t) (SWITCH_RTP_FLAG_PROXY_MEDIA | SWITCH_RTP_FLAG_AUTOADJ | SWITCH_RTP_FLAG_DATAWAIT);
</del><span class="cx">                         } else {
</span><del>-                                flags = (switch_rtp_flag_t) (SWITCH_RTP_FLAG_PROXY_MEDIA | SWITCH_RTP_FLAG_DATAWAIT);
</del><ins>+                                timer_name = tech_pvt-&gt;profile-&gt;timer_name;
+
+                                if ((var = switch_channel_get_variable(tech_pvt-&gt;channel, &quot;rtp_timer_name&quot;))) {
+                                        timer_name = (char *) var;
+                                }
</ins><span class="cx">                         }
</span><del>-                        timer_name = NULL;
</del><span class="cx"> 
</span><del>-                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_DEBUG,
-                                                          &quot;PROXY VIDEO RTP [%s] %s:%d-&gt;%s:%d codec: %u ms: %d\n&quot;,
-                                                          switch_channel_get_name(tech_pvt-&gt;channel),
-                                                          tech_pvt-&gt;local_sdp_audio_ip,
-                                                          tech_pvt-&gt;local_sdp_video_port,
-                                                          tech_pvt-&gt;remote_sdp_video_ip,
-                                                          tech_pvt-&gt;remote_sdp_video_port, tech_pvt-&gt;video_agreed_pt, tech_pvt-&gt;read_impl.microseconds_per_packet / 1000);
</del><ins>+                        /******************************************************************************************/
</ins><span class="cx"> 
</span><del>-                } else {
-                        timer_name = tech_pvt-&gt;profile-&gt;timer_name;
</del><span class="cx"> 
</span><del>-                        if ((var = switch_channel_get_variable(tech_pvt-&gt;channel, &quot;rtp_timer_name&quot;))) {
-                                timer_name = (char *) var;
-                        }
-                }
</del><span class="cx"> 
</span><del>-                /******************************************************************************************/
-
-
-                if (sofia_test_flag(tech_pvt, TFLAG_VIDEO) &amp;&amp; tech_pvt-&gt;video_rm_encoding &amp;&amp; tech_pvt-&gt;remote_sdp_video_port) {
</del><span class="cx">                         if (!tech_pvt-&gt;local_sdp_video_port) {
</span><span class="cx">                                 sofia_glue_tech_choose_video_port(tech_pvt, 1);
</span><span class="cx">                         }
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_unicallmod_unicallc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_unicall/mod_unicall.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_unicall/mod_unicall.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/endpoints/mod_unicall/mod_unicall.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx">                                                     switch_caller_profile_t *outbound_profile,
</span><span class="cx">                                                     switch_core_session_t **new_session,
</span><span class="cx">                                                     switch_memory_pool_t **pool,
</span><del>-                                                    switch_originate_flag_t flags);
</del><ins>+                                                    switch_originate_flag_t flags, switch_call_cause_t *cancel_cause);
</ins><span class="cx"> static switch_status_t unicall_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t unicall_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id);
</span><span class="cx"> static switch_status_t unicall_kill_channel(switch_core_session_t *session, int sig);
</span><span class="lines">@@ -1543,7 +1543,7 @@
</span><span class="cx">                                                     switch_caller_profile_t *outbound_profile,
</span><span class="cx">                                                     switch_core_session_t **new_session,
</span><span class="cx">                                                     switch_memory_pool_t **pool,
</span><del>-                                                    switch_originate_flag_t flags)
</del><ins>+                                                    switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx">     private_t *tech_pvt;
</span><span class="cx">     switch_channel_t *channel;
</span></span></pre></div>
<a id="freeswitchtrunksrcmodlanguagesmod_spidermonkeymod_spidermonkeyc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -2852,7 +2852,7 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         if (switch_ivr_originate(old_jss ? old_jss-&gt;session : NULL, 
</span><del>-                                                                         &amp;jss-&gt;session, &amp;jss-&gt;cause, uuid, 60, NULL, NULL, NULL, NULL, NULL, SOF_NONE) == SWITCH_STATUS_SUCCESS) {
</del><ins>+                                                                         &amp;jss-&gt;session, &amp;jss-&gt;cause, uuid, 60, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL) == SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                                 switch_set_flag(jss, S_HUP);
</span><span class="cx">                                 switch_channel_set_state(switch_core_session_get_channel(jss-&gt;session), CS_SOFT_EXECUTE);
</span><span class="cx">                                 *rval = BOOLEAN_TO_JSVAL(JS_TRUE);
</span><span class="lines">@@ -3013,7 +3013,7 @@
</span><span class="cx">                 caller_profile = switch_caller_profile_new(pool, username, dialplan, cid_name, cid_num, network_addr, ani, aniii, rdnis, modname, context, dest);
</span><span class="cx"> 
</span><span class="cx">                 saveDepth = JS_SuspendRequest(cx);
</span><del>-                status = switch_ivr_originate(session, &amp;peer_session, &amp;jss-&gt;cause, dest, to ? atoi(to) : 60, NULL, NULL, NULL, caller_profile, NULL, SOF_NONE);
</del><ins>+                status = switch_ivr_originate(session, &amp;peer_session, &amp;jss-&gt;cause, dest, to ? atoi(to) : 60, NULL, NULL, NULL, caller_profile, NULL, SOF_NONE, NULL);
</ins><span class="cx">                 JS_ResumeRequest(cx, saveDepth);
</span><span class="cx"> 
</span><span class="cx">                 if (status != SWITCH_STATUS_SUCCESS) {
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_core_sessionc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_core_session.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_core_session.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/switch_core_session.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -346,7 +346,9 @@
</span><span class="cx">                                                                                                                                                  const char *endpoint_name,
</span><span class="cx">                                                                                                                                                  switch_caller_profile_t *caller_profile,
</span><span class="cx">                                                                                                                                                  switch_core_session_t **new_session,
</span><del>-                                                                                                                                                 switch_memory_pool_t **pool, switch_originate_flag_t flags)
</del><ins>+                                                                                                                                                 switch_memory_pool_t **pool, 
+                                                                                                                                                 switch_originate_flag_t flags,
+                                                                                                                                                 switch_call_cause_t *cancel_cause)
</ins><span class="cx"> {
</span><span class="cx">         switch_io_event_hook_outgoing_channel_t *ptr;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_FALSE;
</span><span class="lines">@@ -408,7 +410,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if ((cause =
</span><del>-                 endpoint_interface-&gt;io_routines-&gt;outgoing_channel(session, var_event, outgoing_profile, new_session, pool, flags)) != SWITCH_CAUSE_SUCCESS) {
</del><ins>+                 endpoint_interface-&gt;io_routines-&gt;outgoing_channel(session, var_event, outgoing_profile, new_session, pool, flags, cancel_cause)) != SWITCH_CAUSE_SUCCESS) {
</ins><span class="cx">                 UNPROTECT_INTERFACE(endpoint_interface);
</span><span class="cx">                 return cause;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_cppcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_cpp.cpp (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_cpp.cpp        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/switch_cpp.cpp        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -488,7 +488,7 @@
</span><span class="cx">                 allocated = 1;
</span><span class="cx">     } else {
</span><span class="cx">                 cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
</span><del>-                if (switch_ivr_originate(a_leg ? a_leg-&gt;session : NULL, &amp;session, &amp;cause, nuuid, 60, NULL, NULL, NULL, NULL, NULL, SOF_NONE) 
</del><ins>+                if (switch_ivr_originate(a_leg ? a_leg-&gt;session : NULL, &amp;session, &amp;cause, nuuid, 60, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL) 
</ins><span class="cx">                         == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         channel = switch_core_session_get_channel(session);
</span><span class="cx">                         allocated = 1;
</span><span class="lines">@@ -993,7 +993,8 @@
</span><span class="cx">                                                          NULL, 
</span><span class="cx">                                                          NULL,
</span><span class="cx">                                                          NULL,
</span><del>-                                                         SOF_NONE) != SWITCH_STATUS_SUCCESS) {
</del><ins>+                                                         SOF_NONE,
+                                                         NULL) != SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, &quot;Error Creating Outgoing Channel! [%s]\n&quot;, dest);
</span><span class="cx">                 goto failed;
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_ivr_originatec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_ivr_originate.c (15564 => 15565)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_ivr_originate.c        2009-11-20 02:15:49 UTC (rev 15564)
+++ freeswitch/trunk/src/switch_ivr_originate.c        2009-11-20 02:17:08 UTC (rev 15565)
</span><span class="lines">@@ -1141,6 +1141,7 @@
</span><span class="cx">         switch_core_session_t *session;
</span><span class="cx">         switch_core_session_t *bleg;
</span><span class="cx">         switch_call_cause_t cause;
</span><ins>+        switch_call_cause_t cancel_cause;
</ins><span class="cx">         const char *bridgeto;
</span><span class="cx">         uint32_t timelimit_sec;
</span><span class="cx">         const switch_state_handler_table_t *table;
</span><span class="lines">@@ -1152,6 +1153,7 @@
</span><span class="cx">         switch_status_t status;
</span><span class="cx">         int done;
</span><span class="cx">         switch_thread_t *thread;
</span><ins>+        switch_mutex_t *mutex;
</ins><span class="cx"> } enterprise_originate_handle_t;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -1174,12 +1176,22 @@
</span><span class="cx">                                                                                   handle-&gt;cid_num_override,
</span><span class="cx">                                                                                   handle-&gt;caller_profile_override,
</span><span class="cx">                                                                                   handle-&gt;ovars,
</span><del>-                                                                                  handle-&gt;flags
</del><ins>+                                                                                  handle-&gt;flags,
+                                                                                  &amp;handle-&gt;cancel_cause
</ins><span class="cx">                                                                                   );
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">         handle-&gt;done = 1;
</span><ins>+        switch_mutex_lock(handle-&gt;mutex);
+        switch_mutex_unlock(handle-&gt;mutex);
</ins><span class="cx">         
</span><ins>+        if (handle-&gt;done != 2) {
+                if (handle-&gt;status == SWITCH_STATUS_SUCCESS) {
+                        switch_channel_hangup(switch_core_session_get_channel(handle-&gt;bleg), SWITCH_CAUSE_LOSE_RACE);
+                        switch_core_session_rwunlock(handle-&gt;bleg);
+                }
+        }
+
</ins><span class="cx">         return NULL;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1236,7 +1248,7 @@
</span><span class="cx">         char *data;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_FALSE;
</span><span class="cx">         switch_threadattr_t *thd_attr = NULL;
</span><del>-        int running = 0;
</del><ins>+        int running = 0, over = 0;
</ins><span class="cx">         switch_status_t tstatus = SWITCH_STATUS_FALSE;
</span><span class="cx">         switch_memory_pool_t *pool;
</span><span class="cx">         switch_event_header_t *hi = NULL;
</span><span class="lines">@@ -1358,6 +1370,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, &quot;ignore_early_media&quot;, &quot;true&quot;);
</ins><span class="cx"> 
</span><span class="cx">         if (!(x_argc = switch_separate_string_string(data, SWITCH_ENT_ORIGINATE_DELIM, x_argv, MAX_PEERS))) {
</span><span class="cx">                 *cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
</span><span class="lines">@@ -1376,6 +1389,7 @@
</span><span class="cx">                 handles[i].session = session;
</span><span class="cx">                 handles[i].bleg = NULL;
</span><span class="cx">                 handles[i].cause = 0;
</span><ins>+                handles[i].cancel_cause = 0;
</ins><span class="cx">                 handles[i].bridgeto = x_argv[i];
</span><span class="cx">                 handles[i].timelimit_sec = timelimit_sec;
</span><span class="cx">                 handles[i].table = table;
</span><span class="lines">@@ -1384,6 +1398,8 @@
</span><span class="cx">                 handles[i].caller_profile_override = cp;
</span><span class="cx">                 switch_event_dup(&amp;handles[i].ovars, var_event);                
</span><span class="cx">                 handles[i].flags = flags;
</span><ins>+                switch_mutex_init(&amp;handles[i].mutex, SWITCH_MUTEX_NESTED, pool);
+                switch_mutex_lock(handles[i].mutex);
</ins><span class="cx">                 switch_thread_create(&amp;handles[i].thread, thd_attr, enterprise_originate_thread, &amp;handles[i], pool);
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -1412,26 +1428,33 @@
</span><span class="cx"> 
</span><span class="cx">         for(;;) {
</span><span class="cx">                 running = 0;
</span><ins>+                over = 0;
</ins><span class="cx">                 
</span><span class="cx">                 if (channel &amp;&amp; !switch_channel_ready(channel)) {
</span><span class="cx">                         break;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 for(i = 0; i &lt; x_argc; i++) {
</span><ins>+
+
</ins><span class="cx">                         if (handles[i].done == 0) {
</span><span class="cx">                                 running++;
</span><span class="cx">                         } else if (handles[i].done == 1) {
</span><span class="cx">                                 if (handles[i].status == SWITCH_STATUS_SUCCESS) {
</span><ins>+                                        handles[i].done = 2;
</ins><span class="cx">                                         hp = &amp;handles[i];
</span><span class="cx">                                         goto done;
</span><span class="cx">                                 } else {
</span><del>-                                        handles[i].done = 2;
</del><ins>+                                        handles[i].done = -1;
</ins><span class="cx">                                 }
</span><ins>+                        } else {
+                                over++;
</ins><span class="cx">                         }
</span><del>-                        switch_cond_next();
</del><ins>+
+                        switch_yield(10000);
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if (!running) {
</del><ins>+                if (!running || over == x_argc) {
</ins><span class="cx">                         break;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -1439,36 +1462,39 @@
</span><span class="cx"> 
</span><span class="cx">  done:
</span><span class="cx"> 
</span><del>-        if (channel &amp;&amp; rb_data.thread) {
-                switch_channel_set_flag(channel, CF_NOT_READY);
-                switch_thread_join(&amp;tstatus, rb_data.thread);
-                switch_channel_clear_flag(channel, CF_NOT_READY);
</del><ins>+        if (hp) {
+                *cause = hp-&gt;cause;
+                status = hp-&gt;status;
+                *bleg = hp-&gt;bleg;
+                switch_mutex_unlock(hp-&gt;mutex);
+                switch_thread_join(&amp;tstatus, hp-&gt;thread);
+                switch_event_destroy(&amp;hp-&gt;ovars);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        for(i = 0; i &lt; x_argc; i++) {
+                if (hp == &amp;handles[i]) {
+                        continue;
+                }
+                handles[i].cancel_cause = SWITCH_CAUSE_LOSE_RACE;
+        }
</ins><span class="cx"> 
</span><span class="cx">         for(i = 0; i &lt; x_argc; i++) {
</span><del>-                if (hp &amp;&amp; hp == &amp;handles[i]) {
</del><ins>+                if (hp == &amp;handles[i]) {
</ins><span class="cx">                         continue;
</span><span class="cx">                 }
</span><del>-                if (handles[i].bleg) {
-                        switch_channel_hangup(switch_core_session_get_channel(handles[i].bleg), SWITCH_CAUSE_LOSE_RACE);
-                        switch_core_session_rwunlock(handles[i].bleg);
-                }
-
-                handles[i].cause = SWITCH_CAUSE_LOSE_RACE;
</del><ins>+                switch_mutex_unlock(handles[i].mutex);
</ins><span class="cx">                 switch_thread_join(&amp;tstatus, handles[i].thread);
</span><span class="cx">                 switch_event_destroy(&amp;handles[i].ovars);
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx"> 
</span><del>-        if (hp) {
-                *cause = hp-&gt;cause;
-                status = hp-&gt;status;
-                *bleg = hp-&gt;bleg;
-                switch_thread_join(&amp;tstatus, hp-&gt;thread);
-                switch_event_destroy(&amp;hp-&gt;ovars);
</del><ins>+        if (channel &amp;&amp; rb_data.thread) {
+                switch_channel_set_flag(channel, CF_NOT_READY);
+                switch_thread_join(&amp;tstatus, rb_data.thread);
+                switch_channel_clear_flag(channel, CF_NOT_READY);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx">  end:
</span><span class="cx"> 
</span><span class="cx">         if (var_event &amp;&amp; var_event != ovars) {
</span><span class="lines">@@ -1498,7 +1524,8 @@
</span><span class="cx">                                                                                                          const char *cid_num_override,
</span><span class="cx">                                                                                                          switch_caller_profile_t *caller_profile_override, 
</span><span class="cx">                                                                                                          switch_event_t *ovars,
</span><del>-                                                                                                         switch_originate_flag_t flags
</del><ins>+                                                                                                         switch_originate_flag_t flags,
+                                                                                                         switch_call_cause_t *cancel_cause
</ins><span class="cx">                                                                                                          )
</span><span class="cx"> {
</span><span class="cx">         originate_status_t originate_status[MAX_PEERS] = { { 0 } }; 
</span><span class="lines">@@ -1547,7 +1574,6 @@
</span><span class="cx">                                                                                   caller_profile_override, ovars, flags);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-
</del><span class="cx">         oglobals.ringback_ok = 1;
</span><span class="cx"> 
</span><span class="cx">         if (session) {
</span><span class="lines">@@ -2218,7 +2244,7 @@
</span><span class="cx">                                 switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, &quot;originate_early_media&quot;, oglobals.early_ok ? &quot;true&quot; : &quot;false&quot;);
</span><span class="cx"> 
</span><span class="cx">                                 if ((reason = switch_core_session_outgoing_channel(oglobals.session, var_event, chan_type, 
</span><del>-                                                                                                                                   new_profile, &amp;new_session, &amp;pool, myflags)) != SWITCH_CAUSE_SUCCESS) {
</del><ins>+                                                                                                                                   new_profile, &amp;new_session, &amp;pool, myflags, cancel_cause)) != SWITCH_CAUSE_SUCCESS) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, &quot;Cannot create outgoing channel of type [%s] cause: [%s]\n&quot;, 
</span><span class="cx">                                                                           chan_type, switch_channel_cause2str(reason));
</span><span class="cx">                                         
</span><span class="lines">@@ -2439,11 +2465,16 @@
</span><span class="cx">                                 oglobals.ringback_ok = 0;
</span><span class="cx">                         }
</span><span class="cx">                         
</span><del>-                        *cause = 0;
-                        while (*cause == 0 &amp;&amp; ((!caller_channel || switch_channel_ready(caller_channel) || switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE))) &amp;&amp; 
-                                   check_channel_status(&amp;oglobals, originate_status, and_argc)) {
</del><ins>+                        while ((!caller_channel || switch_channel_ready(caller_channel) || switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE)) &amp;&amp;
+                   check_channel_status(&amp;oglobals, originate_status, and_argc)) {
</ins><span class="cx">                                 time_t elapsed = switch_epoch_time_now(NULL) - start;
</span><span class="cx">                                 
</span><ins>+                                if (cancel_cause &amp;&amp; *cancel_cause &gt; 0) {
+                                        force_reason = *cancel_cause;
+                                        oglobals.idx = IDX_CANCEL;
+                                        goto notready;
+                                }
+
</ins><span class="cx">                                 check_per_channel_timeouts(&amp;oglobals, originate_status, and_argc, start);
</span><span class="cx"> 
</span><span class="cx">                                 if (oglobals.session) {
</span><span class="lines">@@ -2603,11 +2634,7 @@
</span><span class="cx">                                 }
</span><span class="cx">                                 
</span><span class="cx">                         }
</span><del>-
-                        if (*cause) {
-                                force_reason = *cause;
-                        }
-
</del><ins>+                        
</ins><span class="cx">                   notready:
</span><span class="cx"> 
</span><span class="cx">                         if (caller_channel) {
</span><span class="lines">@@ -2812,7 +2839,7 @@
</span><span class="cx">                             switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(originate_status[i].peer_session));
</span><span class="cx">                                                         holding = NULL;
</span><span class="cx">                         } else {
</span><del>-                                                        switch_channel_hangup(originate_status[i].peer_channel, reason);
</del><ins>+                                                        switch_channel_hangup(originate_status[i].peer_channel, force_reason ? force_reason : reason);
</ins><span class="cx">                                                 }
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>