Talking to my own MySQL-table

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Talking to my own MySQL-table

Matti Zemack

Hi all,

 

Still being a newbie, I’ve been off and on thinking about the following for the last few days.

What module should I use (or rather what’s the smartest approach) for the following scenario;

·         If I have my own home made table in the “opensips”-database. How can I insert and delete rows from it? Basically what I would like to make is a storage of the latest REGISTER try from any one account. When a new REGISTER is tried from that account the old gets deleted. Basically all I want to save is $fu. What module is applicable, and how could I use it?
Why not in “usr_preferences” you may ask, well I would like a solution which is easily deployed and upgradeable without interfering with the standardized database schema. Or is “usr_preferences” the best way to go?

 

Thankful for any answers,

Matti Zemack

Stockholm

Sweden

 

As soon as this is solved I will continue adding on the http://www.opensips.org/index.php?n=Resources.DocsTools , all suggestions of other tools are welcome!


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Talking to my own MySQL-table

Brett Nemeroff
I do the same. Use avp_db_query.
-Brett


Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: "Matti Zemack" <[hidden email]>

Date: Thu, 29 Jan 2009 15:57:48
To: <[hidden email]>
Subject: [OpenSIPS-Users] Talking to my own MySQL-table


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Talking to my own MySQL-table

Matti Zemack
Thanks Brett. (This mailing list is fantastic...)


Working fine now with avp_db_query.

I might stick with the 'usr_preferences', but still use the avp_db_query
as it makes coding a bit simpler "controllable" for me as I don't yet
fully understand the avp_db_store-command.

Oh, I wish there would be more config examples easy accesible on one web
page. Probably what I'll do when I know more. :-)


Best Regards and have a wonderful weekend,
Matti Zemack
Stockholm
Sweden


-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: den 29 januari 2009 16:15
To: Matti Zemack; [hidden email];
[hidden email]
Subject: Re: [OpenSIPS-Users] Talking to my own MySQL-table

I do the same. Use avp_db_query.
-Brett


Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: "Matti Zemack" <[hidden email]>

Date: Thu, 29 Jan 2009 15:57:48
To: <[hidden email]>
Subject: [OpenSIPS-Users] Talking to my own MySQL-table

Hi all,

Still being a newbie, I've been off and on thinking about the following
for the last few days.
What module should I use (or rather what's the smartest approach) for
the following scenario;
* If I have my own home made table in the "opensips"-database. How
can I insert and delete rows from it? Basically what I would like to
make is a storage of the latest REGISTER try from any one account. When
a new REGISTER is tried from that account the old gets deleted.
Basically all I want to save is $fu. What module is applicable, and how
could I use it?
Why not in "usr_preferences" you may ask, well I would like a solution
which is easily deployed and upgradeable without interfering with the
standardized database schema. Or is "usr_preferences" the best way to
go?

Thankful for any answers,
Matti Zemack
Stockholm
Sweden
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Talking to my own MySQL-table

Brett Nemeroff
avp_db_store is to write avps back to the avp table. 

You can do all SQL queries with the avp_db_query function. It's fantastic.

Just remember, SQL transactions take time and will affect your overall performance. Some of the built in functions are more efficient in terms of processing which include capabilities such as memory caching.

For example, you can do LCR lookups entirely with avp_db_query (I've done this). But the LCR module in it's present revision caches everything. Which on a larger scale, really makes all the difference. I've worked with a number of different sized providers, nothing gigantic, but some doing multiple DS3s of traffic, and avp_db_query hasn't been too slow to handle it yet.

-Brett


On Fri, Jan 30, 2009 at 9:28 AM, Matti Zemack <[hidden email]> wrote:
Thanks Brett. (This mailing list is fantastic...)


Working fine now with avp_db_query.

I might stick with the 'usr_preferences', but still use the avp_db_query
as it makes coding a bit simpler "controllable" for me as I don't yet
fully understand the avp_db_store-command.

Oh, I wish there would be more config examples easy accesible on one web
page. Probably what I'll do when I know more. :-)


Best Regards and have a wonderful weekend,
Matti Zemack
Stockholm
Sweden


-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: den 29 januari 2009 16:15
To: Matti Zemack; [hidden email];
[hidden email]
Subject: Re: [OpenSIPS-Users] Talking to my own MySQL-table

I do the same. Use avp_db_query.
-Brett


Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: "Matti Zemack" <[hidden email]>

Date: Thu, 29 Jan 2009 15:57:48
To: <[hidden email]>
Subject: [OpenSIPS-Users] Talking to my own MySQL-table

Hi all,

Still being a newbie, I've been off and on thinking about the following
for the last few days.
What module should I use (or rather what's the smartest approach) for
the following scenario;
*       If I have my own home made table in the "opensips"-database. How
can I insert and delete rows from it? Basically what I would like to
make is a storage of the latest REGISTER try from any one account. When
a new REGISTER is tried from that account the old gets deleted.
Basically all I want to save is $fu. What module is applicable, and how
could I use it?
Why not in "usr_preferences" you may ask, well I would like a solution
which is easily deployed and upgradeable without interfering with the
standardized database schema. Or is "usr_preferences" the best way to
go?

Thankful for any answers,
Matti Zemack
Stockholm
Sweden
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users