コード例 #1
0
ファイル: views.py プロジェクト: zoolook495/astconfman
def leave_conference(conf_number, callerid):
    if not asterisk_is_authenticated():
        return 'NOTAUTH'
    message = gettext('Number %(num)s has left the conference.', num=callerid)
    conference = Conference.query.filter_by(number=conf_number).first_or_404()
    conference.log(message)
    sse_notify(conference.id, 'update_participants')
    return 'OK'
コード例 #2
0
def unmute_request(conf_number, callerid):
    if not asterisk_is_authenticated():
        return 'NOTAUTH'
    message = gettext('Unmute request from number %(num)s.', num=callerid)
    conference = Conference.query.filter_by(number=conf_number).first_or_404()
    conference.log(message)
    sse_notify(conference.id, 'unmute_request', callerid)
    return 'OK'
コード例 #3
0
def enter_conference(conf_number, callerid):
    if not asterisk_is_authenticated():
        return 'NOTAUTH'
    message = gettext('Number %(num)s has entered the conference.', num=callerid)
    conference = Conference.query.filter_by(number=conf_number).first_or_404()
    conference.log(message)
    sse_notify(conference.id, 'update_participants')
    return 'OK'
コード例 #4
0
ファイル: views.py プロジェクト: zoolook495/astconfman
def unmute_request(conf_number, callerid):
    if not asterisk_is_authenticated():
        return 'NOTAUTH'
    message = gettext('Unmute request from number %(num)s.', num=callerid)
    conference = Conference.query.filter_by(number=conf_number).first_or_404()
    conference.log(message)
    sse_notify(conference.id, 'unmute_request', callerid)
    return 'OK'
コード例 #5
0
 def unlock(self, conf_id):
     conf = Conference.query.get_or_404(conf_id)
     confbridge_unlock(conf.number)
     msg = gettext('The conference has been unlocked.')
     flash(msg)
     conf.log(msg)
     sse_notify(conf.id, 'update_participants')
     time.sleep(1)
     return redirect(url_for('.details_view', id=conf_id))
コード例 #6
0
ファイル: views.py プロジェクト: zoolook495/astconfman
 def unlock(self, conf_id):
     conf = Conference.query.get_or_404(conf_id)
     confbridge_unlock(conf.number)
     msg = gettext('The conference has been unlocked.')
     flash(msg)
     conf.log(msg)
     sse_notify(conf.id, 'update_participants')
     time.sleep(1)
     return redirect(url_for('.details_view', id=conf_id))
コード例 #7
0
def leave_conference(conf_number, callerid):
    if not asterisk_is_authenticated():
        return 'NOTAUTH'
    message = gettext('Number %(num)s has left the conference.', num=callerid)
    conference = Conference.query.filter_by(number=conf_number).first_or_404()
    conference.log(message)
    sse_notify(conference.id, 'update_participants')
    for num in talkers:
        if (  num == callerid ):
            talkers.remove(callerid)
    return 'OK'
コード例 #8
0
 def kick(self, conf_id, channel=None):
     conf = Conference.query.filter_by(id=conf_id).first_or_404()
     if channel:
         confbridge_kick(conf.number, channel)
         msg = gettext('Channel %(channel)s is kicked.', channel=channel)
         flash(msg)
         conf.log(msg)
     else:
         confbridge_kick_all(conf.number)
         msg = gettext('All participants have been kicked from the conference.')
         conf.log(msg)
         flash(msg)
     sse_notify(conf.id, 'update_participants')
     time.sleep(1)
     return redirect(url_for('.details_view', id=conf.id))
コード例 #9
0
ファイル: views.py プロジェクト: zoolook495/astconfman
 def kick(self, conf_id, channel=None):
     conf = Conference.query.filter_by(id=conf_id).first_or_404()
     if channel:
         confbridge_kick(conf.number, channel)
         msg = gettext('Channel %(channel)s is kicked.', channel=channel)
         flash(msg)
         conf.log(msg)
     else:
         confbridge_kick_all(conf.number)
         msg = gettext('All participants have been kicked from the conference.')
         conf.log(msg)
         flash(msg)
     sse_notify(conf.id, 'update_participants')
     time.sleep(1)
     return redirect(url_for('.details_view', id=conf.id))
コード例 #10
0
 def unmute(self, conf_id, channel=None):
     conf = Conference.query.get_or_404(conf_id)
     if channel:
         confbridge_unmute(conf.number, channel)
         msg = gettext('Participant %(channel)s unmuted.', channel=channel)
         flash(msg)
         conf.log(msg)
     else:
         # Mute all
         for p in confbridge_list_participants(conf.number):
             confbridge_unmute(conf.number, p['channel'])
         msg = gettext('Conference unmuted.')
         flash(msg)
         conf.log(msg)
     sse_notify(conf.id, 'update_participants')
     time.sleep(1)
     return redirect(url_for('.details_view', id=conf_id))
コード例 #11
0
ファイル: views.py プロジェクト: zoolook495/astconfman
 def unmute(self, conf_id, channel=None):
     conf = Conference.query.get_or_404(conf_id)
     if channel:
         confbridge_unmute(conf.number, channel)
         msg = gettext('Participant %(channel)s unmuted.', channel=channel)
         flash(msg)
         conf.log(msg)
     else:
         # Mute all
         for p in confbridge_list_participants(conf.number):
             confbridge_unmute(conf.number, p['channel'])
         msg = gettext('Conference unmuted.')
         flash(msg)
         conf.log(msg)
     sse_notify(conf.id, 'update_participants')
     time.sleep(1)
     return redirect(url_for('.details_view', id=conf_id))
コード例 #12
0
def update_talkers_off(conf_number,callerid):
   message = gettext('Number %(num)s is shut up.', num=callerid)
   conference = Conference.query.filter_by(number=conf_number).first_or_404()
   conference.log(message)
   sse_notify(conference.id, 'update_participants')
   return 'OK'
コード例 #13
0
ファイル: models.py プロジェクト: credil/astconfman
 def log(self, message):
     post = ConferenceLog(conference=self, message=message)
     db.session.add(post)
     db.session.commit()
     sse_notify(self.id, 'log_message', message)
コード例 #14
0
 def log(self, message):
     post = ConferenceLog(conference=self, message=message)
     db.session.add(post)
     db.session.commit()
     sse_notify(self.id, 'log_message', message)