Hi,

just another note:

o Stefan Sayer [01/19/09 19:40]:
Hello,


o Luciano Afranllie [01/16/09 15:30]:
Hi everybody,

I want to know if somebody implemented an application like this with SEMS:

- Call arrives to sems
- app get user from SIP from
- app make a query into db using user as key (something like "select
balance from accounts where user = $user")
- app play the balance. "Your account balance is x dollars"

I made this using asterisk and would like to know if I can get the
same with SEMS.
the simplest is to use the ivr application, and write a python script for it. I have added an example with TTS here: http://svn.berlios.de/wsvn/sems/trunk/apps/examples/ivr_examples/db_balance.py

set script_path in ivr.conf  and application=db_balance in sems.conf.
depending on your network setup (and whether you use *ser or an equivalently flexible software as home proxy), it might be simpler/better to read the balance at the home proxy which already has DB connection and usually user profile loaded on routing, and add it as some extra header to the INVITE. in SEMS then you only read out that header and play the balance from TTS/files.

Stefan


hth
Stefan


This is the asterisk extension doing this:

exten => 888,1,Set(FROM_USER=${CUT(SIP_HEADER(From), ,1)})
exten => 888,n,MYSQL(Connect connid 192.168.1.10 business testing123 business)
exten => 888,n,MYSQL(Query resultid ${connid} select bal_int from
business.accounts where user=${FROM_USER})
exten => 888,n,Wait(1)
exten => 888,n,MYSQL(Fetch fetch ${resultid} BAL_INT)
exten => 888,n,MYSQL(Clear ${resultid})
exten => 888,n,MYSQL(Query resultid ${connid} select bal_decimal from
business.accounts where user=${FROM_USER})
exten => 888,n,Wait(1)
exten => 888,n,MYSQL(Fetch fetch ${resultid} BAL_DEC)
exten => 888,n,MYSQL(Clear ${resultid})
exten => 888,n,Playback(astcc-account-balance-is)
exten => 888,n,SayNumber(${BAL_INT})
exten => 888,n,Playback(dollars)
exten => 888,n,Playback(with)
exten => 888,n,SayNumber(${BAL_DEC})
exten => 888,n,Playback(cents)
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems


--
Stefan Sayer
VoIP Services

[email protected]
www.iptego.com

IPTEGO GmbH
Am Borsigturm 40
13507 Berlin
Germany

Amtsgericht Charlottenburg, HRB 101010
Geschaeftsfuehrer: Alexander Hoffmann
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to