Saturday, December 28, 2013

app_fsk add a flag.

In this second release I decided to add a flag to this application. When you receive a FSK message you can now end the Receive application when data carrier is lost and not only when you got an hangup. Default behaviour is "end when data carrier is lost", if you want to revert to old behaviour and keep application to receive until it got an hangup, just add the "h" flag. New verison can be downloaded here (app_fsk.c)

For your reference I Bell103 encoded  a simple message: "field1#field2#field3" in wav which can be used to test the application.

An example of dialplan might be:

exten => 200,   1,      Answer()
exten => 200,   n,      ReceiveFSK(msg)
exten => 200,   n,      Noop(Message received ${msg})
exten => 200,   n,      Set(f1=${CUT(msg,#,1)})
exten => 200,   n,      Set(f2=${CUT(msg,#,2)})
exten => 200,   n,      Set(f3=${CUT(msg,#,3)})
exten => 200,   n,      Noop(f1: ${f1})
exten => 200,   n,      Noop(f2: ${f2})
exten => 200,   n,      Noop(f3: ${f3})
exten => 200,   n,      Hangup()

exten => h,     1,      Noop(Got hangup)
exten => h,     n,      Noop(Message ${msg} processed on hangup)
exten => h,     n,      Set(f1=${CUT(msg,#,1)})
exten => h,     n,      Set(f2=${CUT(msg,#,2)})
exten => h,     n,      Set(f3=${CUT(msg,#,3)})
exten => h,     n,      Noop(f1: ${f1}) 
exten => h,     n,      Noop(f2: ${f2})
exten => h,     n,      Noop(f3: ${f3})
exten => h,     n,      Hangup()

Friday, December 27, 2013

App_fsk first release

I got, for some reasons, the need to communicate with an Asterisk server which has no internet connection.
So I decided to revive old days, when every digital communication had to be done using telephone lines.
I started coding something that one day, when it will be finally finished, will be called app_fsk.
In my mind, app_fsk should be composed by 2 applications: SendFSK, and ReceiveFSK.
Those two raw tools should be used to send and receive digital messages using POTS lines.
Current implementation has only ReceiveFSK implemented.
It is already usable but its behaviour is a little weird.
It only supports Bell103 FSK modulation, and I agree with anyone would say nowdays 300bps are ridiculous.
it receive fsk message until channel hangs up. Therefore is possible to interact with received message only in the hangup extension (exten => h).
If in spite of that someone wants to give a try, please do it. app_fsk.c
To build app_fsk, just drop the .c file into the apps directory of the Asterisk source code.
app_fsk needs SpanDSP built with option for test programs "--enable-tests".
Also you need to modify standard asterisk mekeopts and include -lspandsp-sim in the SPANDSP_LIB line.
Any feedback would be appreciated.