summaryrefslogtreecommitdiff
path: root/channels/sip/include
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2012-08-09 14:52:16 +0000
committerMark Michelson <mmichelson@digium.com>2012-08-09 14:52:16 +0000
commit9ee8b3c0f639ea2a269c2107055d13dbe08c6b18 (patch)
treebe79835c811675d4608d295da7573e46d963442d /channels/sip/include
parent10672940656a58f45381d625ba3ecdb3481f57c0 (diff)
Extend extension state callbacks to have more information.
Quote from review board: This patch extends the extension state callbacks so that monitoring channels (as chan_sip) get more information of the devices which are responsible for an extension state change. The additional information is needed by chan_sip to present names/numbers of the caller and callee in an early-state SIP notification. Users of extenstion state callback not interested in the additional information are not affected by the changes. Motivation: to present the involved party's name/number in an early-state nofification (used by the notified device as a pickup offer) one after another so that a user can see which call he will pick up in an undirected pickup. Such a pickup offer to a user shall indicate the same call (number/name-A calls number/name-B) as the call which would be picked up when an undirected pickup is executed. Users interested in additional state info must use the new functions ast_extension_state_add_extended() resp. ast_extension_state_add_destroy_extended() to register an extended state callback. When the callback is registered this way, an extra member device_state_info of struct ast_state_cb_info is passed to the callback in addition to the aggregated extension state. This container holds an object for every device of the monitored extension hint consisting of the device name, the device state and a channel reference to the channel which (presumably) caused the device state. The information is used by chan_sip for early-state notifications. When the state of a device changes and the new state contains AST_EVENT_RINGING, an early-state notification is sent to the subscribed devices with the caller/callee names/numbers of the oldest ringing channel of the monitored extension. The notified user may then invoke a direct pickup, which will pickup exactly this channel. Users of the old non-extended callbacks will only be called when the aggregated state did change (same behavior as before). Users of the extended callback will also be called when the state is unchanged but does contain AST_EVENT_RINGING. That could be the case if two channels are ringing at one device and one of them hangs up, so the aggregated state does not change. This way the monitoring channel can create a new early-state notification with the now ringing party-ids. Review: https://reviewboard.asterisk.org/r/2048 This contribution comes from Guenther Kelleter git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sip/include')
-rw-r--r--channels/sip/include/sip.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/channels/sip/include/sip.h b/channels/sip/include/sip.h
index a821435e9..047310fc4 100644
--- a/channels/sip/include/sip.h
+++ b/channels/sip/include/sip.h
@@ -1155,6 +1155,8 @@ struct sip_pvt {
enum subscriptiontype subscribed; /*!< SUBSCRIBE: Is this dialog a subscription? */
int stateid; /*!< SUBSCRIBE: ID for devicestate subscriptions */
int laststate; /*!< SUBSCRIBE: Last known extension state */
+ struct ao2_container *last_device_state_info; /*!< SUBSCRIBE: last known extended extension state (take care of refs)*/
+ struct timeval last_ringing_channel_time; /*!< SUBSCRIBE: channel timestamp of the channel which caused the last early-state notification */
int last_presence_state; /*!< SUBSCRIBE: Last known presence state */
uint32_t dialogver; /*!< SUBSCRIBE: Version for subscription dialog-info */