Is it possible to use variables instead of asterisk database

Hello, everyone.
Our sip provider has recomended me not to use asterisk database (astdb) in the dialplan. This way, they say, I’m avoiding asterisk looking up stuff on HDD. My question is: could I use variables instead the database. In other words, could I somehow load all keys and their values from astdb into global variables when asterisk starts. After I could use those variables in dialplan and sync them with the database only once in a while, when their values change.
Thanks,

i think that You can use variables and update them when it’s needed.

[quote]
…in dialplan and sync them with the database only once in a while, when their values change. [/quote]
i think that values in astdb will be changed by dialplan, but Your sip provider does not recomended this.
does they explained why “looking up stuff on HDD” is such a wrong thing to do ?

Our sip provider recomended us to not use asterisk or other software pbx…
they said, that asterisk could not cooperate with their system.
they was mistaken in that matter

this question had me wondering who the provider was so i could make sure to avoid them !! unless you’ve told them you have 10000 users or you’re running a P120 of course.

i suppose you could create a ramdisk, stuff ASTDB (or all of /var/lib/asterisk) on there before starting Asterisk (making sure you’ve modified asterisk.conf) and then copy it off again before rebooting. could make agi and call recording quicker too ???

Thats pretty much what they ment. I have not a lot of experience with asterisk. This September I will have to complete a system for about 2000 of sip users (I assume there will be times with 200 parallel calls). One of their recomendations was to avoid the database usage.

are you going to attempt this with a single server ???

Yes. Is it going to be a problem?

that depends on what functionality you’re going to offer and what termination to PSTN you’re intending.

It’s going to be just sip with G711 codec. I’ve read on voip-info.org wiki that people were able to achieve over 300 parallel calls without transcoding. So, hopefully that’ll work for me as well. The only part I’m not sure is the database usage.

if you have the network infrastructure in place to handle 30+ Mbps of traffic and you’re not doing call recording it should be ok. the database isn’t going to be used enough to worry about, unless your dialplan uses it (as your provider says).

what are you hoping to use the ASTDB for ?

One example - call forwarding. By calling *72, client can record to the database a number for an incomming call to be forwarded to. After if asterisk receives an incomming call to client’s extension, it will try to get the number to forward a call to from the database. If the the number exists, the call will be forwarded. Otherwise, client’s extension would be dialed.

;Calling here client activates call forwarding
exten=>*72,1,Read(num_desvio,pls-ent-num-transfer,9)
exten=>
*72,n,Set(DB(FORWARD/${ACCOUNTCODE})=${num_desvio})
exten=>*72,n,Playback(call-forward)
exten=>
*72,n,Playback(activated)
;These are clients’ extensions
exten=>_11111111[4-9],1,Set(NUM=${DB(FORWARD/${EXTEN})})
exten=>_11111111[4-9],n,GotoIf($[${LEN(${NUM})} < 9]?${EXTEN}|102)
exten=>_11111111[4-9],n,Goto(forwarded_calls_context,${NUM},1)
exten=>_11111111[4-9],102,Dial(SIP/${EXTEN},45,tr)

As I have said already I’m a newbie in asterisk. If there is a way to allow the clients activate/desactivate services they want to use (call forwarding, DISA, voicemail …) without using the database, please give me some info.

saving a variable outside of ASTDB is going to have a cost. you could of course use MySQL but you need to decide which is going to be more efficient. probably the ASTDB, although i have had reservations in the past about the robustness of ASTDB when it has a lot of data (i think there’s a thread in the -users mailing list too ??)