login | register
Sun 07 of Sep, 2008 [00:24 UTC]

voip-info.org

History

Asterisk presence

Created by: juraj,Last modification on Wed 13 of Aug, 2008 [10:12 UTC] by JustRumours

Asterisk presence


Current CVS -HEAD provides some support of SIP presence as defined in RFC 3856 - A Presence Event Package for the Session Initiation Protocol (SIP). The release version (1.0.9) has some support too.

To support this, you have to somehow tell which SIP user is mapped to the extension mentioned. A "hint" priority is used to describe this, as in this example:

exten => 100,hint,SIP/peername


(it says, that for presence purposes, extension 100's presence should be mapped the SIP peer)

  • IMPORTANT: In Asterisk 1.4 the inner workings of the hint functionality have slightly changed. It is now imperative that you set a call-limit (even if it's an arbitrarily-high value like 100) and/or the new limitonpeers value in sip.conf. Presence will not work without this. If you are using friend instead of peer, you will need limitonpeers = yes as well as a call-limit statement (new in Asterisk 1.4) for each SIP device
  • If you do not add a hint, the extension will be free ("open") always, more or less.
  • If you add incominglimit=1 to your peer (in Asterisk 1.2 only) in sip.conf, the SIP channel will notify you when that extension is busy.

Extension and device state combined, no user state!

Asterisk - with or without the patch - does not currently support PUBLISH method for publishing presence documents in Presence Information Data Format (PIDF) defined in RFC 3863, but it can generate NOTIFY to SUBSCRIBEd users when REGISTER occurs and also when the client disconnects.

This works for example with Xten's Eyebeam client, but can also work with several other phones that support SIP presence. Due to the lack of PUBLISH method support, there's no support of extended states (Away, Do not disturb, Busy). You can subscribe to extension state for any channel that supports device state notification. In CVS head, the Agent channel, SIP and IAX2 supports it.

In order to fix this, we need a user abstraction in Asterisk, something that will be worked on in development version 1.3.


Phones known to work with the current implementation of SIP Presence

  • Snom (various models)
  • Polycom IP30x/IP50x/IP600
  • Xten EyeBeam
  • Grandstream GXP2000 (Firmware >= 1.0.1.13)
  • Aastra 480i
  • Aastra 9133i
  • Thomson ST2030
  • Linksys SPA962/932 - Tutorial


Specific Phone Configuration


Polycom Phones

To enable presence on the Polycom phones you must add a contact to the contact directory. The CONTACT parameter must match the extension of the phone you wish to monitor and the WATCH BUDDY parameter must be set to "enabled". Also, make sure that the first line of the Polycom is registred with your Asterisk server. Polycom tends to use the configuration from the first line for all subscriptions.

With SIP v1.5.2, The Polycom phones may "forget" their subscription for presence information, and return a 450 error to the presence notification. There is no indication on the phone that this has happened, except that the buddy status no longer changes. The only workarounds is to this is to reboot the phone or toggle the WATCH BUDDY parameter to disabled, then to enabled. This bug does not affect other operations on the phone.

Note: There is a quoted limit of 8 (I've found an actual limit of 7) watchable buddies, so if you go to buy the attendant console solution, don't expect to be able to monitor more than 7 other extensions. (see below)

Note: As of firmware version 1.6.6 the limit has been raised on the 601 to 48 watchable buddies. Still 8 on the 501s tho. Yay polycom!


Parking and BLF

This can be achieved in asterisk 1.2 with a patch, and is built in to asterisk 1.4.

Parking BLF in Asterisk 1.2

  • Patch/bug 5779 added hint support for the Local channel construct which allows for monitoring of the parking lot/ parked calls (by checking for existence of a dialplan extension).
  • NOTE: In order to set up a parking BLF with this patch in Asterisk 1.2.X, you must set up the following in the context where your SIP phone registers:

exten => 701,1,ParkedCall(701)
exten => 701,hint,Local/701@ParkedCalls


Parking BLF in Asterisk 1.4

  • NOTE: In order to set up the built-in parking BLF functionality in Asterisk 1.4, you must set up the following in the context where your SIP Phone registers...

include => parkedcalls

exten => 701,1,ParkedCall(701)
exten => 701,hint,park:701@parkedcalls


This differs from the syntax originally described in the patch/bug report for 1.2 above. If you are using metermaid patch with Asterisk 1.2.X and decide to upgrade to 1.4 expecting it to 'just work' you are in for a harsh and poorly documented surprise.


Update for Asterisk 1.6 (under development)

Russel (Digium) has implemented a DEVSTATE function that is described here in more detail. There is a new version that works with 1.4 here

Presence across PBXs


Nuitari wrote a PHP script which connects to the manager of multiple PBXs and uses Russel's (Digium) devstate to set blf across PBXs. You can find it here


See also


Comments

Comments Filter
222

333Re: Polycom BLF limits

by dayton, Friday 11 of April, 2008 [06:09:44 UTC]
Regarding having more <sd>N</sd> tags...

Are you saying that if you have a directory file with 300 people in it, even if you only have, say, 14 of them marked with <bw>1</bw>, that if you attach an <sd>N</sd> tag to all 300 extensions, this will cause the phone to crash?

I mean, you can only assign as many <sd> tags as you have BLF keys, period?
222

333Polycom BLF limits

by edlitmus, Thursday 21 of February, 2008 [20:23:24 UTC]
If you have more <sd>N</sd> tags with values of N greater than the number of blf keys available it will crash Polycom phones. Empty <sd></sd> tags are okay.


222

333polycom phones

by robertorocha, Friday 12 of October, 2007 [18:26:33 UTC]
You HAVE to enable presence in order for the presence feature to work, along with some other settings:

to set up asterisk for buddy list notifications (presence)
-make the following changes to the extensions.conf file
exten => 1001,hint,SIP/1001
repeat this procedure for all the other extensions that need to advertise themselves
-reload the extensions
asterisk -rx "extensions reload"
to set up polycom phones with buddy list and ready for buddy list notifications
-modify the <macaddress>-directory.xml file to look something like this (change it accordingly with the needed extensions):
NOTE: the extension the phone is using should not be on this list
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<directory>
<item_list>
<item>
<fn>X-Lite</fn> ;first name
<ln>1001</ln> ;last name
<ct>1001</ct> ;actual extension
<sd>1</sd> ;speed-dial index
<rt>6</rt> ;ring type
<dc/> ;divert contact - usually blank
<ad>0</ad> ;auto divert
<ar>0</ar> ;auto reject
<bw>1</bw> ;enables buddy watching - used to set up presence
<bb>0</bb> ;buddy block - blocks this contact from watching this phone
</item>
<item>
<fn>501</fn> ;first name
<ln>1002</ln> ;last name
<ct>1002</ct> ;actual extension
<sd>2</sd> ;speed-dial index
<rt>5</rt> ;ring type
<dc/> ;divert contact - usually blank
<ad>0</ad> ;auto divert
<ar>0</ar> ;auto reject
<bw>1</bw> ;enables buddy watching - used to set up presence
<bb>0</bb> ;buddy block - blocks this contact from watching this phone
</item>
</item_list>
</directory>
-modify the /srv/tftp/sip.cfg file making the following changes (this will enable the phone to watch the status of the other devices):
feature.1.name="presence" feature.1.enabled="0"
it should look like this:
feature.1.name="presence" feature.1.enabled="1"

<presense pres.reg=""/>
it should look like this:
<presense pres.reg="1"/>
-powercycle the phones
222

333polycom phones 2

by robertorocha, Friday 12 of October, 2007 [18:24:46 UTC]
I did all the previously mentioned changes, the phones were advertising themselves but to watching the others
After enabling presence on the sip.conf file then restarting the phones, it all worked.
222

333

by FischeFr, Monday 16 of April, 2007 [12:14:33 UTC]
@James Le Cuirot
What did you try? Did you subscribe to a SIP-URI without user name?
I'm getting "BAD EVENT" for all SUBSCRIBE-Requests

-solved-
222

333One Question

by FischeFr, Thursday 12 of April, 2007 [10:55:46 UTC]
> but it can generate NOTIFY to SUBSCRIBEd users when REGISTER occurs and also when the client disconnects.

Can I send a Subscribe for a whole domain, let's say SIP:domain.de and get notified when any user who belongs to this domain (SIP:anybody@domain.de for example) goes online?
If someone knows this, please tell me!
222

333Presence across servers

by chewi, Wednesday 24 of January, 2007 [22:11:40 UTC]
I want to do this across a server via IAX2 but I don't think it's possible. The status of the server itself is reported rather than the status of the users on that server.
222

333Line status monitor

by erth64net, Wednesday 20 of December, 2006 [19:56:24 UTC]
For phones which don't support line status monitor (ie: Asterisk's BLF function), is it possible to get this information through a webpage? Or maybe even sent to the phone's display?
222

333Line status monitor

by gourou5169, Wednesday 29 of November, 2006 [20:53:06 UTC]
I try to setup the line status monitor on my SPA942.
Asterisk handle well the status of the line but the phone doesn't show it and I don't find any information about the configuration needed by the SPA942.

If somebody has already setup thi feature on this phone please feel free to tell me :)
222

333Re: RFCs for presence information

by even, Friday 01 of September, 2006 [09:25:37 UTC]
RFC for the rich presence standard can be found at: http://tools.ietf.org/html/rfc4480
RFC for the older presence standard (which Asterisk currently supports) can be found at http://bgp.potaroo.net/ietf/idref/rfc3863/.

I'm currently looking into adding support for RFC4480.