当前位置: 首页 > news >正文

做cpa必须要有网站吗永久免费建站系统

做cpa必须要有网站吗,永久免费建站系统,公众号开发网站,小程序官网入口文章目录1. OpenSIPS 源码下载2. 工具准备3. 编译安装4. opensips-cli 工具安装5. 启动 OpenSIPS 实例1. OpenSIPS 源码下载 使用以下命令即可下载 OpenSIPS 的源码,笔者下载的是比较稳定的 3.1 版本,读者有兴趣也可前往 官方传送门 sudo git clone htt…

文章目录

  • 1. OpenSIPS 源码下载
  • 2. 工具准备
  • 3. 编译安装
  • 4. opensips-cli 工具安装
  • 5. 启动 OpenSIPS 实例

1. OpenSIPS 源码下载

使用以下命令即可下载 OpenSIPS 的源码,笔者下载的是比较稳定的 3.1 版本,读者有兴趣也可前往 官方传送门

sudo git clone https://github.com/OpenSIPS/opensips.git -b 3.1 opensips-3.1

2. 工具准备

在本地机器上编译 OpenSIPS 源码可能会有许多工具缺失,根据笔者的经验可以先执行以下命令下载相关工具。如果在编译过程中出现类似 make : flex: Command not found 这种报错,一般是本地缺少对应的软件或者依赖,直接按照提示使用 yum 命令下载相应工具即可,如本例可使用 yum install -y flex 命令

sudo yum install -y mysql-devel libmicrohttpd-devel bison flex

3. 编译安装

  1. 进入 OpenSIPS 源码根目录,执行 sudo make menuconfig 命令,则如下进入编译时配置界面,该界面使用右箭头进入下一级,左箭头返回上一级,空格选中

    在这里插入图片描述

  2. 笔者进入菜单 Configure Compile Options --> Configure Excluded Modules 空格勾选 db_mysqlhttpd,然后返回 Configure Compile Options --> Save Changes 回车保存配置。最后返回上一级菜单,回车选中 Compile And Install OpenSIPS 开始编译安装 OpenSIPS

    在这里插入图片描述

  3. 编译完成后会回到菜单界面,回车选中 Exit & Save All Changes 即可完成安装。由于笔者指定了 mysql 作为 OpenSIPS 的数据库,则需要使用 opensips-cli 工具初始化数据库后才能启动 OpenSIPS 实例

4. opensips-cli 工具安装

  1. 该工具需要匹配 OpenSIPS 版本,读者可前往 官方传送门 选择相应的参数,最终确定一个命令并终端执行。笔者是 CentOS 7 系统的 3.1 版本 OpenSIPS,故执行以下命令即可

    sudo yum install https://yum.opensips.org/3.1/releases/el/7/x86_64/opensips-yum-releases-3.1-6.el7.noarch.rpm

  2. 以上命令执行完成,执行下面的命令安装 opensips-cli 工具

    sudo yum install -y opensips-cli

  3. 安装完成后,执行命令 vim ~/.opensips-cli.cfg 在当前用户目录下本地新增一个 opensips-cli 配置文件,读者可复制以下内容,但需要自行配置关键的数据库连接串信息

    [default]
    log_level: WARNING
    prompt_name: opensips-cli
    prompt_intro: Welcome to OpenSIPS Command Line Interface!
    prompt_emptyline_repeat_cmd: False
    history_file: ~/.opensips-cli.history
    history_file_size: 1000
    output_type: pretty-print
    fifo_file: /tmp/opensips_fifo
    communication_type: http#database_modules: acc clusterer dialog dialplan dispatcher domain rtpproxy usrloc
    database_modules: ALL
    # 管理员账号连接串,自行修改
    database_admin_url: mysql://root:123456@localhost:3306
    # 普通账户连接串,自行修改
    database_url: mysql://root:123456@localhost:3306
    database_name: opensips
    # 修改成 opensips 源码路径下的scripts
    database_schema_path: /home/root/opensips-3.1/scripts
    
  4. 以上步骤执行完,执行命令 opensips-cli -x database create 创建 OpenSIPS 依赖的数据库表

  5. OpenSIPS 实例启动后,可以通过执行 opensips-cli -i default 连接到 OpenSIPS,在命令界面查看 OpenSIPS 实例信息,读者如有兴趣可前往 官方传送门 了解支持的命令

5. 启动 OpenSIPS 实例

  1. 经过以上步骤,OpenSIPS 依赖的数据库表已经建好,接下来使用命令 vim ~/opensips.cfg 在当前用户目录创建 OpenSIPS 配置文件,读者可以复制以下内容,自行修改数据库连接及监听 IP 端口等内容

    ####### Global Parameters #########log_level=4log_stderror=nolog_facility=LOG_LOCAL0/* uncomment the following lines to enable debugging */#debug_mode=yes/* uncomment the next line to enable the auto temporary blacklisting of
    not available destinations (default disabled) */#disable_dns_blacklist=no/* uncomment the next line to enable IPv6 lookup after IPv4 dns
    lookup failures (default disabled) */#dns_try_ipv6=yes/* comment the next line to enable the auto discovery of local aliases
    based on reverse DNS on IPs */auto_aliases=nomhomed=yes#alias=35.187.154.207listen=udp:127.0.0.1:8060   # CUSTOMIZE MEsocket=ws:127.0.0.1:8090  # CUSTOMIZE ME####### Modules Section #########set module pathmpath="/usr/local//lib64/opensips/modules/"#### udp protocol moduleloadmodule "proto_udp.so"loadmodule "proto_ws.so"modparam("proto_ws", "ws_port", 8090)#### SIGNALING moduleloadmodule "signaling.so"#### StateLess moduleloadmodule "sl.so"#### Transaction Moduleloadmodule "tm.so"modparam("tm", "fr_timeout", 5)modparam("tm", "fr_inv_timeout", 30)modparam("tm", "restart_fr_on_each_reply", 0)modparam("tm", "onreply_avp_mode", 1)#### Record Route Moduleloadmodule "rr.so"/* do not append from tag to the RR (no need for this script) */#modparam("rr", "append_fromtag", 0)modparam("rr", "enable_double_rr", 1)#### MAX ForWarD moduleloadmodule "maxfwd.so"#### SIP MSG OPerationS moduleloadmodule "sipmsgops.so"#### MYSQL moduleloadmodule "db_mysql.so"#### drouting moduleloadmodule "drouting.so"modparam("drouting", "db_url","mysql://root:123456@localhost:3306/opensips")modparam("drouting", "default_group", 1)loadmodule "httpd.so"modparam("httpd", "port", 8888)loadmodule "mi_fifo.so"loadmodule "mi_http.so"loadmodule "acc.so"modparam("acc", "early_media", 0)modparam("acc", "report_cancels", 0)modparam("acc", "detect_direction", 0)modparam("acc", "db_url","mysql://root:123456@localhost:3306/opensips") # CUSTOMIZE ME#### USeR LOCation moduleloadmodule "usrloc.so"modparam("usrloc", "nat_bflag", "NAT")modparam("usrloc", "db_mode",   2)modparam("usrloc", "db_url","mysql://root:123456@localhost:3306/opensips") # CUSTOMIZE ME#### REGISTRAR moduleloadmodule "registrar.so"#### AUTHentication modulesloadmodule "auth.so"loadmodule "auth_db.so"modparam("auth_db", "calculate_ha1", 1)modparam("auth_db|uri", "db_url","mysql://root:123456@localhost:3306/opensips") # CUSTOMIZE MEmodparam("auth_db", "load_credentials", "")#### Nathelper protocolloadmodule "nathelper.so"modparam("registrar|nathelper", "received_avp", "$avp(rcv)")#### DIALOG moduleloadmodule "dialog.so"modparam("dialog", "dlg_match_mode", 1)modparam("dialog", "default_timeout", 21600)  # 6 hours timeoutmodparam("dialog", "db_mode", 1)modparam("dialog", "db_url","mysql://root:123456@localhost:3306/opensips") # CUSTOMIZE ME# main request routing logicroute{if (!mf_process_maxfwd_header(10)) {send_reply(483,"Too Many Hops");exit;}# 有 totag 意味着dialog已经建立if (has_totag()) {# handle hop-by-hop ACK (no routing required)if ( is_method("ACK") && t_check_trans() ) {t_relay();exit;}# sequential request within a dialog should# take the path determined by record-routingif ( !loose_route() ) {# we do record-routing for all our traffic, so we should not# receive any sequential requests without Route hdr.send_reply(404,"Not here");exit;}#loose_route();if (is_method("BYE")) {# do accounting even if the transaction faileddo_accounting("db","failed");}# 这里lookup是为了转成注册到opensips 的ua对应r-urilookup("location");# route it out to whatever destination was set by loose_route()# in $du (destination URI).route(relay);exit;}# handle cancel and re-transmissionsif ( is_method("CANCEL") ) {if ( t_check_trans() )t_relay();exit;}# absorb retransmissions, but do not create transactiont_check_trans();if ( !(is_method("REGISTER")  ) ) {if (!is_from_gw(1)) {# authenticate if from local subscriber# authenticate all initial non-REGISTER request that pretend to be# generated by local subscriber (domain from FROM URI is local)if (!proxy_authorize("", "subscriber")) {proxy_challenge("");exit;}consume_credentials();# caller authenticated}}# preloaded route checkingif (loose_route()) {xlog("L_ERR","Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");if (!is_method("ACK"))send_reply(403,"Preload Route denied");exit;}# record routingif (!is_method("REGISTER|MESSAGE"))record_route();# account only INVITEsif (is_method("INVITE")) {# create dialog with timeoutif ( !create_dialog("B") ) {send_reply(500,"Internal Server Error");exit;}# 通过动态路由找到合适的duif (!do_routing()) {if (!lookup("location")) {send_reply(404,"Not Found");exit;}}#$du = "sip:0.0.0.0:8060";do_accounting("db");}if (is_method("REGISTER")) {# authenticate the REGISTER requestsif (!www_authorize("", "subscriber")) {www_challenge("");exit;}fix_nated_register();setbflag("NAT");if (!save("location"))sl_reply_error();exit;}# requests for my domainif (is_method("PUBLISH|SUBSCRIBE")) {send_reply(503, "Service Unavailable");exit;}if ($rU==NULL) {# request with no Username in RURIsend_reply(484,"Address Incomplete");exit;}do_accounting("db","missed");route(relay);}route[relay] {# for INVITEs enable some additional helper routesif (is_method("INVITE")) {rtpproxy_offer();t_on_branch("per_branch_ops");t_on_reply("handle_nat");t_on_failure("missed_call");}if (!t_relay()) {send_reply(500,"Internal Error");}exit;}branch_route[per_branch_ops] {xlog("new branch at $ru\n");}onreply_route[handle_nat] {rtpproxy_answer();fix_nated_contact();xlog("test");}failure_route[missed_call] {if (t_was_cancelled()) {exit;}}
    
  2. 配置脚本准备好后,执行 opensips -f ~/opensips.cfg -D 命令启动OpenSIPS 实例,该命令中 -f 用于指定启动配置文件,-D 用于指定前台启动模式

http://www.hkea.cn/news/753443/

相关文章:

  • 做微网站的第三方学网络营销
  • 湖南做网站的公司有哪些搜索引擎是什么
  • flash网站管理系统seo优化排名易下拉用法
  • 永年网站建设友链互换平台推荐
  • 企业网站的设计公司网络广告营销的典型案例
  • 高校思政主题网站建设的意义关键词歌词任然
  • 哪里做网站比较快2345网址导航下载桌面
  • 广州建设委员会官方网站凡科建站下载
  • 全球做网站的公司排名百度一下你就知道官网
  • 小企业网站价格免费发链接的网站
  • 买了空间和域名 怎么做网站哪家公司网站做得好
  • 网站备案是否关闭衡阳网站建设公司
  • 遂昌建设局网站个人怎么做网站
  • 软件开发和网站建设网络营销的未来6个发展趋势
  • 做网站一年多少钱免费seo网站推广
  • 智通人才网东莞最新招聘信息官网seo是如何做优化的
  • 个人做跨境电商网站百度地图导航手机版免费下载
  • 阿里云注册网站之后怎么做网站百度联盟是什么
  • 动画制作视频河南网站排名优化
  • 网站关键词怎么做排名掌门一对一辅导官网
  • 现在什么网站做推广比较好网页设计需要学什么
  • 个人购物网站 怎么建网络营销包括
  • 有没有做鸭的网站工作室招聘广州网站优化工具
  • 深圳营销外深圳网络营销公司seo和sem的联系
  • 专业的网站制作公司哪家好竞价专员是做什么的
  • 海南省建设厅网站百度seo霸屏软件
  • 淄博张店做网站的公司爱站小工具圣经
  • wordpress w3seo优化自学
  • 临沂手机建站模板微信seo排名优化软件
  • 网站管理员怎么做板块建设艺人百度指数排行榜