Asterisk – Realtime Installation Guide 1.4.x

By default, you rely heavily on Asterisk .conf file for creating your dialplans, iax and sip users and peers, as well as voicemail users. And after making changes to the configuration files, you have to reload Asterisk to apply them. However, the guys at Asterisk have made it easier. With Asterisk Realtime, you can add new users and modify your dialplans on the fly. Everything is neatly stored in a database, and loaded on the fly. So in this article, we will discuss how to get started so that you can make use of Asterisk Realtime.

You are going to begin by installing Asterisk. You can check out my quick install guide here.
Once you have that all complete, you will want to make sure that MYSQL is running. So we can start it by issuing the following command from ssh:

/etc/init.d/mysqld start

We need to create our Asterisk database, and setup our tables now, from the mysql command line:

CREATE DATABASE asterisk;
GRANT ALL PRIVILEGES ON asterisk.* TO 'asterisk'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;

A table for your sip users and peers:


CREATE TABLE `asterisk`.`sip_buddies` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(80) NOT NULL default '',
`accountcode` varchar(20) default NULL,
`amaflags` varchar(7) default NULL,
`callgroup` varchar(10) default NULL,
`callerid` varchar(80) default NULL,
`canreinvite` char(3) default 'yes',
`context` varchar(80) default NULL,
`defaultip` varchar(15) default NULL,
`dtmfmode` varchar(7) default NULL,
`fromuser` varchar(80) default NULL,
`fromdomain` varchar(80) default NULL,
`fullcontact` varchar(80) default NULL,
`host` varchar(31) NOT NULL default '',
`insecure` varchar(20) default NULL,
`language` char(2) default NULL,
`mailbox` varchar(50) default NULL,
`md5secret` varchar(80) default NULL,
`nat` varchar(5) NOT NULL default 'no',
`deny` varchar(95) default NULL,
`permit` varchar(95) default NULL,
`mask` varchar(95) default NULL,
`pickupgroup` varchar(10) default NULL,
`port` varchar(5) NOT NULL default '',
`qualify` char(3) default NULL,
`restrictcid` char(1) default NULL,
`rtptimeout` char(3) default NULL,
`rtpholdtimeout` char(3) default NULL,
`secret` varchar(80) default NULL,
`type` varchar(6) NOT NULL default 'friend',
`username` varchar(80) NOT NULL default '',
`disallow` varchar(100) default 'all',
`allow` varchar(100) default 'g729;ilbc;gsm;ulaw;alaw',
`musiconhold` varchar(100) default NULL,
`regseconds` int(11) NOT NULL default '0',
`ipaddr` varchar(15) NOT NULL default '',
`regexten` varchar(80) NOT NULL default '',
`cancallforward` char(3) default 'yes',
PRIMARY KEY  (`id`),
UNIQUE KEY `name` (`name`),
KEY `name_2` (`name`)
) ENGINE=MyISAM;

And a table for extensions – the backbone of Asterisk:

CREATE TABLE `asterisk`.`extensions` (
`id` int(11) NOT NULL auto_increment,
`context` varchar(20) NOT NULL default '',
`exten` varchar(20) NOT NULL default '',
`priority` tinyint(4) NOT NULL default '0',
`app` varchar(20) NOT NULL default '',
`appdata` varchar(128) NOT NULL default '',
PRIMARY KEY  (`context`,`exten`,`priority`),
KEY `id` (`id`)
) ENGINE=MyISAM;

And a table for the voicemail users:

CREATE TABLE `asterisk`.`voicemessages` (
`id` int(11) NOT NULL auto_increment,
`msgnum` int(11) NOT NULL default '0',
`dir` varchar(80) default '',
`context` varchar(80) default '',
`macrocontext` varchar(80) default '',
`callerid` varchar(40) default '',
`origtime` varchar(40) default '',
`duration` varchar(20) default '',
`mailboxuser` varchar(80) default '',
`mailboxcontext` varchar(80) default '',
`recording` longblob,
PRIMARY KEY  (`id`),
KEY `dir` (`dir`)
) ENGINE=MyISAM;

And the table for queues:

CREATE TABLE `asterisk`.`queues` (
  `name` varchar(128) NOT NULL,
  `musiconhold` varchar(128) default NULL,
  `announce` varchar(128) default NULL,
  `context` varchar(128) default NULL,
  `timeout` int(11) default NULL,
  `monitor_type` varchar(50) NOT NULL,
  `monitor_format` varchar(128) default NULL,
  `queue_youarenext` varchar(128) default NULL,
  `queue_thereare` varchar(128) default NULL,
  `queue_callswaiting` varchar(128) default NULL,
  `queue_holdtime` varchar(128) default NULL,
  `queue_minutes` varchar(128) default NULL,
  `queue_seconds` varchar(128) default NULL,
  `queue_lessthan` varchar(128) default NULL,
  `queue_thankyou` varchar(128) default NULL,
  `queue_reporthold` varchar(128) default NULL,
  `announce_frequency` int(11) default NULL,
  `announce_round_seconds` int(11) default NULL,
  `announce_holdtime` varchar(128) default NULL,
  `retry` int(11) default NULL,
  `wrapuptime` int(11) default NULL,
  `maxlen` int(11) default NULL,
  `servicelevel` int(11) default NULL,
  `strategy` varchar(128) default NULL,
  `joinempty` varchar(128) default NULL,
  `leavewhenempty` varchar(128) default NULL,
  `eventmemberstatus` varchar(4) default NULL,
  `eventwhencalled` varchar(4) default NULL,
  `reportholdtime` tinyint(1) default NULL,
  `memberdelay` int(11) default NULL,
  `weight` int(11) default NULL,
  `timeoutrestart` tinyint(1) default NULL,
  `periodic_announce` varchar(50) default NULL,
  `periodic_announce_frequency` int(11) default NULL,
  `ringinuse` tinyint(1) default NULL,
  PRIMARY KEY  (`name`)
) ENGINE=MyISAM

And the queue members:

CREATE TABLE `asterisk`.`queue_members` (
`uniqueid` int(10) unsigned NOT NULL auto_increment,
`membername` varchar(40) default NULL,
`queue_name` varchar(128) default NULL,
`interface` varchar(128) default NULL,
`penalty` int(11) default NULL,
`paused` tinyint(1) default NULL,
PRIMARY KEY  (`uniqueid`),
UNIQUE KEY `queue_interface` (`queue_name`,`interface`)
) ENGINE=MyISAM

So now we need to make the needed configuration changes so Asterisk knows to use the database. Assuming that you followed my installation guide (or that you have asterisk-addons installed) we need to copy the res_mysql.conf file, so:

cd /usr/src/asterisk-addons/configs/
cp res_mysql.conf.sample /etc/asterisk/res_mysql.conf

And we can edit that new /etc/asterisk/res_mysql.conf file to show your database settings:

[general]
dbhost = localhost
dbname = asterisk
dbuser = asterisk
dbpass = yourpassword
dbport = 3306
dbsock = /var/lib/mysql/mysql.sock

Next we’ll edit the /etc/asterisk/extconfig.conf to show as follows:

[settings]
sipusers => mysql,asterisk,sip_buddies
sippeers => mysql,asterisk,sip_buddies
extensions => mysql,asterisk,extensions
voicemail => mysql,asterisk,voicemessages
queues => mysql,asterisk,queues
queue_members => mysql,asterisk,queue_members

For extensions to be loaded of the database, we need to edit the /etc/asterisk/extensions.conf file as well. Each context that will be getting their information from the database, will need the following: switch => Realtime/@extensions – For example:

[incoming]

switch => Realtime/@extensions



Restart Asterisk and you’re all set. Now you just need to load your data into the database. Let’s have a look at an example of that. So here’s my extension:

exten => 105,1,Dial(SIP/105)

Here’s my database insert for the above extension:

INSERT into extensions (id, context, exten, priority, app, appdata)

VALUES ('','incoming','105','1','Dial','SIP/105');

And for an example of my sip user, I had the following in my sip.conf at one time:

[105]
type=friend
context=internal
callerid=105
host=dynamic
secret=password
canreinvite=no
insecure=port,invite
allow=all
nat=yes

Here is my insert code for the database:

INSERT into sip_buddies (id, name, callerid, context, canreinvite, insecure, type, host, secret, allow, nat)

VALUES ('','105','Robert','incoming','no','port,invite','friend','dynamic','bob123','all','yes');

I hope this example works well for you. I got it working fairly easy. It is important to note, that I haven’t been able to successfully setup the connection I have with my carrier in the realtime database. So I have to define those in my sip.conf or iax.conf – which isn’t a big deal. Another note is that any general conf settings, I always set those within the conf file, instead of within the realtime database.

55 Comments

  1. Eric C says:

    Best example I’ve seen for real time asterisk!!! Thank you!!! :)

  2. mahya says:

    hi
    where did you write the insert code to the database?I mean how tables full?

  3. Author says:

    My tutorial outlines how to create the tables and setup Asterisk for
    realtime use. However, what you put in the tables is entirely based on
    your configuration. If you know some php mysql, you can write some php
    scripts to make inputting new data to the database easier. Otherwise you
    will have to use mysql CLi, or an application like phpMyAdmin.

    This is a good idea though. Perhaps I will write an article shortly about
    a quick php script to insert data into the realtime database tables.

    Thanks for your comments and interest in our site.

  4. Trevor says:

    When you create the table for sip_buddies change the insecure field from varchar(4) to varchar(20) so it can accept values for Asterisk 1.4 and later (e.g. port – invite – port,invite)

  5. Author says:

    Thanks Trevor for this change. You are right. With v1.4, insecure field accepts new values. I have updated the above tutorial.

  6. Joel says:

    Well written tutorial but using Asterisk Real Time where to put the DID in the MySQL?

  7. Author says:

    Joel, you would simply setup your DID and dialplan in the extensions table. For example, so my DID was: 1234561212, I might put something like below in there.

    Standard conf setup:

    exten => 1234561212,1,Answer()
    exten => 1234561212,2,Playback(greeting-file)
    exten => 1234561212,3,Playback(good-bye)
    exten => 1234561212,4,Hangup()

    I would enter it into my extensions table like so:
    INSERT into sip_buddies (id, context, exten, priority, app, appdata)
    VALUES (”,’incoming’,’1234561212′,’1′,’Answer’,”), (”,’incoming’,’1234561212′,’2′,’Playback’,'greeting-file’), (”,’incoming’,’1234561212′,’3′,’Playback’,'good-bye’), (”,’incoming’,’1234561212′,’4′,’Hangup’,”);

  8. Ashwani says:

    Its simply a great post. It has almost solved my problem. For two days now, I have been scanning the web, as I am a PHP/MySQL coder and I want to run a website to assign SIPs to my visitors through a Asterisk server

    I can now easily write the web application which will insert SIPs into the mysql database.

    These SIP will be instantly usable? Will I need to restart Asterisk after every SIP created in mysql?

    Thanks

    Ashwani

  9. Author says:

    Ashwani,

    If you have followed my instructions outlined above, you are running Asterisk realtime. :-)
    That’s one of the greatest things with Asterisk Realtime, you don’t have to reload Asterisk for your new users to be usable. Isn’t Asterisk Realtime so much better? :-D

  10. Horacio says:

    Hi! I want to congratulate you for this great tutorial…

    I’m trying now to configure a queue using ARA, but I don’t know why Asterisk doesn’t retrieve the queue data from the database instead of the queues.conf file. I modified extconfig.conf but it isn’t working. Can you please post somethign related to Queues Real Time?

  11. Author says:

    Horacio,

    I have made adjustments to this article to include Queue and QueueMembers via Asterisk Realtime.
    I hope this is helpful to you too!

  12. [...] In addition to the above, you can always port voicemail.conf to MySQL via Asterisk Realtime. You can learn more Asterisk Realtime here. [...]

  13. Horacio says:

    Thank you very much for adjusting your article!

    I followed the steps described here but I still can’t get queues real time working. Please, can you post some examples of what data goes into the “queues” and queue_members” tables and a way to test it? And one more question: where are stored the passwords of the queue agents?

    Again, thanks a lot!

    Best regards

  14. Dr. Zia Rahman says:

    Very nice tutorial. I must agree, this is the best tutorial on asterisk real-time. Good work. Thanks!

  15. Excellent work. Got realtime working in notime :)

  16. Gabe says:

    Excellent tutorial. Thank you for your hard work.

    I do have one question however. Do you have a table layout for iaxusers, iaxpeers and sipregs?

    Thank you for your help.

  17. Author says:

    Hi Gabe,

    For IAX, you will need to the following within /etc/asterisk/extconfig.conf:

    iaxusers => mysql,asterisk,iax_buddies
    iaxpeers => mysql,asterisk,iax_buddies

    Here’s the database structure:

    CREATE TABLE iax_buddies (
    name varchar(30) primary key NOT NULL,
    username varchar(30),
    type varchar(6) NOT NULL,
    secret varchar(50),
    md5secret varchar(32),
    dbsecret varchar(100),
    notransfer varchar(10),
    inkeys varchar(100),
    outkey varchar(100),
    auth varchar(100),
    accountcode varchar(100),
    amaflags varchar(100),
    callerid varchar(100),
    context varchar(100),
    defaultip varchar(15),
    host varchar(31) NOT NULL default ‘dynamic’,
    language char(5),
    mailbox varchar(50),
    deny varchar(95),
    permit varchar(95),
    qualify varchar(4),
    disallow varchar(100),
    allow varchar(100),
    ipaddr varchar(15),
    port integer default 0,
    regseconds integer default 0
    );
    CREATE UNIQUE INDEX iax_buddies_username_idx ON iax_buddies(username);

    I haven’t tested IAX with Asterisk Realtime. I personally prefer SIP, because it’s a more universally accepted protocol. In addition, SIP can carry video and text. But that’s for another post altogether. :-)

  18. Gabe says:

    Agreed.

    The setup I am testing is with Asterisk 1.6 with 2 servers linked via IAX trunks and I hope to use IAX in realtime as well.

    Again, keep up the good work and thank you.

  19. Rocky says:

    Hi,
    Actually am using Asterisk 1.4. I want to call from one asterisk to another asterisk, but I can’t do that using this realtime.
    Plz help me out from this…

  20. Author says:

    Rocky,

    The same rules apply. You’re simply taking your dialplans and porting them to Asterisk Realtime. Perhaps your dialplans for dialing between the two servers aren’t correct? I’ll publish an article about connecting two Asterisk servers shortly.

  21. Gus says:

    best howto i.ve seen! Thanks for such good work.

  22. akos.tajti says:

    very useful tutorial, thanks! i have just one question: does asterisk realtime support postgre sql? if not do you know about any “hack” that let me use this database provider?

  23. Author says:

    Hi,

    Yes, you can just use /usr/src/asterisk/configs/res_pgsql.conf.sample
    This one is for PGSQL. I hope that helps!

  24. akos.tajti says:

    thank you for your answer!

  25. Farhan says:

    Hi,
    I must agree with the rest that this is one simple and productive tutorial, Congrats “Author” I havent tried it yet but I can tell this in advance and over the weekend I will try that.

    I am currently in the middle of creating a AsteriskNow server I am almost done with static configurations and every thing is working like a charm.Now its time to implement the real time configuration and a web interface so that user can create there own account,

    In my current system I have quite a few registry commands like:
    register => fromuser@fromdomain:secret:authuser@host:port/extension ,
    where do I set this and if needs to be on the sip.conf and does it not defeats the purpose having realtime.

    At this time I do not have any Web interface yet, as soon as it is found I will post it here.

    Thanks in advance

  26. Author says:

    Farhan,

    That is a good point. As far as I know, register strings much be in the sip.conf. Hopefully any connections that you would be creating with your carrier would be a ‘peer’, in which you would be able to add it to the database. Whenever possible, it’s best to avoid the register string.

    Let me know if you find otherwise, but I don’t think it’s possible yet. Thanks for the comments.

  27. Farhan says:

    Hi,
    My Current Environment is asterisknow.
    Asterisk 1.4.24, Copyright (C) 1999 – 2008 Digium, Inc. and others.
    Created by Mark Spencer
    Linux version CENTOS 5.3

    I tried to following the instructions and created all required tables when I was creating tables I noticed that In my asterisk database in mysql there is a table called extension, so what I did is, rename this existing extension table as extension_Old and then created new extension table as mentioned in the above instructions by the Author.

    At this point I have all the required tables created and I am able to connect to the database and view those table structures.
    here is the current table list

    ———————
    | Tables_in_asterisk |
    ———————
    | admin |
    | ampusers |
    | cronmanager |
    | custom_destinations |
    | custom_extensions |
    | devices |
    | extensions |
    | extensions_OLD |
    | featurecodes |
    | freepbx_log |
    | globals |
    | iax |
    | incoming |
    | module_xml |
    | modules |
    | notifications |
    | queue_members |
    | queues |
    | recordings |
    | sip |
    | sip_buddies |
    | users |
    | voicemessages |
    | zap |
    | zapchandids |
    ———————
    25 rows in set (0.00 sec)

    After creating all required tables and based on the above mentioned instructions, I have to execute following command in my linux environment
    cd /usr/src/asterisk-addons/configs/
    cp res_mysql.conf.sample /etc/asterisk/res_mysql.conf

    I couldn’t fine a directory called /usr/src/asterisk-addons.I perfromed some google search and it turned out that In order to get asterisk-addons folder, I need to install asterisk addons so I followed instructions from http://www.voip-info.org/wiki/view/Asterisk RealTime and followed instrictions as

    ——-
    This page assumes you have the MySQL client libraries/headers installed on your box.)
    Check out asterisk-addons from CVS:

    cd /usr/src/
    svn co http://svn.digium.com/svn/asterisk-addons/trunk asterisk-addons

    Go into asterisk-addons and run the following commands

    configure
    make
    make install (This will also compile and install the other stuff in addons so if you don’t want/need it, just run ‘make’ and manually copy res_config_mysql.so to your modules directory.)
    ——
    After executing above mentioned instructions I receive alots of error ,It looks like I am not able to compile addons can you please provide information on how to compile addons for asterisknow

    Thanks
    Farhan

  28. Author says:

    Farhan,

    You will want to install asterisk-addons. You probably are getting the errors because you just copied the res_config_mysql.so to your modules directory. If you only want to install this module, and nothing else from the asterisk-addons, you can uncheck the other options from menuselect.

    Check out my installation guide here: http://hostseries.com/asterisk-my-quick-installation-guide/
    It has instructions for installing the Asterisk-addons. Make sure you have the needed libraries and packages to compile the addons.

    Email me if you want further help. author {@} hostseries.com

  29. Farhan says:

    Thanks for your reply Author and providing me your email address.

    I got it working by using following command from
    http://bugs.digium.com/view.php?id=14931

    # yum install asterisk-addons-mysql
    [ ... ]
    Running Transaction
    Installing : asterisk14-addons-core [1/2]
    Installing : asterisk14-addons-mysql [2/2]

    Installed: asterisk14-addons-mysql.x86_64 0:1.4.7-3_centos5
    Dependency Installed: asterisk14-addons-core.x86_64 0:1.4.7-3_centos5
    Complete!

    This gives me the requested compiled module.
    Remember that this is asterisknow 1.5 that I am using,

    Now what I am missing is in my asterisk directory is a couple of config files
    extension.config i dont know what to do with it how to add information.
    extconfig.conf I created this manually
    sip.config is missing

    Can you please advise what to do.
    Remember event these files are missing I found link of these files in asterisk folder which is pointing to

    lrwxrwxrwx 1 asterisk asterisk 45 Apr 26 02:32 sip.conf -> /var/www/html/adm in/modules/core/etc/sip.conf

    lrwxrwxrwx 1 asterisk asterisk 52 Apr 26 02:32 extensions.conf -> /var/www/h tml/admin/modules/core/etc/extensions.conf
    this Extension file is free pbx generated so how can I update this file?

    Thanks in advance
    Author I will send you an email.

  30. Farhan says:

    Hi,
    I am experiencing Problem setting up Voice mail for realtime,
    I am able to establish calls but my calls are not going to voicemail.
    I followed instructions from here http://www.voip-info.org/wiki/view/Asterisk RealTime Voicemail

    I am able to populate extension,Sip_buddies,voicemail_user table but I dont know how voicemessages table will be populated.
    My extconfig.conf
    [settings]
    sipusers => mysql,asterisk,sip_buddies
    sippeers => mysql,asterisk,sip_buddies
    extensions => mysql,asterisk,extensions
    voicemail => mysql,asterisk,voicemail_users
    queues => mysql,asterisk,queues
    queue_members => mysql,asterisk,queue_members
    and I deleted voicemail.conf from the linux server directory
    Remember When I dial 8500 it takes me to voice mail application;

    Thanks
    Farhan

    Data from Extensions;
    8 | incoming | 5006 | 1 | NoOp | |
    | 9 | incoming | 5006 | 2 | Dial | SIP/5006 |
    | 10 | incoming | 5006 | 3 | Voicemail | u5006 |
    | 11 | incoming | 5006 | 4 | Hangup | |
    | 12 | incoming | 8500 | 1 | VoicemailMain | |
    | 13 | incoming | 5007 | 1 | NoOp | |
    | 14 | incoming | 5007 | 2 | Dial | SIP/5007 |
    | 15 | incoming | 5007 | 3 | Voicemail | u5007 |
    | 16 | incoming | 5007 | 4 | Hangup | |
    —- ———- ——- ———- ————— ———-

  31. hamster says:

    hi admin….thank for u’r great article….

    i’ve problem with my asterisk server….i’ve following your instruction….but it still not working yet…..
    my asterisk can’t read configuration i’ve made….i’m used asterisk 1.4 .0 ….

    instead setting above…what another settings you made in your asterisk realtime ?

    can you help me please….what i’ve missed in asterisk realtime settings…..

  32. Farhan says:

    Hi Author,
    I got your tutorial to setup realtime Asterisk Environment You tutorial is really help full.

    When I dail an extension within LAN there is no ring tone and phone doesnt ring on the other side. I am using x lite for this testing

    My Current Environment is asterisknow.
    Asterisk 1.4.24, Copyright (C) 1999 – 2008 Digium, Inc. and others.
    Created by Mark Spencer
    Linux version CENTOS 5.3

    Data from Extensions;

    | 9 | incoming | 5006 | 1 | Dial | SIP/5006 ,30|
    | 10 | incoming | 5006 | 2 | Voicemail | u5006 |
    | 11 | incoming | 5006 | 3 | Hangup | |
    | 12 | incoming | 8500 | 1 | VoicemailMain | |
    | 14 | incoming | 5007 | 1 | Dial | SIP/5007,30 |
    | 15 | incoming | 5007 | 2 | Voicemail | u5007 |
    | 16 | incoming | 5007 | 3| Hangup | |
    —- ———- ——- ———- ————— ———-

    In addition to that I have 1 Wired Router supplied by the ISP with one port and then I have another Dlink N wireless router which is being used as wireless access point and No router functionality is utilized for this router .I have opened RTP and 5060 Ports on my Router provided by ISP.

    if you need any thing else please let me know.

    Thanksin advance

    Farhan Haider

  33. [...] CommunicationSMS    SMS – »Reference Links1) http://hostseries.com/asterisk-realtime-installation-guide/ August 22nd, 2009 | Category: Asterisk Leave a Reply [...]

  34. Krisna Aditya says:

    Thanks, nice article! (two thumbs up)

    I am newbie in Asterisk
    I see so many column in queues table
    Can You help explain me, the usage of several column (or You can give me an example)? please

    Thanks

  35. Krisna Aditya says:

    I have another answer
    what is different between agent and queue member?
    thanks alot

  36. Digits says:

    Hey man,

    Thanks for the good work, keep it up ! really simple and straight forward.

    I am trying to set SIP users to authenticate from MySQL using Asterisk ARA for 4 days now, i am getting closer thanks to your tutorial, however i get this error on the Asterisk CLI:

    [Oct 11 03:52:41] WARNING[7684]: config.c:1326 find_engine: Realtime mapping for ‘sippeers’ found to engine ‘mysql’, but the engine is not available
    [Oct 11 03:52:41] NOTICE[7684]: chan_sip.c:16078 handle_request_register: Registration from ‘”105″ ‘ failed for ‘xx.xx.xx.xx’ – No matching peer found

  37. Digits says:

    turns out i needed to install asterisk-addons and also forgot to configure res_mysql.conf.. Thanks for the great tutorial

  38. Author says:

    Digits,

    I’m glad you found what you were looking for. And I’m sorry to everyone for taking so long to reply to everyone’s comments. I’ll try to be better. :-)

  39. Author says:

    Hi Krisna,

    Sorry for the delay. I have given one example already of the sip data that you might insert to the database. Each of the columns corresponds to a setting/option in the .conf file. So for example, in my forementioned example of the sip_buddies, name = the data between the brackets from the sip friend in sip.conf [105], and context is the context= value from the sip.conf, and so on….

    I hope that is clear. Thanks for your time.

  40. Author says:

    I’m not sure quite what you are referring to. On older versions of Asterisk, there was the AgentCallBackLogin application, which would allow an agent to login/logout of the queues, etc. In this case, the agent is someone that might be assigned to answer phones for that queue. The agent also could float between SIP Phones, so maybe he didn’t have to sit at the same desk everyday – a little more dynamic.

    A queue member used to be more static, like a SIP Phone – it’s extension, being added to the queue. That ‘member’ would always be there. However, that has changed alot in Asterisk 1.4, 1.6. The queue member can be dynamic, easily added and removed from the queue, etc. I guess it’s always been like this really. But with v1.4, v1.6 AgentCallBackLogin was depreciated. You can read more about that here: http://hostseries.com/agentcallbacklogin-alternative/

    At any rate, when in my writings, when I talk about an ‘Agent’ – I mean someone within our callcenter that is answering the phones. :-)

  41. Author says:

    Hi Hamster,

    The instructions provided will work perfectly. What errors did you get, if any?
    Please email me if you need further assistance. I can login to your system and have a look: author @ hostseries.com

  42. huongtra says:

    hi, I have 2 sipfone, one in linux that installed asterisk and one in windown. I have installed asterisk-addons and config res_mysql.conf :[general]
    dbhost = localhost
    dbname = asterisk
    dbuser = asterisk
    dbpass = yourpassword
    dbport = 3306
    dbsock = /var/lib/mysql/mysql.sock
    I also have tables: sip_buddies, extensions, queue_member_table .
    I follow your instruction , when i check realtime mysql status, it connect suceesfully.
    I have tables: sip_buddies, extensions, queue_member_table.
    but my sipphone can\’t register into asterisk except i use command \’ sip set debug peer test \’( test is peer in linux) and \’sip set debug peer 8051\’(8051 is in windown). After I made a call from test to 8051, 2 phone can make call together. but when i use \”sip show peer\”, 2 phone have status \”UNMONITORED\” . I manuallly add info into table extensions and queue_member_table but asterisk can\’t understand.in cli, \”retrieve sql: select * from queue_member_table where interface like \”%\” and queue_name=\”queue1\” order interface. But I can\’t see any changes in queue_member_table.can you help me?

  43. Author says:

    Huongtra,

    Please email me logins to your server and I’ll have a look: author (@) hostseries.com

  44. [...] In addition to the above, you can always port voicemail.conf to MySQL via Asterisk Realtime. You can learn more Asterisk Realtime here. [...]

  45. vinodh says:

    Is it possible to trigger email once we got voicemail messages saved in the Mysql table.

    If it is yes..Can u just guide me with few examples.

    vinodh

  46. rob says:

    Hi,

    You can do this with voicemail.conf setting: attach=yes – this will send an email automatically with the email attached. I honestly haven’t tried it without the attach=yes, but I would imagine that it would still send the email.

  47. Neven says:

    I followed your article and everything is explained great. But now i have problem / or not, i don’t know. When I go to the asterisk CLI i get:

    WARNING[3583]: res_config_mysql.c:325 realtime_mysql: MySQL RealTime: Invalid database specified: asterisk (check res_mysql.conf)

    But when I issue the command: \realtime mysql status\ i get that i’m connected at [email protected] for xy period of time. And everything seems to be fine.

    My res_mysql.conf:

    [general]
    dbhost = 127.0.0.1
    dbname = asterisk
    dbuser = asterisk
    dbpass = 123456
    dbport = 3306
    dbsock = /tmp/mysql.sock
    requirements=createclose

    I’m using 1.6.2.1 version. Please can someone help me with this?

  48. rob says:

    Hi Neven,

    I think this has to do with your settings in /etc/asterisk/extconfig.conf
    With Asterisk 1.6.x you have to set the ‘connection’ being used in that as well. Check the config samples for extconfig.conf to know what I mean.

  49. alimoni says:

    hi author
    thanks for your great tutorial.

    would you plz give me a sample sql query for voicemail setup.
    I appreciate your concern.

Leave a Reply