• Idefisk
  • Tools
  • Tutorials
  • Reviews
  • VoIP Providers
  • Archives
ZOIPER softphone
Back to Tutorials

6.1.2.20. DBput (dialplan application)

1. DBput - this application allows you to store a value in the Asterisk’s database.

NOTE: This application is valid for Asterisk version 1.0.9 and 1.0.10.

If you are using version 1.2 or newer, then you have to know that this application is deprecated. However, if you want to use its functionality, there is a new syntax, which require the usage of the Set application. For more information click on the link - The new syntax - the DB function.

 


Syntax:

DBput(family/key=value)

 


Purpose and usage

The purpose of this application is to allow you to store a value in the Asterisk’s database. This application has absolutely the same effect as the CLI command - database put <familiy> <key> <value>.

However, it gives you more flexibility, because you can manage the Asterisk’s database in your extensions.conf file.

 


Prerequisites

To use this application you need a working Asterisk PBX with registered users in iax.conf, sip.conf or mgcp.conf(It depends on which protocol you would like to use) and made extensions.

To see how the application works we recommend to use our IAX softphone Idefisk. You can download it from here. Please also read our tutorial to learn how to configure it to work with Asterisk PBX.

 


Asterisk PBX configurations

NOTE: This is only an example of what for you can use this application. Of course you can use it and for other things.

We need one registered users in iax.conf file. This is because we are going to use the IAX2 protocol. If you want to use other protocol such as SIP or MGCP, you have to do the configurations below respectively in sip.conf or mgcp.conf.

iaxoneuser.jpg

So, we have registered the user user1.

Type=friend means that this user can make and receive calls. Host=dynamic means that the IP is not static but dynamic through a DHCP server. Allow=all means that the line which this user will use, could support all audio codecs. Context=test - this shows that this user is working with the extensions in this context of the configuration file extensions.conf.

extDBgetput.jpg

On the picture above you can see our extensions.conf file.

In our example, when somebody dials 1010, the call will be answered by the Answer application. The next executed extension will be the one which contains the DBput application. As arguments in its brackets we have set test/data=122. Here, test is the family in the Asterisk’s database. The key in the database will be the word data and the value will be the number 122.

You can verify that the command is executed correctly by entering the command database show on the CLI of your Asterisk PBX system.

databaseDB.jpg

We will show you another way to check this, by using the DBget application. This application will extract the value from the key data in the family test. The value will be set to a variable. In our case this variable is called NewVar. Please, notice that the name of the variable is written without the ${} characters.

Now, we will call back and display the content of the variable NewVar, by the help of the SendText application. Please, pay attention that here we have to write the variable NewVar with the ${} characters. So in the brackets you have to write the following: ${NewVar}. In our case this will display on the screen of the caller, the message 122. 122 is the set value in the DBput application. So everything is correct.

In order to be sure, that the Asterisk PBX will hang up the line after the conversation is over, it is always a good idea to make an extension for hanging up.

 


2. Screenshots of what you can see on your Idefisk and on the CLI of the Asterisk PBX

ideDBgetput.jpg

cliDBputget.jpg

 


3. Additional information

For more information about extensions.conf you can check here.
For more information about iax.conf you can check here.

This application is tested with our IAX softphone Idefisk. You can download it from here. For more information about this softphone please read our tutorial.

If you would like to test this application with the SIP channel you can read our tutorials about the SIP Softphones to learn how to configure them to work with Asterisk PBX

 


4. Similar dial plan applications

DBget()
DBdel()
DBdeltree()

 

 
User Comments
Rajaathi (fkjm9kjtbxe at hotmail dot com)
19 December 2015 15:16:06
Nice puzzle. I had a bit of<a href="http://jbfohismt.com"> trboule</a> figuring out what ? and * meant until I realized you were just using the same kind of symbols for grep searching. After that, it was easy to keep straight.The * in this puzzle is one of the few times in a puzzle where a "given" actually gives you less information, not more.
 
Add Comment
Name:
Email:
Comment:
In order to prevent automatic posting on our website, we kindly request you to type in the number you see in the picture below.
Image Verification:
 

Latest Headlines:

  • T.38 faxing with Zoiper 2.15 is now easier than ever
    section: voip software
  • Asterisk 1.4.21 Released
    section: Asterisk
  • Asterisk 1.4.20 Released
    section: Asterisk
  • Asterisk 1.4.20-rc2 Released
    section: Asterisk
  • Asterisk 1.4.20-rc1 Now Available
    section: Asterisk
  • News Archives (older news)

Latest Tutorials:

  • Sending Fax from Zoiper to Zoiper using T.38
    added 08/Dec/2008 18:16
  • VMAuthenticate (dialplan application)
    added 01/Mar/2008 15:57
  • Siptronic ST-530
    added 06/Nov/2007 17:57
  • Siemens C455 IP hardphone
    added 05/Nov/2007 10:24
  • Zoiper
    added 22/Oct/2007 17:53

Latest Comments:

  • https://donde-ver-ant-man-y-la-avispa-qu...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-scream-6-tyt.statuspag...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-guardianes-de-la-noche...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-demon-slayer-villa-de-...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://www.reddit.com/r/BenavidezvPlant...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
 
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™