Show Queue agent status on Polycom phone screen

I wrote a post on the PIAF forum, but nobody’s had any suggestions over there.
I’m trying to follow a tutorial on “How to setup Agent Status on Polycom Idle Display”. The location of the tutorial is:

http://www.savelono.com/scripts/asterisk-how-to-setup-agent-status-on-polycom-idle-display.html

and I wasn’t able to find anything else on this type of setup.
The above tutorial is setup on fedora 10, I’m assuming without freepbx. Can anyone help me get this working on a PIAF system?

Here’s my environment:

│ PIAF Installed Version = 2.0.6.4 under *HARDWARE* │ │ FreePBX Version = 2.10.0.2 │ │ Running Asterisk Version = 1.8.23.0 │ │ Asterisk Source Version = 1.8.23.0 │ │ Dahdi Source Version = 2.7.0 │ │ Libpri Source Version = 1.4.12 │ │ IP Address = 10.0.0.250 on eth0 │ │ Operating System = CentOS release 6.4 (Final) │ │ Kernel Version = 2.6.32-358.6.2.el6.i686 - 32 Bit

The bash scripts in the tutorial aren’t creating the XHTML in html\polycom; I manually created the directory in html: drwxr-xr-x 2 apache apache 4096 Feb 20 12:04 polycom
Also pertinent, I placed the scripts in /etc/asterisk/bin/, not sure if that is the correct location for Asterisk 1.8.
Finally, probably the major problem I’m facing is in the dialplan; instead of placing the context in extensions.conf as the tutorial does, I placed it in the bottom of extensions_additional.conf, but I’m not good at working with custom contexts, so I doubt it’s working:

[utilities]

exten => 2078,1,Answer
exten => 2078,n,authenticate(888)
exten => 2078,n,AddQueueMember(sales,SIP/${CALLERID(num)},1,)
exten => 2078,n,Playback(agent-loginok)
exten => 2078,n,system(/etc/asterisk/bin/agent-status.sh ${CALLERID(num)})
exten => 2078,n,Hangup
exten => 3078,1,Answer
exten => 3078,n,authenticate(888)
exten => 3078,n,RemoveQueueMember(sales,SIP/${CALLERID(num)},1,)
exten => 3078,n,Playback(agent-loggedoff)
exten => 3078,n,system(/etc/asterisk/bin/agent-status-logoff.sh ${CALLERID(num)})
exten => 3078,n,Hangup

If I dial 2078 or 3078, nothing happens. As I mentioned, I have little experience with dialplans and only a few times have I gotten them to work properly. So that might be where I’m screwing things up? Either that or I’m using the wrong location for the scripts.

Thanks so much in advance, there’s a lot of knowledgeable folk on here willing to help a complete stranger.

Alright, let me ask to simple questions instead:

My dial plan that is supposed to trigger the agent to be logged in while at the same time running the bash script is not doing either. I can get it to vocally say “agent logged in”, but the agent does not log in to the queue “sales,” nor does the dial plan run the scripts that create the xhtml pages. Any idea why it’s not at least actually logging the agent 1028 into the queue Sales?

exten => 2078,1,Answer exten => 2078,n,AddQueueMember(sales,SIP/1028,1,) exten => 2078,n,Playback(agent-loginok) exten => 2078,n,system(/etc/asterisk/bin/agent-status.sh 1028) exten => 2078,n,Hangup

As you can see, the script is supposed to run with the variable 1028. If I bash agent-status.sh 1028 from the cli, the xhtml is created. Woohoo! But the dial plan isn’t creating it. Any ideas why?

Here’s what the bash script looks like for reference, it is chown’d asterisk:asterisk, btw:

#!/bin/bash #set -x

AGENTXHTML=$(
echo ""
echo "<html lang=“en-US” xml:lang=“en-US” xmlns="http://www.w3.org/1999/xhtml">"
echo ""
echo "Logged in as $1"
echo ""
echo “”
#echo

LOGGED IN AS $1”
#echo "

"
echo ""
echo “”)

echo $AGENTXHTML > /var/www/html/polycom/$1.xhtml ;
chown -R apache:apache /var/www/html/polycom/