Uploaded image for project: 'FreeSWITCH'
  1. FreeSWITCH
  2. FS-9671

Wrong Cseq is sent in NOTIFY after FS receiving a SUBSCRIBE with “Expires: 0”

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.8
    • Fix Version/s: 1.8
    • Component/s: mod_sofia
    • Security Level: public
    • Labels:
      None
    • CPU Architecture:
      x86-64
    • Kernel:
      Linux
    • uname:
      Linux FS 3.10.0-229.el7.x86_64
    • Userland:
      GNU/Linux
    • Distribution:
      CentOS
    • Distribution Version:
      CentOS 7
    • Compiler:
      gcc
    • FreeSWITCH GIT Revision:
      1.6.8+git~20160505T153832Z~99de0ad502~64bit
    • GIT Master Revision hash::
      1.6.8+git~20160505T153832Z~99de0ad502~64bit
    • Target Version:
      1.8

      Description

      After FreeSwitch receive a SUBSCRIBE with Expires 0, It send a NOTIFY with Cseq less than the previous one. Log attached.

      RFC-3261 - 12.2.1.1 Generating the Request:

      “Requests within a dialog MUST contain strictly monotonically increasing and contiguous CSeq sequence numbers (increasing-by-one) in each direction (excepting ACK and CANCEL of course, whose numbers equal the requests being acknowledged or cancelled)”


      I’ve done some changes in “sofia_presence.c”, but I’ve tested only for “message-summary”

         4110 { if (zstr(full_agent)) || (*full_agent != 'z' && *full_agent != 'Z')) {
         4111 /* supress endless loop bug with zoiper */
         4112
         4113 uint32_t callsequence = sofia_presence_get_cseq(profile);
         4114 sip_cseq_t * cseq = sip_cseq_create(nh->nh_home, callsequence, SIP_METHOD_NOTIFY);
         4115 nua_notify(nh,
         4116 SIPTAG_EXPIRES_STR("0"),
         4117 SIPTAG_SUBSCRIPTION_STATE_STR(sstr),
         4118 SIPTAG_CSEQ(cseq),
         4119 TAG_END());
         4120 }
        

         4169 if (!strcasecmp(event, "line-seize")) {

         4180 uint32_t callsequence = sofia_presence_get_cseq(profile);
         4181 sip_cseq_t * cseq = sip_cseq_create(nh->nh_home, callsequence, SIP_METHOD_NOTIFY);
         4182 nua_notify(nh,
         4183 SIPTAG_FROM(sip->sip_to),
         4184 SIPTAG_TO(sip->sip_from),
         4185 SIPTAG_EXPIRES_STR(exp_delta_str),
         4186 SIPTAG_SUBSCRIPTION_STATE_STR(sstr),
         4187 SIPTAG_CSEQ(cseq),
         4188 SIPTAG_EVENT_STR("line-seize"), TAG_IF(full_call_info, SIPTAG_CALL_INFO_STR(full_call_info)), TAG_END());
         4189

       

      1. cseq_in_notify_after_subscribe_ex0_event_line-seize.log
        7 kB
        luiz telles
      2. subscribe_cseq_R_MS.xml
        5 kB
        luiz telles
      3. subscribe_cseq.xml
        3 kB
        Brian West
      4. subscribe_cseq2.xml
        4 kB
        luiz telles
      5. wrong_cseq_in_notify_after_subscribe_ex0.log
        12 kB
        luiz telles

        Activity

        Hide
        mikej Mike Jerris added a comment -
        Hello?
        Show
        mikej Mike Jerris added a comment - Hello?
        Hide
        mikej Mike Jerris added a comment -
        any update?
        Show
        mikej Mike Jerris added a comment - any update?
        Hide
        mikej Mike Jerris added a comment -
        last call for feedback
        Show
        mikej Mike Jerris added a comment - last call for feedback
        Hide
        luiztelles luiz telles added a comment -
        Sorry about my late!

        Brian,
        I did some more tests and I realized that we did not have any problem with l "ine-seize", however, the first change in "sofia_presence.c", fix the problem to "message-summary", but it introduces a problem on "Notify with expires 0 of the line-seize" - The Cseq in it is minor that the previous one -, so we need the second one change to avoid it.
         

        Mike,

        Commit: 4c45f529f8b - FS-9671 fix wrong cseq in notify Expires 0


        /Luiz
        Show
        luiztelles luiz telles added a comment - Sorry about my late! Brian, I did some more tests and I realized that we did not have any problem with l "ine-seize", however, the first change in "sofia_presence.c", fix the problem to "message-summary", but it introduces a problem on "Notify with expires 0 of the line-seize" - The Cseq in it is minor that the previous one -, so we need the second one change to avoid it.   Mike, Commit: 4c45f529f8b - FS-9671 fix wrong cseq in notify Expires 0 /Luiz
        Hide
        mikej Mike Jerris added a comment -
        if more changes are necessary, please reopen this and create a pull request with the additional changes necessary
        Show
        mikej Mike Jerris added a comment - if more changes are necessary, please reopen this and create a pull request with the additional changes necessary

          People

          • Assignee:
            mikej Mike Jerris
            Reporter:
            luiztelles luiz telles
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development