[SR-Users] Xhttp_pi DB Query Clause Operators

Simpson Chua simpsonchua at yahoo.com
Thu Jun 27 13:01:38 CEST 2013


Hi,

I'm using the xhttp_pi module to query the kamailio user registration table "location". Per the defined clause_cols operators in the module, it doesn't seem possible to achieve a query equivalent to a SQL "contains" or "like".
An exact match is required to query the record; e.g., http://xxxxxxx/location/QueryContacts?cmd=on&0=sip:8675309@a.b.c.d:5060;transport=udp. Is my understanding correct that there is no way to match on an regular expression? My end goal is to be able to query for a user's AOR and expiration status based on a search string (e.g. 8675309) via a webservice. Can anyone share a better method to do this? Perhaps asynchronously? All feedback is appreciated.  

Sample contact field:
sip:8675309 at a.b.c.d:5060;transport=udp

Sample Framework:
<cmd><cmd_name>QueryContacts</cmd_name>
<db_table_id>location</db_table_id>
<cmd_type>DB1_QUERY</cmd_type>
<clause_cols>
<col><field>contact</field><operator>=</operator></col>
</clause_cols>
<query_cols>
<col><field>username</field></col>
<col><field>contact</field></col>
<col><field>expires</field></col>
</query_cols>
</cmd>

Thanks,
Simpson


________________________________
 From: "sr-users-request at lists.sip-router.org" <sr-users-request at lists.sip-router.org>
To: sr-users at lists.sip-router.org 
Sent: Thursday, June 27, 2013 5:00 AM
Subject: sr-users Digest, Vol 97, Issue 104
 

Send sr-users mailing list submissions to
    sr-users at lists.sip-router.org

To subscribe or unsubscribe via the World Wide Web, visit
    http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
or, via email, send a message with subject or body 'help' to
    sr-users-request at lists.sip-router.org

You can reach the person managing the list at
    sr-users-owner at lists.sip-router.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of sr-users digest..."


Today's Topics:

   1. kamailio loadbalancer with TLS problem forwarding INVITE    back
      to UA (Allen Zhang)
   2. Re: dialplan not working (Victor V. Kustov)


----------------------------------------------------------------------

Message: 1
Date: Thu, 27 Jun 2013 00:34:00 +0000
From: Allen Zhang <Allen.Zhang at imgtec.com>
To: "sr-users at lists.sip-router.org" <sr-users at lists.sip-router.org>
Cc: Shane Harrison <Shane.Harrison at imgtec.com>
Subject: [SR-Users] kamailio loadbalancer with TLS problem forwarding
    INVITE    back to UA
Message-ID:
    <04588C075527D74CABD19E7C320BCB1C013BE6F6 at WEMAIL01.we.imgtec.org>
Content-Type: text/plain; charset="us-ascii"

Hi,

Our set up:

UA1 -----                                                                              ------  Proxy1
                   \                                                                        /
                       Loadbalancer (dispatcher module)
                   /                                                                        \
UA2-----                                                                               ------  Proxy2

Both proxies have registrar module loaded and share the same database.
REGISTERs work fine.
The problem is this:
                    TLS                                        TCP
UA1  ----------------------> LB --------------------> Proxy
            INVITE(to UA2)                  INVITE(to UA2)

                  TLS                       TCP
UA1  <------------- LB <------------- Proxy
                                          100 Trying

                  TLS                               TCP
UA1  <------------- LB <----------------------- Proxy
                                             INVITE(to UA2)

                      TLS                                                TCP
UA1  <----------------------- LB <----------------------- Proxy
                100 Trying

All above worked fine. Below is what's expected but never happened:

                      TLS                                                TCP
UA2  <----------------------- LB <----------------------- Proxy
                INVITE(to UA2)

We'd like the LB to reuse the TLS connection initiated by UA2. But LB can't find an open connection and tries to start a new TLS connection. The new connection fails.
UAs are not behind NAT at the moment but will be in the future.

Tried this approaches on LB:

route(ADD_CONTACT_ALIAS);
If (not from proxy)
                t_relay();
else
                do load balancing

No luck.

Any help is appreciated.

Regards,

Allen







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130627/a7a97d93/attachment-0001.html>

------------------------------

Message: 2
Date: Thu, 27 Jun 2013 13:39:41 +0400
From: "Victor V. Kustov" <coyote at bks.tv>
To: "Kamailio \(SER\) - Users Mailing List"
    <sr-users at lists.sip-router.org>
Subject: Re: [SR-Users] dialplan not working
Message-ID: <20130627133941.7ae9b458 at bkstv>
Content-Type: text/plain; charset=US-ASCII

Hi all!

I don't see in a doc, but mi dp_translate work correctly this way:

incorrect:

>kamcmd> mi dp_translate 1 9999999999

correct:

kamcmd> mi dp_translate 1 s:9999999999

seems need change documentation 


--
WBR, Victor
  JID: coyote at bks.tv
  JID: coyote at bryansktel.ru
  I use FREE operation system: 3.9.6-calculate GNU/Linux



------------------------------

_______________________________________________
sr-users mailing list
sr-users at lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


End of sr-users Digest, Vol 97, Issue 104
*****************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130627/21cf06d0/attachment-0001.html>


More information about the sr-users mailing list