Бесплатная телефония - как и когда?

sem-20240806

Сетевые настройки ВМ

dns - 10.5.5.100
pbx.aster.one - 10.5.5.101
pbx.aster.one - 10.5.5.102

pbx.aster.one

### iax.conf

[general]
autokill=yes
language=ru
disallow=all
allow=ulaw
allow=alaw

[matroskin]
secret=specialist123
type=friend
context=phones
host=dynamic
qualify=yes
### sip.conf

[general]
allowguest=yes
autocreatepeer=no
alwaysauthreject=yes
language=ru
disallow=all
allow=ulaw
allow=alaw
###extensions.conf

[general]
autofallthgough=yes

[default]
exten => 70007654321,1,Wait(2)
same => n,Playback(beep)
same => n,Dial(IAX2/matroskin,10,r)
same => n,Hangup()

exten => _[a-z].,1,Dial(IAX2/${EXTEN})

[phones]
;exten => 70001234567,1,Dial(SIP/70001234567@pbx.aster.two) ### Без резолва номера в DNS

exten => _[a-z].,1,Dial(SIP/${EXTEN})
same => n,Hangup()

exten => _7XXXXXXXXXX,1,Set(NUMRESULT=${ENUMLOOKUP(${EXTEN},sip,,,e164.arpa)})
same => n,Dial(SIP/${NUMRESULT})
same => n,Hangup()

pbx.aster.two

### iax.conf

[general]
autokill=yes
language=ru
disallow=all
allow=ulaw
allow=alaw

[sharik]
secret=specialist123
type=friend
context=phones
host=dynamic
qualify=yes
### sip.conf

[general]
allowguest=yes
autocreatepeer=no
alwaysauthreject=yes
language=ru
disallow=all
allow=ulaw
allow=alaw
###extensions.conf

[general]
autofallthgough=yes

[default]
exten => 70001234567,1,Wait(2)
same => n,Playback(beep)
same => n,Dial(IAX2/sharik,10,r)
same => n,Hangup()

exten => _[a-z].,1,Dial(IAX2/${EXTEN})

[phones]
;exten => 70007654321,1,Dial(SIP/70007654321@pbx.aster.one) ### Без резолва номера в DNS

exten => _[a-z].,1,Dial(SIP/${EXTEN})
same => n,Hangup()

exten => _7XXXXXXXXXX,1,Set(NUMRESULT=${ENUMLOOKUP(${EXTEN},sip,,,e164.arpa)})
same => n,Dial(SIP/${NUMRESULT})
same => n,Hangup()

dns

### /etc/bind/named.conf.options

options {
        directory "/var/cache/bind";
        forwarders {
                77.88.8.8;
                77.88.8.1;
        };
};
### /etc/bind/named.conf.local

zone "aster.one" {
        type master;
        file "/etc/bind/aster.one";
};

zone "aster.two" {
        type master;
        file "/etc/bind/aster.two";
};

zone "e164.arpa" {
        type master;
        file "/etc/bind/e164.arpa";
};
### /etc/bind/aster.one

$TTL 3h
@ SOA dns  root    2024080600  1d  12h 1w  3h
@ NS dns
dns A 10.5.5.100
pbx A 10.5.5.101

_sip._udp IN SRV 20 0 5060 pbx.aster.one.
### /etc/bind/aster.two

$TTL 3h
@ SOA dns  root    2024080600  1d  12h 1w  3h
@ NS dns
dns A 10.5.5.100
pbx A 10.5.5.102

_sip._udp IN SRV 20 0 5060 pbx.aster.two.
### /etc/bind/e164.arpa

TTL 3h
@ SOA dns  root    2024080600  1d  12h 1w  3h
@ NS dns
dns A 10.5.5.100

7.6.5.4.3.2.1.0.0.0.7 IN NAPTR 100 10 "u" "E2U+sip" "!^.*$!sip:70001234567@pbx.aster.two!i" .
1.2.3.4.5.6.7.0.0.0.7 IN NAPTR 100 10 "u" "E2U+sip" "!^.*$!sip:70007654321@pbx.aster.one!i" .