From: Matthew Jordan Date: Sat, 16 Feb 2013 16:31:30 +0000 (+0000) Subject: Don't send presencestate information if the state is invalid X-Git-Tag: certified/11.2-cert1-rc1~2^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4110cb0e30c651a546b472939d023d4dabec244;p=thirdparty%2Fasterisk.git 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/certified/branches/11.2@381616 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 13e8036d5e..52799d4fd8 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -14422,7 +14422,8 @@ static void state_notify_build_xml(struct state_notify_data *data, int full, con else ast_str_append(tmp, 0, "%s\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, "\n"); ast_str_append(tmp, 0, "\n"); ast_str_append(tmp, 0, "\n");