Test Cases: SIP Residential Gateway

SIPRG has been tested to work successfully with the following test cases.
The test environment was as described in the CONFIGURATION_MANUAL.



======================================================================
PSTN-IP calls
======================================================================
Here, a PSTN user initiates a call by dialing the telephone number which is
connected to SIPRG (e.g, 5725018). On getting IP dial tone she dials the number
of UA (e.g, 1001).

NOTE:
RG.cfg contains the following 2 entries for PSTN-IP calls:
[a] proxy server addr == ip addr of the gateway marshal server
[b] Dial pattern for UA


1. Basic call:
--------------
PSTN user makes a call to SIPRG by dialing it's number(5725018). SIPRG answers the
call & plays an IP dial tone. It then dials the number of UA, i.e, '1001'. SIPRG
then makes a SIP call to UA through VOCAL. 
When UA answers the call an end-to-end voice call is setup between the PSTN
user and UA.

Expected result: Call is set up successfully & voice communication is
possible. Either of the parties can disconnect the call.


2. Non-existent UA:
-------------------
PSTN user makes a call to SIPRG by dialing it's number(5725018). SIPRG answers the
call & plays an IP dial tone. It then dials the number of a non-existent UA
say '1010'. SIPRG then tries to make a SIP call to 1010 through VOCAL.
VOCAL servers return not found response to SIPRG. SIPRG disconnects on PSTN side and
goes to WAIT state for 60 seconds (***).

Expected result: Failed attempt. After 60 sec PSTN user gets Busy tone and SIPRG
becomes 'Ready'.


(***) PSTN in India is calling party hangup. In an active call, if the called party
hangs up and the calling party does not disconnect then the called party can
connect back to the call by just going off-hook again (within 60 seconds). 
This facility is allowed so that the called party can answer the call on a
parallel extension in another room. 
From our tests with the local exchanges in our region we found out that the
timeout set by the PSTN for this was 60 seconds. Hence SIPRG goes into WAIT state
for 60 sec after disconnecting on PSTN side. This is done because the SIPRG is
the called party in an PSTN-IP call and if it goes Off-Hook to service the
next call from IP side it will connect to the previous call if the PSTN user
has not diconnected.


3. Dial Error:
--------------
PSTN user makes a call to SIPRG by dialing it's number(5725018). SIPRG answers the
call & plays an IP dial tone. It then dials an incomplete number say '10'. 
After timeout for input digits, SIPRG finds that the input number does not
satisfy any valid dial pattern and hence it disconnects on PSTN side and goes
to WAIT state (***). 

Expected result: Failed attempt. After 60 sec PSTN user gets Busy tone and SIPRG
becomes 'Ready'.


4. PSTN user cancels while dialing:
-----------------------------------
PSTN user makes a call to SIPRG by dialing it's number(5725018). SIPRG answers the
call & plays an IP dial tone. It then dials a few digits & hangs up without
completely dialing the number of UA. 
SIPRG on detecting the Busy tone from PSTN (PSTN user has disconnected)
disconnects on the PSTN side and becomes 'Ready'.

Expected result: SIPRG is 'Ready' to accept new call.


5. PSTN user cancels while UA is ringing:
-----------------------------------------
PSTN user makes a call to SIPRG by dialing it's number(5725018). SIPRG answers the
call & plays an IP dial tone. It then dials the number of UA, i.e, '1001'. SIPRG
then makes a SIP call to UA through VOCAL. 
On receiving the request UA starts ringing. The PSTN user decides to
disconnect before UA answers the call. SIPRG on detecting the Busy tone from PSTN
(PSTN user has disconnected) disconnects on the PSTN side and becomes 'Ready'.

Expected result: UA starts ringing. When PSTN user disconnects SIPRG becomes
'Ready' and UA stops ringing.


6. IP user busy:
----------------
PSTN user makes a call to SIPRG by dialing it's number(5725018). SIPRG answers the
call & plays an IP dial tone. It then dials the number of UA, i.e, '1001'. SIPRG
then makes a SIP call to UA through VOCAL. 
UA being busy in another call, on receiving the request, sends 486 busy
response to SIPRG. SIPRG plays IP Busy tone to PSTN user for a few seconds and
disconnects on PSTN side and goes to WAIT state (***).

Expected result: PSTN user gets IP Busy tone for a few sec. SIPRG disconnects on
PSTN side and goes to 'WAIT' state. After 60 sec SIPRG becomed 'Ready'.


7. IP user does not answer:
---------------------------
PSTN user makes a call to SIPRG by dialing it's number(5725018). SIPRG answers the
call & plays an IP dial tone. It then dials the number of UA, i.e, '1001'. SIPRG
then makes a SIP call to UA through VOCAL. 
UA does not answer the call. SIPRG timesout, disconnects on the PSTN side & goes
to WAIT state (***).

Expected result: PSTN user gets IP Ringback tone till SIPRG discconnects on PSTN
side and goes to 'WAIT' state. After 60 sec SIPRG becomed 'Ready'.


8. Call Termination - PSTN user Terminates:
-------------------------------------------
A voice call has been setup between PSTN user and UA as discussed in case (1).
PSTN user hangs up the call. SIPRG detects the Busy tone on PSTN and disconnects
on the PSTN side and becomes 'Ready'.

Expected result: Calling party termination hence SIPRG becomes Ready immediately
after diconnecting on the PSTN side.


9. Call Termination - IP user terminates:
-----------------------------------------
A voice call has been setup between PSTN user and UA as discussed in case (1).
UA hangs up in this case. SIPRG disconnects on PSTN side and goes to WAIT state
(***).

Expected result: Called party termination hence SIPRG goes to WAIT state &
becomes 'Ready' after 60 seconds.


10. New call while SIPRG is in WAIT state:
---------------------------------------
While in WAIT state the SIPRG cannot service any call (be it PSTN or IP call). If
a PSTN user makes a call to SIPRG she shall continuously get ringback. If the SIPRG
happens to become 'Ready' before she has given up it will service the call as
a normal call (refer case (1)).

Expected result: Continuos ringback to PSTN user. After SIPRG becomes 'Ready' it
can service the call.


11. Proxy Server down:
----------------------
PSTN user makes a call to SIPRG by dialing it's number(5725018). SIPRG answers the
call & plays an IP dial tone. It then dials the number of UA, i.e, '1001'. SIPRG
then makes a SIP call to UA through VOCAL. 
But in this case the VOCAL proxy server (marshal server) is down and hence the
call cannot be setup. After timeout SIPRG disconnects on PSTN side and goes to
WAIT state (***). 

Expected result: Failed attempt. After 60 sec PSTN user gets Busy tone and SIPRG
becomes 'Ready'.

======================================================================
IP-PSTN calls
======================================================================
Here IP user (UA) makes calls to the PSTN by dialing the desired PSTN numbers
preceded by '9' (access code for PSTN dialing). For e.g. if she wants to make
a call to a number '5721383' she dials '95721383' on the UA. 
SIPRG shall strip of the '9' and dial the correct number on the PSTN line.

NOTE:
UA is configured to use VOCAL. This is done by setting the Proxy_Server addr
of UA in ua.cfg to that of the UA Marshal server.

VOCAL was configured for routing pstn destined calls to SIPRG. This is done by
setting RG's address in G/W Marshal server configuration, and also setting the
digital dial plan to forward pstn destined calls to the g/w marshal server.



1. Basic Call:
--------------
IP user dials '95721383'. SIPRG on receiving INVITE extracts the number from it,
validates it, strips of the initial '9', dials the number (5721383) over
the PSTN line and tracks the call progress tones. On receiving Ringback from
PSTN it sends 180 to UA. After a few rings it establishes RTP voice
communication (###). 


(###) LineJack cannot detect that the PSTN user has answered the call. Hence
we do the following workaround. We start a timer of 5 seconds after detection
of each Ringback cadence and stop the timer started by the previous ringback
cadence detection. If the next cadence does not happen before the timeout we
conclude that the PSTN user has answered the call. This technique works because
the Ringback cadences from PSTN are of fixed duration & we can assume that if
the cadence does not occur within that time span the Ringback has stopped and
the call is answered. This technique can fail if the call is not answered at
all. Hence we protect it by providing a ringback cadence detection count. If
this count exceeds 8 we conclude that the call is not answered & SIPRG
disconnects on the PSTN side. As a side effect we donot allow the SIPRG to be
hogged for long durations during call setup.

Expected result: Successful communication is possible. The IP user may start
hearing the PSTN ringback before the call is actually answered. 


2. Calling a Busy PSTN number:
------------------------------
IP user dials '95721383' which is kept busy. SIPRG on receiving INVITE extracts
the number from it, validates it, strips of the initial '9', dials the number
(5721383) over the PSTN line. On receiving Busy tone from PSTN it sends 486 to
UA, disconnects on the PSTN side and becomes 'Ready'.

Expected result: UA gets Busy tone for a few seconds and then blank as SIPRG
disconnects & becomes 'Ready'.


3. Calling a PSTN number that does not answer:
----------------------------------------------
IP user dials '95721383'. SIPRG on receiving INVITE extracts the number from it,
validates it, strips of the initial '9', dials the number (5721383) over
the PSTN line and tracks the call progress tones. On receiving Ringback from
PSTN it sends 180 to UA. After a few rings it establishes RTP voice
communication (###). After 8 ring detections SIPRG concludes that the PSTN user
is not answering the call, disconnects &  becomes 'Ready'.

Expected result: Desired party contacted. No answer.


4. IP user cancels while SIPRG is dialing on the PSTN:
--------------------------------------------------
IP user dials '95721383'. SIPRG on receiving INVITE extracts the number from it,
validates it, strips of the initial '9', dials the number (5721383) over
the PSTN line. While SIPRG is dialing this number UA cncels the call. SIPRG on
receiving CANCEL from UA disconnects on the PSTN side & becomes 'Ready'.

Expected result: SIPRG becomes 'Ready'.


5. IP user cancels while PSTN user's phone is ringing:
------------------------------------------------------
IP user dials '95721383'. SIPRG on receiving INVITE extracts the number from it,
validates it, strips of the initial '9', dials the number (5721383) over
the PSTN line and tracks the call progress tones. On receiving Ringback from
PSTN it sends 180 to UA. UA cancels the call before the PSTN user answers.
SIPRG on receiving CANCEL from UA disconnects on the PSTN side & becomes 'Ready'.

Expected result: SIPRG becomes 'Ready'.


6. Call Termination - IP termination case:
------------------------------------------
A voice call has been set up between UA and a PSTN user as discussed in case
(1). UA hangs up the call. On receiving BYE from UA, SIPRG disconnects on PSTN
side and becomes 'Ready'.

Expected result: SIPRG becomes 'Ready' & PSTN user gets Busy tone (disconnect
tone)


7. Call Termination - PSTN termination case:
------------------------------------------
A voice call has been set up between UA and a PSTN user as discussed in case
(1). PSTN user disconnects the call. On receiving Busy tone (%%%) from PSTN SIPRG
disconnects on PSTN side and becomes 'Ready'.


(%%%) LineJack cannot detect called party hangup. It has provisions for wink
detect but the PSTN in India does not provide wink on hangup. Hence we do a
workaround. We detect the Busy tone from PSTN (which is sent after the far end
has disconnected) and conclude that PSTN user has disconnected. This works
because the PSTN sends Busy tone only on hangup after a voice call.

Expected result: After the PSTN user has disconnected the UA side gets blank
till PSTN sends Busy tone. After that SIPRG disconnects on PSTN side and becomes
'Ready'.



8. New Call while SIPRG is in WAIT state:
--------------------------------------
While in WAIT state the SIPRG cannot service any call (be it PSTN or IP call).
A call from anyof the UAs will get immediate 486 message.

Expected result: Failed attempt. IP user gets IP Busy tone.


9. Calling a PSTN number that does not exist:
---------------------------------------------
IP user dials '92222222'. SIPRG on receiving INVITE extracts the number from it,
validates it, strips of the initial '9', dials the number '2222222' over the
PSTN line. Since the number does not exist PSTN plays out announcement to
indicate that the number does not exist. 

The Linejack is capable of detecting call progress tones such as Busy,
Ringback, Dialtone, etc which can be programmed as frequency values & cadence
on/off times in the driver API. It cannot detect/interpret announcements played
by PSTN. This case is handled by SIPRG as follows: After playing out the
announcement (usually for three times which may be around 10-15 seconds) the
PSTN sends a Busy tone. SIPRG catches this Busy tone, disconnects on PSTN side ,
sends 486 msg to UA and becomes Ready.

Expected result: IP user gets Busy tone & SIPRG becomes 'Ready'


11. Proxy Server down:
----------------------
UA makes a call to PSTN by dialing '95721383'. Since the VOCAL proxy server
(marshal server) is down the request cannot reach SIPRG. Hence, SIPRG remains in
'Ready' state.

Expected result: Failed attempt.

[ Vovida.org | Applications Homepage | SIPRG Download | Test Cases ]