Though this might have been resolved/accomplished already but I've couple of questions for <span class="Apple-style-span" style="color: rgb(80, 0, 80); font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">Virendra Bhati. </span><div>
<font class="Apple-style-span" face="arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, sans-serif">1- If you are doing this to make new accounts for new users, why couldn't you use Asterisk realtime(DB) based configurations of Voicemail/MoH/SIP/dialplan etc wouldn't it be much easier than doing lots and lots of filing !?<br>
</font></div><div><font class="Apple-style-span" face="arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, sans-serif">2- Since its a web-based Filing operations and if multiple users are to use the same page for appending/overwriting their configurations wouldn't it lead to information being lost when multiple users applying their changes ? I wonder how do you handle that ?</font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, sans-serif">I'm sure I'd more questions when I started writing this response mail but now I've forgotten those :P</font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, sans-serif">Thanks,</font></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; ">Sammy.</span></div>
<div><font class="Apple-style-span" color="#500050" face="arial, sans-serif"><br></font><div class="gmail_quote">On Sun, Sep 4, 2011 at 6:00 PM, Tzafrir Cohen <span dir="ltr"><<a href="mailto:tzafrir.cohen@xorcom.com">tzafrir.cohen@xorcom.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Fri, Sep 02, 2011 at 04:58:52PM +0530, virendra bhati wrote:<br>
</div><div><div></div><div class="h5">> Hi list,<br>
><br>
> I want ot do basic work (add-edit-delete) into asterisk configuration files,<br>
> like sip.conf, manager.conf,musiconhold.conf etc.<br>
><br>
> Please guide me how to configure all these files from from AMI connection. I<br>
> am able to login into AMI from Login action but I want to do more task in to<br>
> it.<br>
><br>
> *AMI login:- *<br>
><br>
> *login.php*<br>
><br>
> <?php<br>
> $socket = fsockopen("127.0.0.1","5038", $errno, $errstr, 30);<br>
> fputs($socket, "Action: Login\r\n");<br>
> fputs($socket, "UserName: root\r\n");<br>
> fputs($socket, "Secret: energy\r\n\r\n");<br>
> ?><br>
> *AMI command:-*<br>
><br>
> Below commands are for musiconhold.conf. I want to add new MOH context into<br>
> it.<br>
> <?php<br>
> include("login.php");<br>
> fputs($socket, "Action: UpdateConfig\r\n");<br>
> fputs($socket, "Filename: musiconhold.conf\r\n");<br>
> fputs($socket, "Srcfilename: musiconhold.conf\r\n");<br>
> fputs($socket, "Dstfilename: musiconhold.conf\r\n");<br>
> fputs($socket, "Action-000000: newcat\r\n");<br>
> fputs($socket, "Cat-000000: bhavik\r\n");<br>
> fputs($socket, "mode: files\r\n");<br>
> fputs($socket, "directory: /var/lib/asterisk/moh\r\n");<br>
> fputs($socket, "Reload: yes\r\n");<br>
> fputs($socket, "ActionID: 9873497149817\r\n");<br>
> fputs($socket, "Action: Logoff\r\n\r\n");<br>
<br>
</div></div>You're not really editing. You're writing.<br>
<br>
Note the following:<br>
<br>
* It requires Asterisk to be running, and accessible through the manager<br>
interface.<br>
* asterisk.conf may be in a path that is not the configuration<br>
directory. I'm not sure if this special case is handled.<br>
* #include are basically handled, but mostly for reading. IIRC the write<br>
is back to a single file. No idea about #exec, which will probably<br>
have odd interactions with UpdateConfig. Configuration templates<br>
('[section](template)') are also not handled gracefully.<br>
<div class="im"><br>
><br>
> After doing all no success :((<br>
<br>
</div>This is a report of the the thing that did not happen. Next time you ask<br>
a question, please report what actually does happen ("I got the following<br>
response: ...").<br>
<font color="#888888"><br>
--<br>
Tzafrir Cohen<br>
icq#16849755 <a href="mailto:jabber%3Atzafrir.cohen@xorcom.com">jabber:tzafrir.cohen@xorcom.com</a><br>
<a href="tel:%2B972-50-7952406" value="+972507952406">+972-50-7952406</a> mailto:<a href="mailto:tzafrir.cohen@xorcom.com">tzafrir.cohen@xorcom.com</a><br>
<a href="http://www.xorcom.com" target="_blank">http://www.xorcom.com</a> <a href="http://iax:guest@local.xorcom.com/tzafrir" target="_blank">iax:guest@local.xorcom.com/tzafrir</a><br>
</font><div><div></div><div class="h5"><br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</div></div></blockquote></div><br></div>