[SR-Users] How to use OR login in DB query in kamailio

Hemanshu Patel hemanshu.patel at saicare.com
Thu Dec 6 11:08:51 CET 2012


Dear friends, 

I have to select entries from table which has a phone nomber in to or from column in a table. 

Say a dialog tables and phone number is 1000. 
So i need to fetch all queries where to_uri or from_uri is like 1000. 
I have checked the code, but i didnt find any way to do this OR behaviour. 
Like in following simple example 



db_keys[0] = &str_expires_col; 
db_ops[0] = OP_LT; 
db_vals[0].type = DB1_INT; 
db_vals[0].nul = 0; 
db_vals[0].val.int_val = (int)time(NULL); 

result_cols[user_col= n_result_cols++] = &str_username_col; 
result_cols[domain_col=n_result_cols++] = &str_domain_col; 
result_cols[etag_col=n_result_cols++] = &str_etag_col; 
result_cols[event_col=n_result_cols++] = &str_event_col; 




This can be used where expires coloumn is less then current unix time. But say i want to change the query like expire value is less then xxxxxx but greater then yyyyy Then how can i do that? 

Should i need to use another db_key with OP_GT value? 

What is Operation info we should use for LIKE. I mean i need to select value which is sip:1000 at xx.xx.xx.xx via searching for 1000. 




I Hope i had explain the question well. Please let me know in case any confusion in question. 


-- 
Regards, 

Hemanshu Patel 
---------------------------------------------------------------------- 
P Help the environment – please don't print this email unless you really need to! 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20121206/380dd247/attachment.htm>


More information about the sr-users mailing list