<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Nice, but useful only when matching the source ip. The ipops or
    permissions module offer more flexibility, so the value that needs
    to be match can be taken from any variable (e.g., target domain in
    r-uri, or some header - useful if there is an edge proxy in
    between).<br>
    <br>
    There are couple of other keywords that should work for network
    address matching, like dst_ip and snd_ip (in onsend_route).<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 10/02/16 10:04, Phil Lavin wrote:<br>
    </div>
    <blockquote
cite="mid:AM4PR03MB153769229D8602B49CEC2B78F6D70@AM4PR03MB1537.eurprd03.prod.outlook.com"
      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:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
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:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">That’s
            nicer Syntax. Thanks, Daniel
          </span><span
style="font-size:11.0pt;font-family:Wingdings;color:#1F497D;mso-fareast-language:EN-US">J</span><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0cm 0cm 0cm">
            <p class="MsoNormal"><b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"
                  lang="EN-US">From:</span></b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"
                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>Daniel-Constantin Mierla<br>
                <b>Sent:</b> 10 February 2016 08:57<br>
                <b>To:</b> Kamailio (SER) - Users Mailing List
                <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> Re: [SR-Users] Need to validate a IP
                address with subnet mask<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal" style="margin-bottom:12.0pt">Hello,<br>
          <br>
          for sake of completion, using the src_ip keyword works with
          network addresses:<br>
          <br>
          if(src_ip==1.2.3.0/24)<br>
          <br>
          Cheers,<br>
          Daniel<o:p></o:p></p>
        <div>
          <p class="MsoNormal">On 10/02/16 08:39, Sunil More wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <div>
            <p class="MsoNormal">Hey Phil, <o:p></o:p></p>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">Thank you for the input , this helps.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><br clear="all">
                <o:p></o:p></p>
              <div>
                <div>
                  <div>
                    <p class="MsoNormal" style="margin-bottom:12.0pt">Thanking
                      You,<br>
                      Sunil More<o:p></o:p></p>
                  </div>
                </div>
              </div>
              <p class="MsoNormal"><o:p> </o:p></p>
              <div>
                <p class="MsoNormal">On Wed, Feb 10, 2016 at 12:40 PM,
                  Phil Lavin <<a moz-do-not-send="true"
                    href="mailto:phil.lavin@synety.com" target="_blank">phil.lavin@synety.com</a>>
                  wrote:<o:p></o:p></p>
                <blockquote style="border:none;border-left:solid #CCCCCC
                  1.0pt;padding:0cm 0cm 0cm
                  6.0pt;margin-left:4.8pt;margin-right:0cm">
                  <div>
                    <div>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">2
                          ways:</span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
                      <p><span
                          style="font-size:11.0pt;font-family:Symbol;color:#1F497D">·</span><span
                          style="font-size:7.0pt;color:#1F497D">        
                        </span><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">is_in_subnet()
                          -
                          <a moz-do-not-send="true"
href="http://www.kamailio.org/docs/modules/3.4.x/modules/ipops.html#idp42416"
                            target="_blank">
http://www.kamailio.org/docs/modules/3.4.x/modules/ipops.html#idp42416</a></span><o:p></o:p></p>
                      <p><span
                          style="font-size:11.0pt;font-family:Symbol;color:#1F497D">·</span><span
                          style="font-size:7.0pt;color:#1F497D">        
                        </span><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Add
                          the IP and mask to the address table and use
                          allow_source_address() -
                          <a moz-do-not-send="true"
href="http://kamailio.org/docs/modules/3.1.x/modules_k/permissions.html#id2528610"
                            target="_blank">
http://kamailio.org/docs/modules/3.1.x/modules_k/permissions.html#id2528610</a></span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Phil</span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif"
                            lang="EN-US">From:</span></b><span
                          style="font-size:11.0pt;font-family:"Calibri",sans-serif"
                          lang="EN-US"> sr-users [mailto:<a
                            moz-do-not-send="true"
                            href="mailto:sr-users-bounces@lists.sip-router.org"><a class="moz-txt-link-abbreviated" href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a></a>]
                          <b>On Behalf Of </b>Sunil More<br>
                          <b>Sent:</b> 10 February 2016 05:41<br>
                          <b>To:</b> Kamailio (SER) - Users Mailing List
                          <<a moz-do-not-send="true"
                            href="mailto:sr-users@lists.sip-router.org"
                            target="_blank">sr-users@lists.sip-router.org</a>><br>
                          <b>Subject:</b> [SR-Users] Need to validate a
                          IP address with subnet mask</span><o:p></o:p></p>
                      <div>
                        <div>
                          <p class="MsoNormal"
                            style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                          <div>
                            <div>
                              <p class="MsoNormal"
                                style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi
                                All,<o:p></o:p></p>
                            </div>
                            <div>
                              <p class="MsoNormal"
                                style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                            </div>
                            <div>
                              <p class="MsoNormal"
                                style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I
                                want to validate a IP address in
                                kamailio for requests coming from
                                different IPs. I have browsed and found
                                permissions module, however is there a
                                way where i can directly compare a
                                source IP address to an address stored
                                in an avp and get a true or false value.<o:p></o:p></p>
                            </div>
                            <div>
                              <p class="MsoNormal"
                                style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                            </div>
                            <div>
                              <p class="MsoNormal"
                                style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">something
                                like this<o:p></o:p></p>
                            </div>
                            <div>
                              <p class="MsoNormal"
                                style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                            </div>
                            <div>
                              <p class="MsoNormal"
                                style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">$si==<a
                                  moz-do-not-send="true"
                                  href="http://192.168.2.0/24"
                                  target="_blank">192.168.2.0/24</a> <o:p></o:p></p>
                            </div>
                            <div>
                              <p class="MsoNormal"
                                style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                            </div>
                            <p class="MsoNormal"
                              style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br
                                clear="all">
                              <o:p></o:p></p>
                            <div>
                              <div>
                                <div>
                                  <p class="MsoNormal"
                                    style="mso-margin-top-alt:auto;margin-bottom:12.0pt">Thanking
                                    You,<br>
                                    Sunil More<o:p></o:p></p>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                  <p class="MsoNormal" style="margin-bottom:12.0pt"><br>
                    _______________________________________________<br>
                    SIP Express Router (SER) and Kamailio (OpenSER) -
                    sr-users mailing list<br>
                    <a moz-do-not-send="true"
                      href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
                    <a moz-do-not-send="true"
                      href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
                      target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></p>
                </blockquote>
              </div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
          </div>
          <p class="MsoNormal"><br>
            <br>
            <br>
            <o:p></o:p></p>
          <pre>_______________________________________________<o:p></o:p></pre>
          <pre>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<o:p></o:p></pre>
          <pre><a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><o:p></o:p></pre>
          <pre><a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></pre>
        </blockquote>
        <p class="MsoNormal"><br>
          <br>
          <o:p></o:p></p>
        <pre>-- <o:p></o:p></pre>
        <pre>Daniel-Constantin Mierla<o:p></o:p></pre>
        <pre><a moz-do-not-send="true" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a><o:p></o:p></pre>
        <pre>Book: SIP Routing With Kamailio - <a moz-do-not-send="true" href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre>
        <pre><a moz-do-not-send="true" href="http://miconda.eu">http://miconda.eu</a><o:p></o:p></pre>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<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>
Book: SIP Routing With Kamailio - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://miconda.eu">http://miconda.eu</a></pre>
  </body>
</html>