<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-&gt;new;<br>my $section = $q-&gt;param(&#39;section&#39;);<br><br>if ($section eq &#39;directory&#39;){<br><br>$XML_STRING2 = &#39;<br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;<br>
&lt;document type=&quot;freeswitch/xml&quot;&gt;<br>  &lt;section name=&quot;directory&quot;&gt;<br>    &lt;domain name=&quot;192.168.4.32&quot;&gt;<br>      &lt;user id=&quot;1001&quot;&gt;<br>    &lt;params&gt;<br>        &lt;param name=&quot;password&quot; value=&quot;1001&quot;/&gt;<br>
       &lt;/params&gt;<br>         &lt;variables&gt;<br>           &lt;variable name=&quot;accountcode&quot; value=&quot;1001&quot;/&gt;<br>          &lt;variable name=&quot;user_context&quot; value=&quot;default&quot;/&gt;<br>
         &lt;variable name=&quot;effective_caller_id_name&quot; value=&quot;1001&quot;/&gt;<br>            &lt;variable name=&quot;nibble_rate&quot; value=&quot;0.05&quot;/&gt;<br>            &lt;variable name=&quot;nibble_account&quot; value=&quot;1&quot;/&gt;<br>
        &lt;variable name=&quot;effective_caller_id_number&quot; value=&quot;1001&quot;/&gt;<br>       &lt;/variables&gt;<br>      &lt;/user&gt;<br>    &lt;/domain&gt;<br>      &lt;/section&gt;<br>&#39;;<br>}<br>elsif ( $section eq &#39;dialplan&#39; ) {<br>
$XML_STRING = &#39;<br>  &lt;section name=&quot;dialplan&quot; description=&quot;example_curl_dialplan&quot;&gt;<br>    &lt;context name=&quot;public&quot;&gt;<br>      &lt;extension name=&quot;curl_test&quot;&gt;<br>        &lt;condition field=&quot;destination_number&quot; expression=&quot;^(80\d{2})$&quot;&gt;<br>
        &lt;action application=&quot;set&quot; data=&quot;dialed_extension=$1&quot;/&gt; <br>        &lt;action application=&quot;set&quot; data=&quot;nibble_account=${accountcode}&quot;/&gt;<br>        &lt;action application=&quot;bridge&quot; data=&quot;sofia/gateway/peer_asterisk/$1&quot;/&gt;<br>
        &lt;/condition&gt;<br>      &lt;/extension&gt;<br>    &lt;/context&gt;<br>  &lt;/section&gt;<br>&lt;/document&gt;<br>&#39;;<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>