├── .gitignore ├── LICENSE.txt ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── ic_launcher-web.png │ ├── java │ └── org │ │ └── whitequark │ │ └── sipcaller │ │ └── CallActivity.java │ └── res │ ├── layout │ └── activity_call.xml │ ├── menu │ └── options_menu.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── screenshot.png └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /gradlew* 4 | /gradle 5 | /local.properties 6 | /.idea/workspace.xml 7 | /.idea/libraries 8 | .DS_Store 9 | /build 10 | /captures 11 | /.idea 12 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 whitequark 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SIP Caller 2 | ========== 3 | 4 | Stock Android dialer (which is also used in CyanogenMod) does not support 5 | dialing SIP numbers directly; the only way to do it is to add a contact 6 | or run `am start -a android.intent.action.CALL sip:...` in terminal. 7 | 8 | SIP Caller is an app that allows dialing SIP numbers: 9 | 10 | ![screenshot](screenshot.png) 11 | 12 | License 13 | ------- 14 | 15 | [MIT License](LICENSE.txt) -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | applicationId "org.whitequark.sipcaller" 9 | minSdkVersion 15 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | testCompile 'junit:junit:4.12' 25 | compile 'com.android.support:appcompat-v7:22.2.1' 26 | } 27 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/whitequark/Work/android-sdk-linux/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whitequark/SIPCaller/839387c6d4761c50ece5490e4e5ecec5d3bbcc88/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/org/whitequark/sipcaller/CallActivity.java: -------------------------------------------------------------------------------- 1 | package org.whitequark.sipcaller; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | import android.net.Uri; 7 | import android.os.Bundle; 8 | import android.support.v7.app.AppCompatActivity; 9 | import android.text.InputType; 10 | import android.view.Menu; 11 | import android.view.MenuInflater; 12 | import android.view.MenuItem; 13 | import android.view.View; 14 | import android.widget.EditText; 15 | 16 | public class CallActivity extends AppCompatActivity { 17 | 18 | private boolean allowAlphanumeric; 19 | 20 | @Override 21 | protected void onCreate(Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | setContentView(R.layout.activity_call); 24 | 25 | EditText sipDomainEdit = (EditText) findViewById(R.id.sipDomain); 26 | 27 | SharedPreferences sharedPref = getPreferences(Context.MODE_PRIVATE); 28 | allowAlphanumeric = sharedPref.getBoolean("allowAlphanumeric", false); 29 | sipDomainEdit.setText(sharedPref.getString(getString(R.string.saved_domain), "")); 30 | 31 | updateOptions(); 32 | } 33 | 34 | @Override 35 | public boolean onCreateOptionsMenu(Menu menu) { 36 | MenuInflater inflater = getMenuInflater(); 37 | inflater.inflate(R.menu.options_menu, menu); 38 | return true; 39 | } 40 | 41 | @Override 42 | public boolean onPrepareOptionsMenu(Menu menu) { 43 | MenuItem checkable = menu.findItem(R.id.allow_alphanumeric); 44 | checkable.setChecked(allowAlphanumeric); 45 | return true; 46 | } 47 | 48 | @Override 49 | public boolean onOptionsItemSelected(MenuItem item) { 50 | switch (item.getItemId()) { 51 | case R.id.allow_alphanumeric: 52 | allowAlphanumeric = !item.isChecked(); 53 | updateOptions(); 54 | return true; 55 | default: 56 | return false; 57 | } 58 | } 59 | 60 | private void updateOptions() { 61 | EditText phoneNumberEdit = (EditText) findViewById(R.id.phoneNumber); 62 | phoneNumberEdit.setInputType(allowAlphanumeric ? 63 | InputType.TYPE_CLASS_TEXT : 64 | InputType.TYPE_CLASS_PHONE); 65 | } 66 | 67 | public void call(View view) { 68 | EditText phoneNumberEdit = (EditText) findViewById(R.id.phoneNumber); 69 | EditText sipDomainEdit = (EditText) findViewById(R.id.sipDomain); 70 | 71 | String phoneNumber = phoneNumberEdit.getText().toString(); 72 | String sipDomain = sipDomainEdit.getText().toString(); 73 | 74 | SharedPreferences sharedPref = getPreferences(Context.MODE_PRIVATE); 75 | SharedPreferences.Editor editor = sharedPref.edit(); 76 | editor.putString(getString(R.string.saved_domain), sipDomain); 77 | editor.commit(); 78 | 79 | Uri phoneCall = Uri.fromParts("sip", phoneNumber + "@" + sipDomain, ""); 80 | Intent caller = new Intent(Intent.ACTION_CALL, phoneCall); 81 | startActivity(caller); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_call.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 20 | 21 | 27 | 28 | 35 | 36 | 43 | 44 | 45 |