Android - SIP Protocol Tutorial

<p> <style type="text/css"><br /> <!--<br /> *{margin:0;padding:0;border:0;}<br /> body {<br /> font-family: arial, 宋体, serif;<br /> font-size:12px;<br /> }<br /> #nav {<br /> line-height: 24px; list-style-type: none; background:#666;<br /> }<br /> #nav a {<br /> display: block; width: 80px; text-align:center;<br /> }<br /> #nav a:link {<br /> color:#666; text-decoration:none;<br /> }<br /> #nav a:visited {<br /> color:#666;text-decoration:none;<br /> }<br /> #nav a:hover {<br /> color:#FFF;text-decoration:none;font-weight:bold;<br /> }<br /> #nav li {<br /> float: left; width: 80px; background:#CCC;<br /> }<br /> #nav li a:hover{<br /> background:#999;<br /> }<br /> #nav li ul {<br /> line-height: 27px; list-style-type: none;text-align:left;<br /> left: -999em; width: 180px; position: absolute; <br /> }<br /> #nav li ul li{<br /> float: left; width: 180px;<br /> background: #F6F6F6; <br /> }<br /> #nav li ul a{<br /> display: block; width: 180px;width: 156px;text-align:left;padding-left:24px;<br /> }<br /> #nav li ul a:link {<br /> color:#666; text-decoration:none;<br /> }<br /> #nav li ul a:visited {<br /> color:#666;text-decoration:none;<br /> }<br /> #nav li ul a:hover {<br /> color:#F3F3F3;text-decoration:none;font-weight:normal;<br /> background:#C00;<br /> }<br /> #nav li:hover ul {<br /> left: auto;<br /> }<br /> #nav li.sfhover ul {<br /> left: auto;<br /> }<br /> #content {<br /> clear: left; <br /> }<br /> --><br /> </style> </p> <p >SIP stands for (Session Initiation Protocol). It is a protocol that let applications easily set up outgoing and incoming voice calls, without having to manage sessions, transport-level communication, or audio record or playback directly.</p> <h2 >Applications</h2> <p >Some of the common applications of SIP are.</p> <ul class="list" > <li >Video conferencing</li> <li >Instant messaging</li> </ul> <h2 >Requirements</h2> <p >Here are the requirements for developing a SIP application &minus;</p> <ul class="list" > <li >Android OS must be 2.3 or higher</li> <li >You must have a data connection or WIFI</li> <li >You must have an SIP account in order to use this service.</li> </ul> <h2 >SIP Classes</h2> <p >Here is a summary of the classes that are included in the Android SIP API:</p> <table class="table table-bordered" > <tbody > <tr > <th >Sr.No</th> <th >Class and description</th> </tr> <tr > <td >1</td> <td ><b >SipAudioCall</b> <p >Handles an Internet audio call over SIP</p> </td> </tr> <tr > <td >2</td> <td ><b >SipErrorCode</b> <p >Defines error codes returned during SIP actions</p> </td> </tr> <tr > <td >3</td> <td ><b >SipManager</b> <p >Provides APIs for SIP tasks, such as initiating SIP connections, and provides access to related SIP services</p> </td> </tr> <tr > <td >4</td> <td ><b >SipProfile</b> <p >Defines a SIP profile, including a SIP account, domain and server information</p> </td> </tr> <tr > <td >5</td> <td ><b >SipSession</b> <p >Represents a SIP session that is associated with a SIP dialog or a standalone transaction not within a dialog</p> </td> </tr> </tbody> </table> <h2 >Functions of SIP</h2> <p >SIP has following major functions.</p> <ul class="list" > <li >SIP allows for the establishment of user location</li> <li >SIP provides a mechanism for call management</li> <li >SIP provides feature negotiation, so that all the parties in the call can agree to the features supported among them</li> </ul> <h2 >Components of SIP</h2> <p >SIP has two major components which are listed below.</p> <ul class="list" > <li >User Agent Client (UAC)</li> <li >User Agent Server (UAS)</li> </ul> <h3 >UAC</h3> <p >UAC or User Agent Client are those end users who generates requests and send those requests to the server.These requests are generated by the client applications running on their systems.</p> <h3 >UAS</h3> <p >UAS or User Agent Server are those systems which get the request generated by UAC. The UAS process those requests and then according to the requests it generates responses accordingly.</p> <h2 >SipManager</h2> <p >SipManager is an android API for SIP tasks, such as initiating SIP connections, and provides access to related SIP services. This class is the starting point for any SIP actions. You can acquire an instance of it with newInstance().</p> <p >The SipManager has many functions for managing SIP tasks. Some of the functions are listed below.</p> <table class="table table-bordered" > <tbody > <tr > <th >Sr.No</th> <th >Class and description</th> </tr> <tr > <td >1</td> <td ><b >close(String localProfileUri)</b> <p >Closes the specified profile to not make/receive calls</p> </td> </tr> <tr > <td >2</td> <td ><b >getCallId(Intent incomingCallIntent)</b> <p >Gets the call ID from the specified incoming call broadcast intent</p> </td> </tr> <tr > <td >3</td> <td ><b >isOpened(String localProfileUri)</b> <p >Checks if the specified profile is opened in the SIP service for making and/or receiving calls</p> </td> </tr> <tr > <td >4</td> <td ><b >isSipWifiOnly(Context context)</b> <p >Returns true if SIP is only available on WIFI</p> </td> </tr> <tr > <td >5</td> <td ><b >isRegistered(String localProfileUri)</b> <p >Checks if the SIP service has successfully registered the profile to the SIP provider (specified in the profile) for receiving calls</p> </td> </tr> <tr > <td >6</td> <td ><b >isVoipSupported(Context context)</b> <p >Returns true if the system supports SIP-based VOIP API</p> </td> </tr> <tr > <td >7</td> <td ><b >takeAudioCall(Intent incomingCallIntent, SipAudioCall.Listener listener)</b> <p >Creates a SipAudioCall to take an incoming call</p> </td> </tr> <tr > <td >8</td> <td ><b >unregister(SipProfile localProfile, SipRegistrationListener listener)</b> <p >Manually unregisters the profile from the corresponding SIP provider for stop receiving further calls</p> </td> </tr> </tbody> </table>
RangeMem:211.58 KB
返回顶部 留言