]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 352862 via svnmerge from
authorAlec L Davis <sivad.a@paradise.net.nz>
Fri, 27 Jan 2012 00:08:03 +0000 (00:08 +0000)
committerAlec L Davis <sivad.a@paradise.net.nz>
Fri, 27 Jan 2012 00:08:03 +0000 (00:08 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r352862 | alecdavis | 2012-01-27 13:05:30 +1300 (Fri, 27 Jan 2012) | 12 lines

  rfc4235 - Section 4.1: Versions MUST be representable using a non-negative 32 bit integer.

  If a BLF subscription exists for long enough, using %d may print negative version numbers.
  Unlikely, as 2^32 at 1 update per second is ~137 years, or half that before the versions number started going negative.

  Tested with Asterisk 1.8.8.2 with Grandstream phones.

  alecdavis (license 585)
  Tested by: alecdavis

  Review: https://reviewboard.asterisk.org/r/1694/
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@352863 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c
channels/sip/include/sip.h

index 6d77bc823a982ad346cca49a89381c67a7a50616..893bffc4b6162327a46557ed512ff4a4a82655a2 100644 (file)
@@ -12877,7 +12877,7 @@ static void state_notify_build_xml(int state, int full, const char *exten, const
                break;
        case DIALOG_INFO_XML: /* SNOM subscribes in this format */
                ast_str_append(tmp, 0, "<?xml version=\"1.0\"?>\n");
-               ast_str_append(tmp, 0, "<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"%d\" state=\"%s\" entity=\"%s\">\n", p->dialogver, full ? "full" : "partial", mto);
+               ast_str_append(tmp, 0, "<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"%u\" state=\"%s\" entity=\"%s\">\n", p->dialogver, full ? "full" : "partial", mto);
                if ((state & AST_EXTENSION_RINGING) && sip_cfg.notifyringing) {
                        const char *local_display = exten;
                        char *local_target = ast_strdupa(mto);
@@ -25406,7 +25406,7 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
                        if (p->subscribed == NONE) { /* if the subscribed field is not already set, and there is no accept header... */
                                transmit_response(p, "489 Bad Event", req);
                                ast_log(LOG_WARNING,"SUBSCRIBE failure: no Accept header: pvt: "
-                                       "stateid: %d, laststate: %d, dialogver: %d, subscribecont: "
+                                       "stateid: %d, laststate: %d, dialogver: %u, subscribecont: "
                                        "'%s', subscribeuri: '%s'\n",
                                        p->stateid,
                                        p->laststate,
@@ -25432,7 +25432,7 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
                        transmit_response(p, mybuf, req);
                        ast_log(LOG_WARNING,"SUBSCRIBE failure: unrecognized format:"
                                "'%s' pvt: subscribed: %d, stateid: %d, laststate: %d,"
-                               "dialogver: %d, subscribecont: '%s', subscribeuri: '%s'\n",
+                               "dialogver: %u, subscribecont: '%s', subscribeuri: '%s'\n",
                                unknown_acceptheader,
                                (int)p->subscribed,
                                p->stateid,
index 7d6cd2971acf20260531542188d230927b3d2079..1b3bc1e43e9f7cfa1352070603d5896ee5f9c99c 100644 (file)
@@ -1117,7 +1117,7 @@ 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 */
-       int dialogver;                      /*!< SUBSCRIBE: Version for subscription dialog-info */
+       uint32_t dialogver;                 /*!< SUBSCRIBE: Version for subscription dialog-info */
 
        struct ast_dsp *dsp;                /*!< Inband DTMF or Fax CNG tone Detection dsp */