Ejemplo n.º 1
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')
    return 'OK'
Ejemplo n.º 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'
Ejemplo n.º 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'
Ejemplo n.º 4
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'
Ejemplo n.º 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))
Ejemplo n.º 6
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))
Ejemplo n.º 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'
Ejemplo n.º 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))
Ejemplo n.º 9
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))
Ejemplo n.º 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))
Ejemplo n.º 11
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))
Ejemplo n.º 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'
Ejemplo n.º 13
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)
Ejemplo n.º 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)