rjm*_*nro 4 voip sip caller-id
有谁知道 SIP 客户端可以在有人呼叫时打开可配置 URL 的网页吗?我们有一个基于网络的数据库,每当接到来电时我都想通过电话号码进行搜索,并在接听电话之前将其显示在屏幕上。
SIP 客户端程序不必具有任何其他音频或呼叫功能 - 我们的办公桌上也都有硬件 SIP 电话。
小智 5
我怀疑 6 个月后你是否仍在寻找这个问题的答案,但这里是:
Twinkle SIP 客户端支持在收到来电时执行脚本,我相信许多其他客户端也这样做。要在 Twinkle 中实现类似的功能,您需要编写如下所示的脚本,然后进入“编辑”->“用户配置文件”->“脚本”,并为“来电”选择 /path/to/my/script。
#!/usr/bin/env python
import os
import re
def get_caller_id(from_hdr):
clid, uri = from_hdr.split(" <sip")
clid = re.sub("\"", "", clid)
# Insert ASCII code for spaces
if re.search("\s", clid):
clid = re.sub("\s", "%20", clid)
return clid
if "SIP_FROM" in os.environ:
from_hdr = os.environ["SIP_FROM"]
if re.match("\"[A-Za-z0-9\s]+\"", from_hdr):
cmd = "firefox "
url = "http://www.google.com/search?q="
caller_id = get_caller_id(from_hdr)
cmd_string = cmd + url + caller_id
# Launch Browser
os.system(cmd_string)
Run Code Online (Sandbox Code Playgroud)