使用Mini Sipserver 搭建小型的sip服务器

使用Mini Sipserver 搭建小型的sip服务器


因为实习即将结束,所以一离开公司,回到学校就没有那么方便的资源了,譬如sip server , mail server,Ip phone等等,我只有一台Android 手机,所以相当苦恼,今天搜索了一下,找到了Mini SipServer,这个是MYVOIPAPP(www.myvoipapp.com)的产品,可以在windows(包括win7),Linux 多平台上使用,而且功能非常强大。虽然不是免费的,但是,如果只是个人使用,可以通过写一篇文章(如何获得免费的miniSipserver)推广。我也希望尽快获得一个lisence。

1 MiniSipserver介绍

下表是miniSipserver的功能,真的是麻雀虽小五脏俱全,可以从这里下载,也可以运行在64位系统上

<
Features 20 clients 50 clients 100 clients 300 clients 1000 clients
Local users (extensions) 20 50 100 300 1000
External line 10 25 50 150 300
Simultaneous calls 10 25 50 150 500
CPS (call per second) 3 8 15 35 84
 
Call detail record(CDR) yes yes yes yes yes
Call recording -- new! yes
  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
Python中有一些库可以用来开发SIP服务器,例如pjsipsipsimple、sippy、python-sipsimple等。这些库提供了丰富的功能和API,可以帮助开发人员快速构建高性能的SIP服务器。 以下是一个使用sipsimple库实现简单SIP服务器的示例代码: ```python from sipsimple.core import SIPCoreError, SIPURI, ToHeader from sipsimple.application import SIPApplication, SIPApplicationError from sipsimple.account import AccountManager, Account from sipsimple.streams import AudioStream from sipsimple.lookup import DNSLookup, SRVLookup from sipsimple.configuration.settings import SIPSimpleSettings from sipsimple.threading import run_in_thread class MySIPServer(SIPApplication): def __init__(self): SIPApplication.__init__(self) self.account_manager = AccountManager() self.account = None def start(self): super(MySIPServer, self).start() self.account_manager.start() def stop(self): self.account_manager.stop() super(MySIPServer, self).stop() @run_in_thread() def register_account(self, username, password, domain): try: sip_uri = SIPURI(username=username, password=password, host=domain) self.account = Account(username=sip_uri, password=password, domain=domain) self.account_manager.register(self.account) except (SIPCoreError, SIPApplicationError) as e: print("Failed to register account: %s" % str(e)) def handle_request(self, req): # 处理收到的SIP请求 print("Received SIP request: %s" % req) to_header = ToHeader("<sip:%s@%s>" % (req.to_details.username, req.to_details.host)) response = req.create_response(200, "OK") response.headers["To"] = to_header self.transport.send(response) if __name__ == "__main__": # 初始化SIPSimple设置 SIPSimpleSettings().initialize() # 创建SIP服务器实例 server = MySIPServer() # 注册SIP账户 server.register_account("username", "password", "example.com") # 启动SIP服务器 server.start() # 运行事件循环 server.run() ``` 在这个示例中,我们使用SIPApplication类来实现SIP服务器,通过注册SIP账户来处理收到的SIP请求,并在收到请求后返回一个200 OK的响应。开发人员可以根据自己的需求使用不同的库和API来实现SIP服务器

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值