Sunday, January 5, 2014

SendFSK

Happy new year!

This is an early release of the new version of app_fsk , in which is finally implemented the SendFSK function. Now there should be all it's needed to send and receive messages between two asterisk using only telephone lines. As early release, I'm sure it's full of bugs, so please notify me any weird behaviour you may notice, I'll do my best to fix it.

Here an example for a test using the two apps on the same machine.

[default]
exten => 100, 1, Noop(Incoming call is just arrived on fsk receive number)
exten => 100, n, Answer()
exten => 100, n, ReceiveFSK(msg)
exten => 100, n, Noop(Message received ${msg})
exten => 100, n, Set(f1=${CUT(msg,#,1)})
exten => 100, n, Set(f2=${CUT(msg,#,2)})
exten => 100, n, Set(f3=${CUT(msg,#,3)})
exten => 100, n, Noop(f1: ${f1})
exten => 100, n, Noop(f2: ${f2})
exten => 100, n, Noop(f3: ${f3})
exten => 100, n, wait(5)
exten => 100, n, Hangup()
exten => 200, 1, Noop(Incoming call is just arrived on fsk send number)
exten => 200, n, Progress()
exten => 200, n, Wait(1)
exten => 200, n, Answer()
exten => 200, n, Wait(5)
exten => 200, n, SendFSK(Field1#Field2#Field3)
exten => 200, n, Wait(5)
exten => 200, n, Hangup()

...and here a call file to be used with the previous dialplan.

Channel:local/100@default
Callerid: "FSKer" <0000>
Maxretries:3
Waittime:45
Context: default
Extension: 200

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.