-{% if account %}
+{% if application == "ConfBridge" %}
+ {{ _("Conference Room %s") % number }}
+
+{% elif application == "VoiceMail" %}
+ {{ _("Voicemail") }}:
+
+ {% if account %}
+ <a href="/phonebook/{{ account.uid }}">{{ account.name }}</a>
+ <span class="text-muted">({{ number }})</span>
+ {% end %}
+
+{% elif account %}
<i class="fa fa-user"></i>
<a href="/phonebook/{{ account.uid }}">{{ account.name }}</a>
<span class="text-muted">({{ number }})</span>
{% elif number == "900" %}
{{ _("Conference Service") }}
-{% elif number in ("901", "902", "903", "904", "905", "906", "907", "908", "909") %}
- {{ _("Conference Room #%s") % number[2] }}
-
{% elif number in ("980", "981", "982", "983", "984", "985", "986", "987", "988", "989") %}
{{ _("Parked Calls Extension") }} <span class="text-muted">({{ number }})</span>
</td>
<td>
- {% module TalkContact(c.callee) %}
+ {% module TalkContact(c.callee, application=c.application) %}
</td>
<td>
return int(seconds)
+ _states = {
+ "4" : "ringing",
+ "6" : "connected",
+ }
+
+ @property
+ def state(self):
+ state = self.status.get("ChannelState")
+
+ try:
+ return self._states[state]
+ except KeyError:
+ return
+
@property
def format(self):
return "%s/%s" % (
@property
def callee(self):
- num = self.status.get("DNID")
+ if self.application == "ConfBridge":
+ return self.data # Will have the conference room number
+
+ elif self.application == "VoiceMail":
+ try:
+ user, rest = self.data.split("@", 1)
+ except:
+ return self.data
+
+ return user
+
+ num = self.status.get("EffectiveConnectedLineNum") or self.status.get("DNID")
return self._format_number(num)
+ @property
+ def application(self):
+ return self.status.get("Application")
+
+ @property
+ def data(self):
+ return self.status.get("Data")
+
class Peer(object):
def __init__(self, manager, peer_id):
class TalkContactModule(UIModule):
- def render(self, number, name=None):
+ def render(self, number, name=None, application=None):
account = self.accounts.get_by_sip_id(number)
return self.render_string("talk/modules/contact.html",
- account=account, number=number, name=name)
+ account=account, number=number, name=name, application=application)
class TalkCallLogModule(UIModule):