Commit e3ad17b9 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Initial commit

parents
all: janus-service ifu-config
tar xf janus-gateway-0.6.3.tar.gz
cd janus-gateway-0.6.3 && sh autogen.sh
cd janus-gateway-0.6.3 && ./configure --prefix=/usr --sysconfdir=/etc
$(MAKE) -C janus-gateway-0.6.3
$(MAKE) -C janus-gateway-0.6.3 install
mkdir -p /etc/janus
cp configs/* /etc/janus
@echo "$$JANUS_SERVICE" > /lib/systemd/system/janus.service
ln -s /lib/systemd/system/janus.service /etc/systemd/system/multi-user.target.wants/janus.service
mkdir -p /srv/www/janus
mv /usr/share/janus/demos/* /srv/www/janus
rm -rf /usr/share/janus/demos
@echo "$$IFU_CONFIG" > /etc/config/ifu
install -v -Dm755 ifu /usr/share/easycwmp/functions/ifu
rm janus-gateway-0.6.3
janus-service:
define JANUS_SERVICE
[Unit]
Description=Janus WebRTC gateway
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/janus -o
Restart=on-abnormal
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
endef
export JANUS_SERVICE
ifu-config:
define IFU_CONFIG
config devices 'camera'
endef
export IFU_CONFIG
[general]
configs_folder = /etc/janus
plugins_folder = /usr/lib/janus/plugins
transports_folder = /usr/lib/janus/transports
events_folder = /usr/lib/janus/events
debug_level = 4
[certificates]
cert_pem = /usr/share/janus/certs/mycert.pem
cert_key = /usr/share/janus/certs/mycert.key
[nat]
stun_server = stun.ruggednetworks.co.uk
stun_port = 3478
full_trickle = true
turn_server = stun.ruggednetworks.co.uk
turn_port = 3478
turn_type = udp
turn_user = janus
turn_pwd = januspass
ice_enforce_list = eth0
[plugins]
disable = libjanus_audiobridge.so,libjanus_echotest.so,libjanus_lua.so,libjanus_nosip.so,libjanus_recordplay.so,libjanus_sip.so,libjanus_videocall.so,libjanus_videoroom.so,libjanus_voicemail.so
[transports]
disable = libjanus_mqtt.so,libjanus_pfunix.so,libjanus_rabbitmq.so,libjanus_websockets.so
[general]
json = indented
[1234]
description = PTZ
post = http://127.0.0.1/ptz.php
[general]
json = indented
base_path = /janus
threads = unlimited
http = yes
port = 8088
[certificates]
cert_pem = /usr/share/janus/certs/mycert.pem
cert_key = /usr/share/janus/certs/mycert.key
#!/bin/sh
#common_execute_method_param "$parameter" "$permission" "$get_cmd" "$set_cmd" "xsd:$type" "$forcedinform"
# $forcedinform should be set to 1 if the parameter is included in the inform message otherwise empty
# Default of $type = string
#############################
# Entry point functuons #
#############################
prefix_list="$prefix_list $DMROOT.IFU."
entry_execute_method_list="$entry_execute_method_list entry_execute_method_root_IFU"
entry_execute_method_list_forcedinform="$entry_execute_method_list_forcedinform entry_execute_method_root_IFU"
entry_execute_method_root_IFU() {
case "$1" in ""|"$DMROOT."|"$DMROOT.IFU."*)
common_execute_method_obj "$DMROOT.IFU." "0"
common_execute_method_obj "$DMROOT.IFU.Camera." "1" "add_camera" "" "camera_browse_instances $1"
return 0;
;;
esac
return $E_INVALID_PARAMETER_NAME;
}
camera_browse_instances() {
get_cameras
if [ $camerascount -ne 0 ]; then
for ((i=0;i<$camerascount;i++)); do
sub_entry_IFU_Camera "$1" "$i"
done
fi
}
sub_entry_IFU_Camera() {
local j="$2"
case_param "$1" belongto "$DMROOT.IFU.Camera.$j." && {
common_execute_method_obj "$DMROOT.IFU.Camera.$j." "1" "" "delete_camera $j"
common_execute_method_param "$DMROOT.IFU.Camera.$j.ID" "1" "camera_get_ID $j" "camera_set_ID $j"
common_execute_method_param "$DMROOT.IFU.Camera.$j.Username" "1" "camera_get_username $j" "camera_set_username $j"
common_execute_method_param "$DMROOT.IFU.Camera.$j.Password" "1" "camera_get_password $j" "camera_set_password $j"
return 0
}
return $E_INVALID_PARAMETER_NAME;
}
get_cameras() {
camerascount=0
cameras=()
list=`$UCI_GET ifu.camera.id`
if [ ! -z "$list" ]; then
while read word; do
if [ -z "$word" ]; then
cameras+=" "
else
cameras+=("$word")
fi
((camerascount++))
done <<< $(echo "$list" | xargs -n 1)
fi
}
#######################################
# Data model parameters functions #
#######################################
add_camera() {
$UCI_ADD_LIST ifu.camera.id=";;"
$UCI_COMMIT
get_cameras
echo $camerascount
}
delete_camera() {
get_cameras
unset cameras[$1]
$UCI_DELETE ifu.camera.id
for camera in "${cameras[@]}"; do
$UCI_ADD_LIST ifu.camera.id="$camera"
done
$UCI_COMMIT
}
camera_get_ID() {
get_cameras
IFS=";" read id user pass <<< "${cameras[$1]}"
echo $id
}
camera_set_ID() {
get_cameras
IFS=";" read id user pass <<< "${cameras[$1]}"
cameras[$1]="$2;$user;$pass"
$UCI_DELETE ifu.camera.id
for camera in "${cameras[@]}"; do
$UCI_ADD_LIST ifu.camera.id="$camera"
done
$UCI_COMMIT
}
camera_get_username() {
get_cameras
IFS=";" read id user pass <<< "${cameras[$1]}"
echo $user
}
camera_set_username() {
get_cameras
IFS=";" read id user pass <<< "${cameras[$1]}"
cameras[$1]="$id;$2;$pass"
$UCI_DELETE ifu.camera.id
for camera in "${cameras[@]}"; do
$UCI_ADD_LIST ifu.camera.id="$camera"
done
$UCI_COMMIT
}
camera_get_password() {
get_cameras
IFS=";" read id user pass <<< "${cameras[$1]}"
echo $pass
}
camera_set_password() {
get_cameras
IFS=";" read id user pass <<< "${cameras[$1]}"
cameras[$1]="$id;$user;$2"
$UCI_DELETE ifu.camera.id
for camera in "${cameras[@]}"; do
$UCI_ADD_LIST ifu.camera.id="$camera"
done
$UCI_COMMIT
}
etc
/etc/janus/.*
bin
/lib/systemd/system/.*
/usr/share/janus/.*
/usr/share/easycwmp/.*
/usr/bin/.*
lib
/usr/lib/janus/.*
doc
/usr/share/doc/.*
man
/usr/share/man/.*
headers
/usr/include/janus/.*
web
/srv/www/.*
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment