diff options
author | Matthew Jordan <mjordan@digium.com> | 2013-02-16 16:28:43 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2013-02-16 16:28:43 +0000 |
commit | 2ebb9863ea2d68bfa066152527d21e40b2873e13 (patch) | |
tree | aeaa52dd56f509ccd138bfb853698ac072b61c04 /channels/chan_sip.c | |
parent | cce1c9547facb5cf28dc4e74f9d2369e83f3a212 (diff) |
Don't send presencestate information if the state is invalid
Previously, presencestate information was sent whenever the state was not
NOT_SET. When r381594 actually returned INVALID presence state in all the
places it was supposed to, it caused chan_sip to start adding presence
state information to NOTIFY requests that it previously would not have
added. chan_sip shouldn't be adding presence state information when the
provider is in an invalid state; users can't set the state to invalid and
an invalid state always implies that the provider is in an error condition.
(issue AST-1084)
........
Merged revisions 381613 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381615 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index af79f4b68..1808d9289 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -14531,7 +14531,8 @@ static void state_notify_build_xml(struct state_notify_data *data, int full, con else ast_str_append(tmp, 0, "<status><basic>%s</basic></status>\n", (local_state != NOTIFY_CLOSED) ? "open" : "closed"); - if (allow_notify_user_presence(p) && (data->presence_state > 0)) { + if (allow_notify_user_presence(p) && (data->presence_state != AST_PRESENCE_INVALID) + && (data->presence_state != AST_PRESENCE_NOT_SET)) { ast_str_append(tmp, 0, "</tuple>\n"); ast_str_append(tmp, 0, "<tuple id=\"digium-presence\">\n"); ast_str_append(tmp, 0, "<status>\n"); |