当前位置: 首页 > 工具软件 > eXosip > 使用案例 >

ubuntu 安装opensips osip exosip

柴衡
2023-12-01

1、安装包准备
osip:http://ftp.gnu.org/gnu/osip/
exosip: http://download.savannah.nongnu.org/releases/exosip/

需要的软件
apt-get install make gcc g++

2、下载安装包
wget http://ftp.gnu.org/gnu/osip/libosip2-3.6.0.tar.gz
wget http://download.savannah.nongnu.org/releases/exosip/libeXosip2-3.6.0.tar.gz


3、解压安装包
tar -zxf libosip2-3.6.0.tar.gz
tar -zxf libeXosip2-3.6.0.tar.gz

4、首先编译osip
cd libosip2-3.6.0/
./configure
make -j8
make install

5、编译exosip
cd libeXosip2-3.6.0/
修改文件 
文件:include/eXosip2/eX_call.h

int eXosip_call_send_ack(struct eXosip_t *excontext, int tid, osip_message_t *ack, char *host, int port);

添加ip和端口 

文件:src/eXcall_api.c

int eXosip_call_send_ack(struct eXosip_t *excontext, int tid, osip_message_t *ack, char *host, int port) {
  eXosip_dialog_t *jd = NULL;
  eXosip_call_t *jc = NULL;
  osip_transaction_t *tr = NULL;
  int i;
 
  if (tid <= 0) {
    if (ack != NULL)
      osip_message_free(ack);
 
    return OSIP_BADPARAMETER;
  }
 
  if (tid > 0) {
    _eXosip_call_transaction_find(excontext, tid, &jc, &jd, &tr);
  }
 
  if (jc == NULL) {
    /* For old API, did was used here. So use it for backward compatibility */
    _eXosip_call_dialog_find(excontext, tid, &jc, &jd);
  }
 
  if (jc == NULL) {
    OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] no call here\n"));
 
    if (ack != NULL)
      osip_message_free(ack);
 
    return OSIP_NOTFOUND;
  }
 
  if (ack == NULL) {
    i = eXosip_call_build_ack(excontext, tid, &ack);
 
    if (i != 0) {
      return i;
    }
  }
 
  i = _eXosip_snd_message(excontext, NULL, ack, host, port, -1);
 
  if (jd != NULL) {
    /* if the call is already closed, the ACK was rebuilt with a temporary dialog, and jd==NULL */
    if (jd->d_ack != NULL)
      osip_message_free(jd->d_ack);
 
    jd->d_ack = ack;
  }
 
  _eXosip_wakeup(excontext);
  if (i < 0)
    return i;
 
  /* TODO: could be 1 for icmp... */
  return OSIP_SUCCESS;
}


6、编译并安装
cd libosip2-3.6.0/
./configure
make -j8
make install

安装opensips
1、安装包准备
opensips:https://opensips.org/pub/opensips/

需要的软件
apt-get install flex bison libncurses5-dev libssl-dev pkg-config 
apt-get install libmysqlclient-dev libwolfssl-dev
apt-get install autoconf automake libtool

2、下载安装包
wget https://opensips.org/pub/opensips/3.2.6/opensips-3.2.6.tar.gz

3、解压安装包
tar -zxf opensips-3.2.6.tar.gz


4、配置安装(使用xshell)
make menuconfig

Configure Excluded Modules

db_mysql

按空格键选中

Configure Install Prefix

输入安装目录 /usr/local/opensips_proxy/

Compile And Install OpenSIPS

 类似资料: