Re: [asterisk-users] hwo to stok variable wiith menu

2013-05-08 Thread Salaheddine Elharit
hello list

i would your help please regarding this issue

with the below code i can store the call date and the callerid ,now i want
to store also the sip phone called 223

could you please see the code and tell me  how can i add the sip phone in
my table 'Menu'

exten = 506,1,Ringing()
exten = 506,n,Dial(SIP/223, 30)
exten = 506,n,Goto(support,s,1)

[support]

exten = s,1,NoOp(User chose support option)
exten = s,n,MYSQL(Connect connid localhost aheevaccs aheevaccs aheevaccs)
exten = s,n,MYSQL(Query resultid ${connid} INSERT\ INTO\ menu\  SET\
callerid='${CALLERID(num)}'\, calldate=now())
exten = s,n,MYSQL(Clear ${resultid})
exten = s,n,MYSQL(Disconnect ${connid})

thanks and regards


2011/12/1 salaheddine elharit salah.elharit...@gmail.com

 Hi Noll,

 all works perfectly thanks a lot for your help and support i really
 appreciate it :)

 Best Regards

 2011/12/1 Dale Noll dn...@wi.rr.com


 On 11/30/2011 11:13 AM, salaheddine elharit wrote:

 i have last question regarding this thread
 with exten = 3,n,MYSQL(Query resultid ${connid} insert into test (
 option_name ) values ('${CALLERID(num)}'))
 i can store the phone number without issue
 i need also the date and hour fo call in the count coulum
 could you please give me the syntex
 best regards


 The example table that I gave originally was before I knew what you were
 looking to do. I assumed, incorrectly that you simply wanted to track how
 many times an option was selected in the menu.
 I would recommend that you create a table specifically for this
 application.

 That table may look like this.  Please name the table and columns
 appropriately for your application.

 create table option_three (
 calldatedatetime,
 calleridvarchar(40)
 )

 Then the sql would look something like this...
  exten = 3,n,MYSQL(Query resultid ${connid} insert into option_three (
 calldate, callerid ) values ( now(), '${CALLERID(num)}'))


 Dale

 --
 The truth speaks for itself. I'm just the messenger.
 Lyta Alexander - Babylon 5


 --
 __**__**_
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
  
 http://lists.digium.com/**mailman/listinfo/asterisk-**usershttp://lists.digium.com/mailman/listinfo/asterisk-users



--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] hwo to stok variable wiith menu

2011-12-01 Thread salaheddine elharit
Hi Noll,

all works perfectly thanks a lot for your help and support i really
appreciate it :)

Best Regards

2011/12/1 Dale Noll dn...@wi.rr.com


 On 11/30/2011 11:13 AM, salaheddine elharit wrote:

 i have last question regarding this thread
 with exten = 3,n,MYSQL(Query resultid ${connid} insert into test (
 option_name ) values ('${CALLERID(num)}'))
 i can store the phone number without issue
 i need also the date and hour fo call in the count coulum
 could you please give me the syntex
 best regards


 The example table that I gave originally was before I knew what you were
 looking to do. I assumed, incorrectly that you simply wanted to track how
 many times an option was selected in the menu.
 I would recommend that you create a table specifically for this
 application.

 That table may look like this.  Please name the table and columns
 appropriately for your application.

 create table option_three (
 calldatedatetime,
 calleridvarchar(40)
 )

 Then the sql would look something like this...
  exten = 3,n,MYSQL(Query resultid ${connid} insert into option_three (
 calldate, callerid ) values ( now(), '${CALLERID(num)}'))


 Dale

 --
 The truth speaks for itself. I'm just the messenger.
 Lyta Alexander - Babylon 5


 --
 __**__**_
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
  
 http://lists.digium.com/**mailman/listinfo/asterisk-**usershttp://lists.digium.com/mailman/listinfo/asterisk-users

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] hwo to stok variable wiith menu

2011-11-30 Thread salaheddine elharit
thank you so much for you help,i have flowed your email and installed
thesesadd-ons all
works perfectly i can store the phone_number of the Customer ,now i can do
what i want :)



thanks every one for your support J

2011/11/30 Dale Noll dn...@wi.rr.com

 On 11/28/2011 08:24 AM, salaheddine elharit wrote:

 thank you for your help

 You are welcome.

 i would to ask you please, i want to store the phone number of the
 customer  in the option_name column when he press 3 in context menu
 i have created a database aheevacss with user aheevaccs and password
 aheevaccs and also i have creatd a table in this database name of table
 test with two columns:
 option_namevarchar(15)
 countint
 1-how can i check if the app_mysql module compiled and loaded  i use
 asterisk 1.4 and if not installed how can ido in order to install and
 loaded it

 I saw in some other message threads, it looks like you are working out
 getting the mysql connectivity working in 1.4.  In this version, it is an
 'add on' that you have to download separately from the Asterisk source
 tree.  The instructions given by Warren Selby are correct.
 When you do the 'make menuselect', you are presented with a menu with 5
 options.  Under 'Applications' you need to check app_addon_sql_mysql. Under
 'Call Detail Recording' select cdr_addon_mysql. Under 'Resource Modules'
 check res_config_mysql.  Exit from menuselect and type 'make'.  You
 probably do not need the res_config_mysql, but it does not hurt anything to
 compile it.

 Aslo as mentioned in another thread, you do need to have mysql-devel
 package installed.

 Then run 'make' and 'make install' and 'make samples'.  This will build
 the modules app_addon_sql_mysql.so, cdr_addon_mysql.so and
 res_config_mysql.so and install them in /usr/lib/asterisk/modules.  This
 does not change any existing modules, just adds the new ones.

 Start an Asterisk cli (asterisk -r) and issue the command 'module load
 app_addon_sql_mysql'.  This should load the module and the MYSQL app will
 be available in your dialplan.  To verify it is loaded, you can issue the
 command 'module show like sql'

 You should also check the /etc/asterisk/modules.conf file.  There should
 be a line that says 'autoload=yes'.  If it says no, you will have to add a
 line 'load = app_addon_sql_mysql' (do not include the quotes).  Note:  If
 you want to load cdr_addon_mysql, you will have to add a 'load =
 cdr_addon_mysql' line as well.  This file is read by asterisk at startup,
 so after you restart asterisk for the first time after these changes, make
 sure the module is loaded with the module show command.


 2- can you please veify the menu below and tell me waht is wrong
 thanks and regards
 [default]
 exten = 529,1,Ringing()
 exten = 529,2,Wait(4)
 exten = 529,3,Goto(accueil,s,1)

 [accueil] ; définition d’un contexte pour l’accueil
 exten = s,1,SetGlobalVar(sounds_path=/**var/lib/asterisk/sounds/)
 exten = s,2,Background(${sounds_path}**welcome)
 exten = s,3,goto(accueil,s,1)
 exten = #,1,Goto(menu,s,1)
 exten = i,1,Playback(${sounds_path}**erreur-saisie)
 exten = i,2,goto(accueil,s,1)
 exten = t,1,Goto(accueil,s,1)
 [menu]
 exten = s,1,Background(${sounds_path}**menu)
 exten = 0,1,Goto(menu,s,1)
 exten = 1,1,Goto(appel,s,1)
 exten = 2,1,Goto(message,s,1)
 exten = 3,1,NoOp(User chose support option)
 exten = 3,n,MYSQL(Connect connid localhost aheevaccs aheevaccs aheevaccs)
 exten = 3,n,MYSQL(Query resultid ${connid}  update test set count =
 count + 1 where option_name = 'support')
 exten = 3,n,MYSQL(Clear ${resultid})
 exten = 3,n,MYSQL(Disconnect ${connid})
 exten = 3,n,Goto(support,s,1)
 exten = s,2,goto(menu,s,1)
 exten = i,1,Playback(${sounds_path}**erreur-saisie)
 exten = i,2,Goto(menu,s,1)
 exten = t,1,Goto(menu,s,1)
 [appel] ; définition d’un contexte pour le menu d’appel
 exten = s,1,Background(${sounds_path}**appel)
 exten = s,2,WaitExten(10)
 exten = 0,1,Goto(menu,s,1)
 exten = 223,1,Dial(SIP/${EXTEN},20,tr)
 exten = i,1,Playback(${sounds_path}**erreur-saisie)
 exten = i,2,Goto(appel,s,1)
 exten = t,1,Goto(appel,s,1)
 [message] ; définition d’un contexte pour la messagerie
 exten = s,1,VoiceMailMain(${**CALLERIDNUM})
 exten = t,1,Hangup()

 [support] ; définition d’un contexte pour le support
 exten = s,1,GoToIfTime(09:00-17:00|**mon-fri|*|*?s,4)
 exten = s,2,Playback(${sounds_path}no-**relation-support)
 exten = s,3,Goto(menu,s,1)
 exten = s,4,Playback(${sounds_path}**relation-support)
 exten = s,5,Queue(default)
 exten = t,1,Hangup()

 In the [accueil] context, you call Background with the name of the file to
 play, then immediately return to the top and play the message again, and
 again and again.  It will never stop until the caller hangs up.  Also, you
 are asking the caller to press the '#' key to get past the welcome greeting
 before getting to the main menu.   I would recommend playing the welcome
 followed immediately by the Background() for the menu.  The call the
 WaitExten() to give the 

Re: [asterisk-users] hwo to stok variable wiith menu

2011-11-30 Thread salaheddine elharit
i have last question regarding this thread

with exten = 3,n,MYSQL(Query resultid ${connid} insert into test (
option_name ) values ('${CALLERID(num)}'))

i can store the phone number without issue

i need also the date and hour fo call in the count coulum

could you please give me the syntex

best regards

2011/11/30 salaheddine elharit salah.elharit...@gmail.com

  thank you so much for you help,i have flowed your email and installed
 theses add-ons all works perfectly i can store the phone_number of the
 Customer ,now i can do what i want :)



 thanks every one for your support J

   2011/11/30 Dale Noll dn...@wi.rr.com

 On 11/28/2011 08:24 AM, salaheddine elharit wrote:

 thank you for your help

 You are welcome.

 i would to ask you please, i want to store the phone number of the
 customer  in the option_name column when he press 3 in context menu
 i have created a database aheevacss with user aheevaccs and password
 aheevaccs and also i have creatd a table in this database name of table
 test with two columns:
 option_namevarchar(15)
 countint
 1-how can i check if the app_mysql module compiled and loaded  i use
 asterisk 1.4 and if not installed how can ido in order to install and
 loaded it

 I saw in some other message threads, it looks like you are working out
 getting the mysql connectivity working in 1.4.  In this version, it is an
 'add on' that you have to download separately from the Asterisk source
 tree.  The instructions given by Warren Selby are correct.
 When you do the 'make menuselect', you are presented with a menu with 5
 options.  Under 'Applications' you need to check app_addon_sql_mysql. Under
 'Call Detail Recording' select cdr_addon_mysql. Under 'Resource Modules'
 check res_config_mysql.  Exit from menuselect and type 'make'.  You
 probably do not need the res_config_mysql, but it does not hurt anything to
 compile it.

 Aslo as mentioned in another thread, you do need to have mysql-devel
 package installed.

 Then run 'make' and 'make install' and 'make samples'.  This will build
 the modules app_addon_sql_mysql.so, cdr_addon_mysql.so and
 res_config_mysql.so and install them in /usr/lib/asterisk/modules.  This
 does not change any existing modules, just adds the new ones.

 Start an Asterisk cli (asterisk -r) and issue the command 'module load
 app_addon_sql_mysql'.  This should load the module and the MYSQL app will
 be available in your dialplan.  To verify it is loaded, you can issue the
 command 'module show like sql'

 You should also check the /etc/asterisk/modules.conf file.  There should
 be a line that says 'autoload=yes'.  If it says no, you will have to add a
 line 'load = app_addon_sql_mysql' (do not include the quotes).  Note:  If
 you want to load cdr_addon_mysql, you will have to add a 'load =
 cdr_addon_mysql' line as well.  This file is read by asterisk at startup,
 so after you restart asterisk for the first time after these changes, make
 sure the module is loaded with the module show command.


 2- can you please veify the menu below and tell me waht is wrong
 thanks and regards
 [default]
 exten = 529,1,Ringing()
 exten = 529,2,Wait(4)
 exten = 529,3,Goto(accueil,s,1)

 [accueil] ; définition d’un contexte pour l’accueil
 exten = s,1,SetGlobalVar(sounds_path=/**var/lib/asterisk/sounds/)
 exten = s,2,Background(${sounds_path}**welcome)
 exten = s,3,goto(accueil,s,1)
 exten = #,1,Goto(menu,s,1)
 exten = i,1,Playback(${sounds_path}**erreur-saisie)
 exten = i,2,goto(accueil,s,1)
 exten = t,1,Goto(accueil,s,1)
 [menu]
 exten = s,1,Background(${sounds_path}**menu)
 exten = 0,1,Goto(menu,s,1)
 exten = 1,1,Goto(appel,s,1)
 exten = 2,1,Goto(message,s,1)
 exten = 3,1,NoOp(User chose support option)
 exten = 3,n,MYSQL(Connect connid localhost aheevaccs aheevaccs
 aheevaccs)
 exten = 3,n,MYSQL(Query resultid ${connid}  update test set count =
 count + 1 where option_name = 'support')
 exten = 3,n,MYSQL(Clear ${resultid})
 exten = 3,n,MYSQL(Disconnect ${connid})
 exten = 3,n,Goto(support,s,1)
 exten = s,2,goto(menu,s,1)
 exten = i,1,Playback(${sounds_path}**erreur-saisie)
 exten = i,2,Goto(menu,s,1)
 exten = t,1,Goto(menu,s,1)
 [appel] ; définition d’un contexte pour le menu d’appel
 exten = s,1,Background(${sounds_path}**appel)
 exten = s,2,WaitExten(10)
 exten = 0,1,Goto(menu,s,1)
 exten = 223,1,Dial(SIP/${EXTEN},20,tr)
 exten = i,1,Playback(${sounds_path}**erreur-saisie)
 exten = i,2,Goto(appel,s,1)
 exten = t,1,Goto(appel,s,1)
 [message] ; définition d’un contexte pour la messagerie
 exten = s,1,VoiceMailMain(${**CALLERIDNUM})
 exten = t,1,Hangup()

 [support] ; définition d’un contexte pour le support
 exten = s,1,GoToIfTime(09:00-17:00|**mon-fri|*|*?s,4)
 exten = s,2,Playback(${sounds_path}no-**relation-support)
 exten = s,3,Goto(menu,s,1)
 exten = s,4,Playback(${sounds_path}**relation-support)
 exten = s,5,Queue(default)
 exten = t,1,Hangup()

 In the [accueil] context, you call Background with the name of the file
 to play, then 

Re: [asterisk-users] hwo to stok variable wiith menu

2011-11-30 Thread Dale Noll


On 11/30/2011 11:13 AM, salaheddine elharit wrote:

i have last question regarding this thread
with exten = 3,n,MYSQL(Query resultid ${connid} insert into test ( 
option_name ) values ('${CALLERID(num)}'))

i can store the phone number without issue
i need also the date and hour fo call in the count coulum
could you please give me the syntex
best regards



The example table that I gave originally was before I knew what you were 
looking to do. I assumed, incorrectly that you simply wanted to track 
how many times an option was selected in the menu.
I would recommend that you create a table specifically for this 
application.


That table may look like this.  Please name the table and columns 
appropriately for your application.


create table option_three (
calldatedatetime,
calleridvarchar(40)
)

Then the sql would look something like this...
  exten = 3,n,MYSQL(Query resultid ${connid} insert into option_three 
( calldate, callerid ) values ( now(), '${CALLERID(num)}'))


Dale

--
The truth speaks for itself. I'm just the messenger.
 Lyta Alexander - Babylon 5


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] hwo to stok variable wiith menu

2011-11-29 Thread Dale Noll

On 11/28/2011 08:24 AM, salaheddine elharit wrote:

thank you for your help

You are welcome.
i would to ask you please, i want to store the phone number of the 
customer  in the option_name column when he press 3 in context menu
i have created a database aheevacss with user aheevaccs and 
password aheevaccs and also i have creatd a table in this database 
name of table test with two columns:

option_namevarchar(15)
countint
1-how can i check if the app_mysql module compiled and loaded  i use 
asterisk 1.4 and if not installed how can ido in order to install and 
loaded it
I saw in some other message threads, it looks like you are working out 
getting the mysql connectivity working in 1.4.  In this version, it is 
an 'add on' that you have to download separately from the Asterisk 
source tree.  The instructions given by Warren Selby are correct.
When you do the 'make menuselect', you are presented with a menu with 5 
options.  Under 'Applications' you need to check app_addon_sql_mysql. 
Under 'Call Detail Recording' select cdr_addon_mysql. Under 'Resource 
Modules' check res_config_mysql.  Exit from menuselect and type 'make'.  
You probably do not need the res_config_mysql, but it does not hurt 
anything to compile it.


Aslo as mentioned in another thread, you do need to have mysql-devel 
package installed.


Then run 'make' and 'make install' and 'make samples'.  This will build 
the modules app_addon_sql_mysql.so, cdr_addon_mysql.so and 
res_config_mysql.so and install them in /usr/lib/asterisk/modules.  This 
does not change any existing modules, just adds the new ones.


Start an Asterisk cli (asterisk -r) and issue the command 'module load 
app_addon_sql_mysql'.  This should load the module and the MYSQL app 
will be available in your dialplan.  To verify it is loaded, you can 
issue the command 'module show like sql'


You should also check the /etc/asterisk/modules.conf file.  There should 
be a line that says 'autoload=yes'.  If it says no, you will have to add 
a line 'load = app_addon_sql_mysql' (do not include the quotes).  
Note:  If you want to load cdr_addon_mysql, you will have to add a 'load 
= cdr_addon_mysql' line as well.  This file is read by asterisk at 
startup, so after you restart asterisk for the first time after these 
changes, make sure the module is loaded with the module show command.



2- can you please veify the menu below and tell me waht is wrong
thanks and regards
[default]
exten = 529,1,Ringing()
exten = 529,2,Wait(4)
exten = 529,3,Goto(accueil,s,1)

[accueil] ; définition d’un contexte pour l’accueil
exten = s,1,SetGlobalVar(sounds_path=/var/lib/asterisk/sounds/)
exten = s,2,Background(${sounds_path}welcome)
exten = s,3,goto(accueil,s,1)
exten = #,1,Goto(menu,s,1)
exten = i,1,Playback(${sounds_path}erreur-saisie)
exten = i,2,goto(accueil,s,1)
exten = t,1,Goto(accueil,s,1)
[menu]
exten = s,1,Background(${sounds_path}menu)
exten = 0,1,Goto(menu,s,1)
exten = 1,1,Goto(appel,s,1)
exten = 2,1,Goto(message,s,1)
exten = 3,1,NoOp(User chose support option)
exten = 3,n,MYSQL(Connect connid localhost aheevaccs aheevaccs aheevaccs)
exten = 3,n,MYSQL(Query resultid ${connid}  update test set count = 
count + 1 where option_name = 'support')

exten = 3,n,MYSQL(Clear ${resultid})
exten = 3,n,MYSQL(Disconnect ${connid})
exten = 3,n,Goto(support,s,1)
exten = s,2,goto(menu,s,1)
exten = i,1,Playback(${sounds_path}erreur-saisie)
exten = i,2,Goto(menu,s,1)
exten = t,1,Goto(menu,s,1)
[appel] ; définition d’un contexte pour le menu d’appel
exten = s,1,Background(${sounds_path}appel)
exten = s,2,WaitExten(10)
exten = 0,1,Goto(menu,s,1)
exten = 223,1,Dial(SIP/${EXTEN},20,tr)
exten = i,1,Playback(${sounds_path}erreur-saisie)
exten = i,2,Goto(appel,s,1)
exten = t,1,Goto(appel,s,1)
[message] ; définition d’un contexte pour la messagerie
exten = s,1,VoiceMailMain(${CALLERIDNUM})
exten = t,1,Hangup()

[support] ; définition d’un contexte pour le support
exten = s,1,GoToIfTime(09:00-17:00|mon-fri|*|*?s,4)
exten = s,2,Playback(${sounds_path}no-relation-support)
exten = s,3,Goto(menu,s,1)
exten = s,4,Playback(${sounds_path}relation-support)
exten = s,5,Queue(default)
exten = t,1,Hangup()
In the [accueil] context, you call Background with the name of the file 
to play, then immediately return to the top and play the message again, 
and again and again.  It will never stop until the caller hangs up.  
Also, you are asking the caller to press the '#' key to get past the 
welcome greeting before getting to the main menu.   I would recommend 
playing the welcome followed immediately by the Background() for the 
menu.  The call the WaitExten() to give the caller a chance to enter a 
selection.  The if a timeout or invalid entry occurs, go back to the 
point where the menu is played.  You should also think about a look so 
that after a few failed attempts, you hangup the line and do not tie up 
that channel.


To save the telephone number that you when option 3 is pressed, change 
the 

Re: [asterisk-users] hwo to stok variable wiith menu

2011-11-28 Thread salaheddine elharit
hello Noll

thank you for your help

i would to ask you please, i want to store the phone number of the
customer  in the option_name column when he press 3 in context menu

i have created a database aheevacss with user aheevaccs and password
aheevaccs and also i have creatd a table in this database name of table
test with two columns:
option_namevarchar(15)
countint

1-how can i check if the app_mysql module compiled and loaded  i use
asterisk 1.4 and if not installed how can ido in order to install and
loaded it

2- can you please veify the menu below and tell me waht is wrong

thanks and regards

[default]
exten = 529,1,Ringing()
exten = 529,2,Wait(4)
exten = 529,3,Goto(accueil,s,1)

[accueil] ; définition d’un contexte pour l’accueil
exten = s,1,SetGlobalVar(sounds_path=/var/lib/asterisk/sounds/)
exten = s,2,Background(${sounds_path}welcome)
exten = s,3,goto(accueil,s,1)
exten = #,1,Goto(menu,s,1)
exten = i,1,Playback(${sounds_path}erreur-saisie)
exten = i,2,goto(accueil,s,1)
exten = t,1,Goto(accueil,s,1)

[menu]
exten = s,1,Background(${sounds_path}menu)
exten = 0,1,Goto(menu,s,1)
exten = 1,1,Goto(appel,s,1)
exten = 2,1,Goto(message,s,1)
exten = 3,1,NoOp(User chose support option)
exten = 3,n,MYSQL(Connect connid localhost aheevaccs aheevaccs aheevaccs)
exten = 3,n,MYSQL(Query resultid ${connid}  update test set count = count
+ 1 where option_name = 'support')
exten = 3,n,MYSQL(Clear ${resultid})
exten = 3,n,MYSQL(Disconnect ${connid})
exten = 3,n,Goto(support,s,1)
exten = s,2,goto(menu,s,1)
exten = i,1,Playback(${sounds_path}erreur-saisie)
exten = i,2,Goto(menu,s,1)
exten = t,1,Goto(menu,s,1)

[appel] ; définition d’un contexte pour le menu d’appel
exten = s,1,Background(${sounds_path}appel)
exten = s,2,WaitExten(10)
exten = 0,1,Goto(menu,s,1)
exten = 223,1,Dial(SIP/${EXTEN},20,tr)
exten = i,1,Playback(${sounds_path}erreur-saisie)
exten = i,2,Goto(appel,s,1)
exten = t,1,Goto(appel,s,1)
[message] ; définition d’un contexte pour la messagerie
exten = s,1,VoiceMailMain(${CALLERIDNUM})
exten = t,1,Hangup()

[support] ; définition d’un contexte pour le support
exten = s,1,GoToIfTime(09:00-17:00|mon-fri|*|*?s,4)
exten = s,2,Playback(${sounds_path}no-relation-support)
exten = s,3,Goto(menu,s,1)
exten = s,4,Playback(${sounds_path}relation-support)
exten = s,5,Queue(default)
exten = t,1,Hangup()




2011/11/25 Dale Noll dn...@wi.rr.com

 **
 On 11/25/2011 10:48 AM, salaheddine elharit wrote:


 thanks for your response

 i use mysql like a database and my question when the customer press 3 in
 context menu i want to stok this variable in a table in my database and i
 want to get this variable after
 could you please give an exemple like below

 thanks and regards

 [menu]
 exten = s,1,Background(${sounds_path}menu)
 exten = 0,1,Goto(menu,s,1)
 exten = 1,1,Goto(appel,s,1)
 exten = 2,1,Goto(message,s,1)

 exten = 3,1,Goto(support,s,1)
 exten = s,2,goto(menu,s,1)
 exten = i,1,Playback(${sounds_path}erreur-saisie)
 exten = i,2,Goto(menu,s,1)
 exten = t,1,Goto(menu,s,1)


 It is difficult to get a good example because I do not know what you are
 looking to save.  You say you want to store the variable, but the only
 variable you have in this case is the digit the user entered, in this case
 '3'.  If you are trying to count the number of times callers press option
 '3', then it is a simple update.

 If you have the app_mysql module compiled and loaded you can user the
 MYSQL() app.
 http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL

 If you do not want would prefer to setup an ODBC connection, that is a bid
 more complex as you have to setup unixODBC ( /etc/odbcinst.ini,
 /etc/odbc.ini ), then setup res_odbc(/etc/asterisk/res_odbc.conf) and
 func_odbc (/etc/asterisk/func_odbc.conf).

 How you update the database from within dialplan depends on which access
 method you choose.

 Assume you have a mysql table with two columns:
 option_namevarchar(15)
 countint


 You could write something like this if you are using app_mysql

 exten = 3,1,NoOp(User chose support option)
 exten = 3,n,MYSQL(Connect connid localhost database_user
 database_password database_name)
 exten = 3,n,MYSQL(Query resultid ${connid}  update counter_table set
 count = count + 1 where option_name = 'support')
 exten = 3,n,MYSQL(Clear ${resultid})
 exten = 3,n,MYSQL(Disconnect ${connid})
 exten = 3,n,Goto(support,s,1)





 --
 The truth speaks for itself. I'm just the messenger.
  Lyta Alexander - Babylon 5


 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

--
_
-- Bandwidth and Colocation 

[asterisk-users] hwo to stok variable wiith menu

2011-11-25 Thread salaheddine elharit
hello list,

i have created one menu like below all work without issue, what i want to
do is ,

when the customer press  3 in menu context  exten = 3,1,Goto(support,s,1)
i want to stok this variable (3) in database or file instead to go to
support context

thanks for your help and support

best regards


[default]
exten = 529,1,Ringing()
exten = 529,2,Wait(4)
exten = 529,3,Goto(accueil,s,1)

[accueil] ; définition d’un contexte pour l’accueil
exten = s,1,SetGlobalVar(sounds_path=/var/lib/asterisk/sounds/)
exten = s,2,Background(${sounds_path}welcome)
exten = s,3,goto(accueil,s,1)
exten = #,1,Goto(menu,s,1)
exten = i,1,Playback(${sounds_path}erreur-saisie)
exten = i,2,goto(accueil,s,1)
exten = t,1,Goto(accueil,s,1)
[menu]
exten = s,1,Background(${sounds_path}menu)
exten = 0,1,Goto(menu,s,1)
exten = 1,1,Goto(appel,s,1)
exten = 2,1,Goto(message,s,1)
exten = 3,1,Goto(support,s,1)
exten = s,2,goto(menu,s,1)
exten = i,1,Playback(${sounds_path}erreur-saisie)
exten = i,2,Goto(menu,s,1)
exten = t,1,Goto(menu,s,1)

[appel] ; définition d’un contexte pour le menu d’appel
exten = s,1,Background(${sounds_path}appel)
exten = s,2,WaitExten(10)
exten = 0,1,Goto(menu,s,1)
exten = 223,1,Dial(SIP/${EXTEN},20,tr)
exten = i,1,Playback(${sounds_path}erreur-saisie)
exten = i,2,Goto(appel,s,1)
exten = t,1,Goto(appel,s,1)
[message] ; définition d’un contexte pour la messagerie
exten = s,1,VoiceMailMain(${CALLERIDNUM})
exten = t,1,Hangup()

[support] ; définition d’un contexte pour le support
exten = s,1,GoToIfTime(09:00-17:00|mon-fri|*|*?s,4)
exten = s,2,Playback(${sounds_path}no-relation-support)
exten = s,3,Goto(menu,s,1)
exten = s,4,Playback(${sounds_path}relation-support)
exten = s,5,Queue(default)
exten = t,1,Hangup()
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] hwo to stok variable wiith menu

2011-11-25 Thread salaheddine elharit
thanks for your response

i use mysql like a database and my question when the customer press 3 in
context menu i want to stok this variable in a table in my database and i
want to get this variable after
could you please give an exemple like below

thanks and regards

[menu]
exten = s,1,Background(${sounds_path}menu)
exten = 0,1,Goto(menu,s,1)
exten = 1,1,Goto(appel,s,1)
exten = 2,1,Goto(message,s,1)

exten = 3,1,Goto(support,s,1)
exten = s,2,goto(menu,s,1)
exten = i,1,Playback(${sounds_path}erreur-saisie)
exten = i,2,Goto(menu,s,1)
exten = t,1,Goto(menu,s,1)
2011/11/25 Dale Noll dn...@wi.rr.com



 On 11/25/2011 09:32 AM, salaheddine elharit wrote:

 hello list,
 i have created one menu like below all work without issue, what i want to
 do is ,
 when the customer press  3 in menu context  exten =
 3,1,Goto(support,s,1) i want to stok this variable (3) in database or file
 instead to go to support context


 You can save a value to a global variable like you did within your sample
 dialplan, although I do not recommend this approach, you should read the
 note below as to why.

 You can save a value to a channel variable with the Set() command and use
 it later within the same call.

 You can save a value into the AstDB with the Set(${DB())) and access the
 value from any channel even after an Asterisk restart.

 You can setup ODBC, func_odbc and  a database then access the variables
 via the functions defined within the func_odbc.conf

 The method you choose should be determined by your needs.


 Note:  You set the global variable at the start of your dialplan. This
 global variable is available to ALL channels. If you set it for every call,
 you are doing so needlessly.  If you have multiple applications accessing
 the same variable and each one sets it with a different value, you will
 have problems. Global variables should be used to store information needed
 in the majority of calls.  The way you are using the global variable, I
 believe you may be better off removing the SetGlobalVar() call and instead
 set the variable in the [globals] section of extensions.conf.


 I hope that helps.

 Dale

 --
 The truth speaks for itself. I'm just the messenger.
 Lyta Alexander - Babylon 5


 --
 __**__**_
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
  
 http://lists.digium.com/**mailman/listinfo/asterisk-**usershttp://lists.digium.com/mailman/listinfo/asterisk-users

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] hwo to stok variable wiith menu

2011-11-25 Thread Dale Noll

On 11/25/2011 10:48 AM, salaheddine elharit wrote:


thanks for your response
i use mysql like a database and my question when the customer press 3 
in context menu i want to stok this variable in a table in my database 
and i want to get this variable after

could you please give an exemple like below
thanks and regards
[menu]
exten = s,1,Background(${sounds_path}menu)
exten = 0,1,Goto(menu,s,1)
exten = 1,1,Goto(appel,s,1)
exten = 2,1,Goto(message,s,1)

exten = 3,1,Goto(support,s,1)

exten = s,2,goto(menu,s,1)
exten = i,1,Playback(${sounds_path}erreur-saisie)
exten = i,2,Goto(menu,s,1)
exten = t,1,Goto(menu,s,1)



It is difficult to get a good example because I do not know what you are 
looking to save.  You say you want to store the variable, but the only 
variable you have in this case is the digit the user entered, in this 
case '3'.  If you are trying to count the number of times callers press 
option '3', then it is a simple update.


If you have the app_mysql module compiled and loaded you can user the 
MYSQL() app.

http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL

If you do not want would prefer to setup an ODBC connection, that is a 
bid more complex as you have to setup unixODBC ( /etc/odbcinst.ini, 
/etc/odbc.ini ), then setup res_odbc(/etc/asterisk/res_odbc.conf) and 
func_odbc (/etc/asterisk/func_odbc.conf).


How you update the database from within dialplan depends on which access 
method you choose.


Assume you have a mysql table with two columns:
option_namevarchar(15)
countint


You could write something like this if you are using app_mysql

exten = 3,1,NoOp(User chose support option)
exten = 3,n,MYSQL(Connect connid localhost database_user 
database_password database_name)
exten = 3,n,MYSQL(Query resultid ${connid}  update counter_table set 
count = count + 1 where option_name = 'support')

exten = 3,n,MYSQL(Clear ${resultid})
exten = 3,n,MYSQL(Disconnect ${connid})
exten = 3,n,Goto(support,s,1)




--
The truth speaks for itself. I'm just the messenger.
 Lyta Alexander - Babylon 5

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] hwo to stok variable wiith menu

2011-11-25 Thread salaheddine elharit
thank you so much i will test this option and i will update you

2011/11/25 Dale Noll dn...@wi.rr.com

 **
 On 11/25/2011 10:48 AM, salaheddine elharit wrote:


 thanks for your response

 i use mysql like a database and my question when the customer press 3 in
 context menu i want to stok this variable in a table in my database and i
 want to get this variable after
 could you please give an exemple like below

 thanks and regards

 [menu]
 exten = s,1,Background(${sounds_path}menu)
 exten = 0,1,Goto(menu,s,1)
 exten = 1,1,Goto(appel,s,1)
 exten = 2,1,Goto(message,s,1)

 exten = 3,1,Goto(support,s,1)
 exten = s,2,goto(menu,s,1)
 exten = i,1,Playback(${sounds_path}erreur-saisie)
 exten = i,2,Goto(menu,s,1)
 exten = t,1,Goto(menu,s,1)


 It is difficult to get a good example because I do not know what you are
 looking to save.  You say you want to store the variable, but the only
 variable you have in this case is the digit the user entered, in this case
 '3'.  If you are trying to count the number of times callers press option
 '3', then it is a simple update.

 If you have the app_mysql module compiled and loaded you can user the
 MYSQL() app.
 http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL

 If you do not want would prefer to setup an ODBC connection, that is a bid
 more complex as you have to setup unixODBC ( /etc/odbcinst.ini,
 /etc/odbc.ini ), then setup res_odbc(/etc/asterisk/res_odbc.conf) and
 func_odbc (/etc/asterisk/func_odbc.conf).

 How you update the database from within dialplan depends on which access
 method you choose.

 Assume you have a mysql table with two columns:
 option_namevarchar(15)
 countint


 You could write something like this if you are using app_mysql

 exten = 3,1,NoOp(User chose support option)
 exten = 3,n,MYSQL(Connect connid localhost database_user
 database_password database_name)
 exten = 3,n,MYSQL(Query resultid ${connid}  update counter_table set
 count = count + 1 where option_name = 'support')
 exten = 3,n,MYSQL(Clear ${resultid})
 exten = 3,n,MYSQL(Disconnect ${connid})
 exten = 3,n,Goto(support,s,1)





 --
 The truth speaks for itself. I'm just the messenger.
  Lyta Alexander - Babylon 5


 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users