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() {
}
fun performAction(action: Action) {
device.value?.also { d ->
when (d.actionsMethodType) {
"method_dtmf_sip_info" -> {
coreContext.core.useInfoForDtmf = true
action.code?.let { call.sendDtmfs(it) }
}
"method_dtmf_rfc_4733" -> {
coreContext.core.useRfc2833ForDtmf = true
action.code?.let { call.sendDtmfs(it) }
}
"method_sip_message" -> {
var params = coreContext.core.createDefaultChatRoomParams()
params.enableGroup(false)
params.enableEncryption(false)
var chatRoom = coreContext.core.searchChatRoom(params,call.remoteAddress, call.remoteAddress, arrayOf(call.remoteAddress!!))
if (chatRoom == null) {
chatRoom = coreContext.core.createChatRoom(params, call.remoteAddress, arrayOf(call.remoteAddress!!))
}
val message = chatRoom?.createMessageFromUtf8(action.code)
message?.send()
val actionMethodType = device.value?.let { d->
d.actionsMethodType
} ?: corePreferences.defaultActionsMethodType
when (actionMethodType) {
"method_dtmf_sip_info" -> {
coreContext.core.useInfoForDtmf = true
action.code?.let { call.sendDtmfs(it) }
}
"method_dtmf_rfc_4733" -> {
coreContext.core.useRfc2833ForDtmf = true
action.code?.let { call.sendDtmfs(it) }
}
"method_sip_message" -> {
var params = coreContext.core.createDefaultChatRoomParams()
params.enableGroup(false)
params.enableEncryption(false)
var chatRoom = coreContext.core.searchChatRoom(params,call.remoteAddress, call.remoteAddress, arrayOf(call.remoteAddress!!))
if (chatRoom == null) {
chatRoom = coreContext.core.createChatRoom(params, call.remoteAddress, arrayOf(call.remoteAddress!!))
}
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