<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>the idea of sending 100 trying was to stop retransmissions from
      upstream and then wait for 200ok from downstream, not to send
      200ok immediately after the 100trying.</p>
    <p>Is the forwarding to next hops done in parallel or it is serial
      forking?</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 08.02.21 14:51, Denys Pozniak wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CA+x3Axr2TsPkygx7jwQEk2VK9y8-OC0oh3ciNAAesGqeHNz3iQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hello!
        <div><br>
        </div>
        <div>> the 200ok for PUBLISH contains some additional headers
          (e.g., relate to ETag) that must be used in follow-up PUBLISH
          requests, are you sure that replying from intermediary proxy,
          not the presence server is resulting in what you want to have?</div>
        <div>Yes, in our current logic the fields SIP-ETag,
          SIP-If-Match, Expires are not needed yet.</div>
        <div><br>
        </div>
        <div>> If the first 200ok is to stop retransmission, then I
          said, try with 100 trying response from intermediary proxy.</div>
        <div>Added 100 Trying from Intermediate Proxy to Upstream
          direction, but nothing has changed (Intermediate Proxy ignores
          200ok from Presence and sends PUBLISH again).</div>
        <div><br>
          <div><br>
          </div>
          <div><br>
          </div>
          <div><br>
          </div>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">пт, 5 февр. 2021 г. в 11:57,
          Daniel-Constantin Mierla <<a
            href="mailto:miconda@gmail.com" moz-do-not-send="true">miconda@gmail.com</a>>:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div>
            <p>Hello,</p>
            <p>the 200ok for PUBLISH contains some additional headers
              (e.g., relate to ETag) that must be used in follow-up
              PUBLISH requests, are you sure that replying from
              intermediary proxy, not the presence server is resulting
              in what you want to have?</p>
            <p>If the first 200ok is to stop retransmission, then I
              said, try with 100 trying response from intermediary
              proxy.</p>
            <p>Cheers,<br>
              Daniel<br>
            </p>
            <div>On 04.02.21 14:33, Denys Pozniak wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">> I do not understand what is difficult,
                to configure the next hop application to send 100
                trying? Or maybe you can provide a diagram of how sip
                traffic is routed on your case.
                <div><br>
                </div>
                <div>1) Diagram below is the case I described in the
                  initial email. Here you can see incoming SIP PUBLISH
                  and 3 forked legs towards Presence Servers.</div>
                <div>As soon as Kamailio Proxy receives SIP PUBLISH it
                  sends 200 Ok back. </div>
                <div>The Presence Server that has active subscription
                  answers with 200 OK otherwise 404 Not Found.</div>
                <div>So the question was how to drop sending 200 OK (and
                  any other replies) from Proxy to the left side.</div>
                <div>
                  <div><br>
                  </div>
                </div>
                <div><img src="cid:part2.32C03855.FFBF0ABE@gmail.com"
                    alt="image.png" class="" width="562" height="199"><br>
                </div>
                <div><br>
                </div>
                <div>2) When I drop 200 OK in <b>reply_route</b>,
                  Kamailio Proxy retransmits SIP PUBLISH to Presence
                  Server.</div>
                <div><br>
                </div>
                <div><img src="cid:part3.0DA999D8.429C4D2E@gmail.com"
                    alt="image.png" class="" width="562" height="333"><br>
                </div>
              </div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">чт, 4 февр. 2021 г. в
                  14:55, David Villasmil <<a
                    href="mailto:david.villasmil.work@gmail.com"
                    target="_blank" moz-do-not-send="true">david.villasmil.work@gmail.com</a>>:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">
                  <div dir="auto">I think he’s trying to reply to the
                    client immediately with a 200 and consume and not
                    forward the 200 coming from the presence servers.</div>
                  <div><br>
                    <div class="gmail_quote">
                      <div dir="ltr" class="gmail_attr">On Thu, 4 Feb
                        2021 at 12:43, Daniel-Constantin Mierla <<a
                          href="mailto:miconda@gmail.com"
                          target="_blank" moz-do-not-send="true">miconda@gmail.com</a>>
                        wrote:<br>
                      </div>
                      <blockquote class="gmail_quote" style="margin:0px
                        0px 0px 0.8ex;border-left:1px solid
                        rgb(204,204,204);padding-left:1ex">
                        <div>
                          <p><br>
                          </p>
                          <div>On 04.02.21 12:59, Denys Pozniak wrote:<br>
                          </div>
                          <blockquote type="cite">
                            <div dir="ltr">> If you need to stop the
                              retransmission, a 100 trying should be
                              sent instead of 200ok. Can you reconfigure
                              the next hop to do that? Or is it out of
                              your control?<br>
                              <div>Looks it is difficult to do this as
                                Kamailio Proxy forks via append_branch()
                                incoming SIP PUBLISH to all Presence
                                Servers.<br>
                              </div>
                            </div>
                          </blockquote>
                          <p><br>
                          </p>
                          <p>I do not understand what is difficult, to
                            configure the next hop application to send
                            100 trying? Or maybe you can provide a
                            diagram of how sip traffic is routed on your
                            case.</p>
                          <p><br>
                          </p>
                          <blockquote type="cite">
                            <div dir="ltr">
                              <div>And even if Presence Server answers
                                200 OK, the Kamailio Proxy still sends a
                                repeated SIP PUBLISH there within the fr
                                timer.<br>
                              </div>
                            </div>
                          </blockquote>
                          <p><br>
                          </p>
                          <p>This remark is also not clear, is the 200ok
                            handled by Kamailio, sent upstream, but then
                            Kamailio still resends the PUBLISH?<br>
                            <br>
                            Cheers,<br>
                            Daniel</p>
                        </div>
                        <div>
                          <p><br>
                          </p>
                          <blockquote type="cite"><br>
                            <div class="gmail_quote">
                              <div dir="ltr" class="gmail_attr">чт, 4
                                февр. 2021 г. в 13:04, Daniel-Constantin
                                Mierla <<a
                                  href="mailto:miconda@gmail.com"
                                  target="_blank" moz-do-not-send="true">miconda@gmail.com</a>>:<br>
                              </div>
                              <blockquote class="gmail_quote"
                                style="margin:0px 0px 0px
                                0.8ex;border-left:1px solid
                                rgb(204,204,204);padding-left:1ex">
                                <div>
                                  <p>Hello,</p>
                                  <p>if the 200ok is consumed by tm, it
                                    will destroy the transaction very
                                    soon. I am not sure this is a good
                                    path to go.<br>
                                  </p>
                                  <p>If you need to stop the
                                    retransmission, a 100 trying should
                                    be sent instead of 200ok. Can you
                                    reconfigure the next hop to do that?
                                    Or is it out of your control?</p>
                                  <p>Cheers,<br>
                                    Daniel<br>
                                  </p>
                                  <div>On 04.02.21 11:47, Denys Pozniak
                                    wrote:<br>
                                  </div>
                                  <blockquote type="cite">
                                    <div dir="ltr">
                                      <div>Hello!</div>
                                      <div><br>
                                      </div>
                                      <div>In the configuration below
                                        Kamailio Proxy creates a
                                        transaction for the SIP PUBLISH
                                        to get info from the HTTP server
                                        in async mode.</div>
                                      <div>But before creating a
                                        transaction, a synthetic 200 OK
                                        is sent, so that I need somehow
                                        to drop the real 200 OK from the
                                        upstream Presence Server.<br>
                                      </div>
                                      <div>If drop 200 OK in <b>reply_route</b>,
                                        tm module starts to retransmit.<br>
                                      </div>
                                      <div>Those it is necessary that
                                        the 200 OK be consumed by the tm
                                        module, but does not go further.<br>
                                      </div>
                                      <div><br>
                                      </div>
                                      <div><i>if ( !is_method("PUBLISH")
                                          ) {<br>
                                        </i></div>
                                      <div><i>       
                                          sl_send_reply("200", "Ok");<br>
                                                  t_newtran();<br>
                                        </i></div>
                                      <div><i>        $http_req(suspend)
                                          = 1;<br>
                                                 
                                           http_async_query("$var(url)",
                                          "CALLBACK");<br>
                                        </i></div>
                                      <div><i>}</i></div>
                                      <div><i><br>
                                        </i></div>
                                      <div><i>route[CALLBACK] {<br>
                                        </i></div>
                                      <div><i>        <some header
                                          manipulation></i></div>
                                      <i>       
                                        t_on_reply("PUBLISH_REPLY");<br>
                                                route(RELAY);<br>
                                                exit;<br>
                                      </i>
                                      <div><i>}</i></div>
                                      <div><i><br>
                                        </i></div>
                                      <div><i>onreply_route[PUBLISH_REPLY]
                                          {<br>
                                                  if (
                                          t_check_status("200") ) {<br>
                                                          <b>drop; #
                                            Does not work!!!</b><br>
                                                  }<br>
                                          }<br>
                                        </i></div>
                                      <div><br>
                                      </div>
                                      <div>Any advice is appreciated</div>
                                      <div><br>
                                      </div>
                                      -- <br>
                                      <div dir="ltr">
                                        <div dir="ltr"><br>
                                          <div>
                                            <div>BR,</div>
                                            <div>Denys Pozniak<br>
                                            </div>
                                            <div><br>
                                            </div>
                                            <div><br>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                    <br>
                                    <fieldset></fieldset>
                                    <pre>_______________________________________________
Kamailio (SER) - Users Mailing List
<a href="mailto:sr-users@lists.kamailio.org" target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
                                  </blockquote>
                                  <pre cols="72">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank" moz-do-not-send="true">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Funding: <a href="https://www.paypal.me/dcmierla" target="_blank" moz-do-not-send="true">https://www.paypal.me/dcmierla</a></pre>
                                </div>
                              </blockquote>
                            </div>
                            <br clear="all">
                            <div><br>
                            </div>
                            -- <br>
                            <div dir="ltr">
                              <div dir="ltr"><br>
                                <div>
                                  <div>BR,</div>
                                  <div>Denys Pozniak<br>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div><br>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </blockquote>
                          <pre cols="72">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank" moz-do-not-send="true">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Funding: <a href="https://www.paypal.me/dcmierla" target="_blank" moz-do-not-send="true">https://www.paypal.me/dcmierla</a></pre>
                        </div>
                        _______________________________________________<br>
                        Kamailio (SER) - Users Mailing List<br>
                        <a href="mailto:sr-users@lists.kamailio.org"
                          target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                        <a
                          href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                          rel="noreferrer" target="_blank"
                          moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                      </blockquote>
                    </div>
                  </div>
                  -- <br>
                  <div dir="ltr">
                    <div dir="ltr">
                      <div>Regards,</div>
                      <div><br>
                      </div>
                      David Villasmil
                      <div>email: <a
                          href="mailto:david.villasmil.work@gmail.com"
                          target="_blank" moz-do-not-send="true">david.villasmil.work@gmail.com</a></div>
                      <div>phone: +34669448337</div>
                    </div>
                  </div>
                </blockquote>
              </div>
              <br clear="all">
              <div><br>
              </div>
              -- <br>
              <div dir="ltr">
                <div dir="ltr"><br>
                  <div>
                    <div>BR,</div>
                    <div>Denys Pozniak<br>
                    </div>
                    <div><br>
                    </div>
                    <div><br>
                    </div>
                  </div>
                </div>
              </div>
            </blockquote>
            <pre cols="72">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank" moz-do-not-send="true">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Funding: <a href="https://www.paypal.me/dcmierla" target="_blank" moz-do-not-send="true">https://www.paypal.me/dcmierla</a></pre>
          </div>
        </blockquote>
      </div>
      <br clear="all">
      <div><br>
      </div>
      -- <br>
      <div dir="ltr" class="gmail_signature">
        <div dir="ltr"><br>
          <div>
            <div>BR,</div>
            <div>Denys Pozniak<br>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Funding: <a class="moz-txt-link-freetext" href="https://www.paypal.me/dcmierla">https://www.paypal.me/dcmierla</a></pre>
  </body>
</html>