sip
2022-04-09 20:00:44
easonzhang
1247
https://blog.csdn.net/weixin_44205009/article/details/106519809?spm=1001.2101.3001.6650.18&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-18.pc_relevant_antiscanv2&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-18.pc_relevant_antiscanv2&utm_relevant_index=20
https://blog.csdn.net/qq_28092673/article/details/108689894 tar xvf vos30002160.tar rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 yum -y install mysql-server grep "password" /var/log/mysqld.log //获取临时默认密码 mysql -u root -p alter user 'root'@'localhost' identified by 'Zycfan061909'; //修改密码 grant all privileges on *.* to root@'%'identified by '061909'; //设置远程访问权限 flush privileges; //更新权限 cd /usr/local/src wget https://opensips.org/pub/opensips/latest/opensips-3.2.5.tar.gz tar zxvf opensips-3.2.5.tar.gz cd opensips-3.2.5 make menuconfig wget http://mirrors.kernel.org/gnu/automake/automake-1.14.1.tar.gz 安装automakehttps://www.likecs.com/show-203736387.html 比教程多 sudo yum install mysql-devel rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 yum -y install mysql-server 环境说明: 开源sip服务器 软件:opensips 官方网站:https://opensips.org/ 版本:3.2.5 https://opensips.org/pub/opensips/3.2.5/opensips-3.2.5.tar.gz rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 yum -y install mysql-server wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm yum -y install mysql57-community-release-el7-11.noarch.rpm yum -y install mysql-community-server 操作系统: CentOS 7 数据库:mysql 准备安装: 1.安装mysql数据库 wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm rpm -ivh mysql-community-release-el7-5.noarch.rpm yum install mysql-community-server systemctl start mysqld #登录修改root密码 set password for 'root'@'localhost' =password('password'); 2.安装依赖包 yum install mysql mysql-server mysql-libs mysql-devel yum install gcc make yum install flex bison ncurses libncurses-dev ncurses-devel 3.下载源码包 wget https://opensips.org/pub/opensips/3.2.5/opensips-3.2.5.tar.gz tar -zxf opensips-3.2.5.tar.gz cd opensips #启动配置菜单,配置数据库 make menuconfig 重点: 很多教程都没表明这个选择步骤: Configure Compile Options -> Configure Excluded Modules -> db_mysql 按照此顺序选择db_mysql (空格键为选择键方向键为前进后退和确定) 选择db_mysql后一定要save。 最后选择”Compile And Install Opensips” 等待安装完毕。 4.配置数据库连接信息 cd /usr/local/etc/opensips/ vi opensipsctlrc SIP_DOMAIN= YOUR_PC_IP //此处写本机地址,如果有代理填写proxy地址 #数据库 MYSQL ORACLE PGSQL DB_BERKELEY DBTEXT均可 DBENGINE=MYSQL #数据库所在服务器主机名/IP均可 DBHOST=localhost #数据库名称,默认使用opensips,可配置其它名称 DBNAME=opensips #数据库访问用户,主要用于数据的读写,请在mysql添加用户 DBWUSER=opensips #数据库访问密码,密码必须为DBWUSER对应用户的密码 DBWPW=“123456” #数据库管理用户,用于数据库、表创建与数据读写等,默认使用root,如有需要可以自行配置mysql用户权限 DBROOTUSER=“root” #配置 cd /usr/local/sbin/ osipsconfig 依次选择–> Generate OpenSIPS Script –> Residential Script–> Configure Residential Script 选中(选择键为空格键) [*] USE_AUTH [*] USE_DBACC [*] USE_DBUSERLOC [*] USE_DIALOG 返回,选择 –> Generate Residential Script 回车,生成新的配置文件(在/usr/local/etc/opensips/目录下) 拷贝和替换原有配置文件: cd /usr/local/etc/opensips/ mv opensips.cfg opensips.cfg.old mv opensips_residential_2018-5-3_1\:13\:3.cfg opensips.cfg #修改配置文件 vi opensips.cfg listen=udp:127.0.0.1:5060 修改为listen=udp:本机ip:5060 修改完数据库配置后使用opensipsdbctl新建数据库: cd /usr/local/sbin opensipsdbctl create #添加用户 opensipsctl add 1000 1000 opensipsctl add 1001 1001 #启动服务 opensipsctl start