<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">api originate {originate_timeout=30}sofia/internal/1000%192.168.1.5 &socket(<a href="http://127.0.0.1:10000/" target="_blank" style="color:rgb(17,85,204)">127.0.0.1:10000</a> async full)<u></u><u></u></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><u></u> <u></u></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
if I then modify the configuration of my server such that the public dial plan contains the following<u></u><u></u></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<u></u> <u></u></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><include><u></u><u></u></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<extension name="Test"><u></u><u></u></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> <condition field="destination_number" expression="^10000$"><u></u><u></u></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> <action application="set" data="domain_name=$${domain}"/><u></u><u></u></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> <action application="socket" data="<a href="http://127.0.0.1:10000/" target="_blank" style="color:rgb(17,85,204)">127.0.0.1:10000</a> async full"/><u></u><u></u></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> </condition><u></u><u></u></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
</extension><u></u><u></u></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"></include></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">You're calling 1000 but testing for 10000 - that extension'll never get executed.</p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></p><div><br></div><div><br></div><br><div class="gmail_quote">On 11 July 2013 17:09, Christopher Hall <span dir="ltr"><<a href="mailto:chris.hall@vividapps.co.uk" target="_blank">chris.hall@vividapps.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple"><div><p class="MsoNormal">I have written code to interact with FreeSWITCH using the event socket interface. I am originating calls from my code but my understanding of what is required is very limited. I would like to be able to originate a call and have the call I originate processed through the dial plan and I don’t appear to be able to make this happen.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">An example of my problem:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Using a default configuration on FreeSWITCH:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">If I originate a call as below with a SIP phone registered on extension 1000, my sockets server is called as expected.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">api originate {originate_timeout=30}sofia/internal/1000%192.168.1.5 &socket(<a href="http://127.0.0.1:10000" target="_blank">127.0.0.1:10000</a> async full)<u></u><u></u></p><p class="MsoNormal">
<u></u> <u></u></p>
<p class="MsoNormal">if I then modify the configuration of my server such that the public dial plan contains the following<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><include><u></u><u></u></p>
<p class="MsoNormal"> <extension name="Test"><u></u><u></u></p><p class="MsoNormal"> <condition field="destination_number" expression="^10000$"><u></u><u></u></p><p class="MsoNormal">
<action application="set" data="domain_name=$${domain}"/><u></u><u></u></p><p class="MsoNormal"> <action application="socket" data="<a href="http://127.0.0.1:10000" target="_blank">127.0.0.1:10000</a> async full"/><u></u><u></u></p>
<p class="MsoNormal"> </condition><u></u><u></u></p><p class="MsoNormal"> </extension><u></u><u></u></p><p class="MsoNormal"></include><u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">
And call 10000 from the SIP phone registered on 1000, again my sockets server is called.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">If however, I attempt to originate a call to 10000 from my code using <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">api originate {originate_timeout=30}sofia/internal/10000%192.168.XX.XXX &socket(<a href="http://127.0.0.1:10000" target="_blank">127.0.0.1:10000</a> async full)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I get the response.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">–ERR USER_NOT_REGISTERED <u></u><u></u></p><p class="MsoNormal">
<u></u> <u></u></p><p class="MsoNormal">Is there a way in which I can originate a call from my code and have it processed in the same way as a call originated from a SIP phone?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I would like to be able to do this so that my code can simply originate calls to numbers in the knowledge that FreeSWITCH will then route the call accordingly and that doesn’t appear to be the case at the moment as the originate does not appear to be processed by the dial plan.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Chris.<u></u><u></u></p></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>