[OpenSIPS-Devel] [ opensips-Feature Requests-3378944 ] Prepared Statement support in avpops

SourceForge.net noreply at sourceforge.net
Fri Mar 16 11:14:06 CET 2012


Feature Requests item #3378944, was opened at 2011-07-26 13:13
Message generated for change (Settings changed) made by vladut-paiu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086413&aid=3378944&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: None
Status: Open
>Priority: 3
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Prepared Statement support in avpops

Initial Comment:
It would be nice if avpops exposed an easy way to use prepared statements with a database.
Prepared statements offer an extra layer of security and increased performance.

You should be able to create prepare statements as part of the configuration:
#Connect to db with id 1
modparam("avpops","db_url","1 mysql://user:passwd@host/database")

#create prepared statement id 0 on database id 1 with one place holder
modparam("avpops","db_prepare","0 1 select password, ha1 from subscriber where username=?");

#Exec prepared statement id 0
#A prepared statement is associated with a database connection so we do not need to specify the database
avp_db_exec("0", $var(username), $avp(password), $avp(ha1));

Of course on database reconnects they statements should be prepared again automatically.

I think this would be a great feature to have, especially for those who have to make repeated queries to a database. 

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086413&aid=3378944&group_id=232389



More information about the Devel mailing list