是否可以以编程方式创建SIP数据包并将其发送到已注册的SIP设备?我想发送SIP通知消息,如下所示:
NOTIFY sip:alice@alice-phone.example.com SIP/2.0
To: <sip:alice@example.com>;tag=78923
From: <sip:alice@example.com>;tag=4442
Date: Mon, 10 Jul 2000 04:28:53 GMT
Contact: <sip:alice@vmail.example.com>
Call-ID: 1349882@alice-phone.example.com
CSeq: 31 NOTIFY
Event: message-summary
Subscription-State: active
Content-Type: application/simple-message-summary
Content-Length: 503
Messages-Waiting: yes
Message-Account: sip:alice@vmail.example.com
Voice-Message: 4/8 (1/2)
Run Code Online (Sandbox Code Playgroud)
我想使用Perl将此信息发送到SIP设备.我是SIP世界的新手,所以我的问题可能听起来很模糊.但是对它的任何帮助都会非常感激.
谢谢.
是的,当然,这只是一个IP数据包.对于Perl,我的第一次尝试是来自CPAN的Net :: SIP.
或者,如果您想保持简单,请查看此消息中的代码:http://archive.cert.uni-stuttgart.de/bugtraq/2005/07/msg00276.html
为了符合标准,您需要处理来自手机的SUBSCRIBE消息并仅向订阅者发送NOTIFY - 但是您的示例似乎直接来自RFC 3842,我想您已经知道了.:)