[asterisk-users] AMI Originate not working

Faheem Muhammad faheem2084 at gmail.com
Fri May 12 01:28:34 CDT 2017


Thomas,
this code block should work for your Originate case.
This code block will dial a local channel where actual leg 1 number is
dialed. On Answer of leg1, the leg2 is called.

---------------------------------------------------------

require_once('phpagi-2.20/phpagi-asmanager.php');
$asm = new AGI_AsteriskManager('phpagi.conf');
$phone_no = '14160000000';
$callerid = '14160000001';
$leg1_exten = '1000';

if($asm->connect()){
$channel = "Local/".$leg1_exten ."@context_leg1";
$exten = "2000";
$context = "context_leg2";
$priority = 1;
$application = "";
$data = "";
$timeout = 30000;
$callerid = $callerid;
$vars = "t_trunk=$t_trunk,campaign_name=$campaign_name,ivr_name=$ivr_name";
$account = "";
$async = 1;
$actionid = "";

$status = $asm->Originate ($channel,$exten, $context, $priority,
$application, $data, $timeout, $callerid, $vars, $account, $async,
$actionid);
echo "Status: $status";
}

-------------------------------------------------------------

Regards,
Faheem

On Thu, May 11, 2017 at 2:18 PM, Thomas <thomasitcom at gmail.com> wrote:

> Hello,
>
> I want to call an phone and if phone picked up I want to ring another
> phone.
> Or I want to connect to an running channel and then call another phone or
> move
> to an ConfBridge
>
> Iam using PHP
> $channel = 'IAX2/556-1696';
> or $channel = 'SIP/0019736363636 at outbound.patton';
> $exten = '2222';
> $context = 'test_callout';
> $priority = '1';
>
>
>         $parameters = array(
>                 'Channel' => $channel,
>                 'Exten' => $exten,
>                 'Context' => $context,
>                 'Priority' => $priority,
>                 );
>         self::manager_com('Originate', $parameters);
>
>
> I get only this message, but no action or other information
>   == Manager 'vserver_webastmanager' logged on from 127.0.0.1
>   == Manager 'vserver_webastmanager' logged off from 127.0.0.1
>
>
> The AMI access in general should work, because I use it for another
> commands
> for example QueueAdd
>
> best regards
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.
> org/
>
> New to Asterisk? Start here:
>       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20170511/892d6b7a/attachment.html>


More information about the asterisk-users mailing list