Before we'll continue with writing scripts, please let me tell you some words about the file formats the CapiSuite core uses.
CapiSuite always reads and saves files in the native format as they are be expected and given by the CAPI ISDN drivers. This preserves it from having to convert everything from and to other formats thus reducing unnecessary overhead.
As these formats aren't that well-known and you will need special tools to convert or view/play them, I'll give you a short overview of how you can do this.
Most likely, your scripts will convert the special ISDN file formats to well-known ones for sending them to you via e-mail for example. Nevertheless, I'd advice you to store the received and sent files in the native CapiSuite formats somewhere. This will protect you from losing data in the case the conversion fails and will help you in debugging problems which may arise with your scripts.
All tools which I refer to here are described in the section called “Software”. See there for informations how to get them.
ISDN transmits voice data as waves with a sample-rate of 8kHz in mono. To save bandwith, a compression called A-Law is used (at least in Europe, other countries like the USA use u-Law which is quite similar to A-Law). For any reason beyond my understanding, they use a bit-reversed form of A-Law called "inversed A-Law".
There are two possible ways to create A-Law files.
The first one is to call your computer with your phone (either use the default answering machine script and configure it as described in answering_machine.conf