<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    this should work unless there are parameters with the same name in
    userpart, or uri part or header body part.<br>
    <br>
    Perhaps the safest mode is to apply first the tobody transformation
    to extract the part you want then apply the params transformation.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 08/04/16 17:41, Grant Bagdasarian
      wrote:<br>
    </div>
    <blockquote
      cite="mid:42513752936643feb20dd2363d987621@CM-EX-V01.cm.local"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        mso-fareast-language:NL;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">To
            answer my own question.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">This
            does parse:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">                                              
            $var(p_asserted_identity) = $(hdr(P-Asserted-Identity)[*]);<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">                                              
            $var(caller_id) =
            $(var(p_asserted_identity){param.value,'tel',:});<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">But,
            I’m not sure if this is the correct way to do this. Maybe
            someone else has a more elegant solution?<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span
                  style="mso-fareast-language:NL" lang="EN-US">From:</span></b><span
                style="mso-fareast-language:NL" lang="EN-US"> sr-users
                [<a class="moz-txt-link-freetext" href="mailto:sr-users-bounces@lists.sip-router.org">mailto:sr-users-bounces@lists.sip-router.org</a>]
                <b>On Behalf Of </b>Grant Bagdasarian<br>
                <b>Sent:</b> Friday, April 8, 2016 5:38 PM<br>
                <b>To:</b> Kamailio (SER) - 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-rfc2396E" href="mailto:sr-users@lists.sip-router.org"><sr-users@lists.sip-router.org></a><br>
                <b>Subject:</b> [SR-Users] Extracting
                P-Asserted-Identity value<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><span lang="EN-US">Hello,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">How do I extract the
            value of “tel” from multiple P-Asserted-Identity headers?<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Example:<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:black;mso-fareast-language:NL" lang="EN-US">  
            P-Asserted-Identity: "Cullen Jennings" <<a
              moz-do-not-send="true" href="sip:fluffy@cisco.com"><a class="moz-txt-link-freetext" href="sip:fluffy@cisco.com">sip:fluffy@cisco.com</a></a>><o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:black;mso-fareast-language:NL" lang="EN-US">  
          </span><span style="font-size:10.0pt;font-family:"Courier
            New";color:black;mso-fareast-language:NL">P-Asserted-Identity:
            <a moz-do-not-send="true" href="tel:+14085264000">tel:+14085264000</a><o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">What I got so far is:<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">                                              
            $var(p_asserted_identity) = $(hdr(P-Asserted-Identity)[*]);<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">                                              
            $var(caller_id) =
            $var(p_asserted_identity){param.value,'tel',':'};<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">But this does not work.
            I keep getting parser errors when doing the transformation
            (2<sup>nd</sup> line of code example):<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">I’m not sure how to
            format the line of code. I tried multiple ways, but none
            work.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Apr  8 18:35:20
            kamailio: : <core> [cfg.y:3368]: yyerror_at(): parse
            error in config file /etc/kamailio/kamailio.cfg, line 400,
            column 47: syntax error<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Apr  8 18:35:20
            kamailio: : <core> [cfg.y:3368]: yyerror_at(): parse
            error in config file /etc/kamailio/kamailio.cfg, line 400,
            column 47: bad command<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Apr  8 18:35:20
            kamailio: : <core> [cfg.y:3368]: yyerror_at(): parse
            error in config file /etc/kamailio/kamailio.cfg, line 400,
            column 47: bad command<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Apr  8 18:35:20
            kamailio: : <core> [cfg.y:3368]: yyerror_at(): parse
            error in config file /etc/kamailio/kamailio.cfg, line 400,
            column 53: '('')' expected (function call)<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Apr  8 18:35:20
            kamailio: : <core> [cfg.y:3368]: yyerror_at(): parse
            error in config file /etc/kamailio/kamailio.cfg, line 400,
            column 53: bad command: missing ';'?<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Apr  8 18:35:20
            kamailio: : <core> [cfg.y:3368]: yyerror_at(): parse
            error in config file /etc/kamailio/kamailio.cfg, line 400,
            column 59: '('')' expected (function call)<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Apr  8 18:35:20
            kamailio: : <core> [cfg.y:3368]: yyerror_at(): parse
            error in config file /etc/kamailio/kamailio.cfg, line 400,
            column 59: bad command: missing ';'?<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Apr  8 18:35:20
            kamailio: : <core> [cfg.y:3365]: yyerror_at(): parse
            error in config file /etc/kamailio/kamailio.cfg, line 400,
            column 60-64: bad command<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Apr  8 18:35:20
            kamailio: : <core> [cfg.y:3368]: yyerror_at(): parse
            error in config file /etc/kamailio/kamailio.cfg, line 400,
            column 65: bad command<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Apr  8 18:35:20
            kamailio: : <core> [cfg.y:3365]: yyerror_at(): parse
            error in config file /etc/kamailio/kamailio.cfg, line 400,
            column 66-68: bad command<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Apr  8 18:35:20
            kamailio: : <core> [cfg.y:3368]: yyerror_at(): parse
            error in config file /etc/kamailio/kamailio.cfg, line 408,
            column 6: syntax error<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Apr  8 18:35:20
            kamailio: : <core> [cfg.y:3368]: yyerror_at(): parse
            error in config file /etc/kamailio/kamailio.cfg, line 408,
            column 6:<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Regards,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Grant<o:p></o:p></span></p>
      </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://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>
Kamailio World Conference, Berlin, May 18-20, 2016 - <a class="moz-txt-link-freetext" href="http://www.kamailioworld.com">http://www.kamailioworld.com</a></pre>
  </body>
</html>