<div dir="ltr">Hi Sammy,<br><br>Yes I am asking about AstDB only. <br><br><div class="gmail_quote">On Mon, Sep 5, 2011 at 2:00 PM, Sam Govind <span dir="ltr"><<a href="mailto:govoiper@gmail.com">govoiper@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Are you talking about AstDB or MySQL as DB backend for asterisk?<div><div></div><div class="h5">
<br><br><div class="gmail_quote">On Mon, Sep 5, 2011 at 1:23 PM, virendra bhati <span dir="ltr"><<a href="mailto:virbhati@gmail.com" target="_blank">virbhati@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr">Hi Sammy,<br><br>Thanks for share your experance and provide a new way of Asterisk communication with DB.<br>
<br>Actually I am using this feature only for MOH feature of asterisk right now. But I will used it to all the configuration files too as per the needs. <br>
<br>I am not too much aware abut the Asterisk DB handling that's why I used ODBC and mysql connection with asterisk.<br><br>One more thing please tell me how to take backup of Asterisk DB ? It is my 1st and last things which hurt me.<div>
<div></div><div><br>
<br><br><div class="gmail_quote">On Mon, Sep 5, 2011 at 12:48 PM, Sam Govind <span dir="ltr"><<a href="mailto:govoiper@gmail.com" target="_blank">govoiper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>1- Per my experience I've used DB with configuration files and I was amazed that Asterisk was taking a union of DB + conf file configurations and accepting both.So if you just make a simple script or DB function to do file operation on some event/cronjob you'll be saved.</div>
<div><br></div><div>Moreover, if that still may induce duplication into configurations then DB replication and redundancy is the best way to cater your failure case. There are hundreds of how-tos on DB redundancy and failure etc.</div>
<div><br></div><div>2- If you've to move forward with this approach I'll suggest you to read only part of configuration file corresponding to one user i.e [user-1-area] and over-write that part only. If a new user then just append. This way file data loss will be minimized(may even avoided totally).</div>
<div><br></div><div>Those were all my suggestions, if anyone else can add valuable comments to this.</div><div><br>-</div><div>sammy</div><div><div></div><div><div><br></div><div><br><div class="gmail_quote">On Mon, Sep 5, 2011 at 11:45 AM, virendra bhati <span dir="ltr"><<a href="mailto:virbhati@gmail.com" target="_blank">virbhati@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr">Hi Sammy,<br><br>Ans of 1st question:- <br><br>As per my experiance <font face="arial, sans-serif">Asterisk realtime(DB) based</font> data will lost when your server is creash and you may not take backup of your server's DB. <br>
If any one know then plese guide me so that I will start working on it.<br><br>Ans of 2nd question:- <br><br>Your question is correct if more then one user will access these configuration files then might be some problem will come.<br>
<br>For this issue I am just make a connection with server then close it after finishing the job. So problem will be avoided ....<div><div></div><div><br><br><br><div class="gmail_quote">On Mon, Sep 5, 2011 at 10:47 AM, Sam Govind <span dir="ltr"><<a href="mailto:govoiper@gmail.com" target="_blank">govoiper@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Though this might have been resolved/accomplished already but I've couple of questions for <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 face="arial, sans-serif"><br></font></div><div><font 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 face="arial, sans-serif"><br></font></div><div><font 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 face="arial, sans-serif"><br></font></div><div><font 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 face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Thanks,</font></div><div><span style="font-family: arial,sans-serif;">Sammy.</span></div><div><div></div><div>
<div><font 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" target="_blank">tzafrir.cohen@xorcom.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>On Fri, Sep 02, 2011 at 04:58:52PM +0530, virendra bhati wrote:<br>
</div><div><div></div><div>> 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><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" target="_blank">jabber:tzafrir.cohen@xorcom.com</a><br>
<a href="tel:%2B972-50-7952406" value="+972507952406" target="_blank">+972-50-7952406</a> mailto:<a href="mailto:tzafrir.cohen@xorcom.com" target="_blank">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><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>
</div></div><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></blockquote></div><br><br clear="all"><br></div></div>-- <br><div>
<div dir="ltr"><br><br>
<br>-----<br>Thanks and regards<br><br> Virendra Bhati<br><a href="tel:%2B91-9172341457" value="+919172341457" target="_blank">+91-9172341457</a><br>Software Engineer<br></div><br>
</div></div>
<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></blockquote></div><br></div>
</div></div><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></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><br><br>
<br>-----<br>Thanks and regards<br><br> Virendra Bhati<br><a href="tel:%2B91-9172341457" value="+919172341457" target="_blank">+91-9172341457</a><br>Software Engineer<br></div><br>
</div></div></div>
<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></blockquote></div><br>
</div></div><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></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><br><br>
<br>-----<br>Thanks and regards<br><br> Virendra Bhati<br>+91-9172341457<br>Software Engineer<br></div><br>
</div>