<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Checkdir.php  Load page on 'answer' instead of 'ringing']]></title><description><![CDATA[<p dir="auto">I'm trying to set FOP2 up so that only when a call is picked up, it'll open a certain web page.  Currently the contents of the file are as follows:<br />
&lt;?php<br />
require_once('config.php');<br />
function custom_popup($ALLVAR) {<br />
$clidnum   = $ALLVAR['clidnum'];<br />
$clidname  = $ALLVAR['clidname'];<br />
$fromqueue = $ALLVAR['fromqueue'];<br />
$exten     = $ALLVAR['exten'];<br />
$poptype   = $ALLVAR['poptype'];<br />
$clidname  = base64_decode($ALLVAR['clidname']);<br />
$clidnum   = base64_decode($ALLVAR['clidnum']);<br />
header("Content-type: text/javascript");<br />
echo "window.open('<a href="http://OurSugarCrmServer/crm/AsteriskSugDir.php?&amp;search=$clidnum" rel="nofollow ugc">http://OurSugarCrmServer/crm/AsteriskSugDir.php?&amp;search=$clidnum</a>');\n";<br />
return 0;   // We still want regular notifications<br />
}<br />
$ret = custom_popup($_GET);<br />
exit;<br />
Header( "X-JSON: ({ 'clidnum': '$clidnum', 'clidname': '$clidname', 'picture': '$picture', 'queue': '$fromqueue' })");<br />
?&gt;</p>
<p dir="auto">I'm no PHP coder, so I don't really know what to do at this point.  I've tried changing the "If" section that was there from<br />
if($ALLVAR['poptype']=="ringing") {<br />
to<br />
if($ALLVAR['poptype']=="answered") {</p>
<p dir="auto">Of course it wasn't that easy. :roll:<br />
So instead I just got rid of that statement and created this line to help me figure out what other 'poptype' values there were:<br />
echo "window.open('<a href="http://$poptype" rel="nofollow ugc">http://$poptype</a>');\n";<br />
That didn't do anything for me.<br />
I'm thinking I'll have to go further up the code tree to find whatever activates the checkdir.php file and set it to only use it when the call is answered instead of when it's ringing.  I'm thinking that'll be the swf on the client though...   Any Ideas?<br />
Thanks!<br />
--AkkerKid</p>
]]></description><link>http://localhost:4567/topic/728/checkdir.php-load-page-on-answer-instead-of-ringing</link><generator>RSS for Node</generator><lastBuildDate>Tue, 27 Oct 2026 13:27:43 GMT</lastBuildDate><atom:link href="http://localhost:4567/topic/728.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 16 Apr 2011 02:33:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Checkdir.php  Load page on 'answer' instead of 'ringing' on Sun, 19 Oct 2014 15:48:08 GMT]]></title><description><![CDATA[<p dir="auto">in fop2.cfg you must set notify_on_connect=1</p>
]]></description><link>http://localhost:4567/post/3218</link><guid isPermaLink="true">http://localhost:4567/post/3218</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Sun, 19 Oct 2014 15:48:08 GMT</pubDate></item><item><title><![CDATA[Reply to Checkdir.php  Load page on 'answer' instead of 'ringing' on Fri, 17 Oct 2014 09:45:37 GMT]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I am not able to get this working either:</p>
<pre><code>if($ALLVAR['poptype']=="ringing") {
    file_put_contents('/tmp/fop2_test.txt', print_r($ALLVAR, 1));
} else {
    file_put_contents('/tmp/fop2_test2.txt', print_r($ALLVAR, 1));
}
</code></pre>
<p dir="auto">(sample of checkdir.php file)</p>
<p dir="auto">fop2_test.txt gets created but not fop2_test2.txt</p>
<p dir="auto">I have set Event When Called to Yes within the queue config.</p>
<p dir="auto">Is there anything else that may be missing? I am trying to pass the unique call id to a web service, I assume when a popup is triggered on connect of a call it will pass a variable like uniqueid within $ALLVAR ?</p>
<p dir="auto">Thanks.</p>
]]></description><link>http://localhost:4567/post/3217</link><guid isPermaLink="true">http://localhost:4567/post/3217</guid><dc:creator><![CDATA[philiplucasmail]]></dc:creator><pubDate>Fri, 17 Oct 2014 09:45:37 GMT</pubDate></item><item><title><![CDATA[Reply to Checkdir.php  Load page on 'answer' instead of 'ringing' on Mon, 01 Aug 2011 18:46:52 GMT]]></title><description><![CDATA[<p dir="auto">It should work fine, but you must be sure you have the correct block in checkdir.php for call notifications on connect. The stock config.php includes a check at the very top for "poptype", if its "ringing" then blah, blah, and else blah, blah.</p>
<p dir="auto">The else block is executed on connect, and the stock file has everything commented out. You must uncomment/modify your checkdir.php file so it actually does something useful.</p>
]]></description><link>http://localhost:4567/post/3216</link><guid isPermaLink="true">http://localhost:4567/post/3216</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Mon, 01 Aug 2011 18:46:52 GMT</pubDate></item><item><title><![CDATA[Reply to Checkdir.php  Load page on 'answer' instead of 'ringing' on Wed, 27 Jul 2011 13:36:50 GMT]]></title><description><![CDATA[<p dir="auto">Hi</p>
<p dir="auto">I've run into the same problem.  I'm unable to get a screen-pop when the call is "connected" from a queue.     The screen-pop works fine for "ringing".</p>
<p dir="auto">System Details:<br />
FOP2 = 2.21 (final)<br />
Asterisk 1.6.2.10<br />
Elastix 2.0.0.38</p>
<p dir="auto">queues_additional.conf  has eventwhencalled=yes</p>
<pre><code>[500]
announce-frequency=0
announce-holdtime=no
announce-position=no
autofill=no
eventmemberstatus=yes
eventwhencalled=yes
joinempty=yes
leavewhenempty=no
maxlen=0
periodic-announce-frequency=0
queue-callswaiting=silence/1
queue-thereare=silence/1
queue-youarenext=silence/1
reportholdtime=no
retry=5
ringinuse=yes
servicelevel=60
strategy=ringall
timeout=15
weight=0
wrapuptime=0
member=Local/3000@from-queue/n,0,John Lennon,SIP/3000
member=Local/3001@from-queue/n,0,Paul McCartney,SIP/3001
member=Local/3004@from-queue/n,0,Mick Jagger,SIP/3004
</code></pre>
<p dir="auto">notify_on_ringing = 0 and notify_on_connect = 1  in the /usr/local/fop2/fop2.cfg</p>
<pre><code>[root@pbx001 fop2]# pwd
/usr/local/fop2
[root@pbx001 fop2]# grep notify fop2.cfg
; notification on state RINGING (notify_on_ringing=1).
; eventwhencalled=yes and then set here notify_on_connect=1,
notify_on_ringing = 0
notify_on_connect = 1
</code></pre>
<p dir="auto">Thanks<br />
Steve</p>
]]></description><link>http://localhost:4567/post/3215</link><guid isPermaLink="true">http://localhost:4567/post/3215</guid><dc:creator><![CDATA[steve_connected]]></dc:creator><pubDate>Wed, 27 Jul 2011 13:36:50 GMT</pubDate></item><item><title><![CDATA[Reply to Checkdir.php  Load page on 'answer' instead of 'ringing' on Wed, 27 Jul 2011 03:18:33 GMT]]></title><description><![CDATA[<p dir="auto">Hi ,</p>
<p dir="auto">System Details:<br />
Elastix 2.0.0-38<br />
Asterisk 1.6.2.10<br />
FOP2 2.21(final)</p>
<p dir="auto">I've run into what appears to be the same problem.  I can't generate a screen pop when a call is answered / connected from the queue.  The screenpop only works on ringing.</p>
<p dir="auto">queues_additional.conf  has eventwhencalled = yes</p>
<pre><code>[500]
announce-frequency=0
announce-holdtime=no
announce-position=no
autofill=no
eventmemberstatus=yes
eventwhencalled=yes
joinempty=yes
leavewhenempty=no
maxlen=0
periodic-announce-frequency=0
queue-callswaiting=silence/1
queue-thereare=silence/1
queue-youarenext=silence/1
reportholdtime=no
retry=5
ringinuse=yes
servicelevel=60
strategy=ringall
timeout=15
weight=0
wrapuptime=0
member=Local/3000@from-queue/n,0,John Lennon,SIP/3000
member=Local/3001@from-queue/n,0,Paul McCartney,SIP/3001
member=Local/3004@from-queue/n,0,Mick Jagger,SIP/3004

[501]
announce-frequency=0
announce-holdtime=no
announce-position=no
autofill=no
eventmemberstatus=yes
eventwhencalled=yes
joinempty=yes
leavewhenempty=no
maxlen=0
periodic-announce-frequency=0
queue-callswaiting=silence/1
queue-thereare=silence/1
queue-youarenext=silence/1
reportholdtime=no
retry=2
ringinuse=yes
servicelevel=60
strategy=ringall
timeout=20
weight=0
wrapuptime=0
member=Local/3001@from-queue/n,0,Paul McCartney,SIP/3001
member=Local/3002@from-queue/n,0,George Harrison,SIP/3002
member=Local/3004@from-queue/n,0,Mick Jagger,SIP/3004

</code></pre>
<p dir="auto">fop2.cfg has the ringing = 0 and the connect=1</p>
<pre><code>[root@pbx001 fop2]# vi fop2.cfg
  notify_on_ringing = 0
  notify_on_connect = 1
</code></pre>
<p dir="auto">I'm using the "stock" checkdir.php</p>
<p dir="auto">Thanks<br />
Steve</p>
]]></description><link>http://localhost:4567/post/3214</link><guid isPermaLink="true">http://localhost:4567/post/3214</guid><dc:creator><![CDATA[steve_connected]]></dc:creator><pubDate>Wed, 27 Jul 2011 03:18:33 GMT</pubDate></item><item><title><![CDATA[Reply to Checkdir.php  Load page on 'answer' instead of 'ringing' on Mon, 18 Apr 2011 15:06:11 GMT]]></title><description><![CDATA[<p dir="auto">poptype should be "connect" instead of "onconnect".</p>
<p dir="auto">The easiest way is to work your way in the stock checkdir.php instead of writing your own from scratch.</p>
]]></description><link>http://localhost:4567/post/3213</link><guid isPermaLink="true">http://localhost:4567/post/3213</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Mon, 18 Apr 2011 15:06:11 GMT</pubDate></item><item><title><![CDATA[Reply to Checkdir.php  Load page on 'answer' instead of 'ringing' on Sun, 17 Apr 2011 14:23:51 GMT]]></title><description><![CDATA[<p dir="auto">It's still not working.  I turned on "Event When Called:"  and edited my checkdir.php to show the following:</p>
<p dir="auto">&lt;?php<br />
require_once('config.php');<br />
function custom_popup($ALLVAR) {<br />
// For Asternic Tag Call<br />
if($ALLVAR['poptype']=="onconnect") {<br />
// RINGING NOTIFICATION<br />
$clidnum   = $ALLVAR['clidnum'];<br />
$poptype   = $ALLVAR['poptype'];<br />
$clidnum  = base64_decode($ALLVAR['clidnum']);<br />
header("Content-type: text/javascript");<br />
echo "window.open('<a href="http://OurSugarCrmServer/crm/AsteriskSugDir.php?&amp;search=$clidnum" rel="nofollow ugc">http://OurSugarCrmServer/crm/AsteriskSugDir.php?&amp;search=$clidnum</a>');\n";<br />
} else {}<br />
return 0;<br />
}<br />
exit;<br />
?&gt;</p>
<p dir="auto">The subtext of Event When Called is "When this option is set to YES, the following manager events will be generated: AgentCalled, AgentDump, AgentConnect and AgentComplete."  So I also tried "AgentConnect" in the IF statement where "onconnect" is thinking maybe my Trixbox server uses non-standard outputs.  That didn't work either.  Also, when I make changes in this file, should I restart the server or will the changes take effect as soon as I save?</p>
]]></description><link>http://localhost:4567/post/3212</link><guid isPermaLink="true">http://localhost:4567/post/3212</guid><dc:creator><![CDATA[AkkerKid]]></dc:creator><pubDate>Sun, 17 Apr 2011 14:23:51 GMT</pubDate></item><item><title><![CDATA[Reply to Checkdir.php  Load page on 'answer' instead of 'ringing' on Sun, 17 Apr 2011 02:04:34 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">The stock checkdir.php includes different code blocks (if else) for poptype "ringing" or "onconnect". But there is a really important thing to note, the connect popup only works when receiving AGENTCONNECT manager events. Those events are generated only for calls delivered from a queue and when that queue has the eventwhencalled=yes set.</p>
<p dir="auto">It will NOT popup on connected calls that are not from the queue.</p>
<p dir="auto">So, restore the stock checkdir.php , look at the if poptype "ringing", do not touch that part but look at the else, that block is the one you need to modify to output some javascript code for open a popup on connect.</p>
<p dir="auto">Bet regards,</p>
]]></description><link>http://localhost:4567/post/3211</link><guid isPermaLink="true">http://localhost:4567/post/3211</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Sun, 17 Apr 2011 02:04:34 GMT</pubDate></item></channel></rss>