<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/en/2176/25/9/_/styles/combined.css?spaceKey=AST&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://wiki.asterisk.org/wiki/display/AST/Tests+for+Basic+Call+Functionality">Tests for Basic Call Functionality</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://wiki.asterisk.org/wiki/display/~mmichelson">Mark Michelson</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        Add more off-nominal incoming call tests<br />
    </div>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >Pass Conditions: <br>Ensure that Asterisk rejects all INVITEs with credentials with 401s. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;"> <br>h5. Test 3: Unknown Destination <br> <br>Procedure: <br>Alice places a call to extension carol@default <br> <br>Pass Conditions: <br>Ensure that Asterisk sends a 404 to Alice <br> <br>h5. Test 4: Incompatible codecs <br> <br>For this test, the following Alice-specific data is needed: <br>{{allow=!all,amr-wb}} <br> <br>Procedure: <br>Alice places a call to extension playback@default <br> <br>Pass Conditions: <br>Ensure that Asterisk sends a 488 to Alice <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>This page outlines some basic call tests for the new SIP work in Asterisk.</p>

<div>
<ul>
    <li><a href='#TestsforBasicCallFunctionality-ConfigurationforTests'>Configuration for Tests</a></li>
    <li><a href='#TestsforBasicCallFunctionality-Oneleggedtests'>One-legged tests</a></li>
<ul>
    <li><a href='#TestsforBasicCallFunctionality-IncomingCalls'>Incoming Calls</a></li>
<ul>
    <li><a href='#TestsforBasicCallFunctionality-Nominalpath'>Nominal path</a></li>
<ul>
    <li><a href='#TestsforBasicCallFunctionality-Test1%3AFilePlayback'>Test 1: File Playback</a></li>
    <li><a href='#TestsforBasicCallFunctionality-Test2%3AEcho'>Test 2: Echo</a></li>
</ul>
    <li><a href='#TestsforBasicCallFunctionality-Offnominalpaths'>Off-nominal paths</a></li>
<ul>
    <li><a href='#TestsforBasicCallFunctionality-Test1%3AUnknownSource'>Test 1: Unknown Source</a></li>
    <li><a href='#TestsforBasicCallFunctionality-Test2%3AAuthenticationfailure'>Test 2: Authentication failure</a></li>
    <li><a href='#TestsforBasicCallFunctionality-Test3%3AUnknownDestination'>Test 3: Unknown Destination</a></li>
    <li><a href='#TestsforBasicCallFunctionality-Test4%3AIncompatiblecodecs'>Test 4: Incompatible codecs</a></li>
</ul>
</ul>
</ul>
</ul></div>

<h1><a name="TestsforBasicCallFunctionality-ConfigurationforTests"></a>Configuration for Tests</h1>

<p>The configuration for these tests will all be made from a basic template. Some tests will require configuration to be added to the template. This will be specified in the test if necessary.</p>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedHeader panelHeader" style="border-bottom-width: 1px;"><b>res_sip.conf</b></div><div class="preformattedContent panelContent">
<pre>[local-transport-template](!)
type=transport
bind=127.0.0.1

[local-transport](local-transport-template)
; Place test-specific transport options here

[endpoint-template](!)
type=endpoint
context=default
transport=local-transport
allow=!all,ulaw,alaw

; alice is the caller
[alice](endpoint-template)
; Place alice-specific options here

; bob is the recipient of outbound calls
[bob](endpoint-template)
host=127.0.0.1:5062
; Place bob-specific options here

[auth-template](!)
type=auth

[alice-auth](auth-template)
username=alice
; Place alice-specific auth options here

[bob-auth](auth-template)
username=bob
; Place bob-specific auth options here
; Note: in the first iteration of tests on
; this page, there will never be any bob-specific
; auth options because we do not respond properly
; to auth challenges.
</pre>
</div></div>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedHeader panelHeader" style="border-bottom-width: 1px;"><b>extensions.conf</b></div><div class="preformattedContent panelContent">
<pre>exten =&gt; echo,1,Answer()
same  =&gt;      n,Echo()
same  =&gt;      n,Hangup()

exten =&gt; playback,1,Answer()
same  =&gt;          n,Playback(hello-world)
same  =&gt;          n,Hangup()

exten =&gt; early,1,Progress()
same  =&gt;       n,Playback(hello-world,noanswer)
same  =&gt;       n,Hangup(INTERWORKING)

;This dialstring can be altered once endpoints can be used directly
exten =&gt; bob,1,Dial(Gulp/sip:bob@127.0.0.1:5062)
same  =&gt;     n,Hangup()

</pre>
</div></div>

<h1><a name="TestsforBasicCallFunctionality-Oneleggedtests"></a>One-legged tests</h1>

<p>These tests center around non-bridged calls between Asterisk and an endpoint.</p>

<h2><a name="TestsforBasicCallFunctionality-IncomingCalls"></a>Incoming Calls</h2>

<p>Incoming call tests involve a call placed from endpoint "alice" to Asterisk.</p>

<h3><a name="TestsforBasicCallFunctionality-Nominalpath"></a>Nominal path</h3>

<p>All Nominal path tests will be run multiple times. Each iteration of the test is detailed in the table below.</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Iteration</th>
<th class='confluenceTh'>Transport-specific Data</th>
<th class='confluenceTh'>Alice-specific Data</th>
<th class='confluenceTh'>Alice-auth-specific data</th>
<th class='confluenceTh'>modules.conf addons</th>
<th class='confluenceTh'>Comment</th>
</tr>
<tr>
<td class='confluenceTd'>1</td>
<td class='confluenceTd'>protocol=udp</td>
<td class='confluenceTd'>none</td>
<td class='confluenceTd'>none</td>
<td class='confluenceTd'>none</td>
<td class='confluenceTd'>Identify by username, no auth</td>
</tr>
<tr>
<td class='confluenceTd'>2</td>
<td class='confluenceTd'>protocol=udp</td>
<td class='confluenceTd'>auth = alice-auth</td>
<td class='confluenceTd'>password = swordfish</td>
<td class='confluenceTd'>none</td>
<td class='confluenceTd'>Identify by username, userpass auth</td>
</tr>
<tr>
<td class='confluenceTd'>3</td>
<td class='confluenceTd'>protocol=udp</td>
<td class='confluenceTd'>auth = alice-auth</td>
<td class='confluenceTd'>auth_type=md5<br class="atl-forced-newline" />md5_cred=c9b9e23e2160fd69b19f99116da19711</td>
<td class='confluenceTd'>none</td>
<td class='confluenceTd'>Identify by username, md5 auth</td>
</tr>
<tr>
<td class='confluenceTd'>4</td>
<td class='confluenceTd'>protocol=udp</td>
<td class='confluenceTd'>host = 127.0.0.1:5061</td>
<td class='confluenceTd'>none</td>
<td class='confluenceTd'>noload =&gt; res_sip_endpoint_identifier_user.so</td>
<td class='confluenceTd'>Identify by host, no auth</td>
</tr>
<tr>
<td class='confluenceTd'>5</td>
<td class='confluenceTd'>protocol=udp</td>
<td class='confluenceTd'>host = 127.0.0.1:5061<br class="atl-forced-newline" />auth = alice-auth</td>
<td class='confluenceTd'>password = swordfish</td>
<td class='confluenceTd'>noload =&gt; res_sip_endpoint_identifier_user.so</td>
<td class='confluenceTd'>Identify by host, userpass auth</td>
</tr>
<tr>
<td class='confluenceTd'>6</td>
<td class='confluenceTd'>protocol=udp</td>
<td class='confluenceTd'>host = 127.0.0.1:5061<br class="atl-forced-newline" />auth = alice-auth</td>
<td class='confluenceTd'>auth_type=md5<br class="atl-forced-newline" />md5_cred=c9b9e23e2160fd69b19f99116da19711</td>
<td class='confluenceTd'>noload =&gt; res_sip_endpoint_identifier_user.so</td>
<td class='confluenceTd'>Identify by host, md5 auth</td>
</tr>
<tr>
<td class='confluenceTd'>7</td>
<td class='confluenceTd'>protocol=tcp</td>
<td class='confluenceTd'>none</td>
<td class='confluenceTd'>none</td>
<td class='confluenceTd'>none</td>
<td class='confluenceTd'>Identify by username, no auth (TCP)</td>
</tr>
<tr>
<td class='confluenceTd'>8</td>
<td class='confluenceTd'>protocol=tcp</td>
<td class='confluenceTd'>auth = alice-auth</td>
<td class='confluenceTd'>password = swordfish</td>
<td class='confluenceTd'>none</td>
<td class='confluenceTd'>Identify by username, userpass auth (TCP)</td>
</tr>
<tr>
<td class='confluenceTd'>9</td>
<td class='confluenceTd'>protocol=tcp</td>
<td class='confluenceTd'>auth = alice-auth</td>
<td class='confluenceTd'>auth_type=md5<br class="atl-forced-newline" />md5_cred=c9b9e23e2160fd69b19f99116da19711</td>
<td class='confluenceTd'>none</td>
<td class='confluenceTd'>Identify by username, md5 auth (TCP)</td>
</tr>
<tr>
<td class='confluenceTd'>10</td>
<td class='confluenceTd'>protocol=tcp</td>
<td class='confluenceTd'>host = 127.0.0.1:5061</td>
<td class='confluenceTd'>none</td>
<td class='confluenceTd'>noload =&gt; res_sip_endpoint_identifier_user.so</td>
<td class='confluenceTd'>Identify by host, no auth (TCP)</td>
</tr>
<tr>
<td class='confluenceTd'>11</td>
<td class='confluenceTd'>protocol=tcp</td>
<td class='confluenceTd'>host = 127.0.0.1:5061<br class="atl-forced-newline" />auth = alice-auth</td>
<td class='confluenceTd'>password = swordfish</td>
<td class='confluenceTd'>noload =&gt; res_sip_endpoint_identifier_user.so</td>
<td class='confluenceTd'>Identify by host, userpass auth (TCP)</td>
</tr>
<tr>
<td class='confluenceTd'>12</td>
<td class='confluenceTd'>protocol=tcp</td>
<td class='confluenceTd'>host = 127.0.0.1:5061<br class="atl-forced-newline" />auth = alice-auth</td>
<td class='confluenceTd'>auth_type=md5<br class="atl-forced-newline" />md5_cred=c9b9e23e2160fd69b19f99116da19711</td>
<td class='confluenceTd'>noload =&gt; res_sip_endpoint_identifier_user.so</td>
<td class='confluenceTd'>Identify by host, md5 auth (TCP)</td>
</tr>
</tbody></table>
</div>


<h5><a name="TestsforBasicCallFunctionality-Test1%3AFilePlayback"></a>Test 1: File Playback</h5>

<p>Procedure:<br/>
Alice places a call to extension playback@default</p>

<p>Pass conditions:<br/>
Ensure that the audio reaches Alice properly<br/>
Ensure that Asterisk sends a BYE to Alice</p>

<h5><a name="TestsforBasicCallFunctionality-Test2%3AEcho"></a>Test 2: Echo</h5>

<p>Procedure:<br/>
Alice places a call to extension echo@default.<br/>
Alice plays audio towards Asterisk. The audio is reflected back to her.<br/>
After 5 seconds, Alice hangs up.</p>

<p>Pass conditions:<br/>
Ensure that audio from Alice reaches Asterisk<br/>
Ensure that echoed audio from Asterisk reaches Alice<br/>
Ensure that Asterisk responds to Alice's BYE with a 200 OK</p>

<h3><a name="TestsforBasicCallFunctionality-Offnominalpaths"></a>Off-nominal paths</h3>

<h5><a name="TestsforBasicCallFunctionality-Test1%3AUnknownSource"></a>Test 1: Unknown Source</h5>

<p>Procedure:<br/>
Carol places a call to extension playback@default</p>

<p>Pass conditions:<br/>
Ensure Asterisk sends a 403 to Carol</p>

<h5><a name="TestsforBasicCallFunctionality-Test2%3AAuthenticationfailure"></a>Test 2: Authentication failure</h5>

<p>This test requires several iterations. The differences in each iteration are detailed in the table below</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Iteration</th>
<th class='confluenceTh'>Alice-specific Data</th>
<th class='confluenceTh'>Alice-auth-specific data</th>
<th class='confluenceTh'>Supplied Credentials</th>
<th class='confluenceTh'>Comment</th>
</tr>
<tr>
<td class='confluenceTd'>1</td>
<td class='confluenceTd'>auth=alice-auth</td>
<td class='confluenceTd'>password=swordfish</td>
<td class='confluenceTd'>realm=asterisk username=alice password=halibut</td>
<td class='confluenceTd'>Userpass authentication, wrong password</td>
</tr>
<tr>
<td class='confluenceTd'>2</td>
<td class='confluenceTd'>auth=alice-auth</td>
<td class='confluenceTd'>password=swordfish</td>
<td class='confluenceTd'>realm=asterisk username=carol password=swordfish</td>
<td class='confluenceTd'>Userpass authentication, wrong username</td>
</tr>
<tr>
<td class='confluenceTd'>3</td>
<td class='confluenceTd'>auth=alice-auth</td>
<td class='confluenceTd'>password=swordfish</td>
<td class='confluenceTd'>realm=ampersand username=alice password=swordfish</td>
<td class='confluenceTd'>Userpass authentication, wrong realm</td>
</tr>
<tr>
<td class='confluenceTd'>4</td>
<td class='confluenceTd'>auth=alice-auth</td>
<td class='confluenceTd'>auth_type=md5<br class="atl-forced-newline" />md5_cred=c9b9e23e2160fd69b19f99116da19711</td>
<td class='confluenceTd'>realm=asterisk username=alice password=halibut</td>
<td class='confluenceTd'>MD5 authentication, wrong password</td>
</tr>
<tr>
<td class='confluenceTd'>5</td>
<td class='confluenceTd'>auth=alice-auth</td>
<td class='confluenceTd'>auth_type=md5<br class="atl-forced-newline" />md5_cred=c9b9e23e2160fd69b19f99116da19711</td>
<td class='confluenceTd'>realm=asterisk username=carol password=swordfish</td>
<td class='confluenceTd'>MD5 authentication, wrong username</td>
</tr>
<tr>
<td class='confluenceTd'>6</td>
<td class='confluenceTd'>auth=alice-auth</td>
<td class='confluenceTd'>auth_type=md5<br class="atl-forced-newline" />md5_cred=c9b9e23e2160fd69b19f99116da19711</td>
<td class='confluenceTd'>realm=ampersand username=alice password=swordfish</td>
<td class='confluenceTd'>MD5 authentication, wrong realm</td>
</tr>
</tbody></table>
</div>



<p>Procedure:<br/>
Alice places a call to extension playback@default</p>

<p>Pass Conditions:<br/>
Ensure that Asterisk rejects all INVITEs with credentials with 401s.</p>

<h5><a name="TestsforBasicCallFunctionality-Test3%3AUnknownDestination"></a>Test 3: Unknown Destination</h5>

<p>Procedure:<br/>
Alice places a call to extension carol@default</p>

<p>Pass Conditions:<br/>
Ensure that Asterisk sends a 404 to Alice</p>

<h5><a name="TestsforBasicCallFunctionality-Test4%3AIncompatiblecodecs"></a>Test 4: Incompatible codecs</h5>

<p>For this test, the following Alice-specific data is needed:<br/>
<tt>allow=!all,amr-wb</tt></p>

<p>Procedure:<br/>
Alice places a call to extension playback@default</p>

<p>Pass Conditions:<br/>
Ensure that Asterisk sends a 488 to Alice</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://wiki.asterisk.org/wiki/users/removespacenotification.action?spaceKey=AST">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://wiki.asterisk.org/wiki/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://wiki.asterisk.org/wiki/display/AST/Tests+for+Basic+Call+Functionality">View Online</a>
        |
        <a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=22088169&revisedVersion=3&originalVersion=2">View Changes</a>
                |
        <a href="https://wiki.asterisk.org/wiki/display/AST/Tests+for+Basic+Call+Functionality?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>