Asterisk and MIDI pads... JUST WORKS!

Just realised that Asterisk 11.6 and CentOS 6.0

AUTOMAGICALLY

plug and play an Akai LPD8 midi pad like this one:
akaipro.com/product/lpd8

You can receive and send “events” to the pad with this one-liner:

exten => 101,1,System(/usr/bin/amidi -S “90 1F 02”)
exten => 101,n,Dial(SIP/somephone)

When you dial 101, PAD #7 will light up just as in an operator console!!!
This literally opens a world of possibilities!

If someone is interested:

This shell script will light up the PADS when lines are in use.

And it will put users in a conference room when PADS are pressed.

It is as simple as that:


[size=85]while :
do
var=amidi -d -t1
case ${var:1:5} in

            "90 2F")
            asterisk -rx 'originate SIP/youruser1 extension 100@conferenceroom'
            ;;

            "90 23")
            asterisk -rx 'originate SIP/youruser2 extension 100@conferenceroom'
            ;;

            "90 2B")
            asterisk -rx 'originate SIP/youruser3 extension 100@conferenceroom'
            ;;

    esac
    if asterisk -rx 'core show channels' | cut -d' ' -f1 | grep -q youruser1; then amidi -S "90 2F 10"; else amidi -S "80 2F 10"; fi
    if asterisk -rx 'core show channels' | cut -d' ' -f1 | grep -q youruser2; then amidi -S "90 23 10"; else amidi -S "80 23 10"; fi
    if asterisk -rx 'core show channels' | cut -d' ' -f1 | grep -q youruser3; then amidi -S "90 2B 10"; else amidi -S "80 2B 10"; fi

done[/size]