diff options
author | Terry Wilson <twilson@digium.com> | 2012-09-25 19:08:02 +0000 |
---|---|---|
committer | Terry Wilson <twilson@digium.com> | 2012-09-25 19:08:02 +0000 |
commit | b7233b18ebd9ce2f8f4bad1309fbe33edaf44e44 (patch) | |
tree | 803a5d54535cb2aa4fc5d6ca4a0b32933a29f497 /channels/sip | |
parent | 0a9d89d6be870d3b55dccd150ae5202aa5e46e65 (diff) |
Properly handle UAC/UAS roles for SIP session timers
The SIP session timer mechanism contains a mandatory 'refresher' parameter
(included in the Session-Expires header) which is used in the session timer
offer/answer signaling within a SIP Invite dialog. It looks like asterisk is
interpreting the uac resp. uas role only as the initial role of client and
server (caller is uac, callee is uas). The standard rfc 4028 however assigns
the client role to the ((RE)-Invite) requester, the server role to the
((RE)-Invite) responder.
This patch has Asterisk track the actual refresher as "us" or "them" as opposed
to relying on just the configured "uas" or "uac" properties.
(closes issue AST-922)
Reported by: Thomas Airmont
Review: https://reviewboard.asterisk.org/r/2118/
........
Merged revisions 373652 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 373665 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 373690 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373691 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sip')
-rw-r--r-- | channels/sip/include/sip.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/channels/sip/include/sip.h b/channels/sip/include/sip.h index 48a5a3bb5..add14237a 100644 --- a/channels/sip/include/sip.h +++ b/channels/sip/include/sip.h @@ -556,9 +556,15 @@ enum st_mode { /*! \brief The entity playing the refresher role for Session-Timers */ enum st_refresher { - SESSION_TIMER_REFRESHER_AUTO, /*!< Negotiated */ - SESSION_TIMER_REFRESHER_UAC, /*!< Session is refreshed by the UAC */ - SESSION_TIMER_REFRESHER_UAS /*!< Session is refreshed by the UAS */ + SESSION_TIMER_REFRESHER_AUTO, /*!< Negotiated */ + SESSION_TIMER_REFRESHER_US, /*!< Initially prefer session refresh by Asterisk */ + SESSION_TIMER_REFRESHER_THEM, /*!< Initially prefer session refresh by the other side */ +}; + +enum st_refresher_param { + SESSION_TIMER_REFRESHER_PARAM_UNKNOWN, + SESSION_TIMER_REFRESHER_PARAM_UAC, + SESSION_TIMER_REFRESHER_PARAM_UAS, }; /*! \brief Define some implemented SIP transports @@ -954,14 +960,14 @@ struct sip_notify { struct sip_st_dlg { int st_active; /*!< Session-Timers on/off */ int st_interval; /*!< Session-Timers negotiated session refresh interval */ + enum st_refresher st_ref; /*!< Session-Timers cached refresher */ int st_schedid; /*!< Session-Timers ast_sched scheduler id */ - enum st_refresher st_ref; /*!< Session-Timers session refresher */ int st_expirys; /*!< Session-Timers number of expirys */ int st_active_peer_ua; /*!< Session-Timers on/off in peer UA */ int st_cached_min_se; /*!< Session-Timers cached Min-SE */ int st_cached_max_se; /*!< Session-Timers cached Session-Expires */ enum st_mode st_cached_mode; /*!< Session-Timers cached M.O. */ - enum st_refresher st_cached_ref; /*!< Session-Timers cached refresher */ + enum st_refresher st_cached_ref; /*!< Session-Timers session refresher */ unsigned char quit_flag:1; /*!< Stop trying to lock; just quit */ }; @@ -970,10 +976,10 @@ struct sip_st_dlg { * of SIP Session-Timers feature on a per user/peer basis. */ struct sip_st_cfg { - enum st_mode st_mode_oper; /*!< Mode of operation for Session-Timers */ - enum st_refresher st_ref; /*!< Session-Timer refresher */ - int st_min_se; /*!< Lowest threshold for session refresh interval */ - int st_max_se; /*!< Highest threshold for session refresh interval */ + enum st_mode st_mode_oper; /*!< Mode of operation for Session-Timers */ + enum st_refresher_param st_ref; /*!< Session-Timer refresher */ + int st_min_se; /*!< Lowest threshold for session refresh interval */ + int st_max_se; /*!< Highest threshold for session refresh interval */ }; /*! \brief Structure for remembering offered media in an INVITE, to make sure we reply |