<div dir="ltr"><div><span class="gmail-Apple-tab-span" style="white-space:pre">Thomas, </span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">this code block should work for your Originate case.</span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">This code block will dial a local channel where actual leg 1 number is dialed. On Answer of leg1, the leg2 is called. </span></div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">--------------------------------------------------------- </span></div><div><br></div><div>require_once('phpagi-2.20/phpagi-asmanager.php');</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$asm = new AGI_AsteriskManager('phpagi.conf');</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$phone_no = '14160000000';</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$callerid = '14160000001';<br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> $leg1_exten = '1000';</span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre"><br></span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>if($asm->connect()){</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$channel = "Local/".$<span style="white-space:pre">leg1_exten </span>."@context_leg1";</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$exten = "2000";</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$context = "context_leg2";</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$priority = 1;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$application = "";</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$data = "";</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$timeout = 30000;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$callerid = $callerid;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$vars = "t_trunk=$t_trunk,campaign_name=$campaign_name,ivr_name=$ivr_name";</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$account = "";</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$async = 1;</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$actionid = "";</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$status = $asm->Originate ($channel,$exten, $context, $priority, $application, $data, $timeout, $callerid, $vars, $account, $async, $actionid);</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>echo "Status: $status";</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span></div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>}<br></div><div><br></div><div>-------------------------------------------------------------</div><div><br></div><div>Regards,</div><div>Faheem</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 11, 2017 at 2:18 PM, Thomas <span dir="ltr"><<a href="mailto:thomasitcom@gmail.com" target="_blank">thomasitcom@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I want to call an phone and if phone picked up I want to ring another phone.<br>
Or I want to connect to an running channel and then call another phone or move<br>
to an ConfBridge<br>
<br>
Iam using PHP<br>
$channel = 'IAX2/556-1696';<br>
or $channel = 'SIP/<a href="tel:0019736363636" value="+19736363636">0019736363636</a>@outbound.patton';<br>
$exten = '2222';<br>
$context = 'test_callout';<br>
$priority = '1';<br>
<br>
<br>
$parameters = array(<br>
'Channel' => $channel,<br>
'Exten' => $exten,<br>
'Context' => $context,<br>
'Priority' => $priority,<br>
);<br>
self::manager_com('Originate', $parameters);<br>
<br>
<br>
I get only this message, but no action or other information<br>
== Manager 'vserver_webastmanager' logged on from 127.0.0.1<br>
== Manager 'vserver_webastmanager' logged off from 127.0.0.1<br>
<br>
<br>
The AMI access in general should work, because I use it for another commands<br>
for example QueueAdd<br>
<br>
best regards<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer" target="_blank">https://community.asterisk.<wbr>org/</a><br>
<br>
New to Asterisk? Start here:<br>
<a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/<wbr>wiki/display/AST/Getting+<wbr>Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/<wbr>mailman/listinfo/asterisk-<wbr>users</a><br>
</font></span></blockquote></div><br></div>