1

会議に参加する最初のユーザーをモデレーターとして設定したいと思います。私はtwilio-python ドキュメントを使用していますが、これについては何もわかりませんでした。

最初の参加者は、他の参加者をミュート、キックなどするためにモデレーターになる必要がありますが、正直なところ、これが本当に必要かどうかはわかりません。

また、SID の代わりにこれを使用してトークンを取得するために、トークンに関連する名前が参加者にあるかどうかを知りたいです。(ドキュメントには何も表示されませんでした

ここでサーバー側のコード:

@app.route('/call', methods=['GET', 'POST'])
def call():
  resp           = twilio.twiml.Response()
  from_value     = request.values.get('From')
  to             = request.values.get('To')
  conferenceName = request.values.get('conferenceName')

  account_sid     = os.environ.get("ACCOUNT_SID", ACCOUNT_SID)
  auth_token      = os.environ.get("AUTH_TOKEN", AUTH_TOKEN)
  app_sid         = os.environ.get("APP_SID", APP_SID)
  clientTwilio  = TwilioRestClient(account_sid, auth_token)

elif to.startswith("conference:"):
    # allows to user conference call
    # client -> conference
    conferencesList = client.conferences.list(friendly_name=conferenceName)

  #there's no conference with the conferenceName so the first person should be the moderator and join it
    if len(conferencesList) == 0 
      #do somestuff to set a moderator [...]
      resp.dial(callerId=from_value).conference(to[11:])
    else:
      #there's already a conference just join it
      resp.dial(callerId=from_value).conference(to[11:])

そして、参加者を取得するために使用したいトークン/クライアントに関連する「名前」の場合:

     //http://foo.herokuapp.com/token?client=someName"
     self.phone = [[TCDevice alloc] initWithCapabilityToken:token delegate:self];
    NSDictionary *params = @{@"To": @"conference:foo"};
    self.connection = [self.phone connect:params delegate:self];
        [self closeNoddersView:nil];
    //the user is connected as participant in the conference, is it possible to retrieve it with the "someName" ? (server side route which take a "someName" in param)

どんな手掛かり ?:/

4

1 に答える 1

3

client:name を使用する回避策が見つかりました。モデレーターは必要ありません。

会議には参加者のリストが含まれています

参加者が特定の通話に関連している

呼び出しには、to および from_: client:name の情報が含まれます。

@app.route('/conference_kick', methods=['GET', 'POST'])
    def conference():
      client          = TwilioRestClient(account_sid, auth_token)
      conferenceName  = request.values.get('conferenceName')
      participantName = request.values.get('participantName') 
      index           = 0
      call            = ""
      # A list of conference objects
      conferencesList = client.conferences.list(status="in-progress",friendly_name=conferenceName)
      if len(conferencesList) == 1:
        if conferencesList[0].participants:
          participants = conferencesList[0].participants.list()
          while index < len(participants): 
            call       = client.calls.get(participants[index].call_sid)
            array = call.from_.split(':')
            if participantName == array[1]:
              participants[index].kick()
              return json.dumps({'code' : 200, 'success':1, 'message':participantName+' kicked'})
            index      += 1  
          return json.dumps({'code' : 101, 'success':0, 'message':participantName+' not found'})  
        else:
          return json.dumps({'code' : 102, 'success':0, 'message':'no participants'})
      else:  
        return json.dumps({'code' : 103, 'success':0, 'message':'no conference'})
于 2016-01-29T10:08:22.937 に答える