简体   繁体   English

如何使用Asterisk iOS进行电话会议PJSIP(在电话会议中添加新成员)?

[英]How to make conference call PJSIP with Asterisk iOS(Add new member in conference call)?

I am using PJSIP 2.0,Xcode 7.3 and ios 9.2.1, Suppose we have 3 users A,B & C user. 我使用的是PJSIP 2.0,Xcode 7.3和ios 9.2.1,假设我们有3个用户A,B和C用户。
When ever A call to B (its working fine ) but when A add member C in call (as conference call) then A & B can communicate with C but C never get Voice from B .(C & A communicate fine ).So how to manage communication between C & B . 什么时候A呼叫B(工作正常)但是当A在呼叫中添加成员C(作为电话会议)时,A&B可以与C通信,但C从不从B获得语音。(C&A沟通正常)。那么如何管理C&B之间的沟通。

This code working fine for me , only need to merge pjsua_conf_connect() slot number 0 1 and , which is our requirement. 这段代码对我来说很好,只需要合并pjsua_conf_connect()槽号0 1,这是我们的要求。

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.
       */

        pjsua_call_media_status slotOne = ci.media_status;
      if (slotOne == PJSUA_CALL_MEDIA_ACTIVE ||
          slotOne == 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);


      }


          [[NSUserDefaults standardUserDefaults] setObject: @"CallIsRunning"forKey:@"CallIsRunning"];
        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;

            mergeCalls=false;

            int max=pjsua_call_get_count();
            if (max==2) {

                [[NSUserDefaults standardUserDefaults] setInteger:pjsua_call_get_count() forKey:@"callCountForCalling"];
                mergeCalls=true;
            }


          NSString *grpID=  [[NSUserDefaults standardUserDefaults] objectForKey:@"callerTypegroup"];
            // if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"callerTypegroup"] length]>1)

            if (mergeCalls == true && grpID.length==0) {

                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);
        }

    }

You can use pjsip ios library 2.5 latest build and another call. 您可以使用pjsip ios库2.5最新版本和另一个调用。 Second is using webservice to originate call and redirect channels to confbridge for asterisk as sip server. 其次是使用webservice来发起呼叫和重定向信道以作为sip服务器的asterisk进行confbridge。

If you are using another media server then share the details as well. 如果您正在使用其他媒体服务器,则也要共享详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM