[Asterisk-Users] Use of the "hint" modifiers - examples, anyone?

John Todd jtodd at loligo.com
Thu Oct 16 01:51:01 MST 2003


I have found some references to the "hint" (or HINT?) variable and 
method in the source code, but quite a bit of Google-ing has not 
turned up any extensive answers as to some real-life examples of how 
to use this perhaps very useful tool.  I understand the point of the 
tool, but I need to get some actual configs to look at before I think 
I'll figure it out.  Even if my particular equipment doesn't support 
it, there may be other ideas I can get from it.  (JerJer - maybe SCCP 
could use that data if there is an SCCP command of similar nature to 
the SIP SUBSCRIBE command - that would be pretty handy for those 7914 
operator stations.)

Searching through the source gives tantalizing hints (no pun 
intended) in pbx.c, but no actual real-life samples.  Can someone who 
is familiar with it put some words to the features?

I found this from March 20, 2003 from Andre Bierwirth:

--------
Subject: [Asterisk-Dev] Logged in users
To: asterisk-dev at lists.digium.com

I am currently work on it. If i am ready Asterisk have functions to get =
device or extension state.

int ast_extension_state(struct ast_channel *c, char *context, char =
*exten)
returns=20
-1 =3D error or no hint(device hint) for extension
  0 =3D extension is free or unknown
  1 =3D one device in extension is busy (have a call)
  2 =3D all devices in extension unavailable(unregistered)

** You can give ast_device_state a Dialstring like SIP/mark or IAX/mark =
**

int ast_device_state(char *device)
returns
-1 =3D error
  0 =3D device is free or unknown
  1 =3D device is busy (have a call)
  2 =3D device is valid but unregistered

So SIP can support SUBSCRIBE requests, and for Snom200 SUBSCIBE Dialogs =
(Map a Key to an extension and see if the extension have a call (the LED =
turned on))

Its easy to implement the device state support for IAX, i have talk with =
mark about it. I implement only the PBX and Channel and SIP functions.

With IAX you can poll the dialplan and get the extension states if its =
implemented.

Andre
-----------

JT



More information about the asterisk-users mailing list