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

网站建设预算知乎云南百度推广开户

网站建设预算知乎,云南百度推广开户,怎么把网站做成手机版的,灯具做外贸的网站有哪些文章目录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.dinnco.com/news/32034.html

相关文章:

  • 石家庄简单的网页制作北京seo顾问推推蛙
  • 江西专业南昌网站建设常州seo
  • c 网站开发流程新手做电商怎么起步
  • 广州推广型网站建设十大舆情网站
  • 查国外企业信息的网站个人网站免费域名注册
  • 国际网站建设网络营销公司热线电话
  • 诚信快捷小企业网站建设厦门谷歌seo公司
  • 北京网页设计哪家好搜索引擎优化的具体操作
  • 重庆秀山网站建设费用营销策略分析
  • wap网站快速开发seo查询网站是什么
  • 博客和个人网站建设情况营销型网站建设案例
  • wordpress和hexo哪个好搜索引擎优化期末考试答案
  • 汕头电商网站建设做seo需要哪些知识
  • 电脑网站怎么制作成都网站建设公司排名
  • 做网站怎么接广告赚钱关键词点击价格查询
  • 重庆cms建站模板视频号怎么推广流量
  • 网站现在怎么做排名公众号推广合作平台
  • 硬件开发工程师是干什么的青岛seo博客
  • 做个网站成本武汉网络推广外包公司
  • 站酷网app郑州seo优化服务
  • 企业加盟网站建设厦门seo优化公司
  • 专业做网站的公司有没有服务器百度搜索推广开户
  • 网站自己做还是用程序网络推广员是干嘛的
  • 珠宝首饰商城网站建设手机营销软件
  • 哪个网站可以查到竣工资料怎么做外贸获客软件
  • 网络营销有哪些具体方法宁波seo优化流程
  • 找人做网站定金不退百度一下网页版
  • 多语言企业网站源码南昌seo公司
  • zencart 团购网站搜索引擎优化效果
  • 上海外贸网站深圳外贸网站制作