Step 1- Setup HipChat

First you need to configure an integration within HipChat. This will provide you with an API endpoint and credentials that you’ll need in step 2.

From the HipChat web interface you need to select Integrations on the top menu and then Build your own integration.

Once done you need to select the room where notifications will be sent and a name for your integration. The name will appear as part of the notification so choose carefully.

The final step will show the API details. You’ll need to make note of the notification URL as you’ll need this in step 2

Click save and that’s the end of step 1.

Step 2 - Setup your AGI script

As mentioned in the pre-requisites you should have PHPAGI installed and configured. You’ll need to create an AGI script like the following. On my system this has been set to ==/var/lib/asterisk/agi-bin/hipchatnotify.php==.

You’ll need to replace YOURURL with the notification URL provided in step 1. You probably want to change the “From” field too, otherwise it’ll display “Ewing IT PBX”.

You may also notice a timeout of 3 seconds. This is to ensure that a timeout connecting to the HipChat API doesn’t prevent your calls from progressing.