return res["Ping"] == "Pong"
- def call(self, caller, callee, callee_id=None, timeout=30000):
+ def call(self, caller, callee, caller_id=None, timeout=30000):
res = self._send_action("Originate", {
"Channel" : "SIP/%s@kamailio" % caller,
"Exten" : callee,
"Context" : "from-cli",
"Priority" : 1,
"Timeout" : timeout,
- "CallerID" : callee_id or callee,
+ "CallerID" : caller_id or caller,
})
return res
return self._process_cdr(res, replace_sip_uris=True)
- def initiate_call(self, caller, callee, callee_id=None):
+ def initiate_call(self, caller, callee):
a = self.connect_to_asterisk()
- return a.call(caller, callee, callee_id=callee_id)
+ return a.call(caller.sip_id, callee,
+ caller_id="%s <%s>" % (caller.name, caller.sip_id))
# Favourites
called = self.accounts.get_by_sip_id(called_id)
- self.talk.initiate_call(self.current_user.sip_id, called_id)
+ self.talk.initiate_call(self.current_user, called_id)
next = self.get_argument("next", None)
if next is None: