return sip_registrations
+ @lazy_property
+ def sip_channels(self):
+ return self.backend.talk.freeswitch.get_sip_channels(self)
+
def get_cdr(self, date=None, limit=None):
return self.backend.talk.freeswitch.get_cdr_by_account(self, date=date, limit=limit)
-{% if account.sip_registrations %}
+{% if account.sip_channels %}
+ <a class="text-warning" href="/users/{{ account.uid }}/registrations">
+ {{ _("On The Phone") }} ({{ len(account.sip_registrations) }})
+ </a>
+{% elif account.sip_registrations %}
<a class="text-success" href="/users/{{ account.uid }}/registrations">
{{ _("Online") }} ({{ len(account.sip_registrations) }})
</a>
class ChannelsModule(ui_modules.UIModule):
def render(self, account):
- channels = self.backend.talk.freeswitch.get_sip_channels(account)
-
- return self.render_string("people/modules/channels.html", account=account, channels=channels)
+ return self.render_string("people/modules/channels.html",
+ account=account, channels=account.sip_channels)
class MOSModule(ui_modules.UIModule):