<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt>Sasmita, <br>
      <br>
      The parameter from "is_from_gw(n)" must be aligned with the "type"
      you have for the gws, if you want to check comes from a particular
      set of gateways (with a certain type).<br>
      <br>
      If you want to check against all gws (any type), simply do
      "is_from_gw()" with no parameter.<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 25.09.2015 14:20, Sasmita Panda
      wrote:<br>
    </div>
    <blockquote
cite="mid:CALf-Q44GZaiWc+OG0Ei9Xb1c7O3tXv=f6+jQhst0VTXuHitBZQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">After changing it to "0" , it wont even work for me
        .
        <div><br>
        </div>
        <div>Is there anything wrong in storing data in the table what I
          have given above ?</div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>
          <div class="gmail_signature">
            <div dir="ltr"><b><i>Thanks &amp; Regards</i></b>
              <div><i>Sasmita Panda</i></div>
              <div><i>Network Testing and Software Engineer</i></div>
              <div><i>3CLogic , ph:07827611765</i></div>
            </div>
          </div>
        </div>
        <br>
        <div class="gmail_quote">On Thu, Sep 24, 2015 at 8:29 PM,
          Bogdan-Andrei Iancu <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:bogdan@opensips.org"
              target="_blank">bogdan@opensips.org</a>&gt;</span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF"> <tt>Hi Sasmita,<br>
                <br>
                The param for is_from_gw() is wrong -&gt; you put "1"
                while in DB yu have type "0"<br>
                <br>
                Regards,<br>
              </tt><span class="">
                <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
              </span>
              <div>
                <div class="h5">
                  <div>On 24.09.2015 15:07, Sasmita Panda wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">Hi Andrei, 
                      <div><br>
                      </div>
                      <div>    I am wanted to do lookup in location
                        table when a call comes from a gateway .</div>
                      <div>What should I do for that ?</div>
                      <div><br>
                      </div>
                      <div>I have added the gateway in the dr_gateways
                        table like :</div>
                      <div>
                        <div>+----+------+------+--------------------+-------+------------+-------+------------+-------+--------+-------------+</div>
                        <div>| id | gwid | type | address              
                             | strip | pri_prefix | attrs | probe_mode |
                          state | socket | description |</div>
                        <div>+----+------+------+--------------------+-------+------------+-------+------------+-------+--------+-------------+</div>
                        <div>|  1 | gw1  |    0 | <a
                            moz-do-not-send="true"
                            href="http://192.1.1.1:5506" target="_blank">192.1.1.1:5506</a>
                          |     0   |   NULL   | NULL  |          0    
                            |     0  | NULL   |             |</div>
                        <div>+----+------+------+--------------------+-------+------------+-------+------------+-------+--------+-------------+</div>
                      </div>
                      <div><br>
                      </div>
                      <div>   And in my cfg i have written like bellow </div>
                      <div>I have added the drouting module .</div>
                      <div>loadmodule "drouting.so"<br>
                      </div>
                      <div>...............</div>
                      <div>modparam("drrouting", "db_url",
                        "mysql://root:root@localhost/opensips")<br>
                      </div>
                      <div>
                        <div>modparam("drouting", "use_domain", 1)</div>
                        <div>modparam("drouting", "drd_table",
                          "dr_gateways")</div>
                        <div>modparam("drouting", "drr_table",
                          "dr_rules")</div>
                        <div>modparam("drouting", "drg_table",
                          "dr_groups")</div>
                        <div>modparam("drouting", "drc_table",
                          "dr_carriers")</div>
                      </div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div>
                        <div> if( is_from_gw("1") ||  (to_uri=~"@<a
                            moz-do-not-send="true"
                            href="http://192.1.1.161" target="_blank">192.1.1.161</a>"))</div>
                        <div>                        {</div>
                        <div><br>
                        </div>
                        <div>                    xlog( "L_WARN", "Source
                          IP sas : $Ri To Uri : $tu From : $fU Request
                          URI: $oU Call ID:$ci" );</div>
                        <div>                 #          
                          alias_db_lookup("dbaliases");</div>
                        <div>                            if (
                          !lookup("location")){</div>
                        <div>                               
                          sl_send_reply("404","NO Match Found");</div>
                        <div>                    #          
                          cache_store("redis:group1","method,$ci","$rm,$Ts");</div>
                        <div>                            exit;</div>
                        <div>                            }</div>
                      </div>
                      <div>              }</div>
                      <div><br>
                      </div>
                      <div>When I am calling from <a
                          moz-do-not-send="true"
                          href="http://192.1.1.1:5506" target="_blank">192.1.1.1:5506</a>
                        , then call wont enter this loop .</div>
                      <div><br>
                      </div>
                      <div>    What is wrong in the configuration and
                        please let me know if I need to do something
                        else for this ?</div>
                      <div><br>
                      </div>
                    </div>
                    <div class="gmail_extra"><br clear="all">
                      <div>
                        <div>
                          <div dir="ltr"><b><i>Thanks &amp; Regards</i></b>
                            <div><i>Sasmita Panda</i></div>
                            <div><i>Network Testing and Software
                                Engineer</i></div>
                            <div><i>3CLogic , ph:07827611765</i></div>
                          </div>
                        </div>
                      </div>
                      <br>
                      <div class="gmail_quote">On Wed, Sep 23, 2015 at
                        7:15 PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:bogdan@opensips.org"
                            target="_blank">bogdan@opensips.org</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div text="#000000" bgcolor="#FFFFFF"> <tt>Sasmita,<br>
                              <br>
                              The dr_rules table contains the routing
                              rules - please carefully read the module
                              docs, as this is explained over there.<br>
                              <br>
                              A routing rule refers to gateway directly,
                              or via a carrier. Using carriers is
                              optional.<br>
                              <br>
                              Regards,<br>
                            </tt><span>
                              <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                            </span>
                            <div>
                              <div>
                                <div>On 23.09.2015 16:36, Sasmita Panda
                                  wrote:<br>
                                </div>
                                <blockquote type="cite">
                                  <div dir="ltr">HI Andrei ,
                                    <div><br>
                                    </div>
                                    <div> Thank you for your reply .
                                      what ever you said , that is only
                                      for the gateway . </div>
                                    <div>What about the route table of
                                      lcr module ? I think I need to add
                                      the route in dr_carrier table .</div>
                                    <div>But in which format ?  If I am
                                      wrong then what about the
                                      dr_carrier and dr_group table do
                                      in dynamic routing module ?</div>
                                    <div><br>
                                    </div>
                                    <div>Can you please give me a brief
                                      knowledge?  </div>
                                  </div>
                                  <div class="gmail_extra"><br
                                      clear="all">
                                    <div>
                                      <div>
                                        <div dir="ltr"><b><i>Thanks
                                              &amp; Regards</i></b>
                                          <div><i>Sasmita Panda</i></div>
                                          <div><i>Network Testing and
                                              Software Engineer</i></div>
                                          <div><i>3CLogic ,
                                              ph:07827611765</i></div>
                                        </div>
                                      </div>
                                    </div>
                                    <br>
                                    <div class="gmail_quote">On Wed, Sep
                                      23, 2015 at 1:54 PM, Bogdan-Andrei
                                      Iancu <span dir="ltr">&lt;<a
                                          moz-do-not-send="true"
                                          href="mailto:bogdan@opensips.org"
                                          target="_blank">bogdan@opensips.org</a>&gt;</span>
                                      wrote:<br>
                                      <blockquote class="gmail_quote"
                                        style="margin:0 0 0
                                        .8ex;border-left:1px #ccc
                                        solid;padding-left:1ex">
                                        <div text="#000000"
                                          bgcolor="#FFFFFF"> <tt>Hi
                                            Sasmita,<br>
                                            <br>
                                            Build a routing group (1,
                                            for example as this):<br>
                                            <br>
                                            Put in  dr_rules:<br>
+--------+---------+--------+---------+----------+---------+--------+-------+-------------+<br>
                                            | ruleid | groupid | prefix
                                            | timerec | priority |
                                            routeid | gwlist | attrs |
                                            description |<br>
+--------+---------+--------+---------+----------+---------+--------+-------+-------------+<br>
                                            |    100 | 1       |       
                                            |         |        0 |
                                            NULL    |asterisk| NULL 
                                            |             |<br>
+--------+---------+--------+---------+----------+---------+--------+-------+-------------+<br>
                                            <br>
                                            and it dr_gateways:<br>
+----+--------+------+----------------+-------+------------+-------+------------+-------+--------------------+-------------+<br>
                                            | id |  gwid  | type |
                                            address        | strip |
                                            pri_prefix | attrs |
                                            probe_mode | state |
                                            socket             |
                                            description |<br>
+----+--------+------+----------------+-------+------------+-------+------------+-------+--------------------+-------------+<br>
                                            |  1 |asterisk|    0 | <a
                                              moz-do-not-send="true"
                                              href="http://127.0.0.1:5080"
                                              target="_blank">127.0.0.1:5080</a>
                                            |     0 | NULL       | NULL 
                                            |          0 |     0 |
                                            NULL              
                                            |             |<br>
+----+--------+------+----------------+-------+------------+-------+------------+-------+--------------------+-------------+<br>
                                            <br>
                                            <br>
                                            Best regards,<br>
                                          </tt>
                                          <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                                          <div>
                                            <div>
                                              <div>On 22.09.2015 15:16,
                                                Sasmita Panda wrote:<br>
                                              </div>
                                            </div>
                                          </div>
                                          <blockquote type="cite">
                                            <div>
                                              <div>
                                                <div dir="ltr">Hi All ,
                                                  <div><br>
                                                  </div>
                                                  <div>    I am trying
                                                    to upgrade
                                                    opensips-1.6 to
                                                    opensips-1.11 . </div>
                                                  <div>As everybody know
                                                    opensips-1.11 uses
                                                    dynamic routing in
                                                    place of lcr module
                                                    .</div>
                                                  <div><br>
                                                  </div>
                                                  <div>    I have a
                                                    simple scenario and
                                                    , I wanted to and a
                                                    route and a gateway
                                                    for the particular
                                                    route so that my
                                                    call get routed to
                                                    the gw .</div>
                                                  <div><br>
                                                  </div>
                                                  <div>    In lcr tables
                                                    my schema is looking
                                                    like bellow  :</div>
                                                  <div><br>
                                                  </div>
                                                  <div>
                                                    <div>lcr routes</div>
                                                    <div>+----+--------+-----------------------------+--------+----------+</div>
                                                    <div>| id | prefix |
                                                      from_uri          
                                                               | grp_id
                                                      | priority |</div>
                                                    <div>+----+--------+-----------------------------+--------+----------+</div>
                                                    <div>|  4 |        |
                                                      .*@xyz.xxx.com.*  
                                                           |      5 |  
                                                           0 |</div>
                                                    <div><br>
                                                    </div>
                                                    <div>lcr gateways</div>
                                                    <div>+---------------+----------------+------+------------+-----------+--------+-------+------+-------+</div>
                                                    <div>| gw_name      
                                                      | ip_addr        |
                                                      port | uri_scheme
                                                      | transport |
                                                      grp_id | strip |
                                                      tag  | flags |</div>
                                                    <div>+---------------+----------------+------+------------+-----------+--------+-------+------+-------+</div>
                                                    <div>| asterisk    
                                                       | 127.1.1.200  
                                                       | 5080 |        
                                                       1 |         1 |  
                                                         5 |     0 |    
                                                       |     0 |</div>
                                                  </div>
                                                  <div><br>
                                                  </div>
                                                  <div>I have simply add
                                                    a route and for the
                                                    same grp_id I have
                                                    added a gateway .</div>
                                                  <div><br>
                                                  </div>
                                                  <div>    How I will do
                                                    the same thing in
                                                    dynamic routing ? I
                                                    have gone through
                                                    the document of
                                                    dynamic routing
                                                    module . But I am
                                                    not able to
                                                    understand the
                                                    schema .</div>
                                                  <div><br>
                                                  </div>
                                                  <div>Can anyone pleas
                                                    help me , how to
                                                    proceed ??</div>
                                                  <div><br>
                                                  </div>
                                                  <div> <br clear="all">
                                                    <div>
                                                      <div>
                                                        <div dir="ltr"><b><i>Thanks

                                                          &amp; Regards</i></b>
                                                          <div><i>Sasmita
                                                          Panda</i></div>
                                                          <div><i>Network
                                                          Testing and
                                                          Software
                                                          Engineer</i></div>
                                                          <div><i>3CLogic
                                                          ,
                                                          ph:07827611765</i></div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                                <br>
                                                <fieldset></fieldset>
                                                <br>
                                              </div>
                                            </div>
                                            <pre>_______________________________________________
Users mailing list
<a moz-do-not-send="true" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                                          </blockquote>
                                          <br>
                                        </div>
                                      </blockquote>
                                    </div>
                                    <br>
                                  </div>
                                </blockquote>
                                <br>
                              </div>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>