如何添加新的呼叫作为会议PJSIP与虹吸管



我的项目是什么。

  1. 语音呼叫

我的项目中有什么图书馆。

  1. Asterisk服务器(11.0版)
  2. pjsip 2.5.1
  3. UI虹吸管

我的成就

  1. 一对一通话正常

我的问题:-

我需要实现添加新的好友功能,以便我们可以进行会议。

我的问题是什么

  1. 我无法获得电话会议语音。场景是A呼叫B语音工作正常,但当B添加新好友C时,B和C通信,但A和C无法通信

这是我用来调用一对一的代码

if (([[_label text] length] > 0) &&
                ([phoneCallDelegate respondsToSelector:@selector(dialup:number:)]))
            {
                _lastNumber = [[NSString alloc] initWithString: [_label text]];
                [_label setText:@""];
            }
            else
            {
                _lcd.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"lcd_top_simple.png"]];
                [_label setText:_lastNumber];
                [_lastNumber release];
            }
        }
Call.m file  calling this below method . 
status = pjsua_call_make_call(acc_id, &pj_uri, 0, NULL, NULL, call_id);
  if (status != PJ_SUCCESS)
  {
    pjsua_perror(THIS_FILE, "Error making call", status);
  }

缺少一些来自"PJSIP"库的文件。请在编译后包含"PJSIP"库,或者您可以从该链接下载该项目,该项目已包含"PJSIP。

static void on_call_media_state(pjsua_call_id call_id)
{
    pjsua_call_info ci;
  SiphonApplication *app = (SiphonApplication *)[SiphonApplication sharedApplication];
    pjsua_call_get_info(call_id, &ci);
//    PJ_LOG(3,(THIS_FILE,"on_call_media_state status %d count %d",
//      ci.media_status
//      pjmedia_conf_get_connect_count()));
  /* FIXME: Stop ringback */
  sip_ring_stop([app pjsipConfig]); 
  /* Connect ports appropriately when media status is ACTIVE or REMOTE HOLD,
   * otherwise we should NOT connect the ports.
   */
  if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE ||
      ci.media_status == PJSUA_CALL_MEDIA_REMOTE_HOLD) 
  {
    // When media is active, connect call to sound device.
    pjsua_conf_connect(ci.conf_slot, 0);
    pjsua_conf_connect(0, ci.conf_slot);
    //pjsua_conf_adjust_rx_level(0, 3.0);
    //pjsua_conf_adjust_tx_level(0, 5.0);
  }

    if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE) { //    When media is active, connect call to sound device.
        pjsua_conf_port_id slotOne = ci.conf_slot;
        //        pjsua_conf_connect(slotOne, 0);
        //        pjsua_conf_connect(0, slotOne);
        //mergeCalls=true;

        int max=pjsua_call_get_count();
        if (max==2) {
            mergeCalls=true;
        }
        if (mergeCalls == true) {
            pjsua_conf_port_id slotTwo = pjsua_call_get_conf_port(activeCallID);
            pjsua_conf_connect(slotOne, slotTwo);
            pjsua_conf_connect(slotTwo, slotOne);
            // since the "activeCallID" is already  talking, its conf_port is already connected to "0" (and vice versa) ...
        } else {
            activeCallID = call_id;
        }
    } else if (ci.media_status == PJSUA_CALL_MEDIA_LOCAL_HOLD) {
        // … callSuspended(callID);
    }
}

最新更新