- Resume baresip application to the activity that was stopped.
- Add example contact when baresip is started the first time. - Fixed showing of new message in the chats and messages list.
This commit is contained in:
@ -7,8 +7,8 @@ android {
|
|||||||
applicationId = 'com.tutpro.baresip'
|
applicationId = 'com.tutpro.baresip'
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 27
|
targetSdkVersion 27
|
||||||
versionCode = 46
|
versionCode = 47
|
||||||
versionName = '6.0.0'
|
versionName = '6.0.1'
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
cFlags '-DHAVE_INTTYPES_H'
|
cFlags '-DHAVE_INTTYPES_H'
|
||||||
|
|||||||
@ -38,7 +38,7 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||||
android:launchMode="singleTask">
|
android:launchMode="singleTop">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
|||||||
@ -1,33 +1 @@
|
|||||||
#
|
#
|
||||||
# SIP accounts - one account per line
|
|
||||||
#
|
|
||||||
# Displayname <sip:user:password@domain;uri-params>;addr-params
|
|
||||||
#
|
|
||||||
# uri-params:
|
|
||||||
# ;transport={udp,tcp,tls}
|
|
||||||
#
|
|
||||||
# addr-params:
|
|
||||||
# ;answermode={manual,early,auto}
|
|
||||||
# ;audio_codecs=opus,pcma,...
|
|
||||||
# ;auth_user=username
|
|
||||||
# ;mediaenc={srtp,srtp-mand,srtp-mandf,dtls_srtp,zrtp}
|
|
||||||
# ;medianat={stun,turn,ice}
|
|
||||||
# ;outbound="sip:primary.example.com;transport=tcp"
|
|
||||||
# ;outbound2=sip:secondary.example.com
|
|
||||||
# ;ptime={10,20,30,40,...}
|
|
||||||
# ;regint=3600
|
|
||||||
# ;pubint=0 (publishing off)
|
|
||||||
# ;regq=0.5
|
|
||||||
# ;rtpkeep={zero,stun,dyna,rtcp}
|
|
||||||
# ;sipnat={outbound}
|
|
||||||
# ;stunuser=STUN/TURN/ICE-username
|
|
||||||
# ;stunpass=STUN/TURN/ICE-password
|
|
||||||
# ;stunserver=stun:[user:pass]@host[:port]
|
|
||||||
# ;video_codecs=h264,h263,...
|
|
||||||
#
|
|
||||||
# Examples:
|
|
||||||
#
|
|
||||||
# <sip:user@domain.com;auth_pass=secret;transport=tcp>
|
|
||||||
# <sip:user@1.2.3.4;auth_pass=secret;transport=tcp>
|
|
||||||
# <sip:user@[2001:df8:0:16:216:6fff:fe91:614c]:5070;transport=tcp;auth_pass=secret>
|
|
||||||
#
|
|
||||||
|
|||||||
@ -126,7 +126,6 @@ class BaresipService: Service() {
|
|||||||
} catch (e: Error) {
|
} catch (e: Error) {
|
||||||
Log.e(LOG_TAG, "Failed to create directory: " + e.toString())
|
Log.e(LOG_TAG, "Failed to create directory: " + e.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
for (a in assets) {
|
for (a in assets) {
|
||||||
file = File("${filesPath}/$a")
|
file = File("${filesPath}/$a")
|
||||||
@ -160,7 +159,7 @@ class BaresipService: Service() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ContactsActivity.restoreContacts(applicationContext.filesDir)
|
||||||
wl.acquire()
|
wl.acquire()
|
||||||
Thread(Runnable { baresipStart(filesPath) }).start()
|
Thread(Runnable { baresipStart(filesPath) }).start()
|
||||||
BaresipService.isServiceRunning = true
|
BaresipService.isServiceRunning = true
|
||||||
|
|||||||
@ -18,6 +18,7 @@ class ChatActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
internal lateinit var chatMessages: ArrayList<Message>
|
internal lateinit var chatMessages: ArrayList<Message>
|
||||||
internal lateinit var mlAdapter: MessageListAdapter
|
internal lateinit var mlAdapter: MessageListAdapter
|
||||||
|
internal lateinit var listView: ListView
|
||||||
internal lateinit var newMessage: EditText
|
internal lateinit var newMessage: EditText
|
||||||
internal lateinit var sendButton: ImageButton
|
internal lateinit var sendButton: ImageButton
|
||||||
internal lateinit var imm: InputMethodManager
|
internal lateinit var imm: InputMethodManager
|
||||||
@ -27,8 +28,11 @@ class ChatActivity : AppCompatActivity() {
|
|||||||
internal lateinit var messageResponseReceiver: BroadcastReceiver
|
internal lateinit var messageResponseReceiver: BroadcastReceiver
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
Log.d("Baresip", "Chat created")
|
||||||
|
|
||||||
setContentView(R.layout.activity_chat)
|
setContentView(R.layout.activity_chat)
|
||||||
|
|
||||||
aor = intent.extras.getString("aor")
|
aor = intent.extras.getString("aor")
|
||||||
@ -62,7 +66,7 @@ class ChatActivity : AppCompatActivity() {
|
|||||||
val headerText = "Account ${aor.substringAfter(":")}"
|
val headerText = "Account ${aor.substringAfter(":")}"
|
||||||
headerView.text = headerText
|
headerView.text = headerText
|
||||||
|
|
||||||
val listView = findViewById(R.id.messages) as ListView
|
listView = findViewById(R.id.messages) as ListView
|
||||||
chatMessages = uaPeerMessages(aor, peerUri)
|
chatMessages = uaPeerMessages(aor, peerUri)
|
||||||
mlAdapter = MessageListAdapter(this, chatMessages)
|
mlAdapter = MessageListAdapter(this, chatMessages)
|
||||||
listView.adapter = mlAdapter
|
listView.adapter = mlAdapter
|
||||||
@ -161,7 +165,14 @@ class ChatActivity : AppCompatActivity() {
|
|||||||
super.onPause()
|
super.onPause()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*override fun onStop() {
|
||||||
|
super.onStop()
|
||||||
|
Log.d("Baresip", "Chat Stopped")
|
||||||
|
}*/
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
Log.d("Baresip", "Chat resumed")
|
||||||
val chatText = BaresipService.chatTexts.get("$aor::$peerUri")
|
val chatText = BaresipService.chatTexts.get("$aor::$peerUri")
|
||||||
if (chatText != null) {
|
if (chatText != null) {
|
||||||
Log.d("Baresip", "Restoring newMessage ${newMessage.text} for $aor::$peerUri")
|
Log.d("Baresip", "Restoring newMessage ${newMessage.text} for $aor::$peerUri")
|
||||||
@ -169,7 +180,10 @@ class ChatActivity : AppCompatActivity() {
|
|||||||
newMessage.requestFocus()
|
newMessage.requestFocus()
|
||||||
BaresipService.chatTexts.remove("$aor::$peerUri")
|
BaresipService.chatTexts.remove("$aor::$peerUri")
|
||||||
}
|
}
|
||||||
super.onResume()
|
mlAdapter.clear()
|
||||||
|
chatMessages = uaPeerMessages(aor, peerUri)
|
||||||
|
mlAdapter = MessageListAdapter(this, chatMessages)
|
||||||
|
listView.adapter = mlAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
|
|||||||
@ -27,7 +27,11 @@ class ChatsActivity: AppCompatActivity() {
|
|||||||
internal lateinit var plusButton: ImageButton
|
internal lateinit var plusButton: ImageButton
|
||||||
|
|
||||||
public override fun onCreate(savedInstanceState: Bundle?) {
|
public override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
Log.d("Baresip", "Chats created")
|
||||||
|
|
||||||
setContentView(R.layout.activity_chats)
|
setContentView(R.layout.activity_chats)
|
||||||
|
|
||||||
filesPath = applicationContext.filesDir.absolutePath
|
filesPath = applicationContext.filesDir.absolutePath
|
||||||
@ -149,6 +153,20 @@ class ChatsActivity: AppCompatActivity() {
|
|||||||
super.onPause()
|
super.onPause()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*override fun onStop() {
|
||||||
|
super.onStop()
|
||||||
|
Log.d("Baresip", "Chats stopped")
|
||||||
|
}*/
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
// Log.d("Baresip", "Chats resumed")
|
||||||
|
clAdapter.clear()
|
||||||
|
uaMessages = uaMessages(aor)
|
||||||
|
clAdapter = ChatListAdapter(this, uaMessages)
|
||||||
|
listView.adapter = clAdapter
|
||||||
|
}
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
android.R.id.home -> {
|
android.R.id.home -> {
|
||||||
|
|||||||
@ -97,7 +97,6 @@ class ContactsActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
|
|
||||||
fun saveContacts(path: File): Boolean {
|
fun saveContacts(path: File): Boolean {
|
||||||
var contents = ""
|
var contents = ""
|
||||||
for (c in Contact.contacts())
|
for (c in Contact.contacts())
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
Log.d("Baresip", "onCreate with intent action " +
|
Log.d("Baresip", "Main created with action " +
|
||||||
intent.getStringExtra("action"))
|
intent.getStringExtra("action"))
|
||||||
|
|
||||||
window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or
|
window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or
|
||||||
@ -182,7 +182,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ContactsActivity.restoreContacts(applicationContext.filesDir)
|
|
||||||
callUri.setAdapter(ArrayAdapter(this, android.R.layout.select_dialog_item,
|
callUri.setAdapter(ArrayAdapter(this, android.R.layout.select_dialog_item,
|
||||||
Contact.contacts().map{Contact -> Contact.name}))
|
Contact.contacts().map{Contact -> Contact.name}))
|
||||||
callUri.threshold = 2
|
callUri.threshold = 2
|
||||||
@ -800,13 +799,18 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
super.onPause()
|
super.onPause()
|
||||||
// Log.d("Baresip", "Paused")
|
// Log.d("Baresip", "Main paused")
|
||||||
visible = false
|
visible = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*override fun onStop() {
|
||||||
|
super.onStop()
|
||||||
|
Log.d("Baresip", "Main stopped")
|
||||||
|
}*/
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
Log.d("Baresip", "Resumed")
|
Log.d("Baresip", "Main resumed")
|
||||||
imm.hideSoftInputFromWindow(callUri.windowToken, 0)
|
imm.hideSoftInputFromWindow(callUri.windowToken, 0)
|
||||||
visible = true
|
visible = true
|
||||||
if (answerCall != "") {
|
if (answerCall != "") {
|
||||||
|
|||||||
3
fastlane/metadata/android/en-US/changelogs/6.0.1.txt
Normal file
3
fastlane/metadata/android/en-US/changelogs/6.0.1.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
- Resume baresip application to the activity that was stopped.
|
||||||
|
- Add example contact when baresip is started the first time.
|
||||||
|
- Fixed showing of new message in the chats and messages list.
|
||||||
Reference in New Issue
Block a user