<div dir="ltr"><div><div><div><div>Thanks for the all the helping. Now I have beaten this issue to death.<br><br></div>I did a SIP tracing. Peter is right on money. My SIP provider does not like &quot;0000000000&quot; to be caller id number. To be specific and to add confusion, their server doesn&#39;t like if it is 10 zero&#39;s. (All other cases are fine, e.g, 9 zero&#39;s!)  Their server would return service not available .  That is why we see NORMAL_TEMPORARY_FAILURE.<br>
<br></div>It is good to know the world is still sane, except for the little 10 zero quirk from IDT. :)<br><br></div>Cheers. And happy new year.<br><br></div>Jun<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Dec 31, 2013 at 9:44 AM, Sean Devoy <span dir="ltr">&lt;<a href="mailto:sdevoy@bizfocused.com" target="_blank">sdevoy@bizfocused.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">Your first “set”  line has a typo:<u></u><u></u></span></p><div class="im">
<p class="MsoNormal">   &lt;action application=&quot;set&quot; data=&quot;origination_caller_id_number=${outbound_calller_id_number&quot;/&gt;<span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a"><u></u><u></u></span></p>

</div><p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">It is missing the closing “}” on
</span>${outbound_calller_id_number&quot;. So origination_caller_id_number is not being set. 
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I think that is why these fail:<span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a"><u></u><u></u></span></p><div class="im">
<p class="MsoNormal">      &lt;!--action application=&quot;bridge&quot; data=&quot;sofia/gateway/${default_gateway}/$1&quot;/--&gt; 
<span style="background:red">&lt;== NOT WORK</span><br>
      &lt;!--action application=&quot;bridge&quot; data=&quot;sofia/gateway/idt/$1&quot;/--&gt; <span style="background:red">
&lt;== NOT WORK</span><br>
<br>
<span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a"><u></u><u></u></span></p>
</div><p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">As per the wiki, effective_caller_id_number cannot be set in an origination string, so this fails:<u></u><u></u></span></p>
<div class="im">
<p class="MsoNormal">&lt;action application=&quot;bridge&quot; data=&quot;{effective_caller_id_number=111111}sofia/gateway/${default_gateway}/$1&quot;/&gt; 
<span style="background:red">&lt;== NOT WORK</span><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a"><u></u> <u></u></span></p>
</div><p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">And this works because you are finally assigning a value to
</span>origination_caller_id_number<span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">:<u></u><u></u></span></p><div class="im">
<p class="MsoNormal">&lt;!--action application=&quot;bridge&quot; data=&quot;{origination_caller_id_number=111111}sofia/gateway/${default_gateway}/$1&quot;/--&gt;
<span style="background:lime">&lt;== WORKS<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a"><u></u> <u></u></span></p>
</div><p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">Use the LOG application to check your values before the bridge statement, like this:<u></u><u></u></span></p>
<div style="border:dashed #2f6fab 1.0pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#f9f9f9">
<p class="MsoNormal" style="line-height:15.6pt;background:#f9f9f9;border:none;padding:0in">
<span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&lt;action application=&quot;log&quot; data=&quot;INFO
</span>origination_caller_id_number<span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> is $</span>origination_caller_id_number<span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> &quot;/&gt;<u></u><u></u></span></p>

</div>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">Hope that helps,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">Sean<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>]
<b>On Behalf Of </b>Jun Sun<br>
<b>Sent:</b> Monday, December 30, 2013 5:59 PM</span></p><div><div class="h5"><br>
<b>To:</b> FreeSWITCH Users Help<br>
<b>Subject:</b> Re: [Freeswitch-users] strange behavior in setting origination_caller_id_number<u></u><u></u></div></div><p></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Switching to &quot;{}&quot; makes no difference here. See the updated rules below.
<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">This is driving me nuts because there is no way for me to set caller id dynamically (because I cannot do that inside the data field). Why would freeswitch ignore channel variable set? And why would it insist
 on origination_caller_id_number?<br>
<br>
  &lt;extension name=&quot;<a href="http://domestic.example.com" target="_blank">domestic.example.com</a>&quot;&gt;<br>
    &lt;condition field=&quot;${toll_allow}&quot; expression=&quot;domestic&quot;/&gt;<br>
    &lt;condition field=&quot;destination_number&quot; expression=&quot;^(\d{11})$&quot;&gt;<br>
      &lt;action application=&quot;set&quot; data=&quot;origination_caller_id_number=${outbound_calller_id_number&quot;/&gt;<br>
      &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=${outbound_caller_id_number}&quot;/&gt;<br>
      &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_name=${outbound_caller_id_name}&quot;/&gt;<br>
      &lt;!--action application=&quot;bridge&quot; data=&quot;sofia/gateway/${default_gateway}/$1&quot;/--&gt; 
<span style="background:red">&lt;== NOT WORK</span><br>
      &lt;!--action application=&quot;bridge&quot; data=&quot;sofia/gateway/idt/$1&quot;/--&gt; <span style="background:red">
&lt;== NOT WORK</span><br>
      &lt;!--action application=&quot;bridge&quot; data=&quot;{origination_caller_id_number=$${outbound_caller_id_number}}sofia/gateway/${default_gateway}/$1&quot;/--&gt;
<span style="background:red">&lt;== NOT WORK</span><br>
      &lt;action application=&quot;bridge&quot; data=&quot;{effective_caller_id_number=111111}sofia/gateway/${default_gateway}/$1&quot;/&gt; 
<span style="background:red">&lt;== NOT WORK</span><br>
      &lt;!--action application=&quot;bridge&quot; data=&quot;{origination_caller_id_number=111111}sofia/gateway/${default_gateway}/$1&quot;/--&gt;
<span style="background:lime">&lt;== WORKS</span><br>
      &lt;!--action application=&quot;bridge&quot; data=&quot;[origination_caller_id_number=111111]sofia/gateway/${default_gateway}/$1&quot;/--&gt; 
<span style="background:lime">&lt;== WORKS</span><br>
    &lt;/condition&gt;<br>
  &lt;/extension&gt;<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">IN the case when it does not work, I got NORMAL_TEMPORARY_FAILURE:<br>
<br>
2013-12-30 22:53:12.876331 [NOTICE] sofia.c:6623 Hangup sofia/external/<a href="tel:15102991913" value="+15102991913" target="_blank">15102991913</a> [CS_CONSUME_MEDIA] [NORMAL_TEMPORARY_FAILURE]<u></u><u></u></p>
</div>
<p class="MsoNormal">Cheers.<br>
<br>
Jun<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Mon, Dec 30, 2013 at 12:13 PM, Sean Devoy &lt;<a href="mailto:sdevoy@bizfocused.com" target="_blank">sdevoy@bizfocused.com</a>&gt; wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">I use {} and I am not familiar with [] in the bridge statement. Try,</span><u></u><u></u></p>
<div>
<p class="MsoNormal">&lt; action application=&quot;bridge&quot; data=&quot;{effective_caller_id_number=111111}sofia/gateway/idt/$1&quot; /&gt; <u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a"> </span><u></u><u></u></p>
</div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">
<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>]
<b>On Behalf Of </b>Jun Sun<br>
<b>Sent:</b> Monday, December 30, 2013 1:46 PM<br>
<b>To:</b> FreeSWITCH Users Help<br>
<b>Subject:</b> Re: [Freeswitch-users] strange behavior in setting origination_caller_id_number</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">Any takers of this challenge? :)<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Jun<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"> <u></u><u></u></p>
<div>
<p class="MsoNormal">On Sun, Dec 29, 2013 at 9:38 AM, Jun Sun &lt;<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>&gt; wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal"><br>
Sorry! The 2nd &quot;NOT WORK&quot; example was meant to show setting &quot;effective_caller_id_number&quot;, not &quot;origination_caller_id_number&quot;. So the correct dialplan is as follows.<u></u><u></u></p>
<div>
<p class="MsoNormal"><br>
<br>
 &lt;extension name=&quot;<a href="http://domestic.example.com" target="_blank">domestic.example.com</a>&quot;&gt;<br>
    &lt;condition field=&quot;${toll_allow}&quot; expression=&quot;domestic&quot;/&gt;<br>
    &lt;condition field=&quot;destination_number&quot; expression=&quot;^(\d{11})$&quot;&gt;<br>
      &lt;action application=&quot;set&quot; data=&quot;origination_caller_id_number=11111111&quot;/&gt; <br>
      &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=${outbound_caller_id_number}&quot;/&gt;<br>
      &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=${outbound_caller_id_number}&quot;/&gt;<br>
      &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_name=${outbound_caller_id_name}&quot;/&gt;<br>
      &lt;!--action application=&quot;bridge&quot; data=&quot;sofia/gateway/idt/$1&quot;/--&gt;   <span style="color:#990000">
&lt;=== NOT WORK</span><u></u><u></u></p>
</div>
<p class="MsoNormal">      &lt;!--action application=&quot;bridge&quot; data=&quot;[effective_caller_id_number=111111]sofia/gateway/idt/$1&quot;/--&gt;  
<span style="color:#990000">&lt;=== NOT WORK</span><u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
      &lt;action application=&quot;bridge&quot; data=&quot;[origination_caller_id_number=111111]sofia/gateway/idt/$1&quot;/&gt;
<span style="color:#990000">&lt;=== WORKS!!</span><br>
    &lt;/condition&gt;<br>
  &lt;/extension&gt;<u></u><u></u></p>
</div>
<p class="MsoNormal">Cheers.<span style="color:#888888"><br>
<br>
Jun</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><br>
<br>
On 12/29/2013 9:25 AM, Jun Sun wrote:<u></u><u></u></p>
</div>
</div>
</div>
<div>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"> 
<br>
I have a very simple call plan to allow internal extension to call external PSTN numbers. See below.<br>
<br>
 &lt;extension name=&quot;<a href="http://domestic.example.com" target="_blank">domestic.example.com</a>&quot;&gt;<br>
    &lt;condition field=&quot;${toll_allow}&quot; expression=&quot;domestic&quot;/&gt;<br>
    &lt;condition field=&quot;destination_number&quot; expression=&quot;^(\d{11})$&quot;&gt;<br>
      &lt;action application=&quot;set&quot; data=&quot;origination_caller_id_number=11111111&quot;/&gt; <br>
      &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=${outbound_caller_id_number}&quot;/&gt;<br>
      &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=${outbound_caller_id_number}&quot;/&gt;<br>
      &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_name=${outbound_caller_id_name}&quot;/&gt;<br>
      &lt;!--action application=&quot;bridge&quot; data=&quot;sofia/gateway/idt/$1&quot;/--&gt;   <span style="color:#990000">
&lt;=== NOT WORK</span><br>
      &lt;!--action application=&quot;bridge&quot; data=&quot;[origination_caller_id_number=111111]sofia/gateway/idt/$1&quot;/--&gt;  
<span style="color:#990000">&lt;=== NOT WORK</span><br>
      &lt;action application=&quot;bridge&quot; data=&quot;[origination_caller_id_number=111111]sofia/gateway/idt/$1&quot;/&gt;
<span style="color:#990000">&lt;=== WORKS!!</span><br>
    &lt;/condition&gt;<br>
  &lt;/extension&gt;<br>
<br>
There a couple of things strange here:<br>
<br>
1. I have to put origination_caller_id_number inside data field of &quot;bridge&quot; application in order for the dialing out to happen.  Why putting it outside as channel variable does not work?<br>
<br>
2. Actually because bridge command is for leg-B, really it should be &quot;effective_caller_id_number&quot; not &quot;origination_caller_id_number&quot;.  Is that right?<br>
<br>
I&#39;m using IDT express as SIP carrier. I don&#39;t know if they changed something or I changed configuration in freeswitch. Now it seems I have to set origination_caller_id_number if I want to use IDT for outbound calls.<br>

<br>
I&#39;d really appreciate your help.<br>
<br>
Cheers.<br>
<br>
Jun<u></u><u></u></p>
</blockquote>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>