<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <p>It is not implemented in the C code of Kamailio's module, but
      libsecsipid offers a function to sign any payload and headers json
      documents, pasting from its API:</p>
    <p><br>
    </p>
    <p>// SecSIPIDSignJSONHP --<br>
      // * sign the JSON header and payload with provided private key<br>
      // * headerJSON -  header part in JSON forman (0-terminated
      string)<br>
      // * payloadJSON -  payload part in JSON forman (0-terminated
      string)<br>
      // * prvkeyPath - path to private key to be used to generate the
      signature<br>
      // * outPtr - to be set to the pointer containing the output (it
      is a<br>
      //   0-terminated string); the `*outPtr` must be freed after use<br>
      // * return: the length of `*outPtr`<br>
      extern int SecSIPIDSignJSONHP(char* headerJSON, char* payloadJSON,
      char* prvkeyPath, char** outPtr);<br>
    </p>
    <p><br>
    </p>
    <p>Meaning that one can build the headers and payload json documents
      as they want in the config with script operations and get it back
      encoded and with signature. This function can be easily exported
      to kamailio.cfg. Obviously, adding additional code to simplify
      usage in kamailio.cfg for this particular case would be probably
      better, but requires more C (to Kamailio) or Go (to libsecsipid)
      coding. If someone wants to do it, he/she is more that welcome.
      Personally I do not have an immediate need for this extension,
      with other higher priority tasks, it's not something I can
      allocate spare time for it.<br>
    </p>
    <p><br>
    </p>
    <p>More over, one can do alternative implementation in Lua or
      Python, using KEMI or inline execution via app_lua or app_python3.
      I remember people saying they did it (in Lua, iirc) before we had
      any dedicated kamailio module.</p>
    <p><br>
    </p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 09.06.21 16:30, Steven Wheeler
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:6f46f05db8044acc938d658a152f28bc@usinternet.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
      <div id="divtagdefaultwrapper" style="font-size: 12pt; color:
        rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif,
        EmojiFont, "Apple Color Emoji", "Segoe UI
        Emoji", NotoColorEmoji, "Segoe UI Symbol",
        "Android Emoji", EmojiSymbols;" dir="ltr">
        <p>I believe that David's interpretation is correct. My
          understanding of the standard is that it allows carriers which
          are diverting a call (call forwarding, simultaneous ringing,
          etc.) on behalf of one of their customers to provide the
          original attestation they received as well as information
          about where the call is being diverted to.</p>
        <p><br>
        </p>
        <p>I'm no expert in STIR/SHAKEN, but my understanding is that
          this proposal adds two options to handle diversions. The first
          is a "div" passport which is added as an additional Identity
          header to the outgoing SIP message. The second is a "div-o"
          passport which includes the original Identity header within
          its value and replaces the original Identity header in the
          outgoing SIP message.</p>
        <p><br>
        </p>
        <div id="Signature">
          <div id="divtagdefaultwrapper" style="font-size: 12pt; color:
            rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica,
            sans-serif, EmojiFont, "Apple Color Emoji",
            "Segoe UI Emoji", NotoColorEmoji, "Segoe UI
            Symbol", "Android Emoji", EmojiSymbols;">
            <div style="color:rgb(33,33,33); font-size:15px; margin:0px"><font
                size="2" face="Calibri,sans-serif"><span
                  style="font-size:11pt"><font face="Moderat"
                    color="#F4793C"><b>Steven Wheeler</b></font></span></font></div>
            <div style="color:rgb(33,33,33); font-size:15px; margin:0px"><br>
            </div>
          </div>
        </div>
        <div style="color: rgb(0, 0, 0);">
          <hr tabindex="-1" style="display:inline-block; width:98%">
          <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
              face="Calibri, sans-serif" color="#000000"><b>From:</b>
              David Villasmil <a class="moz-txt-link-rfc2396E" href="mailto:david.villasmil.work@gmail.com"><david.villasmil.work@gmail.com></a><br>
              <b>Sent:</b> Wednesday, June 9, 2021 6:50 AM<br>
              <b>To:</b> Kamailio (SER) - Users Mailing List;
              <a class="moz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a><br>
              <b>Cc:</b> Steven Wheeler<br>
              <b>Subject:</b> Re: [SR-Users] ATIS-1000085 STIR/SHAKEN
              DIV PASSporT</font>
            <div> </div>
          </div>
          <div>
            <div dir="auto">From reading, I understood a div PASSporTs
              without attestation should be added by the entity doing
              the diversion.</div>
            <div dir="auto"><br>
            </div>
            <div dir="auto">
              <div><a
href="https://datatracker.ietf.org/doc/html/draft-ietf-stir-passport-divert-09#section-5"
                  id="LPlnk375787" previewremoved="true"
                  moz-do-not-send="true">https://datatracker.ietf.org/doc/html/draft-ietf-stir-passport-divert-09#section-5</a></div>
              <div id="LPBorder_GT_16232490070970.7902097731066349"
                style="margin-bottom: 20px; overflow: auto; width: 100%;
                text-indent: 0px;">
                <table id="LPContainer_16232490070940.22145350644560535"
                  role="presentation" style="width: 90%;
                  background-color: rgb(255, 255, 255); position:
                  relative; overflow: auto; padding-top: 20px;
                  padding-bottom: 20px; margin-top: 20px; border-top:
                  1px dotted rgb(200, 200, 200); border-bottom: 1px
                  dotted rgb(200, 200, 200);" cellspacing="0">
                  <tbody>
                    <tr style="border-spacing: 0px;" valign="top">
                      <td id="TextCell_16232490070950.6964875361001068"
                        colspan="2" style="vertical-align: top;
                        position: relative; padding: 0px; display:
                        table-cell;">
                        <div
                          id="LPTitle_16232490070950.24410288437549732"
                          style="top: 0px; color: rgb(0, 120, 215);
                          font-weight: 400; font-size: 21px;
                          font-family: wf_segoe-ui_light, "Segoe UI
                          Light", "Segoe WP Light",
                          "Segoe UI", "Segoe WP",
                          Tahoma, Arial, sans-serif; line-height: 21px;">
                          <a
                            id="LPUrlAnchor_16232490070960.3154895949099368"
href="https://datatracker.ietf.org/doc/html/draft-ietf-stir-passport-divert-09#section-5"
                            target="_blank" style="text-decoration:
                            none;" moz-do-not-send="true">draft-ietf-stir-passport-divert-09</a></div>
                        <div
                          id="LPMetadata_16232490070960.3087754406546195"
                          style="margin: 10px 0px 16px; color: rgb(102,
                          102, 102); font-weight: 400; font-family:
                          wf_segoe-ui_normal, "Segoe UI",
                          "Segoe WP", Tahoma, Arial,
                          sans-serif; font-size: 14px; line-height:
                          14px;">
                          datatracker.ietf.org</div>
                        <div
                          id="LPDescription_16232490070960.5136224761168477"
                          style="display: block; color: rgb(102, 102,
                          102); font-weight: 400; font-family:
                          wf_segoe-ui_normal, "Segoe UI",
                          "Segoe WP", Tahoma, Arial,
                          sans-serif; font-size: 14px; line-height:
                          20px; max-height: 100px; overflow: hidden;">
                          PASSporT Extension for Diverted Calls
                          (Internet-Draft, 2020)</div>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </div>
              <br>
              <br>
            </div>
            <div dir="auto"><br>
            </div>
            <div dir="auto"><br>
            </div>
            <div><br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Wed, 9 Jun 2021 at
                  12:10, Daniel-Constantin Mierla <<a
                    href="mailto:miconda@gmail.com"
                    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-width:1px;
                  border-left-style:solid; padding-left:1ex;
                  border-left-color:rgb(204,204,204)">
                  <div>
                    <p>Hello,</p>
                    <p><br>
                    </p>
                    <p>I was not aware if this, it does not seem to be
                      from IETF. Can you summarize what it is about,
                      eventually comparing what are the differences to
                      the IETF STIR/SHAKEN specs? Is it about adding the
                      caller signature in another header than Identity
                      and also verifying  another header?</p>
                    <p><br>
                    </p>
                    <p>Cheers,<br>
                      Daniel</p>
                  </div>
                  <div>
                    <p><br>
                    </p>
                    <div>On 08.06.21 23:58, Steven Wheeler wrote:<br>
                    </div>
                    <blockquote type="cite">
                      <div
                        id="m_-876863524909847696divtagdefaultwrapper"
                        dir="ltr" style="font-size: 12pt; font-family:
                        Calibri, Helvetica, sans-serif, EmojiFont,
                        "Apple Color Emoji", "Segoe UI
                        Emoji", NotoColorEmoji, "Segoe UI
                        Symbol", "Android Emoji",
                        EmojiSymbols; color: rgb(0, 0, 0);">
                        <p
                          style="font-family:Calibri,Helvetica,sans-serif">My
                          Google searches aren't turning up any results,
                          probably because this standard isn't finalized
                          yet, but is anyone aware of a module which
                          implements DIV PASSporTs for diverted calls?</p>
                        <p
                          style="font-family:Calibri,Helvetica,sans-serif"><br>
                        </p>
                        <p
                          style="font-family:Calibri,Helvetica,sans-serif">More
                          details on the standard here: <a
                            href="https://transnexus.com/blog/2020/shaken-div-std-letter-ballot/"
                            id="m_-876863524909847696LPlnk221337"
                            target="_blank"
                            style="font-family:Calibri,Helvetica,sans-serif"
                            moz-do-not-send="true">https://transnexus.com/blog/2020/shaken-div-std-letter-ballot/</a></p>
                        <p
                          style="font-family:Calibri,Helvetica,sans-serif"><br>
                        </p>
                        <div id="m_-876863524909847696Signature"
                          style="font-family:Calibri,Helvetica,sans-serif">
                          <div
                            id="m_-876863524909847696divtagdefaultwrapper"
                            style="font-family: Calibri, Helvetica,
                            sans-serif, EmojiFont, "Apple Color
                            Emoji", "Segoe UI Emoji",
                            NotoColorEmoji, "Segoe UI Symbol",
                            "Android Emoji", EmojiSymbols;">
                            <div style="font-size:15px; margin:0px;
                              font-family:Calibri,Helvetica,sans-serif;
                              color:rgb(33,33,33)">
                              <font
                                style="font-family:Calibri,sans-serif;
                                color:rgb(33,33,33)" size="2"
                                face="Calibri,sans-serif"><span
                                  style="font-size:11pt;
                                  font-family:Calibri,sans-serif"><font
                                    style="font-family:Moderat;
                                    color:rgb(244,121,60)"
                                    face="Moderat"><b
                                      style="font-family:Moderat">Steven
                                      Wheeler</b></font></span></font></div>
                          </div>
                        </div>
                      </div>
                      <br>
                      <fieldset></fieldset>
                      <pre style="font-family:monospace">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * <a href="mailto:sr-users@lists.kamailio.org" target="_blank" style="font-family:monospace" moz-do-not-send="true">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" style="font-family:monospace" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
                    </blockquote>
                    <pre cols="72" style="font-family:monospace">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank" style="font-family:monospace" moz-do-not-send="true">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank" style="font-family:monospace" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank" style="font-family:monospace" moz-do-not-send="true">www.linkedin.com/in/miconda</a></pre>
                  </div>
__________________________________________________________<br>
                  Kamailio - Users Mailing List - Non Commercial
                  Discussions<br>
                    * <a href="mailto:sr-users@lists.kamailio.org"
                    target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
                  Important: keep the mailing list in the recipients, do
                  not reply only to the sender!<br>
                  Edit mailing list options or unsubscribe:<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" class="gmail_signature">
              <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>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * <a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </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></pre>
  </body>
</html>