Sebenarnya tentang apa itu?
Bekerja di perusahaan besar, atau di perusahaan menengah dengan jumlah cabang yang sedikit, semakin sering Anda berpikir untuk mengoptimalkan sumber daya, menyederhanakan administrasi, dan menstandarisasi semua dan semua orang.
Kami memiliki, misalnya, beberapa (yah, tidak sedikit) kantor cabang yang sama untuk 10-100 karyawan. Teleponi dapat diatur dengan berbagai cara:
Ambil solusi siap pakai di cloud penyedia
Instal server mini dan tanda bintang Anda sendiri di setiap cabang
Buat satu tanda bintang di tengah
2 opsi pertama, tentu saja, terjadi, tetapi mereka memiliki cukup banyak kekurangan. Ini bukan kenyamanan mempertahankan beberapa contoh kecil, ini juga masalah keuangan dan beberapa poin lainnya.
, , , , . , , . , , 3 , 6 . - 6 ("6 ! !"), 6 .
, - SIP . , -, .
, . , - , -. . ? , - , , - .
18.1 PJSIP .
? , . - . , " ".
(Numbers), . , ?
, (Number)
- ? (Secret)
- , , (domain)
CID -
: , DTMF, -
Flags - -, . , , .
, . ? , , . - , , VIEW. , , . 3 :
Endpoints (ps_endpoints)
(ps_auths)
Aors (ps_aors)
, , "" PJSIP. SQL:
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `ps_aors` AS select concat(`Numbers`.`Number`,if(`Numbers`.`domain` is not null,concat('@',`Numbers`.`domain`),'')) AS `id`,180 AS `default_expiration`,2 AS `max_contacts`,30 AS `minimum_expiration`,'yes' AS `remove_existing`,'' AS `contact` from `Numbers`;
CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `ps_auths` AS select concat(`Numbers`.`Number`,if(`Numbers`.`domain` is not null,concat('@',`Numbers`.`domain`),'')) AS `id`,'userpass' AS `auth_type`,3600 AS `nonce_lifetime`,`Numbers`.`Secret` AS `password`,`Numbers`.`Number` AS `username`,`Numbers`.`domain` AS `realm` from `Numbers` where `Numbers`.`Secret` <> '';
CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `ps_endpoints` AS select concat(`Numbers`.`Number`,if(`Numbers`.`domain` is not null,concat('@',`Numbers`.`domain`),'')) AS `id`,concat('transport-',lcase(`Numbers`.`Protocol`)) AS `transport`,concat(`Numbers`.`Number`,if(`Numbers`.`domain` is not null,concat('@',`Numbers`.`domain`),'')) AS `aors`,if(`Numbers`.`Secret` <> '',concat(`Numbers`.`Number`,if(`Numbers`.`domain` is not null,concat('@',`Numbers`.`domain`),'')),NULL) AS `auth`,'SIP' AS `context`,'all' AS `disallow`,concat('ulaw,alaw,opus',if(find_in_set('Video',`Numbers`.`Flags`),',h263,h261,h263p,h264','')) AS `allow`,concat(`Numbers`.`Number`,if(`Numbers`.`domain` is not null,concat('@',`Numbers`.`domain`),'')) AS `outbound_auth`,concat(`Numbers`.`CID`,' <',`Numbers`.`Number`,'>') AS `callerid`,if(`Numbers`.`Protocol` = 'TLS','sdes','no') AS `media_encryption`,`Numbers`.`PickupGroup` AS `named_pickup_group`,2 AS `device_state_busy_at`,concat('vRecord=',if(find_in_set('Record',`Numbers`.`Flags`) > 0,'yes','no'),';','vRussia=',if(find_in_set('Russia',`Numbers`.`Flags`) > 0,'yes','no'),';','vAbroad=',if(find_in_set('Abroad',`Numbers`.`Flags`) > 0,'yes','no'),';','vVoicemail=',if(find_in_set('Voicemail',`Numbers`.`Flags`) > 0,'yes','no'),';','vFilterCID=no') AS `set_var`,`Numbers`.`NumberID` AS `callerid_tag`,'username,auth_username,ip' AS `identify_by` from `Numbers`;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
. - - "" "":
, 5 . , . , .
, 3 , , , , , 101, 102, "" 007 ..
, Numbers .
Numbers:
, " " , , .
ps_endpoints
, - Numbers.
ps_auth
ps_aors
, . , Numbers, .
, . - id. 5 , - . 3 @ . , , - .
. , . AOR endpointa , .. @, . , (id) , AOR . . - AOR , . , .
, , .
pjsip.conf
, .
disable multi domain
, no. , . - . , , yes. 2 . .
endpoint identifier order
, , . = ip,username. , , .. IP . , username, endpoint .
, .
res config mysql.conf
, - :
extconfig.conf
, .
ps_contacts , astdb.
Spoiler
sorcery.conf
. , , .
.
, ?
, endpoint :
, . " " . " " .
, . .., 5 :
Dial(PJSIP/19960)
3
Dial(PJSIP/123@test3)
, , .
?
Microsip, :
101 . ?
PS:
- .
- , , . , .
domains:
domain (VARCHAR) | code (VARCHAR)
Kami mengisi, misalnya, seperti ini:
test2 | 01
test3 | 02
Tentu saja, Anda dapat mengambil kode cabang apa pun - bahkan 1 karakter. Kami ditentukan dengan akses ke cabang. Misalnya, saya memiliki akses ke "kota" setelah jam 9, dan saya akan mengambil 8 ke cabang. Anda mengambil apa yang nyaman bagi Anda. Setidaknya * (tanda bintang).
Tautkan tabel domain dengan pengidentifikasi domain di extconfig.conf . Kami menulis dialplan:
exten => _8XXXXX,1,NoOp(Call from ${CALLERID(all)} to filial ${EXTEN:1:2})
same => n, Set(domain=${REALTIME_FIELD(domains,code,${EXTEN:1:2},domain)})
same => n, GotoIF($[ "${domain}" = "" ]?GotoError) ;
same => n, Dial(PJSIP/${EXTEN:3}@${domain})
same => n, Hangip
Secara total, kami menghubungi 801123 di telepon dan mencapai cabang test2 di 123.
Untuk mempermudah pengelolaan, Anda dapat menambahkan batasan utama lainnya:
Numbers .domain - FOREIGN KEY -> domain .domain
Ini akan mencegah Anda kehilangan domain saat mengedit.