Commit 544fc2fb authored by Christophe Deschamps's avatar Christophe Deschamps
Browse files

Fix method type on default actions

parent a36928fd
...@@ -187,27 +187,28 @@ class CallViewModel(val call: Call) : ViewModel() { ...@@ -187,27 +187,28 @@ class CallViewModel(val call: Call) : ViewModel() {
} }
fun performAction(action: Action) { fun performAction(action: Action) {
device.value?.also { d -> val actionMethodType = device.value?.let { d->
when (d.actionsMethodType) { d.actionsMethodType
"method_dtmf_sip_info" -> { } ?: corePreferences.defaultActionsMethodType
coreContext.core.useInfoForDtmf = true when (actionMethodType) {
action.code?.let { call.sendDtmfs(it) } "method_dtmf_sip_info" -> {
} coreContext.core.useInfoForDtmf = true
"method_dtmf_rfc_4733" -> { action.code?.let { call.sendDtmfs(it) }
coreContext.core.useRfc2833ForDtmf = true }
action.code?.let { call.sendDtmfs(it) } "method_dtmf_rfc_4733" -> {
} coreContext.core.useRfc2833ForDtmf = true
"method_sip_message" -> { action.code?.let { call.sendDtmfs(it) }
var params = coreContext.core.createDefaultChatRoomParams() }
params.enableGroup(false) "method_sip_message" -> {
params.enableEncryption(false) var params = coreContext.core.createDefaultChatRoomParams()
var chatRoom = coreContext.core.searchChatRoom(params,call.remoteAddress, call.remoteAddress, arrayOf(call.remoteAddress!!)) params.enableGroup(false)
if (chatRoom == null) { params.enableEncryption(false)
chatRoom = coreContext.core.createChatRoom(params, call.remoteAddress, arrayOf(call.remoteAddress!!)) var chatRoom = coreContext.core.searchChatRoom(params,call.remoteAddress, call.remoteAddress, arrayOf(call.remoteAddress!!))
} if (chatRoom == null) {
val message = chatRoom?.createMessageFromUtf8(action.code) chatRoom = coreContext.core.createChatRoom(params, call.remoteAddress, arrayOf(call.remoteAddress!!))
message?.send()
} }
val message = chatRoom?.createMessageFromUtf8(action.code)
message?.send()
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment