[asterisk-users] Asterisk 1.4 + Presence

joakimsen at gmail.com joakimsen at gmail.com
Thu Nov 8 12:51:27 CST 2007

    *  hint: The 'hint' priority associates an extension with an
Asterisk channel for the purpose of mapping the state of the channel
to a state of the extension.

In asterisk, a channel (technology/device) can have several states
(unavailable, in-use, busy, ringing, etc) but an extension is just a
label for a sequence of applications. However, when communicating the
state of the channel to an external device, such as a receptionist
console, you cannot use the Asterisk internal channel names, but must
use an externally identifiable resource name, typically the extension

A device would then subscribe to the state of the extension of
interest and receive status notifications from the supporting
technology channel. This is used in the SIP channel (implemented via
the SUBSCRIBE/NOTIFY mechanism of RFC-3265) to light up the status
lamps on SIP phones.
This is supported in SNOM phones (see also) with their programmable
keys set to type "destination", as well as in Polycom (500/600),
Aastra ( 480i, 9133i ), and Sayson phones. It is also supported in
Citel SIP Handset Gateways.

Privacy considerations: In sip.conf you can define a subscribecontext=
value that determines in which context Asterisk should search for the
matching extension when a subscribe request is received from the
phone; however, if the extension doesn't exist in that context
Asterisk is going to look for it in the default context! In other
words: Everyone can subscribe to a "hinted" extension that is defined
in the default context. By the way, specifying an empty
subscribecontext is also fine if the phone should not at all subscribe
to _any_ context.

Likewise bug/patch 5515 (post Asterisk 1.2.0) adds devstate support
also for MGCP (so far SIP, IAX and ZAP are supported; "show
channeltypes" tell you which channels in your Asterisk support device
status notification). Question: Does this patch only show a device
which is unavailable (e.g. disconnected), or does it also show "busy"?
Answer: Also "busy" (in use).

Also chan_capi-cm v0.6.2 and later comes with basic hint support. It
appears, however, that the dynamic naming of CAPI channels that
includes the called number makes monitoring of a CAPI line for
outgoing calls practically impossible - at least for now.

Note: the 3rd party Bristuff patches come with app_devstate that
permits state manipulation through the dialplan.

New: While Asterisk 1.6 will include func_devstate natively there is
now also a backport available for 1.4. This is quite similar to
app_devstate as part of the bristuff patches.

 exten => 200,hint,SIP/phone1  ; this is case sensitive (!) in 1.0.9 and 1.2.0
 exten => 200,1,Macro(stdexten,SIP/phone1)

If you want to monitor the state of multiple phones using one
speeddial, you can do so:

 exten => 200,hint,SIP/201&SIP/202&SIP/203

Asterisk seems to provide syntax for allowing more than one channel to
be mapped to any particular extension with the hint system.

Useful CLI commands for debugging are "SIP show subscriptions", "show
hints", "show channeltypes" and "SIP show inuse".

On Nov 6, 2007 1:36 PM, Alejandro Cabrera Obed <acabrera at sintys.gov.ar> wrote:
> Dear all, I'm using Asterisk 1.4 as my SIP server of my LAN users. The
> SIP clients are using different operating systems such Debian, Gentoo
> and Windows XP so they use different SIP softphones like SJPhone,
> Twinkle and X-Lite.
> In order to let SIP clients to see the presence status to each other, do
> I have to establish any special setting in Asterisk 1.4 ??? Or the
> presence status (online, offline, away, etc.) is only up to the SIP
> clients and not up to the Asterisk ???
> Really thanks
> Alejandro
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users

More information about the asterisk-users mailing list