ubuntu 安装osip2/eXosip2

1、安装包准备

Osip:http://ftp.gnu.org/gnu/osip/

Xsip2: http://download.savannah.nongnu.org/releases/exosip/

2、下载安装包

wget http://ftp.gnu.org/gnu/osip/libosip2-5.2.1.tar.gz
wget http://download.savannah.nongnu.org/releases/exosip/libexosip2-5.2.1.tar.gz

3、解压安装包

tar -zxf libexosip2-5.2.1.tar.gz
tar -zxf libosip2-5.2.1.tar.gz 

4、首先编译osip

./configure
make -j8
make install

5、编译exosip2

修改文件 目录:include\eXosip2\eX_call.h

函数eXosip_call_send_ack

/**
 * Send the ACK for the 200ok received..
 *
 * @param excontext    eXosip_t instance.
 * @param tid          transaction id of INVITE/2xx.
 * @param ack          SIP ACK message to send.
 */
int eXosip_call_send_ack(struct eXosip_t *excontext, int tid, osip_message_t *ack, char *host, int port);

添加ip和端口 

文件:SIP\exosip\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、编译并安装

./configure
make -j8
make install

 

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值