templates_people_DATA = \
src/templates/people/conferences.html \
src/templates/people/index.html \
- src/templates/people/sip.html \
src/templates/people/subscribed.html \
src/templates/people/unsubscribe.html \
src/templates/people/unsubscribed.html
templates_people_messagesdir = $(templates_peopledir)/messages
templates_people_modules_DATA = \
- src/templates/people/modules/channels.html \
src/templates/people/modules/password.html \
- src/templates/people/modules/password.js \
- src/templates/people/modules/registrations.html
+ src/templates/people/modules/password.js
templates_people_modulesdir = $(templates_peopledir)/modules
+++ /dev/null
-{% if channels %}
- <ul class="list-group mb-3">
- {% for chan in channels %}
- <li class="list-group-item">
- {% if chan.direction == "inbound" %}
- <span class="fas fa-arrow-right text-danger"></span>
-
- {% if chan.conference %}
- <a href="/conferences#{{ chan.conference.handle }}">
- {{ _("Conference Room %s") % chan.conference.number }}
- </a>
- {% elif chan.application == "echo" %}
- {{ _("Echo Test") }}
-
- {% elif chan.application == "voicemail" %}
- {{ _("Voicemail") }}
-
- {% elif chan.callee %}
- {% if chan.callee %}
- <a href="/users/{{ chan.callee.uid }}">{{ chan.callee }}</a>
- {% else %}
- {{ chan.callee_name }}
- {% end %}
-
- <span class="text-muted">({{ format_phone_number(chan.callee_number) }})</span>
-
- {% else %}
- {{ format_phone_number(chan.called_number) }}
- {% end %}
- {% elif chan.direction == "outbound" %}
- <span class="fas fa-arrow-right text-success"></span>
-
- {% if chan.caller %}
- <a href="/users/{{ chan.caller.uid }}">{{ chan.caller }}</a>
- {% else %}
- {{ chan.caller_name }}
- {% end %}
-
- <span class="text-muted">({{ format_phone_number(chan.caller_number) }})</span>
- {% end %}
-
- <ul class="list-inline small mb-0">
- {% if chan.state == "ACTIVE" %}
- {# Don't show anything #}
- {% elif chan.state == "HELD" %}
- <li class="list-inline-item">
- <span class="badge bg-warning">{{ _("On Hold") }}</span>
- </li>
- {% elif chan.state == "RINGING" %}
- <li class="list-inline-item">
- <span class="badge bg-info">{{ _("Ringing") }}</span>
- </li>
- {% else %}
- <li class="list-inline-item">
- {{ _("Unknown State: %s") % chan.state }}
- </li>
- {% end %}
-
- <li class="list-inline-item">
- {{ format_time(chan.duration) }}
- </li>
-
- {% if chan.is_secure() %}
- <li class="list-inline-item">
- <i class="fas fa-lock" title="{{ chan.secure }}"></i>
- </li>
- {% end %}
-
- <li class="list-inline-item">
- {{ chan.codec }}
- </li>
- </ul>
- </li>
- {% end %}
- </ul>
-{% end %}
+++ /dev/null
-{% if account.sip_registrations %}
- <div class="card mb-3">
- <div class="card-body">
- <h6 class="card-title">{{ _("Active Registrations") }}</h6>
-
- <table class="table table-sm mb-0">
- <tbody>
- {% for reg in account.sip_registrations %}
- <tr>
- <td>{{ reg.user_agent }}</td>
- <td>{{ reg.protocol }}/{{ reg.network_ip }}:{{ reg.network_port }}</td>
- <td class="text-end">
- {% if reg.is_reachable() and reg.latency %}
- {{ "%.2f ms" % reg.latency }}
- {% else %}
- <span class="text-muted">{{ _("N/A") }}</span>
- {% end %}
- </td>
- </tr>
- {% end %}
- </tbody>
- </table>
- </div>
- </div>
-{% end %}
+++ /dev/null
-{% extends "../base.html" %}
-
-{% block title %}{{ account }} - {{ _("SIP Status") }}{% end block %}
-
-{% block content %}
- <h1>{{ _("SIP Status") }}</h1>
-
- {% module Channels(account) %}
-
- {% module Registrations(account) %}
-
- {% if account.uses_sip_forwarding() %}
- <div class="card">
- <div class="card-body">
- <h6 class="card-title">{{ _("SIP Forwarding Enabled") }}</h6>
-
- <p class="card-text">
- {{ _("All calls to %s will be forwarded to %s") % (account.sip_id, format_phone_number(account.sip_routing_address)) }}
- </p>
- </div>
- </div>
- {% else %}
- <div class="card">
- <div class="card-body">
- <h6 class="card-title">{{ _("SIP Credentials") }}</h6>
-
- <p>
- {{ _("Use these credentials to connect a SIP client to our SIP server") }}
- </p>
-
- <div class="row justify-content-center">
- <div class="col-12 col-sm-8 col-md-6">
- <dl class="row mb-0">
- <dt class="col-sm-6">{{ _("SIP Server") }}</dt>
- <dd class="col-sm-6">ipfire.org</dd>
-
- <dt class="col-sm-6">{{ _("Username") }}</dt>
- <dd class="col-sm-6">{{ account.sip_id }}</dd>
-
- <dt class="col-sm-6">{{ _("Password") }}</dt>
- <dd class="col-sm-6 font-monospace text-nowrap">{{ account.sip_password }}</dd>
- </dl>
- </div>
- </div>
- </div>
- </div>
- {% end %}
-{% end block %}
"DocsHeader" : docs.HeaderModule,
# People
- "Channels" : people.ChannelsModule,
"Password" : people.PasswordModule,
- "Registrations" : people.RegistrationsModule,
# Nopaste
"Code" : nopaste.CodeModule,
(r"/activate/([a-z_][a-z0-9_-]{0,31})/(\w+)", auth.ActivateHandler),
(r"/conferences", people.ConferencesHandler),
(r"/register", auth.RegisterHandler),
- (r"/users/([a-z_][a-z0-9_-]{0,31})/sip", people.SIPHandler),
# Promotional Consent Stuff
(r"/subscribe", people.SubscribeHandler),
self.render("people/unsubscribed.html")
-class SIPHandler(base.BaseHandler):
- @tornado.web.authenticated
- def get(self, uid):
- account = self.backend.accounts.get_by_uid(uid)
- if not account:
- raise tornado.web.HTTPError(404, "Could not find account %s" % uid)
-
- # Check for permissions
- if not account.can_be_managed_by(self.current_user):
- raise tornado.web.HTTPError(403, "%s cannot manage %s" % (self.current_user, account))
-
- self.render("people/sip.html", account=account)
-
-
-class ChannelsModule(ui_modules.UIModule):
- def render(self, account):
- return self.render_string("people/modules/channels.html",
- account=account, channels=account.sip_channels)
-
-
class PasswordModule(ui_modules.UIModule):
def render(self, account=None):
return self.render_string("people/modules/password.html", account=account)
def embedded_javascript(self):
return self.render_string("people/modules/password.js")
-
-
-class RegistrationsModule(ui_modules.UIModule):
- def render(self, account):
- return self.render_string("people/modules/registrations.html", account=account)