I want to initiate calls to two numbers using a 3rd party API. I need to make sure that the devices ring when they get the calls, media starts to transmit when the call is answered, and the call is terminated when hungup.

Ideally I would like to do this from JUnit tests so that I can automate this whole process. But any other tool will also be fine.

So this is what I want to do programatically,

1) Configure two SIP soft phones to answer on 2 different numbers using some credentials provided by the test.

2) Make a call using the API

3) Assert that two phones are in ringing state

4) Answer the call

5) Assert that RTP media is being transmitted among them

6) Hang up

7) Assert that the call is now successfully disconnected

I am quite new to telephony, so would appreciate any pointers on any tool or SDK that will help me accomplish this.

有帮助吗?

解决方案

Please check out SipUnit https://code.google.com/p/commtesting/wiki/SipUnit. It can do all above except check out the media is flowing yet.

其他提示

Check out the KitCAT framework. It's based on JUnit and can support all of your requirements. It supports multiple user agents, which can all be coordinated within a test case. It also provides coordination with other protocols (e.g., RTP, HTTP).

Sample code:

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()));

Check out the complete API here.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top