Icons, billeder brugt til illustration.
Generer adgangskode.
Degenerer adgangskode.
Foreløbig laves en dørstation til Videx. Og denne model af en website er et mix af kode samt anvendeligheden af de enkelte komponenter. Jeg tror at hvis kode, forretnings model samt tydelig forklaring for at producere et produkt er en rød tråd gennem dette website. Kan der laves en skabelon der får produkter hurtigt gennem udvikling. Med andre ord skal enhver kunne producere ud fra dette websites opskrifter.
I sidste ende er en kode idé ikke meget værd, hvis ikke den kan gøres til en forretning, som vi tjener penge på. Men vigtigst er at idé som kode beskyttes. Arbejder på det.
En DNS Server som FreeDNS, gør at man kan bruge navne som vist på billedet. Og ud fra et Domain som man ejer, kan skabe lige så mange navne man vil, ud fra sit Domain navn. Dette er en gratis løsning for at give vor kunder, eller enheder, som kameraer et web navn f.eks. kamera99.doordk.com eller hansi.doordk.com.
adresse1.doordk.com
adresse2.doordk.com
adresse3.doordk.com
adresse4.doordk.com
adresse5.doordk.com
osv.doordk.com
Under menu'en DNS ACME, ses hvordan man laver en secure HTTPS:// adresse med FreeDNS.
Link. FreeDNS https://freedns.afraid.org/På den lange bane, må vi selv have(lave) en DNS server. Og ikke være afhængig af FreeDNS.
pcm.!default {
type asym
capture.pcm "mic"
playback.pcm "speaker"
}
pcm.mic {
type plug
slave {
pcm "hw:2,0"
}
}
pcm.speaker {
type plug
slave {
pcm "hw:2,0"
}
}
Update Firmware.
Når man forsøger at update Rocken. Går den i ged??.
Løsningen er at update key filen.
Update key.
After backup. Clean Up.
cd ~
rm cmake-3.29.0.tar.gz && sudo rm -R cmake-3.29.0
#!/bin/bash
ip_4=$(curl -m 120 -w '\n' -sfL 'api{4}.ipify.org')
#echo $ip_4
ping -c1 $ip_4 &>"/dev/null"
if [[ "${?}" -ne 0 ]]; then
echo "$ip_4 offline. Take action?"
IPV4_ADDRESS=$(dig whoami.cloudflare ch txt @1.1.1.1 +short | awk -F'"' '{print $2}')
#echo $IPV4_ADDRESS
ping -c1 $IPV4_ADDRESS &>"/dev/null"
if [[ "${?}" -ne 0 ]]; then
echo "$IPV4_ADDRESS offline. Take action?"
elif [[ "${#args[@]}" -eq 0 ]]; then
#echo "$IPV4_ADDRESS online"
IPV4_ADD=$IPV4_ADDRESS
fi
elif [[ "${#args[@]}" -eq 0 ]]; then
#echo "ip_4 online"
IPV4_ADD=$ip_4
fi
ip_6=$(curl -m 120 -w '\n' -sfL 'api{6}.ipify.org')
#echo $ip_6
ping -c1 $ip_6 &>"/dev/null"
if [[ "${?}" -ne 0 ]]; then
echo "$ip_6 offline. Take action?"
IPV6_ADDRESS=$(dig whoami.cloudflare ch txt @2606:4700:4700::1111 +short | awk -F'"' '{print $2}')
#echo $IPV6_ADDRESS
ping -c1 $IPV6_ADDRESS &>"/dev/null"
if [[ "${?}" -ne 0 ]]; then
echo "$IPV6_ADDRESS offline. Take action?"
elif [[ "${#args[@]}" -eq 0 ]]; then
#echo "$IPV6_ADDRESS online"
IPV6_ADD=$IPV6_ADDRESS
fi
elif [[ "${#args[@]}" -eq 0 ]]; then
#echo "ip_6 online"
IPV6_ADD=$ip_6
fi
if [[ -n "${IPV4_ADD}" ]]; then
#echo $IPV4_ADD
if : >/dev/tcp/8.8.8.8/53; then
#echo "$DATE wee are on internet"
FREEDNS_DOMAIN_0=doorbell.doordk.com
FREEDNS_DOMAINHASHKEY_0=NEp1d2VnZTRsbXNaRzB5dkdIb0tEZ0IxOjIwNjQzODQ5
registered_ip_0=$(host -t A doorbell.doordk.com | awk '{print $4}' | cut -d/ -f1)
#registered_ip_0=$(ping -qn -c 1 $FREEDNS_DOMAIN_0 | head -n 1 | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
#registered_ip_0=$(curl --silent "https://freedns.afraid.org/dynamic/update.php?$FREEDNS_DOMAINHASHKEY_0" | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
UPDATE_URL_0="http://freedns.afraid.org/dynamic/update.php?$FREEDNS_DOMAINHASHKEY_0&address=$IPV4_ADD"
#echo "$DATE wee are on internet. Freedns reg ip addresse: $registered_ip_0"
#
if [ "$IPV4_ADD" != "$registered_ip_0" ]; then
echo "$DATE $FREEDNS_DOMAIN_0 Update from $registered_ip_0 to $IPV4_ADD"
wget -q --read-timeout=0.0 --waitretry=5 --tries=400 --background $UPDATE_URL_0
fi
else
echo "$DATE IPV4 wee are NOT on internet. Take action?"
fi
fi
if [[ -n "${IPV6_ADD}" ]]; then
#echo $IPV6_ADD
if : >/dev/tcp/8.8.8.8/53; then
#echo "$DATE wee are on internet"
FREEDNS_DOMAIN_1=doorbell.doordk.com
FREEDNS_DOMAINHASHKEY_1=NEp1d2VnZTRsbXNaRzB5dkdIb0tEZ0IxOjIzMDkyNTA2
#registered_ip_1=$(ping -qn -c 1 $FREEDNS_DOMAIN_1 | head -n 1 | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
registered_ip_1=$(host -t AAAA doorbell.doordk.com | awk '{print $5}' | cut -d/ -f1)
#registered_ip_1=$(curl --silent "https://freedns.afraid.org/dynamic/update.php?$FREEDNS_DOMAINHASHKEY_1" | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
UPDATE_URL_1="http://freedns.afraid.org/dynamic/update.php?$FREEDNS_DOMAINHASHKEY_1&address=$IPV6_ADD"
#echo "$DATE wee are on internet. Freedns reg ip addresse: $registered_ip_1"
#
if [ "$IPV6_ADD" != "$registered_ip_1" ]; then
echo "$DATE $FREEDNS_DOMAIN_1 Update from $registered_ip_1 to $IPV6_ADD"
wget -q --read-timeout=0.0 --waitretry=5 --tries=400 --background $UPDATE_URL_1
fi
else
echo "$DATE IPV6 wee are NOT on internet. Take action?"
fi
fi
******************************************
SerialClass *serial=NULL;
serial=new SerialClass();
serial->set_port("/dev/ttyUSB2");
if( !serial->Start() ){
std::cout << "error findig port? " << std::endl;
letter = 'x';
}
Når programmet kører tast "a" og Enter for test.
Sender "AT\r" til modemet, og forventer at få svaret "OK".
time_out=3; Giver modemet 3seconds max, Har modemet ikke svaret inden kommer en fejl meddelse "Time OUT????".
ellers "Hurray: expected: OK"
std::string ttyUSB_port="";
std::string ttySIM_port="/dev/ttySIM02";
std::string ret=ExecCmd("ls -l /dev/ttySIM0*");
int pos = ret.find(ttySIM_port);
if( pos > 0 ){
// Copy substring after pos
std::string str = ret.substr(pos + 1);
boost::algorithm::trim(str);
std::vector strs;
boost::split(strs, str , boost::is_any_of("\n"));
if( strs.size() > 0 ){
//std::cout << strs.size() << " str: " << strs[0] << std::endl;
std::vector strs_1;
boost::split(strs_1, strs[0] , boost::is_any_of(" "));
if( strs_1.size() > 0 ){
ttyUSB_port=strs_1[strs_1.size()-1];
boost::algorithm::trim(ttyUSB_port);
ttyUSB_port="/dev/"+ttyUSB_port;
//std::cout << " ttyUSB_port: " << ttyUSB_port << std::endl;
}else{
std::cout << "No serial PORT found" << std::endl;
return 1;
}
}else{
std::cout << "No serial PORT found" << std::endl;
return 1;
}
}else{
std::cout << "No serial PORT found" << std::endl;
return 1;
}
#!/bin/bash
sed -i 's";\[radius\]"\[radius\]"g' /etc/asterisk/cdr.conf
sed -i 's";radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf"radiuscfg => /etc/radcli/radiusclient.conf"g' /etc/asterisk/cdr.conf
sed -i 's";radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf"radiuscfg => /etc/radcli/radiusclient.conf"g' /etc/asterisk/cel.conf
chmod u+x radius.sh
/var/log/asterisk/debug /var/log/asterisk/console /var/log/asterisk/full /var/log/asterisk/messages /var/log/asterisk/*log {
missingok
rotate 15
compress
delaycompress
notifempty
size 2M
create 640 asterisk asterisk
sharedscripts
postrotate
/usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
endscript
}
**********************************************
AST_USER="asterisk"
AST_GROUP="asterisk"
************************************
enabled=yes
bindport=8088
;; tls certificados
tlsenable=yes
tlsbindaddr=0.0.0.0:8089
tlscertfile=/etc/asterisk/keys/fullchain.pem
tlsprivatekey=/etc/asterisk/keys/key.pem
ca_list_file=/etc/asterisk/keys/ca.pem
************************************
[general]
[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0
external_media_address = doorbell.doordk.com ;; Public IP
external_signaling_address = doorbell.doordk.com ;; Public IP
;external_signaling_port = 6061
local_net = 127.0.0.1
local_net = 192.168.1.0/24
local_net = 192.168.0.0/24
[transport-wss]
type=transport
protocol=wss
bind=0.0.0.0
external_media_address = doorbell.doordk.com ;; Public Ip
external_signaling_address = doorbell.doordk.com ;; Public Ip
;external_signaling_port = 6061
local_net = 127.0.0.1
local_net = 192.168.1.0/24
local_net = 192.168.0.0/24
;;
;; 6000 UDP
;;
[6000]
type = aor
max_contacts = 1
remove_existing=yes
[6000]
type=auth
auth_type=userpass
password=1234
username=6000
[6000]
type = endpoint
transport = transport-udp
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 6000
auth = 6000
webrtc=no
;;
;; 7000 Webrtc
;;
[7000]
type = aor
max_contacts = 1
remove_existing=yes
[7000]
type=auth
auth_type=userpass
password=1234
username=7000
[7000]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7000
auth = 7000
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7001 Webrtc
;;
[7001]
type = aor
max_contacts = 1
remove_existing=yes
[7001]
type=auth
auth_type=userpass
password=1234
username=7001
[7001]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7001
auth = 7001
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7002 Webrtc
;;
[7002]
type = aor
max_contacts = 1
remove_existing=yes
[7002]
type=auth
auth_type=userpass
password=1234
username=7002
[7002]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7002
auth = 7002
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7003 Webrtc
;;
[7003]
type = aor
max_contacts = 1
remove_existing=yes
[7003]
type=auth
auth_type=userpass
password=1234
username=7003
[7003]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7003
auth = 7003
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7004 Webrtc
;;
[7004]
type = aor
max_contacts = 1
remove_existing=yes
[7004]
type=auth
auth_type=userpass
password=1234
username=7004
[7004]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7004
auth = 7004
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7005 Webrtc
;;
[7005]
type = aor
max_contacts = 1
remove_existing=yes
[7005]
type=auth
auth_type=userpass
password=1234
username=7005
[7005]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7005
auth = 7005
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7006 Webrtc
;;
[7006]
type = aor
max_contacts = 1
remove_existing=yes
[7006]
type=auth
auth_type=userpass
password=1234
username=7006
[7006]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7006
auth = 7006
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7007 Webrtc
;;
[7007]
type = aor
max_contacts = 1
remove_existing=yes
[7007]
type=auth
auth_type=userpass
password=1234
username=7007
[7007]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7007
auth = 7007
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7008 Webrtc
;;
[7008]
type = aor
max_contacts = 1
remove_existing=yes
[7008]
type=auth
auth_type=userpass
password=1234
username=7008
[7008]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7008
auth = 7008
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7009 Webrtc
;;
[7009]
type = aor
max_contacts = 1
remove_existing=yes
[7009]
type=auth
auth_type=userpass
password=1234
username=7009
[7009]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7009
auth = 7009
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7010 Webrtc
;;
[7010]
type = aor
max_contacts = 1
remove_existing=yes
[7010]
type=auth
auth_type=userpass
password=1234
username=7010
[7010]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7010
auth = 7010
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7011 Webrtc
;;
[7011]
type = aor
max_contacts = 1
remove_existing=yes
[7011]
type=auth
auth_type=userpass
password=1234
username=7011
[7011]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7011
auth = 7011
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7012 Webrtc
;;
[7012]
type = aor
max_contacts = 1
remove_existing=yes
[7012]
type=auth
auth_type=userpass
password=1234
username=7012
[7012]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7012
auth = 7012
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7013 Webrtc
;;
[7013]
type = aor
max_contacts = 1
remove_existing=yes
[7013]
type=auth
auth_type=userpass
password=1234
username=7013
[7013]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7013
auth = 7013
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7014 Webrtc
;;
[7014]
type = aor
max_contacts = 1
remove_existing=yes
[7014]
type=auth
auth_type=userpass
password=1234
username=7014
[7014]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7014
auth = 7014
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7015 Webrtc
;;
[7015]
type = aor
max_contacts = 1
remove_existing=yes
[7015]
type=auth
auth_type=userpass
password=1234
username=7015
[7015]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7015
auth = 7015
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 7016 Webrtc
;;
[7016]
type = aor
max_contacts = 1
remove_existing=yes
[7016]
type=auth
auth_type=userpass
password=1234
username=7016
[7016]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 7016
auth = 7016
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 8000 Webrtc
;;
[8000]
type = aor
max_contacts = 1
remove_existing=yes
[8000]
type=auth
auth_type=userpass
password=1234
username=8000
[8000]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 8000
auth = 8000
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 8001 Webrtc
;;
[8001]
type = aor
max_contacts = 1
remove_existing=yes
[8001]
type=auth
auth_type=userpass
password=1234
username=8001
[8001]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 8001
auth = 8001
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 8002 Webrtc
;;
[8002]
type = aor
max_contacts = 1
remove_existing=yes
[8002]
type=auth
auth_type=userpass
password=1234
username=8002
[8002]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 8002
auth = 8002
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 8003 Webrtc
;;
[8003]
type = aor
max_contacts = 1
remove_existing=yes
[8003]
type=auth
auth_type=userpass
password=1234
username=8003
[8003]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 8003
auth = 8003
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 8004 Webrtc
;;
[8004]
type = aor
max_contacts = 1
remove_existing=yes
[8004]
type=auth
auth_type=userpass
password=1234
username=8004
[8004]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 8004
auth = 8004
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 8005 Webrtc
;;
[8005]
type = aor
max_contacts = 1
remove_existing=yes
[8005]
type=auth
auth_type=userpass
password=1234
username=8005
[8005]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 8005
auth = 8005
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 8006 Webrtc
;;
[8006]
type = aor
max_contacts = 1
remove_existing=yes
[8006]
type=auth
auth_type=userpass
password=1234
username=8006
[8006]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 8006
auth = 8006
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 8007 Webrtc
;;
[8007]
type = aor
max_contacts = 1
remove_existing=yes
[8007]
type=auth
auth_type=userpass
password=1234
username=8007
[8007]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 8007
auth = 8007
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 8008 Webrtc
;;
[8008]
type = aor
max_contacts = 1
remove_existing=yes
[8008]
type=auth
auth_type=userpass
password=1234
username=8008
[8008]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 8008
auth = 8008
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 8009 Webrtc
;;
[8009]
type = aor
max_contacts = 1
remove_existing=yes
[8009]
type=auth
auth_type=userpass
password=1234
username=8009
[8009]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 8009
auth = 8009
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
;;
;; 8010 Webrtc
;;
[8010]
type = aor
max_contacts = 1
remove_existing=yes
[8010]
type=auth
auth_type=userpass
password=1234
username=8010
[8010]
type = endpoint
transport = transport-wss ;; important
context = office-phones
disallow = all
;allow = !all,opus,ulaw,alaw,vp8,vp9
allow = !all,ulaw,alaw,h264,vp8
aors = 8010
auth = 8010
dtls_auto_generate_cert=no ;; important
webrtc=yes ;; important
force_rport=yes ;; important
direct_media=yes ;; important
************************************
[office-phones]
exten => 6000,1,Dial(PJSIP/6000)
exten => 7000,1,Dial(PJSIP/7000)
exten => 7001,1,Dial(PJSIP/7001)
exten => 7002,1,Dial(PJSIP/7002)
exten => 7003,1,Dial(PJSIP/7003)
exten => 7004,1,Dial(PJSIP/7004)
exten => 7005,1,Dial(PJSIP/7005)
exten => 7006,1,Dial(PJSIP/7006)
exten => 7007,1,Dial(PJSIP/7007)
exten => 7008,1,Dial(PJSIP/7008)
exten => 7009,1,Dial(PJSIP/7009)
exten => 7010,1,Dial(PJSIP/7010)
exten => 7011,1,Dial(PJSIP/7011)
exten => 7012,1,Dial(PJSIP/7012)
exten => 7013,1,Dial(PJSIP/7013)
exten => 7014,1,Dial(PJSIP/7014)
exten => 7015,1,Dial(PJSIP/7015)
exten => 7016,1,Dial(PJSIP/7016)
exten => 8000,1,Dial(PJSIP/8000)
exten => 8001,1,Dial(PJSIP/8001)
exten => 8002,1,Dial(PJSIP/8002)
exten => 8003,1,Dial(PJSIP/8003)
exten => 8004,1,Dial(PJSIP/8004)
exten => 8005,1,Dial(PJSIP/8005)
exten => 8006,1,Dial(PJSIP/8006)
exten => 8007,1,Dial(PJSIP/8007)
exten => 8008,1,Dial(PJSIP/8008)
exten => 8009,1,Dial(PJSIP/8009)
exten => 8010,1,Dial(PJSIP/8010)
same => n,Playback(hello-world)
same => n,Hangup()
************************************
noload = app_voicemail_imap.so
noload = app_voicemail_odbc.so
noload => res_config_ldap.so
load = res_crypto
load = res_http_websocket
load = res_pjsip_transport_websocket
load = codec_opus
load = res_srtp
************************************
[general]
rtpstart=10000
rtpend=20000
icesupport=yes ;; important
strictrtp=no ;; important
stunaddr=stun.l.google.com:19302 ;; important
************************************
dateformat=%F %T ; ISO 8601 date format
ignoreip = 127.0.0.0/8 192.168.1.0/24 109.59.158.32 #92
#761
[asterisk]
backend = systemd
enabled = true
filter = asterisk
action = iptables-allports[name=SIP, protocol=all]
logpath = /var/log/asterisk/full
bantime = 3600
maxretry = 5
************************************
sudo cp /etc/asterisk/asterisk.conf /etc/asterisk/asterisk.bak && \
sudo cp /etc/asterisk/cdr.conf /etc/asterisk/cdr.bak && \
sudo cp /etc/asterisk/cel.conf /etc/asterisk/cel.bak && \
sudo cp /etc/asterisk/extensions.conf /etc/asterisk/extensions.bak && \
sudo cp /etc/asterisk/http.conf /etc/asterisk/http.bak && \
sudo cp /etc/asterisk/logger.conf /etc/asterisk/logger.bak && \
sudo cp /etc/asterisk/modules.conf /etc/asterisk/modules.bak && \
sudo cp /etc/asterisk/pjsip.conf /etc/asterisk/pjsip.bak && \
sudo cp /etc/asterisk/rtp.conf /etc/asterisk/rtp.bak
#Deploy asterisk .conf files.
sudo cp /home/rock/asterisk_conf/asterisk.conf /etc/asterisk/asterisk.conf && \
sudo cp /home/rock/asterisk_conf/cdr.conf /etc/asterisk/cdr.conf && \
sudo cp /home/rock/asterisk_conf/cel.conf /etc/asterisk/cel.conf && \
sudo cp /home/rock/asterisk_conf/extensions.conf /etc/asterisk/extensions.conf && \
sudo cp /home/rock/asterisk_conf/http.conf /etc/asterisk/http.conf && \
sudo cp /home/rock/asterisk_conf/logger.conf /etc/asterisk/logger.conf && \
sudo cp /home/rock/asterisk_conf/modules.conf /etc/asterisk/modules.conf && \
sudo cp /home/rock/asterisk_conf/pjsip.conf /etc/asterisk/pjsip.conf && \
sudo cp /home/rock/asterisk_conf/rtp.conf /etc/asterisk/rtp.conf
#Save asterisk .conf files for later use.
mkdir /home/rock/asterisk_conf
sudo cp /etc/asterisk/asterisk.conf /home/rock/asterisk_conf/asterisk.conf && \
sudo cp /etc/asterisk/cdr.conf /home/rock/asterisk_conf/cdr.conf && \
sudo cp /etc/asterisk/cel.conf /home/rock/asterisk_conf/cel.conf && \
sudo cp /etc/asterisk/extensions.conf /home/rock/asterisk_conf/extensions.conf && \
sudo cp /etc/asterisk/http.conf /home/rock/asterisk_conf/http.conf && \
sudo cp /etc/asterisk/logger.conf /home/rock/asterisk_conf/logger.conf && \
sudo cp /etc/asterisk/modules.conf /home/rock/asterisk_conf/modules.conf && \
sudo cp /etc/asterisk/pjsip.conf /home/rock/asterisk_conf/pjsip.conf && \
sudo cp /etc/asterisk/rtp.conf /home/rock/asterisk_conf/rtp.conf
GPIO | Input | Output | Notes |
0 | pulled up | OK | outputs PWM signal at boot, must be LOW to enter flashing mode |
1 | TX pin | OK | debug output at boot |
2 | OK | OK | connected to on-board LED, must be left floating or LOW to enter flashing mode |
3 | OK | RX pin | HIGH at boot |
4 | OK | OK | |
5 | OK | OK | outputs PWM signal at boot, strapping pin |
6 | x | x | connected to the integrated SPI flash |
7 | x | x | connected to the integrated SPI flash |
8 | x | x | connected to the integrated SPI flash |
9 | x | x | connected to the integrated SPI flash |
10 | x | x | connected to the integrated SPI flash |
11 | x | x | connected to the integrated SPI flash |
12 | OK | OK | boot fails if pulled high, strapping pin |
13 | OK | OK | |
14 | OK | OK | outputs PWM signal at boot |
15 | OK | OK | outputs PWM signal at boot, strapping pin |
16 | OK | OK | |
17 | OK | OK | |
18 | OK | OK | |
19 | OK | OK | |
21 | OK | OK | |
22 | OK | OK | |
23 | OK | OK | |
25 | OK | OK | |
26 | OK | OK | |
27 | OK | OK | |
32 | OK | OK | |
33 | OK | OK | |
34 | OK | input only | |
35 | OK | input only | |
36 | OK | input only | |
39 | OK | input only |
Sketch for 4x4.
#include "Arduino.h"
#include <string>
#include <Keypad.h>
const byte ROWS = 4; /* four rows */
const byte COLS = 4; /* four columns */
/* define the symbols on the buttons of the keypads */
char hexaKeys[ROWS][COLS] = {
{'0','1','2','3'},
{'4','5','6','7'},
{'8','9','A','B'},
{'C','D','E','F'}
};
byte rowPins[ROWS] = {13, 12, 14, 27}; /* connect to the row pinouts of the keypad */
byte colPins[COLS] = {26, 25, 33, 32}; /* connect to the column pinouts of the keypad */
/* initialize an instance of class NewKeypad */
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
String getValue(String data, char separator, int index)
{
int found = 0;
int strIndex[] = {0, -1};
int maxIndex = data.length()-1;
for(int i=0; i<=maxIndex && found<=index; i++){
if(data.charAt(i)==separator || i==maxIndex){
found++;
strIndex[0] = strIndex[1]+1;
strIndex[1] = (i == maxIndex) ? i+1 : i;
}
}
return found>index ? data.substring(strIndex[0], strIndex[1]) : "";
}
void setup(){
Serial.begin(115200);
}
void loop(){
char customKey = customKeypad.getKey();
if (customKey){
Serial.println(customKey);
}
// Check if user sent a new string
if (Serial.available() > 0)
{
String user_string = Serial.readString();
String part01 = getValue(user_string,':',0);
Serial.println(part01);
part01.trim();
if(part01=="reboot"){
ESP.restart();
}
}
}
Link to keypad library for arduino
#!/bin/bash
# IPv6
##
## set default policies to let everything in
ip6tables --policy INPUT ACCEPT;
ip6tables --policy OUTPUT ACCEPT;
ip6tables --policy FORWARD ACCEPT;
##
## start fresh
ip6tables -Z; # zero counters
ip6tables -F; # flush (delete) rules
ip6tables -X; # delete all extra chains
# IPv4
##
## set default policies to let everything in
iptables --policy INPUT ACCEPT;
iptables --policy OUTPUT ACCEPT;
iptables --policy FORWARD ACCEPT;
##
## start fresh
iptables -Z; # zero counters
iptables -F; # flush (delete) rules
iptables -X; # delete all extra chains
# delete old configuration, if any
# Flush all the rules in filter and nat tables
iptables --flush
iptables --table nat --flush
# delete all chains that are not in default filter and nat table, if any
iptables --delete-chain
iptables --table nat --delete-chain
chmod u+x reset_iptabeles.sh
#103
[DEFAULT]
ignoreip = 127.0.0.0/8 192.168.1.0/24 109.59.158.32
banaction = iptables-multiport
banaction_allports = iptables-allports
#banaction = nftables-multiport
#banaction_allports = nftables-allports
backend = auto
#282
[sshd]
backend=systemd
enabled = true
filter = sshd
action = iptables[name=SSH, port=ssh, protocol=tcp]
findtime = 120
maxretry = 5
bantime = 3600
******************************************Under menu'en SIM7600.
Se assignment.
# sudo truncate -s 0 /etc/nginx/sites-enabled/default
# sudo nano /etc/nginx/sites-enabled/default
# sudo nginx -t
# sudo systemctl reload nginx
# sudo systemctl restart nginx
# sudo systemctl status nginx
server {
listen 80;
listen [::]:80;
server_name doorbell.doordk.com;
return 301 https://$host$request_uri;
}
# SSL configuration
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name doorbell.doordk.com;
ssl_certificate /home/rock/certs/doorbell.doordk.com/fullchain.pem;
ssl_certificate_key /home/rock/certs/doorbell.doordk.com/key.pem;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm;
# Improve HTTPS performance with session resumption
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
# Enable server-side protection against BEAST attacks
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384";
# RFC-7919 recommended: https://wiki.mozilla.org/Security/Server_Side_TLS#ffdhe4096
ssl_dhparam /home/rock/certs/doorbell.doordk.com/dh.pem;
ssl_ecdh_curve secp521r1:secp384r1;
# Aditional Security Headers
# ref: https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
# ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
add_header X-Frame-Options DENY always;
# ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
add_header X-Content-Type-Options nosniff always;
# ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
add_header X-Xss-Protection "1; mode=block" always;
# Enable OCSP stapling
# ref. http://blog.mozilla.org/security/2013/07/29/ocsp-stapling-in-firefox
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /home/rock/certs/doorbell.doordk.com/fullchain.pem;
resolver 1.1.1.1 1.0.0.1 [2606:4700:4700::1111] [2606:4700:4700::1001] valid=300s; # Cloudflare
resolver_timeout 5s;
# pass PHP scripts to FastCGI server
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
# Required for LE certificate enrollment using certbot
location '/.well-known/acme-challenge' {
default_type "text/plain";
root /var/www/html;
}
location / {
root /var/www/html;
}
}
******************************************
<?php
phpinfo();
******************************************
<?php
$servername = "localhost";
$username = "phpmyadmin";
$password = "mariaspacewalk";
$dbname = "phpmyadmin";
// Create connection
$mysqli = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($mysqli->connect_error) {
die("Connection failed: " . $mysqli->connect_error);
}
echo "Connected successfully\n";
$sql = "SHOW DATABASES;";
// Process the query so that we will save the date of birth
$results = $mysqli->query($sql);
// Fetch Associative array
$row = $results->fetch_all(MYSQLI_ASSOC);
var_dump($row);
// Free result set
$results->free_result();
// Close the connection after using it
$mysqli->close();
******************************************Icons, billeder brugt til illustration.