<div dir="ltr">Hi list,<br><br>I want ot do basic work (add-edit-delete) into asterisk configuration files, like sip.conf, manager.conf,musiconhold.conf etc.<br><br>Please guide me how to configure all these files from from AMI connection. I am able to login into AMI from Login action but I want to do more task in to it.<br>
<br><b style="color: rgb(153, 0, 0);">AMI login:- </b><br><br><b>login.php</b><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><b style="color: rgb(153, 0, 0);">AMI command:-</b><br><br>Below commands are for musiconhold.conf. I want to add new MOH context into 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 dir="ltr">?><br><br>After doing all no success :((<br><br><br>-----<br>Thanks and regards<br><br> Virendra Bhati<br>+91-9172341457<br>Software Engineer<br>
</div><br>
</div>