Giter Site home page Giter Site logo

tisipclient-android's Introduction

This was the quick way of get SIP integration for Appcelerator's Titanium. From Gingerbread onwards Android comes with a SIP stack/API. So I'm just tapping into it. It is not ideal. Firstly it doesn't support a separate Authentication UserId. I think that is from about API 13 onward... Also I'm not terrible confident with what Google has provided.

Here is how to  use it.
You need to include the module in the tiapp.xml:
            <module platform="android" version="0.1">com.yydigital.sipclient</module>

You also need to add these permissions:
            <!-- For Basic Sip -->
            <uses-permission android:name="android.permission.USE_SIP"/>
            <uses-permission android:name="android.permission.INTERNET"/>
            <uses-permission android:name="android.permission.VIBRATE"/>
            <!-- For StartAudio -->
            <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
            <uses-permission android:name="android.permission.WAKE_LOCK"/>
            <uses-permission android:name="android.permission.RECORD_AUDIO"/>
            <!-- For Speaker Mode -->
            <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>


Then the code is something like this:

        var sip = require("com.yydigital.sipclient");
       
        var sipClient = sip.createSipclient({
            username : ...,
            domain : ...,
            password : ...,
            outboundProxy:...,

            autoRegistration : ...,
            sendKeepAlive :...,
            port : ...,
            // Events
            onregistering : function() {
                //callback
            },
            onregisterationfailed : function() {
                //callback
            },
            onregistrationdone : function() {
                //callback
            },
            oncallestablished : function() {
                //callback
            },
            oncallended : function() {
                //callback
            },
            onincomingcall : function(e) {
                //callback
            },
            onringingback : function() {
                //callback
            },
            oncallbusy : function() {
                //callback
            },
            onerror : function(e) {
                //callback
            }
        });
       
The following methods are supported: register, answer, close, hangup, holdCall, initiateCall(address), sendDTMF, toggleMuted, unholdCall.
The following  get properties are support: registered, incall, muted, onhold.
The following  set properties are support: speakerMode.

This is what you will need to do on your own:
All audio files: ringback tones, ringtone, dtmf.
All UIs - meaning everything.
Make the phone wakeup, turn on and launch application on an incoming call. I needed to build another native module for that.

tisipclient-android's People

Contributors

dbankier avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.