powered by Jive Software

How to add more presence statuses into spark-asterisk-im

Guys, is there a way to add more presence statuses into asterisk-im + spark?

right now it works great when a user is on a call so spark shows the phone icon, etc.

but say, I want to be able to show if a user dials *21 to forward calls to voicemail, then spark can show the user as been out of the office or something… is this possible?

the idea would be to listen to custom message thruthe asterisk manager (which can be triggerd by userevents) and then change the user status in spark to somethig (i dont know if spark send the status to the server or if the server could push a status change to spark)… I guess the server can push changes to spark or else how would spark know a user is on the phone… so how can we take advantage of this?

any ideas?

As far as I can tell Spark-IM doesnt really get much in terms of status messages from Asterisk, it mostly pushes. Calls are a different matter and spark knows when someone is being called so it can set that status.

Because of this design I think the better solution would be to go the opposite way, have spark-im trigger the voicemail forwarding.

Example: User A sets his status to “Out of Office.” Spark-IM sees the status change and executes a script that forwards calls to voicemail.

Both ideas would be great… either a user can change their status on spark or using their phone, now, one problem would be, if the user changes their spark status to out of office and forwards to voicemail, if they shutdown their pc, status is changed to pffline but the forward should not be removed on asterisk… anyway… I think the communication channel is there, spark gets phone call statuses from asterisk (via the manager event) and changes its status on openfire -> pc spark client … so the idea would be, instead of just getting status from the manager like on the phone, dialing, etc, using userevents, be able to interpret more statuses and switch spark to away with customs texts defined somewher or passed to spark from openfire…

too demanding?

This would certainly be possible. But I doubt it will be useful for many people and it has the addtional drawback that it requires changing the dialplan which I would like to avoid.

Currently Asterisk-IM just runs out of the box.

yes but it only does “on the phone” or “not on the phone”… it can do much more… you would just need to put userevents and thats it…

if I wanted to implement this, how would I go about it? I mean, is there a surce code for asterisk-im or what would I need to modify?

Yes, sources are here: https://svn.igniterealtime.org/svn/repos/asterisk-im/trunk

how di I recompile it or how do I make changs to the code? Im a PHP coder and know some C but never coded in java…