load-net

rtpengine kamailio

Apr 13th, 2022 (edited)
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.05 KB | None | 0 0
  1. -------------------------------------------------------------------------------------
  2. apt-get autoremove -y
  3. apt-get update && apt-get dist-upgrade -y --allow-unauthenticated --allow-downgrades --allow-remove-essential --allow-change-held-packages gnupg gnupg2
  4.  
  5. apt-get install -y git gcc g++ flex bison libmariadb-dev make autoconf pkg-config libssl-dev libcurl4-openssl-dev libxml2-dev libpcre3-dev
  6. mkdir -p /usr/local/src/kamailio-5.5
  7.  
  8. apt search kamailio
  9. apt install kamailio-postgres-modules
  10.  
  11. mcedit /etc/postgresql/14/main/pg_hba.conf
  12. host all all 10.20.7.1/24 trust
  13.  
  14. Под простым пользователем
  15. sudo kamdbctl create
  16.  
  17.  
  18. select * from pg_shadow;
  19. select * from pg_database;
  20.  
  21.  
  22. ## database host
  23. DBHOST=10.20.7.104
  24.  
  25. ## database port
  26. DBPORT=5432
  27.  
  28. ## database name (for ORACLE this is TNS name)
  29. DBNAME=kamailio
  30.  
  31. ## database path used by dbtext, db_berkeley or sqlite
  32. # DB_PATH="/usr/local/etc/kamailio/dbtext"
  33.  
  34. ## database read/write user
  35. DBRWUSER="kamailio"
  36.  
  37. ## password for database read/write user
  38. DBRWPW="kamailiorw"
  39.  
  40. ## database read only user
  41. DBROUSER="kamailioro"
  42.  
  43. ## password for database read only user
  44. DBROPW="kamailioro"
  45.  
  46. ## database access host (from where is kamctl used)
  47. # DBACCESSHOST=10.20.7.104
  48.  
  49. ## database super user (for ORACLE this is 'scheme-creator' user)
  50. DBROOTUSER="postgres"
  51.  
  52. ## password for database super user
  53. ## - important: this is insecure, targeting the use only for automatic testing
  54. ## - known to work for: mysql
  55. DBROOTPW="dbrootpw"
  56.  
  57. ######################################################
  58. mcedit /etc/kamailio/kamailio.cfg
  59.  
  60. ]
  61. #!define DBURL "postgres://kamailio:kamailiorw@localhost:5432/kamailio"
  62.  
  63.  
  64. loadmodule "pv.so"
  65. loadmodule "ctl.so"
  66. loadmodule "jsonrpcs.so"
  67. loadmodule "tm.so"
  68. loadmodule "textops.so"
  69. loadmodule "sl.so"
  70. loadmodule "usrloc.so"
  71. loadmodule "registrar.so"
  72. loadmodule "auth.so"
  73. loadmodule "db_postgres.so"
  74. loadmodule "auth_db.so"
  75. loadmodule "siputils.so"
  76. loadmodule "nathelper.so"
  77.  
  78. #############[Подключение к БД]###########
  79. modparam("auth_db", "db_url", DBURL); # указываем URL для подключения, берем его из ранее созданной директивы DBURL
  80.  
  81. request_route {
  82. if (is_method("INVITE") || is_method("REGISTER")) {
  83. route(NAT);
  84. }
  85.  
  86. if (is_method("REGISTER")) {
  87. route(AUTH);
  88. }
  89. }
  90.  
  91. route[AUTH] {
  92. if (!auth_check("$fd", "subscriber", "1")) {
  93. force_rport();
  94. auth_challenge("$fd", "1");
  95. exit;
  96. }
  97. force_rport();
  98. if (is_method("REGISTER")) {
  99. save("location");
  100. exit;
  101. } else {
  102. return;
  103. }
  104. }
  105.  
  106. route[NAT] {
  107. if (nat_uac_test("19")) {
  108. if (is_method("REGISTER")) {
  109. set_contact_alias();
  110. } else {
  111. if(is_first_hop()) {
  112. set_contact_alias();
  113. }
  114. }
  115. }
  116. return;
  117. }
  118.  
  119.  
  120. ######################################################
  121. ----------------------------------------------------------------------------------------
  122. asterisk -rvvvv
  123.  
  124. apt install mc
  125. apt install gcc
  126.  
  127. apt-get install libmariadb-dev-compat
  128. apt-get install libmariadb-dev
  129. apt-get install libssl-dev
  130. apt-get install libssl-dev
  131. apt-get install libcurl4-openssl-dev
  132. apt-get install libxml2-dev
  133. apt-get install libpcre3-dev
  134. apt install g++
  135. timedatectl set-timezone Asia/Yekaterinburg
  136.  
  137.  
  138. wget -O- https://deb.kamailio.org/kamailiodebkey.gpg | sudo apt-key add -
  139.  
  140. mcedit /etc/apt/sources.list
  141. deb http://deb.kamailio.org/kamailio55 jessie main
  142. deb-src http://deb.kamailio.org/kamailio55 jessie main
  143.  
  144. apt install default-mysql-server
  145. apt install kamailio kamailio-mysql-modules
  146. which kamailio
  147. apt install kamailio-websocket-modules
  148. systemctl enable kamailio
  149. apt install mariadb-server
  150. systemctl enable mariadb
  151. systemctl start mariadb
  152.  
  153. mcedit /etc/kamailio/kamctlrc
  154. Uncomment the DBENGINE parameter by removing the pound symbol and make sure the value equals MYSQL. The parameter should look like this afterwards:
  155. DBENGINE=MYSQL
  156. Uncomment and setup the Database Read/Write and Database Read/Only fields. You can just use the default values for right now and you can change them at a later time.
  157. ## database read/write user
  158. DBRWUSER="kamailio"
  159. ## password for database read/write user
  160. DBRWPW="kamailiorw"
  161. ## database read only user
  162. DBROUSER="kamailioro"
  163. ## password for database read only user
  164. DBROPW="kamailioro"
  165.  
  166. /usr/sbin/kamdbctl create
  167. koi8u
  168.  
  169. mcedit /etc/kamailio/kamailio.cfg
  170. Add the following after #!KAMAILIO
  171. #!define WITH_MYSQL
  172. #!define WITH_AUTH
  173.  
  174.  
  175. systemctl stop kamailio
  176. systemctl start kamailio
  177. systemctl status kamailio
  178.  
  179. kamctl add [email protected] opensourceisneat
  180. kamctl add [email protected] 123
  181. psql -h localhost -U kamailio -W kamailio -c "INSERT INTO dispatcher (setid, destination, description) values ('1', 'pjsip:10.20.7.124', 'media server 1');"
  182. psql -h 10.20.7.122 -U kamailio -W kamailio -c "INSERT INTO dispatcher (setid, destination, description) values ('1', 'pjsip:10.20.7.124', 'media server 1');"
  183.  
  184.  
  185. kamctl ul show
  186. kamailio -V
  187.  
  188. dispatcher.so
  189. kamcmd dispatcher.list
  190. kamctl db show subscriber
  191. kamctl monitor
  192. kamctl online
  193.  
  194. kamctl fifo rtpengine_show
  195.  
  196.  
  197. ps -ef
  198.  
  199. tcpdump -i any -G 600 -i any -vvvv port 5060
  200.  
  201.  
  202. find / -name dispatcher.so -print
  203. find / -name rtpengine.so -print
  204. find / -name ngcp-rtpengine-daemon -print
  205.  
  206. ---------------------------------------------------------------------------------------
  207.  
  208. cat /etc/*-release
  209. PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
  210. NAME="Debian GNU/Linux"
  211. VERSION_ID="11"
  212. VERSION="11 (bullseye)"
  213. VERSION_CODENAME=bullseye
  214. ID=debian
  215. HOME_URL="https://www.debian.org/"
  216. SUPPORT_URL="https://www.debian.org/support"
  217. BUG_REPORT_URL="https://bugs.debian.org/"
  218.  
  219.  
  220.  
  221. apt-get remove --auto-remove nftables
  222. apt-get purge nftables
  223. apt-get update
  224. apt-get install iptables
  225. iptables -L -v
  226. apt-get install iptables-persistent
  227. iptables-save > /etc/iptables/rules.v4
  228. ip6tables-save > /etc/iptables/rules.v6
  229. iptables-restore < /etc/iptables/rules.v4
  230.  
  231. cd /usr/src/
  232. apt-get autoremove -y
  233. apt-get update && apt-get dist-upgrade -y --allow-unauthenticated --allow-downgrades --allow-remove-essential --allow-change-held-packages gnupg gnupg2 git mc
  234.  
  235.  
  236.  
  237.  
  238. git clone https://github.com/sipwise/rtpengine.git
  239. cd /usr/src/rtpengine
  240. apt install -y dpkg-dev
  241. dpkg-checkbuilddeps
  242.  
  243.  
  244. apt install debhelper-compat default-libmysqlclient-dev gperf libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libbcg729-dev libbencode-perl libcrypt-openssl-rsa-perl libcrypt-rijndael-perl libcurl4-openssl-dev libdigest-crc-perl libdigest-hmac-perl libevent-dev libglib2.0-dev libhiredis-dev libio-multiplex-perl libio-socket-inet6-perl libiptc-dev libjson-glib-dev libjson-perl libmosquitto-dev libnet-interface-perl libpcap0.8-dev libpcre3-dev libsocket6-perl libspandsp-dev libssl-dev libswresample-dev libsystemd-dev libwebsockets-dev libxmlrpc-core-c3-dev libxtables-dev markdown python3-websockets zlib1g-dev
  245.  
  246. dpkg-buildpackage -d
  247.  
  248. cd /usr/src/rtpengine/daemon
  249. ./rtpengine --interface=public/10.20.7.122 --interface=private/10.20.7.122 --listen-ng=127.0.0.1:7724
  250. ps -ax | grep rtp
  251.  
  252. dpkg -i *.deb
  253.  
  254.  
  255.  
  256. /var/lib/asterisk/sounds/en/
  257. /etc/asterisk/
  258.  
  259.  
  260.  
  261.  
  262. apt install -y dpkg-dev
  263. dpkg-checkbuilddeps
  264. default-libmysqlclient-dev libbencode-perl libcrypt-openssl-rsa-perl libcrypt-rijndael-perl libdigest-crc-perl libdigest-hmac-perl libio-multiplex-perl libio-socket-inet6-perl libnet-interface-perl libsocket6-perl python3-websockets
  265.  
  266. find / -name ngcp-rtpengine_6.2.0.0+0~mr6.2.0.0_all.deb -print
  267.  
  268.  
  269. https://kurgan-telecom.ru/fr/node/315
  270. ps -ax | grep rtp
  271. ./rtpengine --interface=public/10.20.7.123 --interface=private/10.20.7.123 --listen-ng=127.0.0.1:7724
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
Add Comment
Please, Sign In to add comment