<?php
$timeout = 7500;
$login_extension = "SIP/6001"; // agent extension
$call_telephone = "97077777"; // customer's telephone
$socket = fsockopen("10.0.0.3","5038", $errno, $errstr, $timeout);
if ($socket)
{
$call_person = "Exten: " . $call_telephone . "\r\n";
$call_extension = "Channel: " . $login_extension . "\r\n";
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: user\r\n");
fputs($socket, "Secret: password\r\n\r\n");
fputs($socket, "Action: Originate\r\n");
fputs($socket, $call_extension);
fputs($socket, "Context: local\r\n");
fputs($socket, $call_person);
fputs($socket, "Priority: 1\r\n");
fputs($socket, "Callerid: \r\n\r\n");
}
?>The above code is used when I need to ringback a customer to tell them their driver is outside. Problem is the call centre agent initiates the call. The agent's SIP phone (SIP/6001) rings then he answers the call from asterisk, asterisk then dials the customer.
I want asterisk to dial the customer, ring twice and then hangup. This will save the agent's time and reduce our call costs. I don't want the agent to be involved. I have tried messing around with the code above but no result.
So my problem in summary is: I would like dial an external line, let it ring twice and then hangup all via PHP.
Thanks for your help.
Gary Ruddock swiftdrinks
_______________________________________________ Asterisk-Users mailing list [email protected] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
