The information in this article applies to:
[ Summary | Information | Links ]
This article describes how to create new status messages (Tweets) on twitter.com on incoming calls.
This can be usefull for example for
Other articles in this series:
How to setup the script
Download the file kb4067_Twitter.rse via the link at the end of this article. To load the file into the Call Routing Manager (CRM) i.e. the Graphical Script Editor (GSE) do the following:
How it works
The Twitter service provides a so called Twitter API. This is a web (HTTP) based interface which can be used (beside others) to add new status messages (Tweets) via a simple HTTP request. Such HTTP requests can be created quite easily from within a call routing script. The script in this articles provides a function TwitterCall which can be called from naerly every place within graphical part of the call routing script. By calling this function the current phone call can be twittered in certain situations, like calls from certain numbers, overflows in call queues, timeouts in call queues.
Own VBScript code (to be more specific: own functions, subroutines, constant definitions and variable declarations) will be placed into the Start Block of a call routing script.
The code being placed here can be called from nearly everywhere within the call routing script (as also from other call routing scripts for the same user as long as the script holding the code is activated). This example script uses the VBScript Code block to call the function.
To make the script a little bit more easy and flexible to use two rule parameters are used to pass username and password from the Call Routing Manager (description field of the rule) into the script without the need for the user to open the GSE.
GSE rule parameters will be defined within the properties of the GSE rule and are available in own defined variables within the call routing script.
The example script calls for every incoming call the TwitterCall function and passes the login information (rule parameters) as parameters. Afterwards the rule will be exited via the Rule skipped exit to force the Call Routing Manager to also start following rules in the list of rules.
This is the VBScript code being stored in the Start block:
If the server is able to resolve the caller name (from the global or private phonebook or a previous running script) this name will be used within the Twitter Tweet, otherwise just the caller's phone number.
Afterwards an HTTP request to Twitter will be executed using the Windows buid-in XMLHTTP COM object.
Using PBXScript.OutputTrace the status message (Tweet) as also the Twitter return code will be written into the server's trace file for failure analysis.
The third-party contact information included in this article is provided to help you find the technical support you need. This contact information is subject to change without notice. Enreach in no way guarantees the accuracy of this third-party contact information nor is responsible for it's content.