<div dir="ltr">You can use the $env variable and getHeader:<div><br></div><div><div>our $env;</div><div>my $uuid = $env->getHeader('uuid');<br></div><div>my $dest_num = $env->getHeader('Caller-Destination-Number');<br>
</div><div class="gmail_extra"><br></div><div class="gmail_extra">Note that this is for mod_perl and that's what you are using. perlmod and ESL are a bit different.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
To see all the channel variables you can do this:</div><div class="gmail_extra"><div class="gmail_extra">our $env;</div><div class="gmail_extra">open(FILEOUT,'>','/var/log/channeldata.txt');</div><div class="gmail_extra">
print FILEOUT $env->serialize;</div><div class="gmail_extra">close(FILEOUT);</div><div><br></div></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Regards,</div><div class="gmail_extra">
Ali Pey</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 5, 2013 at 5:48 AM, <span dir="ltr"><<a href="mailto:covici@ccs.covici.com" target="_blank">covici@ccs.covici.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">You need to use the api call instead -- I am not sure how to do this in<br>
Perl, you would have to form an api object and then execute<br>
sofia_contact on that.<br>
<div class=""><div class="h5"><br>
mehroz <<a href="mailto:mehroz.ashraf85@gmail.com">mehroz.ashraf85@gmail.com</a>> wrote:<br>
<br>
> I can get the registration status of a user in XML dialplan with :<br>
> <condition<br>
> field="${sofia_contact(internal/${<a href="mailto:destination_number%7D@192.168.1.5">destination_number}@192.168.1.5</a>)}"<br>
> expression="error/user_not_registered"><br>
> ... and route the call accordingly.<br>
><br>
> I am writing a perl script and calling it in XML with<br>
> <action application="perl" data="/usr/local/src/<a href="http://test.pl/" target="_blank">test.pl/</a>><br>
><br>
> and want to get the same registration status from the same CHANNEL VARIABLE.<br>
> I can get CHANNEL VARIABLE using<br>
> $session->getVariable("variable");<br>
> but cannot get ${sofia_contact(internal/${<a href="mailto:destination_number%7D@192.168.1.5">destination_number}@192.168.1.5</a>)}<br>
> value with this procedure.<br>
><br>
> I believe this is not actually a CHANNEL VARIABLE , but I cant find ant<br>
> other way of retrieving this information within my script.<br>
><br>
><br>
><br>
><br>
><br>
> --<br>
> View this message in context: <a href="http://freeswitch-users.2379917.n2.nabble.com/Perl-equivalent-dialplan-tp7595980.html" target="_blank">http://freeswitch-users.2379917.n2.nabble.com/Perl-equivalent-dialplan-tp7595980.html</a><br>
> Sent from the freeswitch-users mailing list archive at Nabble.com.<br>
><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>
</div></div><span class=""><font color="#888888">--<br>
Your life is like a penny. You're going to lose it. The question is:<br>
How do<br>
you spend it?<br>
<br>
John Covici<br>
<a href="mailto:covici@ccs.covici.com">covici@ccs.covici.com</a><br>
</font></span><div class=""><div class="h5"><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>
</div></div></blockquote></div><br></div><img class="" src="https://contactmonkey.com/api/v1/tracker?cm_session=1bc46fa9-36e5-4fd7-8af6-d35360531272&cm_type=open&cm_user_email=alipey@gmail.com"></div></div>