* You are viewing Posts Tagged ‘device state’

XMPP Issues In Asterisk 11.6.0 For Distributed Device States…

I have been working with distributed device states in Asterisk using XMPP
attached to an OpenFire server. I have it working well across two servers and want to roll it out across every server in my company. All servers are Asterisk 11.6.0. I am running into a problem that seems like it should be a bit easier to solve than it is seeming to be. On the third server I am rolling into this solution, I get plenty of the following:

res_xmpp.c:1398 xmpp_pubsub_handle_error: Error performing operation on PubSub node device_state, 403.

So, basically, servers 1 and 2 continue to hum along nicely updating their device state, but server 3 gets a 403 forbidden message when it tries to deal with device state. I believe this has to do with the permissions set up on the device state node. I have a small example that demonstrates the creation of a new node.

In the Asterisk CLI, I ran ‘xmpp create collection asterisk test’ on server 3, which was successful and can be seen on servers 1 and 2 with
‘xmpp list nodes asterisk’

The debug output from server 3 for this is as follows:

<--- XMPP sent to 'asterisk' --->








<--- XMPP sent to 'asterisk' --->


As we can see, the first message creates the test node and sets the access model to whitelist, so only jids in the whitelist are allowed to modify it. The second message then sets the appropriate server 1 and server 2
jids to be owners, thus meeting the requirements of the whitelist.

Since these nodes are persistent, it would appear that server 3 cannot properly access device_state because it was never whitelisted when the node was created originally. I am fairly certain that I can solve this by deleting all my nodes and letting them be recreated, but that seems extreme as I put more servers into the system. Any thoughts on a better way to handle xmpp and making sure new servers can access the proper nodes?

Kevin Larsen – Systems Analyst – Pioneer Balloon Company

Disabling Mwi Messages With XMPP?


Anyone know if it is possible with Asterisk 11.7 using a Tigase 5.1.5 server to stop receiving notice about old and new messages waiting? Looking at xmpp.conf there does not seems to be a setting to disable voicemail notification. Only the Device State is useful for us for now and strangely in the setup of 18 Asterisk 11 servers (a mix between 11.7 and 11.4
versions) we currently have running we are getting a lot of core dumps (a lot of the times 3 or 4 servers crashes at the same time at least once per day) and from what we can see it is always related to a random voicemail notice message.

We havent been able to do a DONT OPTIMIZE backtrace yet but we are working on it but in the meantime, since these servers are in production if we could just disable these messages I think we could prevent those crashes for now and give us time to work on this issue. At this point, we dont know yet if it is related to an error in our config files or a real bug. Once we can get a usable backtrace we will post a bug on the issue tracker.



AST-2012-015: Denial Of Service Through Exploitation Of Device State Caching

Asterisk Project Security Advisory – AST-2012-015

Product Asterisk
Summary Denial of Service Through Exploitation of Device
State Caching
Nature of Advisory Denial of Service
Susceptibility Remote Unauthenticated Sessions
Severity Critical
Exploits Known None
Reported On 26 July, 2012
Reported By Russell Bryant
Posted On 2 January, 2013
Last Updated On January 2, 2013
Advisory Contact Matt Jordan
CVE Name CVE-2012-5977

Description Asterisk maintains an internal cache for devices. The
device state cache holds the state of each device known to
Asterisk, such that consumers of device state information
can query for the last known state for a particular device,
even if it is not part of an active call. The concept of a
device in Asterisk can include things that do not have a
physical representation. One way that this currently occurs
is when anonymous calls are allowed in Asterisk. A device
is automatically created and stored in the cache for each
anonymous call that occurs; this is possible in the SIP and
IAX2 channel drivers and through channel drivers that
utilize the res_jabber/res_xmpp resource modules (Gtalk,
Jingle, and Motif). Attackers exploiting this vulnerability
can attack an Asterisk system configured to allow anonymous
calls by varying the source of the anonymous call,
continually adding devices to the device state cache and
consuming a system’s resources.

Resolution Channels that are not associated with a physical device are
no longer stored in the device state cache. This affects
Local, DAHDI, SIP and IAX2 channels, and any channel drivers
built on the res_jabber/res_xmpp resource modules (Gtalk,
Jingle, and Motif).

Affected Versions
Product Release Series
Asterisk Open Source 1.8.x All Versions
Asterisk Open Source 10.x All Versions
Asterisk Open Source 11.x All Versions
Certified Asterisk 1.8.11 All Versions
Asterisk Digiumphones 10.x-digiumphones All Versions

Corrected In
Product Release
Asterisk Open Source, 10.11.1, 11.1.1
Certified Asterisk 1.8.11-cert10
Asterisk Digiumphones 10.11.1-digiumphones

SVN URL Revision
http://downloads.asterisk.org/pub/security/AST-2012-015-1.8.diff Asterisk
http://downloads.asterisk.org/pub/security/AST-2012-015-10.diff Asterisk
http://downloads.asterisk.org/pub/security/AST-2012-015-11.diff Asterisk

Links https://issues.asterisk.org/jira/browse/ASTERISK-20175

Asterisk Project Security Advisories are posted at


This document may be superseded by later versions; if so, the latest
version will be posted at
http://downloads.digium.com/pub/security/AST-2012-015.pdf and

Revision History
Date Editor Revisions Made
19 November 2012 Matt Jordan Initial Draft

Asterisk Project Security Advisory – AST-2012-015
Copyright (c) 2012 Digium, Inc. All Rights Reserved.
Permission is hereby granted to distribute and publish this advisory in its
original, unaltered form.

Asterisk 11 Queue Calls – Emulate Dial(b) Functionality

I currently run an Asterisk 10 system with hotdesking functionality set up. Several of the users have worked with a system in the past that supported BLF on their IP phones, and would like their current phones to behave in a similar fashion. Right now I have a really kludgy system that mostly works, but doesn’t consistently trigger the cleanup macro to “clear” the device state on the end of a call. Rather than continue to beat my head against the wall playing “which context isn’t firing an h extension to dump calls into the cleanup macro”, I decided to investigate Asterisk 11 for the new Dial() b function and the new hangup handler CHANNEL variable.

I have the hints working more or less correctly on direct calls to/from the phones, making use of the b and U functions in Dial() and some judicious use of GROUP channel variables and CHANNEL(hangup_handler_wipe). But, on my live system, sometimes the users receive calls from a queue, and I don’t see any way with the queue calls to emulate the b functionality in Dial() to be able to set the agent extension’s device state to RINGING when the queue call gets created. Obviously, I can use membergosub to set the agent to “INUSE” after they pick up the call (like Dial() U), but is there anything that I can use to manipulate the channel that is calling the agent while/before it is ringing?

Thank you,

Noah Engelberth MetaLINK Technologies

Device State Of A Realtime Queue Member

I’m trying to find if a realtime queue member is paused or not from  the dialplan.

For a “paused”, “not in use” phone, DEVICE_STATE returns “not in use” only. Is there a function that will tell if the phone is paused or not (other than querying the database directly)?
You could use


Use:  ‘queue show’ or ‘asterisk console commands’