Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Incorrect method of PHP call control?


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
gregt at cgicommunicat...
Guest





PostPosted: Mon Aug 31, 2009 10:27 am    Post subject: [Freeswitch-users] Incorrect method of PHP call control? Reply with quote

Hi. Before I go to far down this path, I wonder if what I intend to do is not a good practice.

I started using mod_xml_curl to use PHP on localhost to generate a dialplan dynamically, based on the Caller-Destination-Number variable that is posted. It prints out the XML that calls the javascript that then controls the call. For example,


$response = <<< XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="dialplan" description="example_curl_dialplan">
<context name="public">
<extension name="curl_test">
<condition field="destination_number" expression="^(\+1|1?)(5844111)$">
<action application="javascript" data="demos/stest-examp-st.js" />
</condition>
</extension>
</context>
</section>
</document>
XML;


Then I thought, that's silly to go back out to javascript to handle the actions, playing files, using pocketsphinx, etc. I should just stay in PHP, using esl.php to answer and handle the call.


Then I rethought, is that a good practice to take over the call control from freeswitch at that point, while it is in the xml-curl dialplan hunt?


Then I also thought, is it even possible to do some of the things I need to do from the php esl, like the equivalent of this javascript:
session.collectInput(onInputsml, "emptyobject", 7000);

--
Greg Thoen
Back to top
msc at freeswitch.org
Guest





PostPosted: Mon Aug 31, 2009 12:01 pm    Post subject: [Freeswitch-users] Incorrect method of PHP call control? Reply with quote

On Mon, Aug 31, 2009 at 8:22 AM, Greg Thoen <gregt@cgicommunications.com (gregt@cgicommunications.com)> wrote:
Quote:
Hi. Before I go to far down this path, I wonder if what I intend to do is not a good practice.

I started using mod_xml_curl to use PHP on localhost to generate a dialplan dynamically, based on the Caller-Destination-Number variable that is posted. It prints out the XML that calls the javascript that then controls the call. For example,


$response = <<< XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
  <section name="dialplan" description="example_curl_dialplan">
    <context name="public">
      <extension name="curl_test">
        <condition field="destination_number" expression="^(\+1|1?)(5844111)$">
          <action application="javascript" data="demos/stest-examp-st.js" />
        </condition>
      </extension>
    </context>
  </section>
</document>
XML;


Then I thought, that's silly to go back out to javascript to handle the actions, playing files, using pocketsphinx, etc. I should just stay in PHP, using esl.php to answer and handle the call.


Then I rethought, is that a good practice to take over the call control from freeswitch at that point, while it is in the xml-curl dialplan hunt?


Then I also thought, is it even possible to do some of the things I need to do from the php esl, like the equivalent of this javascript:
session.collectInput(onInputsml, "emptyobject", 7000);

--
Greg Thoen






Just remember that you're dealing with two somewhat related but still distinctly separate entities: generating a dialplan and executing some sort of call control from the dialplan. You need some sort of dialplan no matter what, so the issue there is whether you need a dynamic one or not. If you're just going to drop calls to an extension that opens an outbound socket to your call control program then you may not need the dynamic dp generation that mod_xml_curl gives you. You'll have to decide on static vs. dynamic based on your needs. In either case, once the call is connected to your socket you've got all sorts of control options. PHP has an ESL abstraction just like the other languages so there shouldn't be any issue about PHP lacking the ability to control calls.

I say start hacking away at it and see what happens. Smile Definitely join us in #freeswitch on irc.freenode.net if you want to discuss this more in realtime.
-MC
Back to top
gregt at cgicommunicat...
Guest





PostPosted: Tue Sep 01, 2009 9:02 am    Post subject: [Freeswitch-users] Incorrect method of PHP call control? Reply with quote

Thanks for the input.
Quote:
You'll have to decide on static vs. dynamic based on your needs. In either case, once the call is connected to your socket you've got all sorts of control options. PHP has an ESL abstraction just like the other languages so there shouldn't be any issue about PHP lacking the ability to control calls.

But I'm having a hard time seeing how the ESL would duplicate this JS functionality:


Quote:
Quote:
session.collectInput(onInputsml, "emptyobject", 7000);




How do I set the PHP callback routine, etc.?

--
Greg Thoen





On Aug 31, 2009, at 12:55 PM, Michael Collins wrote:
Quote:


On Mon, Aug 31, 2009 at 8:22 AM, Greg Thoen <gregt@cgicommunications.com (gregt@cgicommunications.com)> wrote:
Quote:
Hi. Before I go to far down this path, I wonder if what I intend to do is not a good practice.

I started using mod_xml_curl to use PHP on localhost to generate a dialplan dynamically, based on the Caller-Destination-Number variable that is posted. It prints out the XML that calls the javascript that then controls the call. For example,


$response = <<< XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="dialplan" description="example_curl_dialplan">
<context name="public">
<extension name="curl_test">
<condition field="destination_number" expression="^(\+1|1?)(5844111)$">
<action application="javascript" data="demos/stest-examp-st.js" />
</condition>
</extension>
</context>
</section>
</document>
XML;


Then I thought, that's silly to go back out to javascript to handle the actions, playing files, using pocketsphinx, etc. I should just stay in PHP, using esl.php to answer and handle the call.


Then I rethought, is that a good practice to take over the call control from freeswitch at that point, while it is in the xml-curl dialplan hunt?


Then I also thought, is it even possible to do some of the things I need to do from the php esl, like the equivalent of this javascript:
session.collectInput(onInputsml, "emptyobject", 7000);
--
Greg Thoen







Just remember that you're dealing with two somewhat related but still distinctly separate entities: generating a dialplan and executing some sort of call control from the dialplan. You need some sort of dialplan no matter what, so the issue there is whether you need a dynamic one or not. If you're just going to drop calls to an extension that opens an outbound socket to your call control program then you may not need the dynamic dp generation that mod_xml_curl gives you. You'll have to decide on static vs. dynamic based on your needs. In either case, once the call is connected to your socket you've got all sorts of control options. PHP has an ESL abstraction just like the other languages so there shouldn't be any issue about PHP lacking the ability to control calls.

I say start hacking away at it and see what happens. Smile Definitely join us in #freeswitch on irc.freenode.net if you want to discuss this more in realtime.
-MC



_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
mike at jerris.com
Guest





PostPosted: Thu Sep 03, 2009 1:32 pm    Post subject: [Freeswitch-users] Incorrect method of PHP call control? Reply with quote

In esl you get events for each dtmf.

Mike

On Sep 1, 2009, at 9:54 AM, Greg Thoen wrote:
Quote:
Thanks for the input.
Quote:
You'll have to decide on static vs. dynamic based on your needs. In either case, once the call is connected to your socket you've got all sorts of control options. PHP has an ESL abstraction just like the other languages so there shouldn't be any issue about PHP lacking the ability to control calls.

But I'm having a hard time seeing how the ESL would duplicate this JS functionality:


Quote:
Quote:
session.collectInput(onInputsml, "emptyobject", 7000);




How do I set the PHP callback routine, etc.?
--
Greg Thoen






On Aug 31, 2009, at 12:55 PM, Michael Collins wrote:
Quote:


On Mon, Aug 31, 2009 at 8:22 AM, Greg Thoen <gregt@cgicommunications.com (gregt@cgicommunications.com)> wrote:
Quote:
Hi. Before I go to far down this path, I wonder if what I intend to do is not a good practice.

I started using mod_xml_curl to use PHP on localhost to generate a dialplan dynamically, based on the Caller-Destination-Number variable that is posted. It prints out the XML that calls the javascript that then controls the call. For example,


$response = <<< XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="dialplan" description="example_curl_dialplan">
<context name="public">
<extension name="curl_test">
<condition field="destination_number" expression="^(\+1|1?)(5844111)$">
<action application="javascript" data="demos/stest-examp-st.js" />
</condition>
</extension>
</context>
</section>
</document>
XML;


Then I thought, that's silly to go back out to javascript to handle the actions, playing files, using pocketsphinx, etc. I should just stay in PHP, using esl.php to answer and handle the call.


Then I rethought, is that a good practice to take over the call control from freeswitch at that point, while it is in the xml-curl dialplan hunt?


Then I also thought, is it even possible to do some of the things I need to do from the php esl, like the equivalent of this javascript:
session.collectInput(onInputsml, "emptyobject", 7000);
--
Greg Thoen







Just remember that you're dealing with two somewhat related but still distinctly separate entities: generating a dialplan and executing some sort of call control from the dialplan. You need some sort of dialplan no matter what, so the issue there is whether you need a dynamic one or not. If you're just going to drop calls to an extension that opens an outbound socket to your call control program then you may not need the dynamic dp generation that mod_xml_curl gives you. You'll have to decide on static vs. dynamic based on your needs. In either case, once the call is connected to your socket you've got all sorts of control options. PHP has an ESL abstraction just like the other languages so there shouldn't be any issue about PHP lacking the ability to control calls.

I say start hacking away at it and see what happens. Smile Definitely join us in #freeswitch on irc.freenode.net if you want to discuss this more in realtime.
-MC



_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org





_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services