<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://docs.telcobridges.com/mediawiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://docs.telcobridges.com/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Routing_script_tutorial%3Aroute_remap_Tutorial</id>
		<title>Routing script tutorial:route remap Tutorial - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://docs.telcobridges.com/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Routing_script_tutorial%3Aroute_remap_Tutorial"/>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/mediawiki/index.php?title=Routing_script_tutorial:route_remap_Tutorial&amp;action=history"/>
		<updated>2026-06-01T01:51:35Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.18.1</generator>

	<entry>
		<id>https://docs.telcobridges.com/mediawiki/index.php?title=Routing_script_tutorial:route_remap_Tutorial&amp;diff=15455&amp;oldid=prev</id>
		<title>Abrassard: /* route_remap tutorial */</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/mediawiki/index.php?title=Routing_script_tutorial:route_remap_Tutorial&amp;diff=15455&amp;oldid=prev"/>
				<updated>2014-06-03T14:04:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;route_remap tutorial&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 14:04, 3 June 2014&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&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;== route_remap tutorial ==&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;== route_remap tutorial ==&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;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;'route_remap' is a method implemented in the base_routing and is use to modify call parameters. This tutorial will explain how to use the parameter for the 'route_remap' method. &amp;#160;&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;'route_remap' is a method implemented in the base_routing and is use to modify call parameters &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;per route (allowing to change call attributes in a different manner per route)&lt;/ins&gt;. This tutorial will explain how to use the parameter for the 'route_remap' method. &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;/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;=== route_remap examples ===&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;=== route_remap examples ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:5729:newid:15455 --&gt;
&lt;/table&gt;</summary>
		<author><name>Abrassard</name></author>	</entry>

	<entry>
		<id>https://docs.telcobridges.com/mediawiki/index.php?title=Routing_script_tutorial:route_remap_Tutorial&amp;diff=5729&amp;oldid=prev</id>
		<title>Lucas Trottier: Replace remapped_fields by call_params</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/mediawiki/index.php?title=Routing_script_tutorial:route_remap_Tutorial&amp;diff=5729&amp;oldid=prev"/>
				<updated>2010-03-24T20:37:47Z</updated>
		
		<summary type="html">&lt;p&gt;Replace remapped_fields by call_params&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 20:37, 24 March 2010&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 44:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 44:&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; route_remap :call_field_name =&amp;gt; :called, :route_field_name =&amp;gt; :called&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; route_remap :call_field_name =&amp;gt; :called, :route_field_name =&amp;gt; :called&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; route_remap :method =&amp;gt; :remapped_tutorial&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; route_remap :method =&amp;gt; :remapped_tutorial&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; route_remap :proc =&amp;gt; Proc.new { |route, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;call&lt;/del&gt;, nap_list, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;remapped_fields&lt;/del&gt;|&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; route_remap :proc =&amp;gt; Proc.new { |route, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;caf_call&lt;/ins&gt;, nap_list, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;call_params&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;&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;&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; puts &amp;quot;Proc is called&amp;quot;&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; puts &amp;quot;Proc is called&amp;quot;&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; #remapping calling&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; #remapping calling&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; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;if remapped_fields[:calling].nil?&lt;/del&gt;&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; remap_calling = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;call_params&lt;/ins&gt;[:calling]&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; remap_calling = call.get(:calling)&lt;/del&gt;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &lt;/ins&gt;puts &amp;quot;remapped : #{remap_calling}&amp;quot;&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; puts &amp;quot;call : #{remap_calling}&amp;quot;&lt;/del&gt;&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;&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; else&lt;/del&gt;&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;&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;/del&gt;remap_calling = &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;remapped_fields&lt;/del&gt;[:calling]&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;&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;/del&gt;puts &amp;quot;remapped : #{remap_calling}&amp;quot;&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;&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; end&lt;/del&gt;&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;&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;&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;&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; if( remap_calling == &amp;quot;5550000&amp;quot; )&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; if( remap_calling == &amp;quot;5550000&amp;quot; )&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 63:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 58:&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;&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;&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; puts &amp;quot;remap_calling : #{remap_calling}&amp;quot;&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; puts &amp;quot;remap_calling : #{remap_calling}&amp;quot;&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; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;remapped_fields&lt;/del&gt;[:calling] = remap_calling&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; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;call_params&lt;/ins&gt;[:calling] = remap_calling&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;&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;&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; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;remapped_fields&lt;/del&gt;&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; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;call_params&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; }&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; }&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;&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;&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; def remapped_tutorial(route, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;call&lt;/del&gt;, nap_list, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;remapped_fields&lt;/del&gt;)&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; def remapped_tutorial(route, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;caf_call&lt;/ins&gt;, nap_list, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;call_params&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;&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;&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; puts &amp;quot;Method is called&amp;quot;&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; puts &amp;quot;Method is called&amp;quot;&amp;#160; &amp;#160;&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; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;if remapped_fields[:calling].nil?&lt;/del&gt;&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; remap_calling = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;call_params&lt;/ins&gt;[:calling]&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; remap_calling = call.get(:calling)&lt;/del&gt;&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &lt;/ins&gt;puts &amp;quot;remapped : #{remap_calling}&amp;quot;&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; puts &amp;quot;call : #{remap_calling}&amp;quot;&lt;/del&gt;&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;&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; else&lt;/del&gt;&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;&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;/del&gt;remap_calling = &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;remapped_fields&lt;/del&gt;[:calling]&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;&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;/del&gt;puts &amp;quot;remapped : #{remap_calling}&amp;quot;&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;&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; end&lt;/del&gt;&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;&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;&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;&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; if( remap_calling == &amp;quot;5550000&amp;quot; )&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; if( remap_calling == &amp;quot;5550000&amp;quot; )&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 86:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 76:&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;&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;&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; puts &amp;quot;remap_calling : #{remap_calling}&amp;quot;&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; puts &amp;quot;remap_calling : #{remap_calling}&amp;quot;&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; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;remapped_fields&lt;/del&gt;[:calling] = remap_calling&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; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;call_params&lt;/ins&gt;[:calling] = remap_calling&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;&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;&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; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;remapped_fields&lt;/del&gt;&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; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;call_params&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;&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;&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; end&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; end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 114:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 104:&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;As for the :method and :proc parameters, they both remap the calling number but to different values. &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;As for the :method and :proc parameters, they both remap the calling number but to different values. &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;/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;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;It is important when remapping to always verify the remapped_fields parameter. If some parameters were remapped previously, the changes will be supply in the remapped_fields (4th parameter of your method or proc). &lt;/del&gt;The remapping result needs to &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;put &lt;/del&gt;in &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;that &lt;/del&gt;hash and return in your method or proc. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;It is possible though that you may want to overwrite the change done previously, &lt;/del&gt;in &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;that case use directly &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;call parameter but of course you will need to order your 'route_remap' accordingly&lt;/del&gt;. They are executed in the order they are declared&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/del&gt;&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;The remapping result needs to &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;be inserted &lt;/ins&gt;in &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;call_params &lt;/ins&gt;hash and return in your method or proc. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;All remap function return remapped parameter &lt;/ins&gt;in the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;call_params&lt;/ins&gt;. They are executed in the order they are declared.&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;&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;&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The actual changes on the call will only be &amp;quot;merged&amp;quot; after all the remapping are done&lt;/del&gt;.&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;&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;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;Here is the output of the example:&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;Here is the output of the example:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:564:newid:5729 --&gt;
&lt;/table&gt;</summary>
		<author><name>Lucas Trottier</name></author>	</entry>

	<entry>
		<id>https://docs.telcobridges.com/mediawiki/index.php?title=Routing_script_tutorial:route_remap_Tutorial&amp;diff=564&amp;oldid=prev</id>
		<title>10.0.0.157 at 15:21, 20 May 2009</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/mediawiki/index.php?title=Routing_script_tutorial:route_remap_Tutorial&amp;diff=564&amp;oldid=prev"/>
				<updated>2009-05-20T15:21:05Z</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 15:21, 20 May 2009&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&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;=== route_remap examples ===&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;=== route_remap examples ===&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 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;Things to know about these examples:&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;Things to know about these examples:&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;* A new field called 'priority' needs to be add to the routes.&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;* A new field called 'priority' needs to be add to the routes.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 35:&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;=== route_remap parameter ===&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;=== route_remap parameter ===&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;&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;&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;/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 example is a isdn to sip gateway. This time we will remap the called and the calling number.&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 example is a isdn to sip gateway. This time we will remap the called and the calling number.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:563:newid:564 --&gt;
&lt;/table&gt;</summary>
		<author><name>10.0.0.157</name></author>	</entry>

	<entry>
		<id>https://docs.telcobridges.com/mediawiki/index.php?title=Routing_script_tutorial:route_remap_Tutorial&amp;diff=563&amp;oldid=prev</id>
		<title>10.0.0.157: New page: == route_remap tutorial ==  'route_remap' is a method implemented in the base_routing and is use to modify call parameters. This tutorial will explain how to use the parameter for the 'rou...</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/mediawiki/index.php?title=Routing_script_tutorial:route_remap_Tutorial&amp;diff=563&amp;oldid=prev"/>
				<updated>2009-05-20T15:20:47Z</updated>
		
		<summary type="html">&lt;p&gt;New page: == route_remap tutorial ==  &amp;#039;route_remap&amp;#039; is a method implemented in the base_routing and is use to modify call parameters. This tutorial will explain how to use the parameter for the &amp;#039;rou...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== route_remap tutorial ==&lt;br /&gt;
&lt;br /&gt;
'route_remap' is a method implemented in the base_routing and is use to modify call parameters. This tutorial will explain how to use the parameter for the 'route_remap' method. &lt;br /&gt;
&lt;br /&gt;
=== route_remap examples ===&lt;br /&gt;
Things to know about these examples:&lt;br /&gt;
* A new field called 'priority' needs to be add to the routes.&lt;br /&gt;
* A new field called 'asr_threshold' needs to be add to the routes.&lt;br /&gt;
* A new field called 'usage_threshold' needs to be add to the routes.&lt;br /&gt;
&lt;br /&gt;
==== route_remap setup ====&lt;br /&gt;
&lt;br /&gt;
Time to take a look how to match route to a call. List of routes use for the example:&lt;br /&gt;
  Calling      Called      NAP      Remapped NAP       Priority&lt;br /&gt;
  5550000     1110000     isdn       sip                4     &lt;br /&gt;
  5550000     2220000     sip        isdn               3     &lt;br /&gt;
  5550000     3330000     sip_p2     isdn_1             2     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List of naps:&lt;br /&gt;
  Name       Asr threshold       Usage threshold   &lt;br /&gt;
  isdn         40                 90     &lt;br /&gt;
  sip          52                 92     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Input used in the test script window:&lt;br /&gt;
  @call_params = {:calling =&amp;gt; '5550000', :called =&amp;gt; '5550002', :nap =&amp;gt; 'isdn'}&lt;br /&gt;
  @nap_list = [&lt;br /&gt;
    {:name =&amp;gt; 'sip', },&lt;br /&gt;
    {:name =&amp;gt; 'isdn' },&lt;br /&gt;
    {:name =&amp;gt; 'sip_p3' }&lt;br /&gt;
  ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== route_remap parameter ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following example is a isdn to sip gateway. This time we will remap the called and the calling number.&lt;br /&gt;
  require 'base_routing'&lt;br /&gt;
  &lt;br /&gt;
  class RemapTutorial &amp;lt; BaseRouting&lt;br /&gt;
    route_match :call_field_name =&amp;gt; :nap&lt;br /&gt;
    route_remap :call_field_name =&amp;gt; :called, :route_field_name =&amp;gt; :called&lt;br /&gt;
    route_remap :method =&amp;gt; :remapped_tutorial&lt;br /&gt;
    route_remap :proc =&amp;gt; Proc.new { |route, call, nap_list, remapped_fields|&lt;br /&gt;
  &lt;br /&gt;
      puts &amp;quot;Proc is called&amp;quot;  &lt;br /&gt;
      #remapping calling&lt;br /&gt;
      if remapped_fields[:calling].nil?&lt;br /&gt;
        remap_calling = call.get(:calling)&lt;br /&gt;
        puts &amp;quot;call : #{remap_calling}&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        remap_calling = remapped_fields[:calling]&lt;br /&gt;
        puts &amp;quot;remapped : #{remap_calling}&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      &lt;br /&gt;
      if( remap_calling == &amp;quot;5550000&amp;quot; )&lt;br /&gt;
        remap_calling = &amp;quot;9871111&amp;quot;&lt;br /&gt;
      elsif ( remap_calling == &amp;quot;7772222&amp;quot;)&lt;br /&gt;
        remap_calling = &amp;quot;6541111&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
  &lt;br /&gt;
      puts &amp;quot;remap_calling : #{remap_calling}&amp;quot;&lt;br /&gt;
      remapped_fields[:calling] = remap_calling&lt;br /&gt;
      &lt;br /&gt;
      remapped_fields&lt;br /&gt;
    }&lt;br /&gt;
  &lt;br /&gt;
    def remapped_tutorial(route, call, nap_list, remapped_fields)&lt;br /&gt;
  &lt;br /&gt;
      puts &amp;quot;Method is called&amp;quot;  &lt;br /&gt;
      if remapped_fields[:calling].nil?&lt;br /&gt;
        remap_calling = call.get(:calling)&lt;br /&gt;
        puts &amp;quot;call : #{remap_calling}&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        remap_calling = remapped_fields[:calling]&lt;br /&gt;
        puts &amp;quot;remapped : #{remap_calling}&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      &lt;br /&gt;
      if( remap_calling == &amp;quot;5550000&amp;quot; )&lt;br /&gt;
        remap_calling = &amp;quot;7772222&amp;quot;&lt;br /&gt;
      elsif( remap_calling == &amp;quot;9871111&amp;quot; )&lt;br /&gt;
        remap_calling = &amp;quot;9992222&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      &lt;br /&gt;
      puts &amp;quot;remap_calling : #{remap_calling}&amp;quot;&lt;br /&gt;
      remapped_fields[:calling] = remap_calling&lt;br /&gt;
      &lt;br /&gt;
      remapped_fields&lt;br /&gt;
    &lt;br /&gt;
    end&lt;br /&gt;
  &lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  @@routing = RemapTutorial.new&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  def init_routes( routes )&lt;br /&gt;
    @@routing.init routes&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def route( call, nap_list )&lt;br /&gt;
    @@routing.route call, nap_list&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== route_remap script output ====&lt;br /&gt;
&lt;br /&gt;
The called number is remapped by the the :call_field_name / :route_field_name. Like 'route_match', if :call_field_name is used alone the parameter (in this case :called), will be remapped by the same parameter of :route_field_name. The following 2 lines will have the exact same behavior (they both remapped the called number of the call with the called number of the route):&lt;br /&gt;
  route_remap :call_field_name =&amp;gt; :called&lt;br /&gt;
  route_remap :call_field_name =&amp;gt; :called, :route_field_name =&amp;gt; :called&lt;br /&gt;
&lt;br /&gt;
As for the :method and :proc parameters, they both remap the calling number but to different values. &lt;br /&gt;
&lt;br /&gt;
It is important when remapping to always verify the remapped_fields parameter. If some parameters were remapped previously, the changes will be supply in the remapped_fields (4th parameter of your method or proc). The remapping result needs to put in that hash and return in your method or proc. It is possible though that you may want to overwrite the change done previously, in that case use directly the call parameter but of course you will need to order your 'route_remap' accordingly. They are executed in the order they are declared.&lt;br /&gt;
&lt;br /&gt;
The actual changes on the call will only be &amp;quot;merged&amp;quot; after all the remapping are done.&lt;br /&gt;
&lt;br /&gt;
Here is the output of the example:&lt;br /&gt;
  Call Params:&lt;br /&gt;
    Reason:        ok&lt;br /&gt;
    Called:        2220000&lt;br /&gt;
    Calling:       6541111&lt;br /&gt;
    Nap:           sip&lt;br /&gt;
  Matched route:&lt;br /&gt;
    Remapped calling:    &lt;br /&gt;
    Called:        2220000&lt;br /&gt;
    Calling:       5550000&lt;br /&gt;
    Remapped called:    &lt;br /&gt;
    Priority:      3&lt;br /&gt;
    Remapped nap:  isdn&lt;br /&gt;
    Nap:           sip&lt;br /&gt;
  Output: OUT: Method is called&lt;br /&gt;
   OUT:&lt;br /&gt;
   OUT: call : 5550000&lt;br /&gt;
   OUT:&lt;br /&gt;
   OUT: remap_calling : 7772222&lt;br /&gt;
   OUT:&lt;br /&gt;
   OUT: Proc is called&lt;br /&gt;
   OUT:&lt;br /&gt;
   OUT: remapped : 7772222&lt;br /&gt;
   OUT:&lt;br /&gt;
   OUT: remap_calling : 6541111&lt;br /&gt;
   OUT:&lt;br /&gt;
   OUT: Nap attribute must be remapped&lt;br /&gt;
   OUT:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Back to [[Routing_script_tutorial|Routing Script Tutorial]].&lt;/div&gt;</summary>
		<author><name>10.0.0.157</name></author>	</entry>

	</feed>