<section id="test-call">
<h3>{{ _("Test Call") }}</h3>
- <div class="well">
- <span class="glyphicon glyphicon-earphone text-success"></span>
- <a href="/call/9999"">9999<span class="text-muted">@ipfire.org</span></a>
- - {{ _("A music playing service") }}
- </div>
+ <ul class="list-unstyled">
+ <li>
+ <span class="glyphicon glyphicon-earphone text-success"></span>
+ <a href="/call/991">991<span class="text-muted">@ipfire.org</span></a>
+ - {{ _("Echo Test") }}
+ </li>
+
+ <li>
+ <span class="glyphicon glyphicon-earphone text-success"></span>
+ <a href="/call/992">992<span class="text-muted">@ipfire.org</span></a>
+ - {{ _("A music playing service") }}
+ </li>
+ </ul>
</section>
{% if current_user.is_admin() %}
return res["Ping"] == "Pong"
- def call(self, caller, callee, caller_id=None, timeout=30000):
+ def call(self, caller, callee, callee_id=None, timeout=30000):
res = self._send_action("Originate", {
- "Channel" : caller,
+ "Channel" : "SIP/%s@kamailio" % caller,
"Exten" : callee,
"Context" : "from-cli",
"Priority" : 1,
"Timeout" : timeout,
- "CallerID" : caller_id or callee,
+ "CallerID" : callee_id or callee,
})
return res
return self._process_cdr(res, replace_sip_uris=True)
- def initiate_call(self, caller, called, when=None):
- self.db.execute("INSERT INTO dialout(caller, called, not_before) \
- VALUES(%s, %s, %s)", caller, called, when)
+ def initiate_call(self, caller, callee, callee_id=None):
+ a = self.connect_to_asterisk()
+
+ return a.call(caller, callee, callee_id=callee_id)
# Favourites