I have been working on this for a while today, and still no luck. This is my script:<br><br>#!/usr/bin/php<br><?php<br>$errno=0;<br>$errstr=0;<br>$fp = fsockopen ("localhost",5038,$errno,$errstr,20);<br>if (!$fp) {<br>
echo "$errstr ($errno)<br>\n";<br>} else {<br><br> fputs($fp, "Action: Login\r\n");<br> fputs($fp, "Username: xxxx\r\n");<br> fputs($fp, "Secret: xxxx\r\n");<br>
fputs($fp, "Events: off\r\n");<br> sleep(1);<br> fputs($fp, "Action: Originate\r\n");<br> fputs($fp, "Channel: SIP/trunk/1DIDNumber\r\n");<br> fputs($fp, "Context: CallContext\r\n\r\n");<br>
fputs($fp, "Exten: NumberToCall\r\n");<br> fputs($fp, "Priority: 1\r\n");<br> fputs($fp, "Timeout: 30000\r\n");<br> sleep(2);<br> fclose($fp);<br><br>}<br>
?><br><br>It seems simple enough, And I have no compilation errors. This is my output:<br><br> -- Launched AGI Script /var/lib/asterisk/agi-bin/MyScript.php<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_request: MyScript.php<br>
<SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_channel: SIP/xx.xx.xxx.xx-00000111<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_language: en<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_type: SIP<br>
<SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_uniqueid: 1281390000.000<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_version: 1.6.2.6<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_callerid: 1PhoneThatCalled The DID<br>
<SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_calleridname: unknown<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_callingpres: 0<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_callingani2: 0<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_callington: 0<br>
<SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_callingtns: 0<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_dnid: IncomingExt<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_rdnis: unknown<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_context: default<br>
<SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_extension: incomingExt<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_priority: 3<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_enhanced: 0.0<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_accountcode:<br>
<SIP/xx.xx.xxx.xx-00000111>AGI Tx >> agi_threadid: -1237000000<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >><br> == Manager 'Man' logged on from 127.0.0.1<br> == Manager 'Man' logged off from 127.0.0.1<br>
<SIP/xx.xx.xxx.xx-00000111>AGI Rx <<<br><SIP/xx.xx.xxx.xx-00000111>AGI Tx >> 510 Invalid or unknown command<br>[Aug 9 17:44:10] ERROR[25594]: utils.c:1128 ast_carefulwrite: write() returned error: Broken pipe<br>
[Aug 9 17:44:10] ERROR[25594]: utils.c:1128 ast_carefulwrite: write() returned error: Broken pipe<br> -- <SIP/xx.xx.xxx.xx-00000111>AGI Script MyScript.php completed, returning 0<br><br>Could someone please point me in the right direction?<br>
<br><br><br><div class="gmail_quote">On Mon, Aug 9, 2010 at 11:15 AM, Danny Nicholas <span dir="ltr"><<a href="mailto:danny@debsinc.com">danny@debsinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="blue" lang="EN-US">
<div>
<div>
<p class="MsoNormal"><b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma;"> <a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>
[mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>] <b><span style="font-weight: bold;">On Behalf Of </span></b>Kathryn Jones<br>
<b><span style="font-weight: bold;">Sent:</span></b> Monday, August 09, 2010
11:22 AM<br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [asterisk-users]
Connecting two calls with Originate</span></font></p>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> </span></font></p>
<div><div class="im">
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;">On Mon, Aug 9, 2010 at 10:00 AM, Danny Nicholas <<a href="mailto:danny@debsinc.com" target="_blank">danny@debsinc.com</a>> wrote:</span></font></p>
<div link="blue" vlink="purple">
<div>
<div>
<p class="MsoNormal"><b><font size="2" color="navy" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma; color: navy; font-weight: bold;">></span></font></b><b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">>From:</span></font></b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma;"> <a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>
[mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>]
<b><span style="font-weight: bold;">On Behalf Of </span></b>Kathryn Jones<br>
<font color="navy"><span style="color: navy;">></span></font>><b><span style="font-weight: bold;">Subject:</span></b> [asterisk-users] Connecting two
calls with Originate</span></font></p>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> </span></font></p>
<div>
<p class="MsoNormal"><font size="3" color="navy" face="Times New Roman"><span style="font-size: 12pt; color: navy;">>></span></font>Hello list!!<br>
<br>
<font color="navy"><span style="color: navy;">>></span></font>I want to
connect an open call with an extension. I call in with a DID, them redirect to
the extension using AGI. Can I use agi's originate to make the second call <font color="navy"><span style="color: navy;">>></span></font>without dropping the
first DID call? How would I go about this?</p>
</div>
<p class="MsoNormal"><font size="3" color="navy" face="Times New Roman"><span style="font-size: 12pt; color: navy;"><snip></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;"><br>
<font color="navy"><span style="color: navy;">>></span></font>I am not having
much luck, am I going about this the wrong way? Thanks in advance for your
replies.</span></font></p>
</div>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p class="MsoNormal" style="margin-bottom: 12pt;"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">->Assuming
that you’re not trying to dial back out on the same line, this should not be
problematic. The AGI originate is not necessarily aware that it is
working in tandem with an existing call. The “Channelopendidcall” is the
“wrong way” part of this equation. For example, if the call comes in on
DAHDI/1-1, you can’t use DAHDI/1-1 </span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">to open a second call whilst it is active; you can make a
call on DAHDI/1-2 and join the 2 together.</span></font><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"></span></font></p>
</div>
</div>
</div><p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;">>Wow, that was
fast. Thanks for your reply!!!<div class="im"><br>
>So if I were to do:<br>
<br>
>Action: login<br>
>Username: xxxx<br>
>Secret: xxxx<br>
>Events: off<br>
<br>
>Action: Originate<br>
>Channel: SIP/trunk<br>
>Context: context-for-second-call<br>
>Exten: secondCall<br>
>Priority: 1<br>
>Callerid: CallerID<br>
>Timeout: 30<br>
<br>
>I could connect the 2 calls?<br>
<br>
</div><font color="navy"><span style="color: navy;">As best as I know, yes this should
work. You are actually creating a “new leg” with the originate, but the net
effect is a joined call.</span></font></span></font></p>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> </span></font></p>
</div>
</div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</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" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br>