<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p>I expect that you have to call append_branch() before doing
      t_load_contacts().</p>
    <p>Then, where do you execute drop() for the sip reply? Kamailio is
      dropping the replies if you call drop() -- this is a feature since
      2005-2006 (openser 1.1.x or so), if I recall it properly at this
      moment, I may even be the developer for this feature. Anyhow, it
      should work fine if used in reply_route or onreply_route -- I used
      for a new config last week inside reply_route to fix issues with a
      broken gateway that doesn't like 183 before 180.</p>
    <p>Maybe you can provide a pcap as well as relevant configuration
      file snippets for use of the drop().</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 02/07/16 15:49, John Petrini wrote:<br>
    </div>
    <blockquote
cite="mid:CAD4AmV7hVkM6s3K9dtAcDe90xE1kq4TcUDYS0FnaxRNuaZ4=XA@mail.gmail.com"
      type="cite">
      <div dir="ltr"><span style="font-size:12.8px">Hello,</span>
        <div style="font-size:12.8px"><br>
        </div>
        <div style="font-size:12.8px">I'm trying to append a branch,
          assign it a q value so it has priority and serialize the new
          branch and the main branch.</div>
        <div style="font-size:12.8px"><br>
        </div>
        <div style="font-size:12.8px">The goal is to send the new branch
          off to our CNAM provider, capture the CNAM in their reply to
          an $avp then drop the branch, stick the cnam in the main
          branch and allow the call to continue as normal. We do this
          currently using OpenSIPS with serialize_branches(1) but the of
          load_contacts() behavior seems to be different than
          serialize_branches.</div>
        <div style="font-size:12.8px"><br>
        </div>
        <div style="font-size:12.8px">route[CNAM_DIPS]</div>
        <div style="font-size:12.8px">
          <div>  t_on_branch("CNAM_DIPS");</div>
          <div>  t_on_reply("CNAM_DIPS");</div>
          <div>  t_on_failure("CNAM_DIPS");</div>
          <div>  t_load_contacts();</div>
          <div>  t_next_contacts();</div>
          <div> 
            append_branch(<a class="moz-txt-link-rfc2396E" href="sip:2223334444@22.33.444.55:5600;trans-type=5">"sip:2223334444@22.33.444.55:5600;trans-type=5"</a>,
            "0.5");</div>
          <div>  relay();</div>
          <div>  break;</div>
          <div><br>
          </div>
          <div>Two problems. First when t_next_contacts is called I get
            the following error:</div>
          <div>ERROR: pv [pv_branch.c:58]: pv_get_branchx(): error
            accessing branch [0]<br>
          </div>
          <div>So it looks like the branches aren't actually being
            loaded?</div>
          <div><br>
          </div>
          <div>Second problem is that despite the first error my call
            goes out on the branch I appended and I get a reply from the
            CNAM provider but Kamailio forwards that reply back to the
            phone causing the phone to send a second invite. In OpenSIPs
            we just called drop, to drop the branch and let the main
            branch continue but this doesn't seem to work in Kamailio.</div>
          <div><br>
          </div>
          <div>I've read and reread the documentaion but it doesn't seem
            to behave the way the documentation says it should. Is there
            something I'm missing? Is there a better way to accomplish
            this in Kamailio?</div>
          <div><br>
          </div>
          <div>Thank You,</div>
        </div>
        <div>
          <div class="gmail_signature" data-smartmail="gmail_signature">
            <div dir="ltr">
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <p
style="margin-top:8px;margin-bottom:8px;font-family:Helvetica,Verdana,Arial,sans-serif;font-size:0.85em;color:rgb(51,51,51);line-height:1.4"><span
                            style="font-size:0.85em;line-height:1.4">___</span><br>
                        </p>
                        <p
style="margin-top:8px;margin-bottom:8px;font-family:Helvetica,Verdana,Arial,sans-serif;font-size:1.1em;color:rgb(51,51,51);line-height:1.4">John
                          Petrini</p>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a> - <a class="moz-txt-link-freetext" href="http://www.kamailio.org">http://www.kamailio.org</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
  </body>
</html>