[Asterisk-Users] extensions.conf if/then statement
Can someone explain to me how to read this? This is an excerpt from http://lists.digium.com/pipermail/asterisk-dev/2003-May/000653.html I had it working the way I wanted at one time but I never really understood the first statement. It's some sort of if/else but I'm not familar with this method. ; is this a forwarded call (-5) or a direct call (-2) exten = 8500,1,gotoif,$[${RDNIS}]?${EXTEN}|5:${EXTEN}|2 I believe this is similar to the following PHP statement - which I can get to do what I want but I don't really understand the syntax. print option value=AcctStartTime. ($_GET[searchfield]=='AcctStartTime'?' selected':'') . Login Time/option; Bill ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] MySQL
What's the proper way to download a STABLE version of asterisk and asterisk-addons from CVS? I keep finding documentation that says two different ways of download it. Now that I've downloaded the asterisk-addons that has the res_mysql.conf.sample it won't compile. If I cd to asterisk-addons and do a make clean; make I get the following. This used to work fine before. res_config_mysql.c: In function `load_module': res_config_mysql.c:467: error: structure has no member named `static_func' res_config_mysql.c:468: error: structure has no member named `realtime_func' res_config_mysql.c:469: error: structure has no member named `update_func' res_config_mysql.c:470: error: structure has no member named `realtime_multi_func' make: *** [res_config_mysql.o] Error 1 rm app_saycountpl.o The mysql-vm-routines.h is still there as well. I thought that file was removed. Bill - Original Message - From: Matthew Boehm To: Asterisk Users Mailing List - Non-Commercial Discussion Sent: Monday, December 13, 2004 9:09 AM Subject: Re: [Asterisk-Users] MySQL You are missing the fact that RealTime is not 1-0, its CVS. 'Thats' why res_mysql.conf isn't even there. -Matthew - Original Message - From: Bill [EMAIL PROTECTED] To: Asterisk Users Mailing List - Non-Commercial Discussion [EMAIL PROTECTED] Sent: Monday, December 13, 2004 8:32 AM Subject: Re: [Asterisk-Users] MySQL Same here. I've deleted and re-installed asterisk a few times and the RealTime voicemail never works. The best I've gotten is the MySQL query to execute with the wrong context. When I use cvs checkout -r v1-0 zaptel libpri asterisk asterisk-addons asterisk-sounds to download the latest version the res_mysql.conf.sample isn't even there. I made it from scratch but it still doesn't work. If that file isn't there what else is missing? Bill - Original Message - From: Greg - Cirelle Enterprises To: Asterisk Users Mailing List - Non-Commercial Discussion Sent: Sunday, December 12, 2004 12:50 PM Subject: Re: [Asterisk-Users] MySQL At 06:29 PM 12/9/04, you wrote: Sure. (I really need to write a wiki on this.) You have two choices here before we start. You can use RealTime one of 2 ways: ODBC or direct MySQL. Currently these are the only two supported methods. Since I don't use ODBC and as the author of the MySQL RealTime driver, I'm going to instruct on how to use/install it. The RealTime MySQL driver can be found inside asterisk-addons. Just do the standard make, make install. Now copy asterisk-addons/configs/res_mysql.conf.sample to /etc/asterisk/res_mysql.conf (or whereever your conf dir is). Edit the res_mysql.conf to your liking. Now edit /etc/asterisk/extconfig.conf. Down at the bottom is the RealTime config stuff. If you want voicemail, add this line: voicemail = mysql,asterisk,voicemail_users No such file res_mysql.conf only cdr_mysql_conf.sample Greg ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] MySQL
Yeah, I have been changing that line each time I re-install/re-configure it but it never seems to work. My mysql.sock files is at /var/lib/mysql/mysql.sock The best I've gotten it to work so far is trying to get the voicemail password from the Mysql table with the wrong context. For some reason it always wanted to put the context as default while I had from-sip as the context in extensions.conf and sip.conf I was able to see it do a mysql request in the /var/log/mysql.log file. Bill - Original Message - From: Brian Wilkins To: Asterisk Users Mailing List - Non-Commercial Discussion Sent: Monday, December 13, 2004 4:33 AM Subject: Re: [Asterisk-Users] MySQL Yep, same problem I had. Look in /etc/mysql/my.cnf for the location of the sock file. On Monday 13 December 2004 03:17 pm, Greg - Cirelle Enterprises wrote: At 09:32 AM 12/13/04, you wrote: Same here. I've deleted and re-installed asterisk a few times and the RealTime voicemail never works. The best I've gotten is the MySQL query to execute with the wrong context. When I use cvs checkout -r v1-0 zaptel libpri asterisk asterisk-addons asterisk-sounds to download the latest version the res_mysql.conf.sample isn't even there. I made it from scratch but it still doesn't work. If that file isn't there what else is missing? Bill I just found out (on my system), the res_mysql.conf has the local mysql socket setting looking for mysql.sock in /tmp/mysql.sock I did a locate mysql.sock which found the actual location and I put that location in res_mysql.conf in the dbsock parameter and it began working. Hope this helps you Greg ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Brian Wilkins Software Engineer [EMAIL PROTECTED] Heritage Communications Corporation Melbourne, FL USA 32935 321.308.4000 x33 http://www.hcc.net ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] Voicemail and MySQL
Yeah, I don't believe that new feature wasn't in the one I made my notes with a few months ago. I just assumed that context was the same as in sip.conf and extensions.conf Bill - Original Message - From: Matthew Boehm To: Asterisk Users Mailing List - Non-Commercial Discussion Sent: Monday, December 13, 2004 2:21 PM Subject: Re: [Asterisk-Users] Voicemail and MySQL A..now we find the problem. Voicemailmain does NOT use the context that calls it. haha..finally found the problem. You must call it as VoicemailMain(@from-sip) if you want it to look for mailbox in a specific context. I knew it was something simple. -Matthew - Original Message - From: Bill [EMAIL PROTECTED] To: Asterisk Users Mailing List - Non-Commercial Discussion [EMAIL PROTECTED] Sent: Monday, December 13, 2004 1:04 PM Subject: [Asterisk-Users] Voicemail and MySQL I have Asterisk talking to MySQL using Realtime but for some reason I keep getting the wrong context used when Realtime makes the MySQL call. I can see this in my /var/log/mysql.log file. Because of this I can't login to VoicemailMain from my X-Ten phone. I can login if I statically configure the voicemail user in voicemail.conf but I prefer the MySQL. SELECT * FROM users WHERE mailbox = '0063' AND context = 'default' In my sip.conf file I have the default settings except the default context is set. I removed all the example SIP configs further down the config. [general] context=from-sip ;Default context for incoming calls In my extensions.conf file I have the following. All example extension configs have been removed. [from-sip] exten = 8500,1,VoicemailMain exten = 8500,n,Hangup What am I doing wrong? Bill ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] MySQL
Darren, Matthew submitted a set of instructions yesterday for setting up voicemail with mysql and odbc. These are the fields he stated for use with mysql. CREATE TABLE `voicemail_users` ( `uniqueid` int(11) NOT NULL auto_increment, `customer_id` int(11) NOT NULL default '0', `context` varchar(50) NOT NULL default '', `mailbox` int(5) NOT NULL default '0', `password` int(4) NOT NULL default '0', `fullname` varchar(50) NOT NULL default '', `email` varchar(50) NOT NULL default '', `pager` varchar(50) NOT NULL default '', `options` varchar(100) NOT NULL default '', `stamp` timestamp(14) NOT NULL, PRIMARY KEY (`uniqueid`) ) TYPE=MyISAM; Bill - Original Message - From: Matthew Boehm To: Asterisk Users Mailing List - Non-Commercial Discussion Sent: Friday, December 10, 2004 8:41 AM Subject: Re: [Asterisk-Users] MySQL What do you mean? For voicemail, I provided the fields in my instructions. Matthew - Original Message - From: Darren Wiebe [EMAIL PROTECTED] To: Asterisk Users Mailing List - Non-Commercial Discussion [EMAIL PROTECTED] Sent: Thursday, December 09, 2004 8:49 PM Subject: Re: [Asterisk-Users] MySQL Does anybody have a list of fields that should be added to tables for a basic setup? I would gladly write a perl script to add them if somebody has a list. Darren Wiebe [EMAIL PROTECTED] Matthew Boehm wrote: Sure. (I really need to write a wiki on this.) You have two choices here before we start. You can use RealTime one of 2 ways: ODBC or direct MySQL. Currently these are the only two supported methods. Since I don't use ODBC and as the author of the MySQL RealTime driver, I'm going to instruct on how to use/install it. The RealTime MySQL driver can be found inside asterisk-addons. Just do the standard make, make install. Now copy asterisk-addons/configs/res_mysql.conf.sample to /etc/asterisk/res_mysql.conf (or whereever your conf dir is). Edit the res_mysql.conf to your liking. Now edit /etc/asterisk/extconfig.conf. Down at the bottom is the RealTime config stuff. If you want voicemail, add this line: voicemail = mysql,asterisk,voicemail_users This basically says Please use the RealTime MySQL driver, the database asterisk and the table voicemail_users and bind that to the voicemail family. You can change to your liking: voicemail = driver,databasename,tablename Now go into your mysql server and make the following table: CREATE TABLE `voicemail_users` ( `uniqueid` int(11) NOT NULL auto_increment, `customer_id` int(11) NOT NULL default '0', `context` varchar(50) NOT NULL default '', `mailbox` int(5) NOT NULL default '0', `password` int(4) NOT NULL default '0', `fullname` varchar(50) NOT NULL default '', `email` varchar(50) NOT NULL default '', `pager` varchar(50) NOT NULL default '', `options` varchar(100) NOT NULL default '', `stamp` timestamp(14) NOT NULL, PRIMARY KEY (`uniqueid`) ) TYPE=MyISAM; Put in some rows. Restart asterisk and it should work. Please let me know if it works/doesn't work. -Matthew - Original Message - From: VCI Help Desk [EMAIL PROTECTED] To: Asterisk Users Mailing List - Non-Commercial Discussion [EMAIL PROTECTED] Sent: Thursday, December 09, 2004 4:44 PM Subject: [Asterisk-Users] MySQL Does anyone have any instructions for setting up MySQL with the latest CVS? I upgraded from an older version this week and none of the MySQL works now and I believe it's due to the newer Realtime Architecture. I can't find any instructions that explain it very well anywhere. Any help would be appreciated. Bill ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[Asterisk-Users] extensions.conf using TO field and not INVITE field of SIP header
Is there a way to get the extensions.conf file to use the To: field of a SIP header instead of the INVITE field? If so, can you point me in the right direction? Bill ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[Asterisk-Users] MySQL
Does anyone have any instructions for setting up MySQL with the latest CVS? I upgraded from an older version this week and none of the MySQL works now and I believe it's due to the newer Realtime Architecture. I can't find any instructions that explain it very well anywhere. Any help would be appreciated. Bill ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[Asterisk-Users] Voicemail forwarding from SER extensions.conf
I have SER running with Asterisk, both on seperate servers. If I call another SIP number from my SIP phone SER looks up the phone number to see if it's online. If it's not online it forwards the call to Asterisk. How do I configure the extensions.conf file so that calls being forwarded to Asterisk destined for VoiceMail do not conflict with normal outbound calls destined for the PSTN? I have the following which works ok but I can't make outbound calls when this is enabled. ; send caller to voicemail if call is being forwarded from SER ; exten = _.,1,MailboxExists([EMAIL PROTECTED]) ; exten = _.,2,Hangup(); hangup ; exten = _.,102,Voicemail(u${EXTEN}); answer and state unavailable, leave a message ; exten = _.,103,Hangup() ; hangup Bill Dunn ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users