Hi Jonathan,<div><br></div><div>On a separate side note, that code is particularly unclean.</div><div><br></div><div>You may want to consider either building the XML response using an XML library, or use a template parsing language so you are not placing raw XML in your source.</div>
<div><br></div><div>In regards to your original email, the link Steven has provided is a good starting point.</div><div><br></div><div>Hope this helps.</div><div><br></div><div>Cal</div><div><br><div class="gmail_quote">On Sun, Jan 27, 2013 at 1:16 PM, johnthan123 <span dir="ltr"><<a href="mailto:johnthan123@gmail.com" target="_blank">johnthan123@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>HI All,<br><br><br></div> Can You Please any one help me To Write Directory and Dialplan and In XML_CURL Like Below <br>
<br></div>#################CODE########################<br>#!/usr/bin/perl<br>
use strict;<br>use warnings;<br>use Data::Dump qw(dump); <br>use CGI;<br>my $q = CGI->new;<br>my $section = $q->param('section');<br><br>if ($section eq 'directory'){<br><br>$XML_STRING2 = '<br>
<?xml version="1.0" encoding="UTF-8" standalone="no"?><br>
<document type="freeswitch/xml"><br> <section name="directory"><br> <domain name="192.168.4.32"><br> <user id="1001"><br> <params><br> <param name="password" value="1001"/><br>
</params><br> <variables><br> <variable name="accountcode" value="1001"/><br> <variable name="user_context" value="default"/><br>
<variable name="effective_caller_id_name" value="1001"/><br> <variable name="nibble_rate" value="0.05"/><br> <variable name="nibble_account" value="1"/><br>
<variable name="effective_caller_id_number" value="1001"/><br> </variables><br> </user><br> </domain><br> </section><br>';<br>}<br>elsif ( $section eq 'dialplan' ) {<br>
$XML_STRING = '<br> <section name="dialplan" description="example_curl_dialplan"><br> <context name="public"><br> <extension name="curl_test"><br> <condition field="destination_number" expression="^(80\d{2})$"><br>
<action application="set" data="dialed_extension=$1"/> <br> <action application="set" data="nibble_account=${accountcode}"/><br> <action application="bridge" data="sofia/gateway/peer_asterisk/$1"/><br>
</condition><br> </extension><br> </context><br> </section><br></document><br>';<br>} <br><br></div>###########################END#############################<br><br></div>
This is Working for Me But i cant able to take the Database values into XML file <br><br><br></div><div>Thanks In Advance <br><br><br></div><div>Thanks <br><br></div><div>J :: T<br></div><div><div><div><div><div><div><div>
<br> <br></div></div></div></div></div></div></div></div>
<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></blockquote></div><br></div>