查看KitCAT 框架。它基于 JUnit,可以支持您的所有要求。它支持多个用户代理,它们都可以在一个测试用例中进行协调。它还提供与其他协议(例如,RTP、HTTP)的协调。
示例代码:
SIPAgent callee1 = createAgent("callee1"); // sip:callee1@host
SIPAgent callee2 = createAgent("callee2"); // sip:callee2@host
// invoke your API here
invoke3rdPartyAPI(callee1.getSipURI(), callee2.getSipURI());
pause(2000);
assertThat(callee1, is(invited()));
assertThat(callee2, is(invited()));
callee1.answer();
callee2.answer();
pause(500);
assertThat(callee1, is(connectedTo(callee2))); // check for SDP match
callee1.playAudio(audioFileName);
pause(500);
assertThat(callee2, has(incomingMedia());
callee1.disconnect();
pause(500);
assertThat(callee2, is(disconnected()));
在此处查看完整的 API。