Stop event processing when call is auto-rejected
This commit is contained in:
@@ -179,7 +179,7 @@ static void event_handler(enum ua_event ev, struct bevent *event, void *arg)
|
|||||||
ua = uag_find_msg(msg);
|
ua = uag_find_msg(msg);
|
||||||
// There is no call yet and call is thus used to hold SIP message
|
// There is no call yet and call is thus used to hold SIP message
|
||||||
call = (struct call *)msg;
|
call = (struct call *)msg;
|
||||||
len = re_snprintf(event_buf, sizeof event_buf, "%s,%r", prm, &msg->from.auri);
|
len = re_snprintf(event_buf, sizeof event_buf, "%s,%r,%ld", prm, &msg->from.auri, (long)event);
|
||||||
break;
|
break;
|
||||||
case UA_EVENT_CALL_INCOMING:
|
case UA_EVENT_CALL_INCOMING:
|
||||||
len = re_snprintf(event_buf, sizeof event_buf, "call incoming,%s", prm);
|
len = re_snprintf(event_buf, sizeof event_buf, "call incoming,%s", prm);
|
||||||
@@ -1290,6 +1290,16 @@ JNIEXPORT void JNICALL Java_com_tutpro_baresip_Api_sip_1treply(
|
|||||||
(*env)->ReleaseStringUTFChars(env, reason, native_reason);
|
(*env)->ReleaseStringUTFChars(env, reason, native_reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_com_tutpro_baresip_Api_bevent_1stop(
|
||||||
|
JNIEnv *env, jobject obj, jlong event)
|
||||||
|
{
|
||||||
|
(void)env;
|
||||||
|
(void)obj;
|
||||||
|
re_thread_enter();
|
||||||
|
bevent_stop((struct bevent *)event);
|
||||||
|
re_thread_leave();
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_tutpro_baresip_Api_calls_1mute(
|
JNIEXPORT void JNICALL Java_com_tutpro_baresip_Api_calls_1mute(
|
||||||
JNIEnv *env, jobject obj, jboolean mute)
|
JNIEnv *env, jobject obj, jboolean mute)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ object Api {
|
|||||||
|
|
||||||
external fun sip_treply(msg: Long, code: Int, reason: String)
|
external fun sip_treply(msg: Long, code: Int, reason: String)
|
||||||
|
|
||||||
|
external fun bevent_stop(event: Long)
|
||||||
|
|
||||||
external fun call_connect(callp: Long, peer_uri: String): Int
|
external fun call_connect(callp: Long, peer_uri: String): Int
|
||||||
external fun call_hold(callp: Long, hold: Boolean): Int
|
external fun call_hold(callp: Long, hold: Boolean): Int
|
||||||
external fun call_ismuted(callp: Long): Boolean
|
external fun call_ismuted(callp: Long): Boolean
|
||||||
|
|||||||
@@ -714,6 +714,7 @@ class BaresipService: Service() {
|
|||||||
if (toastMsg != "") {
|
if (toastMsg != "") {
|
||||||
Log.d(TAG, "Auto-rejecting incoming call $uap/$peerUri")
|
Log.d(TAG, "Auto-rejecting incoming call $uap/$peerUri")
|
||||||
Api.sip_treply(callp, 486, "Busy Here")
|
Api.sip_treply(callp, 486, "Busy Here")
|
||||||
|
Api.bevent_stop(ev[2].toLong())
|
||||||
toast(toastMsg)
|
toast(toastMsg)
|
||||||
val name = "callwaiting_$toneCountry"
|
val name = "callwaiting_$toneCountry"
|
||||||
val resourceId = applicationContext.resources.getIdentifier(
|
val resourceId = applicationContext.resources.getIdentifier(
|
||||||
|
|||||||
Reference in New Issue
Block a user