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@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@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-tp759... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici covici@ccs.covici.com
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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