Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

[Freeswitch-users] mod_perl multiple bindings


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





PostPosted: Thu Nov 20, 2008 7:28 am    Post subject: [Freeswitch-users] mod_perl multiple bindings Reply with quote

Hi,

Is there a way to declare more than one script with its binding in
perl.conf.xml?
Because from what I understood by reading the documentation, is that
there are
no different sections to define different perl scripts with bindings
like for example in the
xml_curl.conf.xml :

<configuration name="xml_curl.conf" description="cURL XML Gateway">
<bindings>
<binding name="binding1">
...
</binding>
<binding name="binding2">
...
</binding>

...

</bindings>
</configuration>





_______________________________________________
Freeswitch-users mailing list
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
anthony.minessale at g...
Guest





PostPosted: Thu Nov 20, 2008 9:21 am    Post subject: [Freeswitch-users] mod_perl multiple bindings Reply with quote

no the languages only have one binding.
Do you really need more than one binding?

On Thu, Nov 20, 2008 at 6:20 AM, regs@kinetix.gr (regs@kinetix.gr) <regs@kinetix.gr (regs@kinetix.gr)> wrote:
Quote:
Hi,

Is there a way to declare more than one script with its binding in
perl.conf.xml?
Because from what I understood by reading the documentation, is that
there are
no different sections to define different perl scripts with bindings
like for example in the
xml_curl.conf.xml :

<configuration name="xml_curl.conf" description="cURL XML Gateway">
<bindings>
<binding name="binding1">
...
</binding>
<binding name="binding2">
...
</binding>

...

</bindings>
</configuration>





_______________________________________________
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



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
regs at kinetix.gr
Guest





PostPosted: Thu Nov 20, 2008 9:40 am    Post subject: [Freeswitch-users] mod_perl multiple bindings Reply with quote

What if I want to use one binding for "directory", one for "configuration" and one for "dialplan"?

While we are at it, how can I pass parameters so that I can "fill up" my %XML_REQUEST when
the perl script is called from the xml dialplan? e.g. :

<context name="route">
<extension name=default>
<condition field="destination_number" expression="^.*$">
<action application="perl" data="/root/test_perl2.pl" />
</condition>
</extension>
</context>



Anthony Minessale wrote:
Quote:
no the languages only have one binding.
Do you really need more than one binding?

On Thu, Nov 20, 2008 at 6:20 AM, regs@kinetix.gr (regs@kinetix.gr) <regs@kinetix.gr (regs@kinetix.gr)> wrote:
Quote:
Hi,

Is there a way to declare more than one script with its binding in
perl.conf.xml?
Because from what I understood by reading the documentation, is that
there are
no different sections to define different perl scripts with bindings
like for example in the
xml_curl.conf.xml :

<configuration name="xml_curl.conf" description="cURL XML Gateway">
<bindings>
<binding name="binding1">
...
</binding>
<binding name="binding2">
...
</binding>

...

</bindings>
</configuration>





_______________________________________________
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



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Quote:


_______________________________________________
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
anthony.minessale at g...
Guest





PostPosted: Thu Nov 20, 2008 11:19 am    Post subject: [Freeswitch-users] mod_perl multiple bindings Reply with quote

currently it would entail binding everything to 1 script and detecting which kind of section it
was in the script. Making it support many would require some coding which would need to be done in every language module to keep them uniform and we don't have the time for it right now. you can provide a patch or post a bounty and maybe someone can work on it.

there is a magic env obj created in your script that has all the params

print $env->serialize();
print $env->serialize("xml");

$info = $env->getHeader("info");



On Thu, Nov 20, 2008 at 8:34 AM, regs@kinetix.gr (regs@kinetix.gr) <regs@kinetix.gr (regs@kinetix.gr)> wrote:
Quote:
What if I want to use one binding for "directory", one for "configuration" and one for "dialplan"?

While we are at it, how can I pass parameters so that I can "fill up" my %XML_REQUEST when
the perl script is called from the xml dialplan? e.g. :

<context name="route">
<extension name=default>
<condition field="destination_number" expression="^.*$">
<action application="perl" data="/root/test_perl2.pl" />
</condition>
</extension>
</context>



Anthony Minessale wrote:
Quote:

no the languages only have one binding.
Do you really need more than one binding?

On Thu, Nov 20, 2008 at 6:20 AM, regs@kinetix.gr (regs@kinetix.gr) <regs@kinetix.gr (regs@kinetix.gr)> wrote:
Quote:
Hi,

Is there a way to declare more than one script with its binding in
perl.conf.xml?
Because from what I understood by reading the documentation, is that
there are
no different sections to define different perl scripts with bindings
like for example in the
xml_curl.conf.xml :

<configuration name="xml_curl.conf" description="cURL XML Gateway">
<bindings>
<binding name="binding1">
...
</binding>
<binding name="binding2">
...
</binding>

...

</bindings>
</configuration>





_______________________________________________
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



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400


Quote:

_______________________________________________
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




--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
regs at kinetix.gr
Guest





PostPosted: Fri Nov 21, 2008 2:44 am    Post subject: [Freeswitch-users] mod_perl multiple bindings Reply with quote

That's great. And how do I pass the parameters when calling the script from my dialplan?

e.g.

<action application="perl" data="/root/test_perl.pl" />

Anthony Minessale wrote:
Quote:
currently it would entail binding everything to 1 script and detecting which kind of section it
was in the script. Making it support many would require some coding which would need to be done in every language module to keep them uniform and we don't have the time for it right now. you can provide a patch or post a bounty and maybe someone can work on it.

there is a magic env obj created in your script that has all the params

print $env->serialize();
print $env->serialize("xml");

$info = $env->getHeader("info");



On Thu, Nov 20, 2008 at 8:34 AM, regs@kinetix.gr (regs@kinetix.gr) <regs@kinetix.gr (regs@kinetix.gr)> wrote:
Quote:
What if I want to use one binding for "directory", one for "configuration" and one for "dialplan"?

While we are at it, how can I pass parameters so that I can "fill up" my %XML_REQUEST when
the perl script is called from the xml dialplan? e.g. :

<context name="route">
<extension name=default>
<condition field="destination_number" expression="^.*$">
<action application="perl" data="/root/test_perl2.pl" />
</condition>
</extension>
</context>



Anthony Minessale wrote:
Quote:
no the languages only have one binding.
Do you really need more than one binding?

On Thu, Nov 20, 2008 at 6:20 AM, regs@kinetix.gr (regs@kinetix.gr) <regs@kinetix.gr (regs@kinetix.gr)> wrote:
Quote:
Hi,

Is there a way to declare more than one script with its binding in
perl.conf.xml?
Because from what I understood by reading the documentation, is that
there are
no different sections to define different perl scripts with bindings
like for example in the
xml_curl.conf.xml :

<configuration name="xml_curl.conf" description="cURL XML Gateway">
<bindings>
<binding name="binding1">
...
</binding>
<binding name="binding2">
...
</binding>

...

</bindings>
</configuration>





_______________________________________________
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



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400


Quote:

_______________________________________________
Freeswitch-users mailing list
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




--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Quote:


_______________________________________________
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
brian at freeswitch.org
Guest





PostPosted: Fri Nov 21, 2008 8:43 am    Post subject: [Freeswitch-users] mod_perl multiple bindings Reply with quote

<action application="perl" data="/root/test_perl.pl arg1 arg2 arg3" />

/b

On Nov 21, 2008, at 1:41 AM, regs@kinetix.gr wrote:

Quote:
That's great. And how do I pass the parameters when calling the
script from my dialplan?

e.g.

<action application="perl" data="/root/test_perl.pl" />

_______________________________________________
Freeswitch-users mailing list
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
anthony.minessale at g...
Guest





PostPosted: Fri Nov 21, 2008 8:49 am    Post subject: [Freeswitch-users] mod_perl multiple bindings Reply with quote

also any variables you may set before you call the script will be available too if you want to use named params.


On Fri, Nov 21, 2008 at 7:41 AM, Brian West <brian@freeswitch.org (brian@freeswitch.org)> wrote:
Quote:
<action application="perl" data="/root/test_perl.pl arg1 arg2 arg3" />

/b

On Nov 21, 2008, at 1:41 AM, regs@kinetix.gr (regs@kinetix.gr) wrote:

Quote:
That's great. And how do I pass the parameters when calling the
script from my dialplan?

e.g.

<action application="perl" data="/root/test_perl.pl" />



_______________________________________________
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





--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
regs at kinetix.gr
Guest





PostPosted: Mon Nov 24, 2008 4:24 am    Post subject: [Freeswitch-users] mod_perl multiple bindings Reply with quote

I tried using the $env object but it fails with :

2008-11-24 09:12:46 [ERR] mod_perl.c:69 Perl_safe_eval() [require '/root/test_perl2.pl';]
Can't call method "serialize" on an undefined value at /root/test_perl2.pl line 19.
Compilation failed in require at (eval 3) line 1.

The script I am using :

#!/usr/bin/perl

freeswitch::console_log("info", $env->serialize());

### MAIN START

$XML_STRING = '
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="dialplan" description="Perl RE Dial Plan For FreeSwitch">
<context name="kinetix">
<extension name="test">
<condition field="destination_number" expression="^.*$">
<action application="playback" data="tone_stream://path=${base_dir}/conf/tetris.ttml;loops=5"/>
</condition>
</extension>
</context>
</section>
</document>
';

### MAIN END

1;

Anthony Minessale wrote:
Quote:
currently it would entail binding everything to 1 script and detecting which kind of section it
was in the script. Making it support many would require some coding which would need to be done in every language module to keep them uniform and we don't have the time for it right now. you can provide a patch or post a bounty and maybe someone can work on it.

there is a magic env obj created in your script that has all the params

print $env->serialize();
print $env->serialize("xml");

$info = $env->getHeader("info");



On Thu, Nov 20, 2008 at 8:34 AM, regs@kinetix.gr (regs@kinetix.gr) <regs@kinetix.gr (regs@kinetix.gr)> wrote:
Quote:
What if I want to use one binding for "directory", one for "configuration" and one for "dialplan"?

While we are at it, how can I pass parameters so that I can "fill up" my %XML_REQUEST when
the perl script is called from the xml dialplan? e.g. :

<context name="route">
<extension name=default>
<condition field="destination_number" expression="^.*$">
<action application="perl" data="/root/test_perl2.pl" />
</condition>
</extension>
</context>



Anthony Minessale wrote:
Quote:
no the languages only have one binding.
Do you really need more than one binding?

On Thu, Nov 20, 2008 at 6:20 AM, regs@kinetix.gr (regs@kinetix.gr) <regs@kinetix.gr (regs@kinetix.gr)> wrote:
Quote:
Hi,

Is there a way to declare more than one script with its binding in
perl.conf.xml?
Because from what I understood by reading the documentation, is that
there are
no different sections to define different perl scripts with bindings
like for example in the
xml_curl.conf.xml :

<configuration name="xml_curl.conf" description="cURL XML Gateway">
<bindings>
<binding name="binding1">
...
</binding>
<binding name="binding2">
...
</binding>

...

</bindings>
</configuration>





_______________________________________________
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



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400


Quote:

_______________________________________________
Freeswitch-users mailing list
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




--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Quote:


_______________________________________________
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