使用 SIP 传输文件
问题是 - 有没有办法使用我的 sip 提供商传输文件 - 我想制作一个 Android 应用程序 - sip 客户端,具有发送文件的唯一功能。
您输入您的 sip 帐户信息、要处理的号码并选择要发送的文件。您与您的朋友进行交易,他接听并开始文件传输。文件可以是任何格式。
我读了很多资料但没有找到做这个项目的方法。有什么想法吗?
The question is - is there any way to transfer files using my sip provider - I'd like to make an android application - sip client with the only function to send files.
You enter your sip account information, number to deal and choose the file to send. You deal your friend, he answers and file transfer begins. The files can be any format.
I read a lot of information but didn't find the way to do the project. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能应该使用 jabber 而不是 SIP。
无论如何,必须有一种方法在 SDP 中协商文件传输。
谷歌是我的朋友:
https://datatracker.ietf.org/ doc/html/draft-ietf-mmusic-file-transfer-mech-11
如果我必须这样做,我会涉及到上传到的服务器,并且只需传递 URL 和加密密钥在 SIP 中。
You probably should have went with jabber instead of SIP.
Anyway, there must be a way to negotiate a file transfer in SDP.
Google is my friend:
https://datatracker.ietf.org/doc/html/draft-ietf-mmusic-file-transfer-mech-11
If I had to do it, I'd involve a server to upload to, and just pass the URL and encryption key in SIP.
SIP 在很多方面都被滥用,但这可能是其中最糟糕的 ;)
由于每条消息都应适合相当低的 MTU(某些路由器无法处理分段 UDP),因此每条消息大约占标头和每条消息的 25% 左右已从另一方确认...这将是一个非常缓慢且非常占用带宽的过程。也不是很可靠。
如果您正在开发两端,您可能最好只向另一个客户端发送带有新事件类型值的 NOTIFY。在消息中指定您在哪里等待连接,然后直接通过 TCP 传输文件。当然,它也有 NAT 处理问题,但至少一旦启动它就会非常可靠。
SIP is abused in many ways, but this may be the worst of them ;)
Since each message should fit in a reasonably low MTU (some routers can't handle fragmented UDP), each message is 25% or so of headers and each message is confirmed from the other side... this would be both a very slow and very bandwidth intensive process. Also not very reliable.
If you're developing both ends, you might have a better off just sending a NOTIFY to the other client with a new event type value. In the message specify where are you waiting with connection and just transfer the file directly over TCP. That of course has it's own share of NAT handling issues, but at least it will be quite reliable once it's started.