| Subcribe via RSS

Integrating Jabber into Asterisk with FreePBX

December 31st, 2009 | No Comments | Posted in Asterisk, FreePBX

I was poking around with Asterisk trying to hook it into an Openfire XMPP server and get Asterisk to send IMs when various events happen.

I have Asterisk set up as a Jabber client by setting the following in jabber.conf

[asterisk]
type=client
serverhost=jabber.server
username=asterisk@jabber.server/AsteriskServer
secret=password
port=5222
usetls=yes
usesasl=yes
statusmessage="Asterisk Test Server"

The more interesting part came when trying to get Asterisk to send messages to Jabber clients for incoming calls. I found a lot of information on the web on how to do it, but not where to put the config when you’re using FreePBX.  It turned out to be fairly simple in the end.

Editing the extensions_custom.conf put int he following code.

[from-internal-custom]
exten => 10,1,jabbersend(asterisk,user@jabber.server,"Call from ${CALLERID(name)} at number ${CALLERID(num)} on ${STRFTIME(,GMT-1,%A %B %d %G at %l:%M:%S %p)}")
exten => _X!,n,Goto(from-trunk,${EXTEN},1)

This sends an IM to user@jabber.server whenever they get an incoming call.

It could probably be improved to look up the appropriate user for the extension with a DB lookup (which means you’d only need one bit of code for all extensions) but I wouldn’t have a clue how to go about it.

The next step is to identify when an incoming call is for that extension in particular or if it’s a ring group.

MySQL ErrorNo 121

December 29th, 2009 | No Comments | Posted in MySQL, Web Development

MySQL has a helpful error “Can’t create table (errno: 121)” which doesn’t seem to be documented anywhere except in forums.

Turns out this error is caused by InnoDB tables throwing an error when it detects duplicate foreign key names.

Basically, every foreign key has to have a unique name for InnoDB to function correctly.

Badger Badger Badger

December 9th, 2009 | No Comments | Posted in Uncategorized

It’s A SNAAAAKKKKEEE!!!

Palm snake

A neighbour knocked on the door and told us that there was a snake on our roof. By the time we found it it had changed from a roof snake to a palm snake.

Palm Snake 2

Tree Snake 1

Tree Snake 2

Close up

Breakfast

Breakfast was tasty.

Longish, but not too long

Spot the Python

Spot the Python.

Digesting breakfast


Skin

This skin may be from the same python. But it looks too long for it to me. We have had bigger pythons in the back yard in the past.


Drawing Development

December 2nd, 2009 | No Comments | Posted in Uncategorized

I have no idea how kids are supposed to develop but in the past 6 months Liam has gone from potatoes with arms to full stick figures.

Liam the potatoe

12th Nov

Liam playing golf

30th Nov

Beer

December 2nd, 2009 | No Comments | Posted in Uncategorized

A client recently sent me some of my own branded beer.

The bottle

The label

Apparently I’m fantastic enough to get my  own beer.

Yum! Paint!

October 18th, 2009 | No Comments | Posted in Uncategorized

Emily and paint

Emily after a painting session.

Apparently she missed a spot

She missed a spot.

How does your garden grow

September 5th, 2009 | No Comments | Posted in Uncategorized

Emily harvesting peas from the vege garden

Emily harvesting peas

Everyone at work

Busy in the garden

It came from the sky!

September 5th, 2009 | No Comments | Posted in Uncategorized

Had a visitor the other day. A Red Browed Firetail crashed into my back window and knocked itself out.

Liam touching the bird.

Liam touching the bird.

Liam and the firetail Firetail in the hand Can I have it? Released back to the wild.

Spiders?

July 9th, 2009 | 3 Comments | Posted in Uncategorized

Sunday night the spiders arrived. Wrist hurt as it usually does when I went to sleep, but when I awoke I had spiders in my wrist.

Flex 1 Flex 2 flex-profile-marked

When my hand is extended the swelling is pretty much flat.

But when I clench my fist the lump pops up. The one behind the wrist doesn’t change at all.

Extended 1 extend-top-marked Extended 2

The big one spread in two stages. First it was right next to the wrist. Then another formed futher down my hand. Over the day they merged. The one behind the wrist showed up last. I was driving around a lot that day visiting docs and wot not, so that’s probably what made it worse. Haven’t done much since then however.

It aches a bit, only hurts when I extend my fingers or hold a glass etc. Hurts more the futher it extends. I feel a little twinge when I poke at it.

It feels like there is something in there – not fluid like, more slack muscle like. When fingers are extended it gets really hard like a clenched muscle (hurts a lot ot poke it then).

So is it spiders? or something else?

New PC

February 26th, 2009 | No Comments | Posted in Hardware, Toys

I got a new pc. YAY

Computer Innards