<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Verdana","sans-serif";
        color:#44546A;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546A">Your first “set” line has a typo:<o:p></o:p></span></p>
<p class="MsoNormal"> <action application="set" data="origination_caller_id_number=${outbound_calller_id_number"/><span style="font-family:"Verdana","sans-serif";color:#44546A"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546A">It is missing the closing “}” on
</span>${outbound_calller_id_number". So origination_caller_id_number is not being set.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I think that is why these fail:<span style="font-family:"Verdana","sans-serif";color:#44546A"><o:p></o:p></span></p>
<p class="MsoNormal"> <!--action application="bridge" data="sofia/gateway/${default_gateway}/$1"/-->
<span style="background:red"><== NOT WORK</span><br>
<!--action application="bridge" data="sofia/gateway/idt/$1"/--> <span style="background:red">
<== NOT WORK</span><br>
<br>
<span style="font-family:"Verdana","sans-serif";color:#44546A"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546A">As per the wiki, effective_caller_id_number cannot be set in an origination string, so this fails:<o:p></o:p></span></p>
<p class="MsoNormal"><action application="bridge" data="{effective_caller_id_number=111111}sofia/gateway/${default_gateway}/$1"/>
<span style="background:red"><== NOT WORK</span><span style="font-family:"Verdana","sans-serif";color:#44546A"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546A"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546A">And this works because you are finally assigning a value to
</span>origination_caller_id_number<span style="font-family:"Verdana","sans-serif";color:#44546A">:<o:p></o:p></span></p>
<p class="MsoNormal"><!--action application="bridge" data="{origination_caller_id_number=111111}sofia/gateway/${default_gateway}/$1"/-->
<span style="background:lime"><== WORKS<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546A"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546A">Use the LOG application to check your values before the bridge statement, like this:<o:p></o:p></span></p>
<div style="mso-element:para-border-div;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:"Courier New";color:black"><action application="log" data="INFO
</span>origination_caller_id_number<span style="font-size:10.0pt;font-family:"Courier New";color:black"> is $</span>origination_caller_id_number<span style="font-size:10.0pt;font-family:"Courier New";color:black"> "/><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546A"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546A">Hope that helps,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546A">Sean<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546A"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org]
<b>On Behalf Of </b>Jun Sun<br>
<b>Sent:</b> Monday, December 30, 2013 5:59 PM<br>
<b>To:</b> FreeSWITCH Users Help<br>
<b>Subject:</b> Re: [Freeswitch-users] strange behavior in setting origination_caller_id_number<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Switching to "{}" makes no difference here. See the updated rules below.
<o:p></o:p></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>
<extension name="<a href="http://domestic.example.com">domestic.example.com</a>"><br>
<condition field="${toll_allow}" expression="domestic"/><br>
<condition field="destination_number" expression="^(\d{11})$"><br>
<action application="set" data="origination_caller_id_number=${outbound_calller_id_number"/><br>
<action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/><br>
<action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"/><br>
<!--action application="bridge" data="sofia/gateway/${default_gateway}/$1"/-->
<span style="background:red"><== NOT WORK</span><br>
<!--action application="bridge" data="sofia/gateway/idt/$1"/--> <span style="background:red">
<== NOT WORK</span><br>
<!--action application="bridge" data="{origination_caller_id_number=$${outbound_caller_id_number}}sofia/gateway/${default_gateway}/$1"/-->
<span style="background:red"><== NOT WORK</span><br>
<action application="bridge" data="{effective_caller_id_number=111111}sofia/gateway/${default_gateway}/$1"/>
<span style="background:red"><== NOT WORK</span><br>
<!--action application="bridge" data="{origination_caller_id_number=111111}sofia/gateway/${default_gateway}/$1"/-->
<span style="background:lime"><== WORKS</span><br>
<!--action application="bridge" data="[origination_caller_id_number=111111]sofia/gateway/${default_gateway}/$1"/-->
<span style="background:lime"><== WORKS</span><br>
</condition><br>
</extension><o:p></o:p></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/15102991913 [CS_CONSUME_MEDIA] [NORMAL_TEMPORARY_FAILURE]<o:p></o:p></p>
</div>
<p class="MsoNormal">Cheers.<br>
<br>
Jun<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Mon, Dec 30, 2013 at 12:13 PM, Sean Devoy <<a href="mailto:sdevoy@bizfocused.com" target="_blank">sdevoy@bizfocused.com</a>> wrote:<o:p></o:p></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" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Verdana","sans-serif";color:#44546A">I use {} and I am not familiar with [] in the bridge statement. Try,</span><o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">< action application="bridge" data="{effective_caller_id_number=111111}sofia/gateway/idt/$1" /> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Verdana","sans-serif";color:#44546A"> </span><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">
<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><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Any takers of this challenge? :)<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Jun<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Sun, Dec 29, 2013 at 9:38 AM, Jun Sun <<a href="mailto:jsun@junsun.net" target="_blank">jsun@junsun.net</a>> wrote:<o:p></o:p></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" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br>
Sorry! The 2nd "NOT WORK" example was meant to show setting "effective_caller_id_number", not "origination_caller_id_number". So the correct dialplan is as follows.<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br>
<br>
<extension name="<a href="http://domestic.example.com" target="_blank">domestic.example.com</a>"><br>
<condition field="${toll_allow}" expression="domestic"/><br>
<condition field="destination_number" expression="^(\d{11})$"><br>
<action application="set" data="origination_caller_id_number=11111111"/> <br>
<action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/><br>
<action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/><br>
<action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"/><br>
<!--action application="bridge" data="sofia/gateway/idt/$1"/--> <span style="color:#990000">
<=== NOT WORK</span><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <!--action application="bridge" data="[effective_caller_id_number=111111]sofia/gateway/idt/$1"/-->
<span style="color:#990000"><=== NOT WORK</span><o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><br>
<action application="bridge" data="[origination_caller_id_number=111111]sofia/gateway/idt/$1"/>
<span style="color:#990000"><=== WORKS!!</span><br>
</condition><br>
</extension><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Cheers.<span style="color:#888888"><br>
<br>
Jun</span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br>
<br>
On 12/29/2013 9:25 AM, Jun Sun wrote:<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">
<br>
I have a very simple call plan to allow internal extension to call external PSTN numbers. See below.<br>
<br>
<extension name="<a href="http://domestic.example.com" target="_blank">domestic.example.com</a>"><br>
<condition field="${toll_allow}" expression="domestic"/><br>
<condition field="destination_number" expression="^(\d{11})$"><br>
<action application="set" data="origination_caller_id_number=11111111"/> <br>
<action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/><br>
<action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/><br>
<action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"/><br>
<!--action application="bridge" data="sofia/gateway/idt/$1"/--> <span style="color:#990000">
<=== NOT WORK</span><br>
<!--action application="bridge" data="[origination_caller_id_number=111111]sofia/gateway/idt/$1"/-->
<span style="color:#990000"><=== NOT WORK</span><br>
<action application="bridge" data="[origination_caller_id_number=111111]sofia/gateway/idt/$1"/>
<span style="color:#990000"><=== WORKS!!</span><br>
</condition><br>
</extension><br>
<br>
There a couple of things strange here:<br>
<br>
1. I have to put origination_caller_id_number inside data field of "bridge" 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 "effective_caller_id_number" not "origination_caller_id_number". Is that right?<br>
<br>
I'm using IDT express as SIP carrier. I don'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'd really appreciate your help.<br>
<br>
Cheers.<br>
<br>
Jun<o:p></o:p></p>
</blockquote>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></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">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><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>