diff options
author | John Crispin <john@openwrt.org> | 2010-11-03 19:12:34 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2010-11-03 19:12:34 +0000 |
commit | a8b2a07f375edefec242de9f20d4aefafa927517 (patch) | |
tree | d15f5bb696bfa9dfd9555788d411e0ba59b99a65 /package/tapi_sip/files/telephony.init | |
parent | 72ae8452cda47d6e18e664097a4adbc0eee3fc7b (diff) | |
download | master-31e0f0ae-a8b2a07f375edefec242de9f20d4aefafa927517.tar.gz master-31e0f0ae-a8b2a07f375edefec242de9f20d4aefafa927517.tar.bz2 master-31e0f0ae-a8b2a07f375edefec242de9f20d4aefafa927517.zip |
* adds a rewrite of the tapi drivers + sip app. this is the result of lars' gsoc 2010 project, Thanks !
SVN-Revision: 23840
Diffstat (limited to 'package/tapi_sip/files/telephony.init')
-rwxr-xr-x | package/tapi_sip/files/telephony.init | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/package/tapi_sip/files/telephony.init b/package/tapi_sip/files/telephony.init new file mode 100755 index 0000000000..082024c236 --- /dev/null +++ b/package/tapi_sip/files/telephony.init @@ -0,0 +1,50 @@ +#!/bin/sh /etc/rc.common +START=80 + +download_fw() +{ + config_load telephony + config_get fw_url config fw_url + config_get fw_file config fw_file + wget $fw_url -O /tmp/$fw_file || { + echo "failed to load $fw_url" + exit 1 + } +} + +load_module() +{ + M=`lsmod | grep vmmc` + [ -z "$M" ] || return + config_load telephony + config_get fw_file config fw_file + [ -z "fw_file" ] && exit 1 + F=/lib/firmware/$fw_file + [ ! -f "$F" -a ! -L "$F" ] && { + echo "missing firmware file" + exit 1 + } + [ -L "$F" -a -f /tmp/$fw_file ] && F=/tmp/$fw_file + insmod vmmc + sleep 3 +} + +stop() +{ + killall tapi-sip 2>/dev/null +} + +start() +{ + stop + config_load telephony + config_get fw_url config fw_url + config_get fw_file config fw_file + config_get netdev config netdev + config_get disable config disable + [ "$disable" != "1" ] && { + [ ! -z "$fw_url" -a ! -f "/tmp/$fw_file" ] && download_fw + load_module + /usr/bin/tapi-sip $netdev & + } +} |