【发布时间】:2015-05-19 12:48:18
【问题描述】:
我创建了一个 SIP 呼叫,现在我没有任何声音,即我没有声音管理器。我想为接收器播放音频文件。即当我打电话给某人时,我希望他们听到音频消息。如何发送文件并播放?
ContentLengthHeader contentLength = headerFactory.createContentLengthHeader(211);
ContentTypeHeader contentType =
headerFactory.createContentTypeHeader("application", "sdp");
String sdpData = "v=0\n" +
"o=test 795808818 480847547 IN IP4 "+localIP+"\n" +
"s=Audio Call\n" +
"u=/audio/play.wav"+
"c=IN IP4 "+localIP+"\n" +
"t=0 0\n" +
"m=audio 8000 RTP/AVP 0 8 101\n" +
"a=rtpmap:0 PCMU/8000\n" +
"a=rtpmap:8 PCMA/8000\n" +
"a=rtpmap:101 telephone-event/8000\n" +
"a=sendrecv";
byte[] contents = sdpData.getBytes();
request.setContent(contents, contentType);
如果我像这样直接发送文件,它会播放吗?还可以发送文本并在通话中播放吗?
【问题讨论】:
-
请先尝试一下,然后提出问题。
-
你能建议我在这个实现中可以遵循的方向吗?
-
For the transmission of media streams (voice, video) the SDP payload carried in SIP messages typically employs the Real-time Transport Protocol (RTP) or the Secure Real-time Transport Protocol (SRTP).您不会使用 SIP“发送”音频或视频。