Bulk call by asterisk

How can we make bulk calling (call blast) by using asterisk ? and if we use the PHP AMI then how can we store or pass the events by API?

First question: Originate or Call FIles

Second question: Please provide the code you wrote, based on the documentation that you read, and logs demonstrating where it is failing.

i want to originate the call

i am using below code

<?php // Replace with your port if not using the default. // If unsure check /etc/asterisk/manager.conf under [general]; $port = 5038; // Replace with your username. You can find it in /etc/asterisk/manager.conf. // If unsure look for a user with "originate" permissions, or create one as // shown at http://www.voip-info.org/wiki/view/Asterisk+config+manager.conf. $username = "AMIOut"; // Replace with your password (refered to as "secret" in /etc/asterisk/manager.conf) $password = "AMI123"; // Internal phone line to call from //$internalPhoneline = "1000"; // Context for outbound calls. See /etc/asterisk/extensions.conf if unsure. //$context = "smartout"; $socket = stream_socket_client("tcp://172.15.02.102:5038"); if($socket) { echo "Connected to socket, sending authentication request.\n"; // Prepare authentication request $authenticationRequest = "Action: Login\r\n"; $authenticationRequest .= "Username: AMIOut\r\n"; $authenticationRequest .= "Secret: AMI123\r\n"; $authenticationRequest .= "Events: on\r\n\r\n"; // Send authentication request $authenticate = stream_socket_sendto($socket, $authenticationRequest); if($authenticate > 0) { // Wait for server response usleep(200000); // Read server response $authenticateResponse = fread($socket, 4096); // Check if authentication was successful if(strpos($authenticateResponse, 'Success') !== false) { echo "Authenticated to Asterisk Manager Inteface. Initiating call.\n"; // Prepare originate request $originateRequest = "Action: Originate\r\n"; $originateRequest .= "Channel: SIP/g0/8569963845\r\n"; $originateRequest .= "Callerid: 6709201\r\n"; $originateRequest .= "Application: Playback\r\n"; $originateRequest .= "Data: /usr/Welcome\r\n"; $originateRequest .= "Context: ami\r\n"; $originateRequest .= "Exten: 111\r\n"; $originateRequest .= "Priority: 1\r\n"; $originateRequest .= "ActionID: at-ami-call\r\n"; $originateRequest .= "Async: yes\r\n\r\n"; // Send originate request $originate = stream_socket_sendto($socket, $originateRequest); if($originate > 0) { // Wait for server response usleep(200000); while(true) { // Read server response $originateResponse = fread($socket, 4096); echo $originateResponse . "\n"; } // Check if originate was successful if(strpos($originateResponse, 'Success') !== false) { echo "Call initiated, dialing.\n"; } else { echo "Could not initiate call.\n"; } } else { echo "Could not write call initiation request to socket.\n"; } } else { echo "Could not authenticate to Asterisk Manager Interface.\n"; } } else { echo "Could not write authentication request to socket.\n"; } } else { echo "Unable to connect to socket."; }

how we can store or pass the response of call in API or store in database ??

I’m not going to read a program presented on a single line.

Guide us how can we pass the events of calls in php API or store the events from linux terminal to database and if possible then share the php code?

AMI.txt (3.2 KB)

I have read @Asteriskabhi multiples post from you asking the same question with different titles. You need to write your own code using Originate Action, if you want to read Asterisk events using php use the socket function with read() function or fgets(), there are many exmples codes on ther Internet. This forum it is community forum, I dont think nobody here write custom codes and then share it,