diff options
author | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-11-03 19:12:34 +0000 |
---|---|---|
committer | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-11-03 19:12:34 +0000 |
commit | 6ea7ec75d2fe0dd52bc3e86135412bfc92c3158c (patch) | |
tree | 1b900bd32ce90c62703905c460db950c7c2ba9ec /package/tapi_sip/files | |
parent | 74f6f2f5a244b9ba7aec5d7114fe763f8c20e96c (diff) |
[ifxmips]
* adds a rewrite of the tapi drivers + sip app. this is the result of lars' gsoc 2010 project, Thanks !
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23840 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/tapi_sip/files')
-rw-r--r-- | package/tapi_sip/files/telephony.conf | 28 | ||||
-rwxr-xr-x | package/tapi_sip/files/telephony.init | 50 |
2 files changed, 78 insertions, 0 deletions
diff --git a/package/tapi_sip/files/telephony.conf b/package/tapi_sip/files/telephony.conf new file mode 100644 index 000000000..6d87f45a8 --- /dev/null +++ b/package/tapi_sip/files/telephony.conf @@ -0,0 +1,28 @@ +config 'config' 'config' +# option 'fw_url' 'http://192.168.1.100/danube_firmware.bin' + option 'fw_file' 'danube_firmware.bin' + option 'netdev' 'pppoe-wan' + option 'disable' '1' + +config 'account' 'account' + option 'realm' 'example.com' + option 'username' 'user' + option 'password' 'password' + option 'stun_host' 'stun.example.com' + option 'stun_port' '3478' + option 'sip_port' '5600' + +config 'contact' + option 'name' 'sip example' + option 'identifier' 'sip:user@example.net' + option 'number' '123' + +config 'contact' + option 'name' 'local1' + option 'identifier' 'tel:1' + option 'number' '01' + +config 'contact' + option 'name' 'local2' + option 'identifier' 'tel:2' + option 'number' '02' diff --git a/package/tapi_sip/files/telephony.init b/package/tapi_sip/files/telephony.init new file mode 100755 index 000000000..082024c23 --- /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 & + } +} |