1
0
This repository has been archived on 2025-01-10. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Anderson Luiz Alves 0464e230c1 stock 103961
2017-07-30 16:48:04 -03:00

24 lines
734 B
Bash
Executable File

#!/bin/sh
# Called on ip-up event on a LAN interface
# $LANID= LAN connection index
restart_voip() {
local lanid=${LANID:-0}
[ "$lanid" = 0 ] && return 0
local ipaddr=`cat /var/bewan/wan.d/$lanid/ip/ipaddr 2>/dev/null`
[ "$ipaddr" = '' ] && return 0
local ifname=`cat /var/bewan/wan.d/$lanid/ip/ifname 2>/dev/null`
[ "$ifname" = '' ] && return 0
# force first argument to 0 so that to adress all voice profiles
# Force lanid to 0 for VOIP app. Hardcoded to test on lan ID 1 for dev purposes for the moment.
# Execute in background to avoid blocking. Up to application to remove the pipe when shutting down.
(
[ -e /var/tmp/PHONE.pipe ] && echo "IP_UP,0,0,$ifname,$ipaddr" > /var/tmp/PHONE.pipe
) &
}
restart_voip