0 like 0 dislike
301 views
asked Jul 7, 2014 in Education & Reference by Bhoomika (50 points) | 301 views
    

1 Answer

0 like 0 dislike

You can always use ASTERISK command USING SOCKET PHP + AMI MANAGER

So in your PHP file sip-reload.php

<?php
      $socket = fsockopen("127.0.0.1","5038", $errno, $errstr, 10);
      if (!$socket){
    echo "$errstr ($errno)\n";
    }else{
            fputs($socket, "Action: Login\r\n");
            fputs($socket, "UserName: username\r\n");
            fputs($socket, "Secret: password\r\n\r\n");

            fputs($socket, "Action: Command\r\n");
            fputs($socket, "Command: sip reload\r\n\r\n");

//            fputs($socket, "Command: dialplan reload\r\n\r\n");
//            fputs($socket, "Command: sip show peers\r\n\r\n");
            fputs($socket, "Action: Logoff\r\n\r\n");
            while (!feof($socket)){
               echo fgets($socket).'<br>';
            }
            fclose($socket);
            }
?>

cd /etc/asterisk/

manager.conf
[general]
displaysystemname = yes
enabled = yes
webenabled = yes
port = 5038
httptimeout = 300
bindaddr = 0.0.0.0


[username]
secret = password
read = system,call,all,command
write = system,call,all,command
answered Jul 7, 2014 by Krish (880 points)

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Mar 30, 2014 in Computers & Internet by Yogi (180 points) | 58 views
0 like 0 dislike
0 answers
0 like 0 dislike
1 answer
asked Sep 12, 2013 in Education & Reference by Sidh | 1,028 views
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked Jun 19, 2014 in Education & Reference by Bhoomika (50 points) | 34 views
1 like 0 dislike
1 answer
asked Apr 15, 2014 in Education & Reference by Yogi (180 points) | 66 views
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

Mathe Forum Schule und Studenten
1,169 questions
1,309 answers
276 comments
1,601 users