User:Mrtuk/sandbox

Category:SNTCategory:SNT_Documentation

=What Is This=

A Racing Services service for the XXXXXXX Group which plays remotely updated audio tipster information, updated by the client on a daily basis.

=Service 1=


 * Service 1 is run on 0844xxxxxxx and 0871xxxxxxx. 0844xxxxxxx is the 'international' number that (sometimes) works from abroad, the 0871xxxxxxx is for UK callers.


 * This a subscription service and requires a PIN to access the service.


 * PIN's are sent to us by the client and added/updated in Opsxxxxx table tblPins.


 * Callers on calling the service are asked to enter the 8-digit PIN and are given a couple of goes of getting it right. If the PIN is entered correctly the remotely updated audio file File100.r32 is played, otherwise the call ends.


 * There is a limit on how many times per day a PIN can be used. This currently set at 6.

=Service 2=
 * Every time an attempt is made to enter a PIN, this info is recorded and stored in a variable until the end of the call when EXTRASTATS Global variable is set and the data recorded in the CDR record.


 * Service 2 is run on 0906xxxxxxx.


 * This service just plays the remotely updated audio file File200.r32

=Code=


 * Code is located here t:\shared\code\sntbase\run\xxxxxxx.ed

=Audio=

Audio Updating

 * Audio is updated using the standard SNT RUD service running on 0870xxxxxxx.


 * However because of a problem that exists where audio cannot be updated while a caller is listening to it, for this service we use what is known as pseudo files


 * Tables db2admin_rud_pins and db2admin_rud_files are filled in as normal for an RUD, but we also fill out db2admin_rud_pseudofiles.


 * In db2admin_rud_pseudofiles, two records are filled out for each file to be updated, with a pseudo file name for each file the client will update, and a date field for when each pseudo was last updated. On the caller side, the table is checked and the latest pseudo file played out to the caller.


 * So for instance when Service 1 is being updated, a temporary File100 is used for the recording. When this recording is saved the table db2admin_rud_pseudofiles is checked to find the oldest pseudo file name for File100 and audio copied to that file name, in this case we use File0404_100a & 'File0404_100b'. So if File0404_100a is currently being played out to callers, File100 will be copied to File0404_100b and the next caller will then hear this file.

Audio Location

 * Audio for the service is located here t:\shared\code\sntbase\raudio\content\xxxxxxxroup\racingservices


 * Remote update audio is located here s:\sntbase\raudio\content\xxxxxxxxxgroup\racingservices

=Script=

Service 1
Intro.r32 Hello and thank you for calling

EnterPIN.r32 To procede with the service, please enter your PIN after the tone.

File100.r32 Remotely Updated Audio by Client

IncorrectPIN.r32 I'm sorry but your PIN does appear to be correct, please try again Repeat twice before going to NotValid.r32

NotValid.r32 You PIN does not appear to be valid, please call back later once you have checked your details. Thank you for call

Inactive.r32 I'm sorry but your PIN is no longer active. Thank you for calling

TooMany.r32 Iím sorry but the PIN has reached the maximum usage for today. Please try again tomorrow. Thank you for calling.

Service 2
File200.r32 Remotly Updated Audio by Client

=SQL/SovereignPINAdmin=

For adding/updating of PIN's you can either use the xxxxxxxxxPINAdmin software that you would need installing on your computer, or you may find the SQL below usful for the doing the same.

SQL
select * from tblPins where pin = '62490158' -- when a pin doesn't exist insert into tblPins (Pin, AttemptNo, Active, ServiceID) values ('62490158', 0, 1, 1) select * from tblPins where AttemptNo = 0 and Active = 1 -- Active PIN update tblPins set Active = 1, ServiceID = 1, AttemptNo = 0 --where pin = '05940972' where pin in ( '69657666' ) select * from tblPins where pin in ( '19232738' ) update tblPins set Active = 0 --where pin = '53017769' where pin in ( '75938196', '57320431', '87439960', '98537146', '65194096', '04039247' )