[Freeswitch-users] Perl equivalent dialplan

Ali Pey alipey at gmail.com
Tue Nov 5 18:44:27 MSK 2013


You can use the $env variable and getHeader:

our $env;
my $uuid = $env->getHeader('uuid');
my $dest_num = $env->getHeader('Caller-Destination-Number');

Note that this is for mod_perl and that's what you are using. perlmod and
ESL are a bit different.

To see all the channel variables you can do this:
our $env;
open(FILEOUT,'>','/var/log/channeldata.txt');
print FILEOUT $env->serialize;
close(FILEOUT);



Regards,
Ali Pey


On Tue, Nov 5, 2013 at 5:48 AM, <covici at ccs.covici.com> wrote:

> You need to use the api call  instead -- I am not sure how to do this in
> Perl, you would have to form an api object and then execute
> sofia_contact on that.
>
> mehroz <mehroz.ashraf85 at gmail.com> wrote:
>
> > I can get the registration status of a user in XML dialplan with :
> > <condition
> > field="${sofia_contact(internal/${destination_number}@192.168.1.5)}"
> > expression="error/user_not_registered">
> > ... and route the call accordingly.
> >
> > I am writing a perl script and calling it in XML with
> > <action application="perl" data="/usr/local/src/test.pl/>
> >
> > and want to get the same registration status from the same CHANNEL
> VARIABLE.
> > I can get CHANNEL VARIABLE using
> > $session->getVariable("variable");
> > but cannot get ${sofia_contact(internal/${
> destination_number}@192.168.1.5)}
> > value with this procedure.
> >
> > I believe this is not actually a CHANNEL VARIABLE , but I cant find ant
> > other way of retrieving this information within my script.
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> http://freeswitch-users.2379917.n2.nabble.com/Perl-equivalent-dialplan-tp7595980.html
> > Sent from the freeswitch-users mailing list archive at Nabble.com.
> >
> > _________________________________________________________________________
> > Professional FreeSWITCH Consulting Services:
> > consulting at freeswitch.org
> > http://www.freeswitchsolutions.com
> >
> > 
> > 
> >
> > Official FreeSWITCH Sites
> > http://www.freeswitch.org
> > http://wiki.freeswitch.org
> > http://www.cluecon.com
> >
> > FreeSWITCH-users mailing list
> > FreeSWITCH-users at lists.freeswitch.org
> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> > http://www.freeswitch.org
>
> --
> Your life is like a penny.  You're going to lose it.  The question is:
> How do
> you spend it?
>
>          John Covici
>          covici at ccs.covici.com
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20131105/1470355a/attachment-0001.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list