<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://docs.yate.ro/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://docs.yate.ro/wiki/index.php?action=history&amp;feed=atom&amp;title=Altering_release_cause</id>
		<title>Altering release cause - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://docs.yate.ro/wiki/index.php?action=history&amp;feed=atom&amp;title=Altering_release_cause"/>
		<link rel="alternate" type="text/html" href="https://docs.yate.ro/wiki/index.php?title=Altering_release_cause&amp;action=history"/>
		<updated>2026-05-17T04:43:41Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.1</generator>

	<entry>
		<id>https://docs.yate.ro/wiki/index.php?title=Altering_release_cause&amp;diff=7270&amp;oldid=prev</id>
		<title>Monica at 16:09, 31 October 2013</title>
		<link rel="alternate" type="text/html" href="https://docs.yate.ro/wiki/index.php?title=Altering_release_cause&amp;diff=7270&amp;oldid=prev"/>
				<updated>2013-10-31T16:09:49Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 16:09, 31 October 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; Message.install(onDisconnected,&amp;quot;chan.disconnected&amp;quot;,80);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; Message.install(onDisconnected,&amp;quot;chan.disconnected&amp;quot;,80);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Javascript]] [[Category:Change reason]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Monica</name></author>	</entry>

	<entry>
		<id>https://docs.yate.ro/wiki/index.php?title=Altering_release_cause&amp;diff=7129&amp;oldid=prev</id>
		<title>Monica: /* Example */</title>
		<link rel="alternate" type="text/html" href="https://docs.yate.ro/wiki/index.php?title=Altering_release_cause&amp;diff=7129&amp;oldid=prev"/>
				<updated>2013-10-25T12:15:35Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Example&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 12:15, 25 October 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The following [[Javascript]] is an example of altering the release cause. The script can be placed in the share/scripts directory and be configured in javascript.conf&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The following [[Javascript]] is an example of altering the release cause. The script can be placed in the share/scripts directory and be configured in javascript.conf&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;In javascript.conf&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; [scripts]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; alter_cause=alter_release_cause.js&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; alter_cause=alter_release_cause.js&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Monica</name></author>	</entry>

	<entry>
		<id>https://docs.yate.ro/wiki/index.php?title=Altering_release_cause&amp;diff=6835&amp;oldid=prev</id>
		<title>Paulc: /* Example */</title>
		<link rel="alternate" type="text/html" href="https://docs.yate.ro/wiki/index.php?title=Altering_release_cause&amp;diff=6835&amp;oldid=prev"/>
				<updated>2013-09-09T15:37:49Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Example&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 15:37, 9 September 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  break;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  break;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160;  case /^h323/:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160;  case /^h323&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\/&lt;/ins&gt;/:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  // Cause propagated to H.323&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  // Cause propagated to H.323&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  switch (msg.reason) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  switch (msg.reason) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Paulc</name></author>	</entry>

	<entry>
		<id>https://docs.yate.ro/wiki/index.php?title=Altering_release_cause&amp;diff=6834&amp;oldid=prev</id>
		<title>Paulc: Created page with &quot;Yate provides a default mapping from the call release cause of the call leg that initiated the release.  You may want to alter the release cause or to enforce specific mapping...&quot;</title>
		<link rel="alternate" type="text/html" href="https://docs.yate.ro/wiki/index.php?title=Altering_release_cause&amp;diff=6834&amp;oldid=prev"/>
				<updated>2013-09-09T15:36:59Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;Yate provides a default mapping from the call release cause of the call leg that initiated the release.  You may want to alter the release cause or to enforce specific mapping...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Yate provides a default mapping from the call release cause of the call leg that initiated the release.&lt;br /&gt;
&lt;br /&gt;
You may want to alter the release cause or to enforce specific mappings per protocol.&lt;br /&gt;
&lt;br /&gt;
== Concept ==&lt;br /&gt;
&lt;br /&gt;
When a call leg is released a cause code is received over the protocol or is generated locally in case of an error.&lt;br /&gt;
&lt;br /&gt;
The peer of the hung up call leg gets disconnected. At this stage it sends a [[chan.disconnected]] message that can be used to prevent the call release or to alter the propagated release cause.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
The following [[Javascript]] is an example of altering the release cause. The script can be placed in the share/scripts directory and be configured in javascript.conf&lt;br /&gt;
 alter_cause=alter_release_cause.js&lt;br /&gt;
&lt;br /&gt;
Content of a very simple script:&lt;br /&gt;
 function onDisconnected(msg) {&lt;br /&gt;
     if (msg.reason == &amp;quot;congestion&amp;quot;)&lt;br /&gt;
         msg.reason = &amp;quot;busy&amp;quot;;&lt;br /&gt;
     return false;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 Message.install(onDisconnected,&amp;quot;chan.disconnected&amp;quot;,80);&lt;br /&gt;
&lt;br /&gt;
A more complex script:&lt;br /&gt;
 function onDisconnected(msg) {&lt;br /&gt;
     var newreason = false;&lt;br /&gt;
     switch (msg.id) {&lt;br /&gt;
         case /^sip\//:&lt;br /&gt;
             // Cause propagated to SIP&lt;br /&gt;
             switch (msg.lastpeerid) {&lt;br /&gt;
                 case /^sip\//:&lt;br /&gt;
                     // SIP to SIP&lt;br /&gt;
                     switch (msg.reason) {&lt;br /&gt;
                         case &amp;quot;noroute&amp;quot;:&lt;br /&gt;
                             newreason = &amp;quot;congestion&amp;quot;;&lt;br /&gt;
                             break;&lt;br /&gt;
                         case &amp;quot;rejected&amp;quot;:&lt;br /&gt;
                             newreason = &amp;quot;forbidden&amp;quot;;&lt;br /&gt;
                             break;&lt;br /&gt;
                     }&lt;br /&gt;
                     break;&lt;br /&gt;
             }&lt;br /&gt;
             break;&lt;br /&gt;
         case /^h323/:&lt;br /&gt;
             // Cause propagated to H.323&lt;br /&gt;
             switch (msg.reason) {&lt;br /&gt;
                 case &amp;quot;congestion&amp;quot;:&lt;br /&gt;
                     newreason = &amp;quot;busy&amp;quot;;&lt;br /&gt;
                     break;&lt;br /&gt;
             }&lt;br /&gt;
             break;&lt;br /&gt;
     }&lt;br /&gt;
     if (newreason) {&lt;br /&gt;
         Engine.debug(Engine.DebugInfo,&amp;quot;Changing end reason '&amp;quot; + msg.reason + &amp;quot;' to '&amp;quot; + newreason + &amp;quot;'&amp;quot;);&lt;br /&gt;
         msg.reason = newreason;&lt;br /&gt;
     }&lt;br /&gt;
     return false;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 Message.install(onDisconnected,&amp;quot;chan.disconnected&amp;quot;,80);&lt;/div&gt;</summary>
		<author><name>Paulc</name></author>	</entry>

	</feed>