HelpSpot Help Desk Software | HelpSpot Blog | HelpSpot Support

Using private.request.create to insert a hyper link into the tNote field


#1

Hi,

Just wondering if anyone can help out with this one.

I have my phone system setup to automatically create a helpdesk jobs and assign it to the tech that answers the call.

The next stepin the process is to add a link in the job to where the voice recording for that job is kept. I can get the information into the job OK, but I would like it to be a hyper link so that I only have to click on the link instead of cut and paste it into a web browser.

Is this possible to do? Or is there a better method you can suggest.

Below is how I am currently doing it, the $sh_agi_xxx varibles are being sent down from the phone system

curl -F"tNote=Voice Clip http:///helpdeskrecording/$sh_agi_CALLFILENAME.wav" -F"Custom22=13" -F"Custom14=2" -F"sFirstName=$sh_agi_MEMBERINTERFACE" -F"xCategory=1" -F"xPersonAssignedTo=$sh_agi_email" -F"-: http:///api/index.php?method=private.request.create >>/tmp/help

Thanks
Barrie


#2

Hi Barrie,

That’s great. Yes, what you need to do is set the fNoteIsHTML option to 1 so it’s HTML and then you can pass in a regular HTML link with the note.


#3

Hi Ian,

Thanks for that worked a treat.

Here are the remaining parts of the puzzle incase anyone else wants to do the same things.

Phone System - Asterisk 1.4

Pre-reqs

Have entries in ASTDB for each agent that refrences their user number in Helpspot
eg

/acd/ithelpdesk/SIP/8069a/email : 1

where 1 is the staff id of the user on interface SIP/8069a

From relevant parts from extensions.conf

[ITHelpdesk]
exten => s,1,Wait(1)
exten => s,n,Answer()
exten => s,n,Set(CALLERID(name)=Helpdesk)
exten => s,n,Set(CALLFILENAME=Helpdesk-{STRFTIME({EPOCH},%Y%m%d%H%M%S)}-${CALLERID(num)})
exten => s,n,GotoIfTime(8:00-4:59|mon-fri||?lbl_ITHelpdesk_0)

exten => s,n,Playback(tsrg/ITHelpdesk_AH_message)

;This is heads off to afterhours call handling
exten => s,n,goto(ITHelpdeskAfterhours,s,1)
exten => s,n,Hangup()

exten => s,n(lbl_ITHelpdesk_0),Playback(tsrg/ITHelpdesk_day_message)
;Setup the voice recording and will call the FTP script to upload to the webserver
exten => s,n,mixmonitor(/tsrg/${CALLFILENAME}.wav,abW(4),/var/lib/asterisk/agi-bin/uploadHelpdesk ^{CALLFILENAME}.wav)

;Queues the call, once it is answered by an agent will run the newhdjob agi script
exten => s,n,Queue(ITHelpdesk|t|||240|/var/lib/asterisk/agi-bin/newhdjob)

;Handles call if nobody logged on or they have been in the queue for too long
exten => s,n,GotoIf(["{QUEUESTATUS}" = “TIMEOUT”]?lbl_ITHelpdesk_1:)
exten => s,n,GotoIf(["{QUEUESTATUS}" = “JOINEMPTY”]?lbl_ITHelpdesk_1:)
exten => s,n,Hangup()

exten => s,n(lbl_ITHelpdesk_1),Set(ahslot=${DB(acd/ithelpdesk/ahslot)})
exten => s,n,goto(ITHelpdeskAfterhours,s,1)
exten => s,n,Hangup()

Upload voice recording to web server and clean off of the phone system

/var/lib/asterisk/agi-bin/uploadHelpdesk
#!/bin/sh
filename=$1
server="“
directory=”/PABX/eaglestreet/Helpdesk"
password=""
sleep 4

cd /tsrg
ftp -n $server <<End-Of-Session
user "$password"
bin
prompt
cd $directory
put "$filename"
bye
End-Of-Session
rm $filename -f
exit 0

Create a new helpdesk job and assign it to the tech who ansered the call. This is based off of a lookup on ASTDB

/var/lib/agi-bin/newhdjob
#!/bin/bash

Call this script with at least 10 parameters, for example

./scriptname 1 2 3 4 5 6 7 8 9 10

MINPARAMS=1
sh_agi_cmd() { # command arg [arg…]
local sh_agi_tmp_respline
# send command to stdout
echo "*" # read reply from stdin while read sh_agi_tmp_respline; do sh_agi_response=(echo “${sh_agi_tmp_respline}” | cut -d ’ ’ -f 1)
case "sh_agi_response" in "200" ) sh_agi_result=(echo “${sh_agi_tmp_respline}” | cut -d ‘=’ -f 2)
break;;
“510” )
break;;
“520” )
break;;
esac
done
return
}

sh_agi_getvariable() {
sh_agi_cmd GET VARIABLE “$1"
case “$sh_agi_result” in
1*)
# result start with 1. Let’s get the string between parentheses
eval sh_agi_”1"=\"(echo “$sh_agi_result”|sed -e ‘s/.(([^)])).*/\1/’)"
;;
esac
}

sh_agi_getdbvariable() {
sh_agi_cmd DATABASE GET “$1” “$2"
case “$sh_agi_result” in
1*)
# result start with 1. Let’s get the string between parentheses
eval sh_agi_”2"=\"(echo “$sh_agi_result”|sed -e ‘s/.(([^)])).*/\1/’)"
;;
esac
}
sh_agi_getvariable MEMBERINTERFACE
sh_agi_getdbvariable acd/ithelpdesk/$sh_agi_MEMBERINTERFACE email
sh_agi_getvariable CALLFILENAME

curl -F"fNoteIsHTML=1" -F"tNote=Voice Clip <A href=“http:///helpdeskrecording/$sh_agi_CALLFILENAME.wav”> $sh_agi_CALLFILENAME " -F"Custom22=13" -F"Custom14=2" -F"sFirstName=$sh_agi_MEMBERINTERFACE" -F"xCategory=1" -F"xPersonAssignedTo=$sh_agi_email" -u: http:///api/index.php?method=private.request.create >>/tmp/help


#4

that’s very useful indeed!!! Thanks for posting that :slight_smile: