I was thinking, would it be possible to trigger a "Dial" Event by extension, then monitoring that callid until it''s disconnected.
In our organization which spans 20 offices in 15 countries we''re using Asterisk for the central dialplan with Call Manager Express running on Cisco equipment as SIP peers in many of the offices. The problem there is that one SIP peer is actually handling multiple extensions, f.ex. in Sendai in Japan the extension in extensions.conf is SIP/cme-sendai/40xx where xx is a number between 00 and 15. There are good reasons for this setup, which have to do with network connectivity and access to local telephone lines. This means that I can''t flag an individual in Sendai in the Asterisk plugin.
Therefore I was thinking of something like this.
1. SIP/cme-sendai/4001 is called, Asterisk-IM plugin notices that and flags the unique call id (which is something like SIP/cme-sendai-4a32fd as being a call to 4001.
2. Plugin put''s status of user with 4001 as on the phone
3. When SIP/cme-sendai-4a32fd call is terminated, plugin looks up who''s extension it is and flags the user as off the phone.
Of course, it would have to go both ways, and IM plugin would have to check for CallerID as well.
I hope I explained this properly and that I can help somewhat with the implementation.