Replaced UA_EVENT_GET_PASSWORD with UA_EVENT_CUSTOM
This commit is contained in:
@@ -242,7 +242,7 @@ static void ua_event_handler(struct ua *ua, enum ua_event ev,
|
|||||||
case UA_EVENT_MWI_NOTIFY:
|
case UA_EVENT_MWI_NOTIFY:
|
||||||
len = re_snprintf(event_buf, sizeof event_buf, "mwi notify,%s", prm);
|
len = re_snprintf(event_buf, sizeof event_buf, "mwi notify,%s", prm);
|
||||||
break;
|
break;
|
||||||
case UA_EVENT_GET_PASSWORD:
|
case UA_EVENT_CUSTOM:
|
||||||
get_password((char *)ua, (char *)call);
|
get_password((char *)ua, (char *)call);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
@@ -267,18 +267,6 @@ static void ua_event_handler(struct ua *ua, enum ua_event ev,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev == UA_EVENT_GET_PASSWORD) {
|
|
||||||
jmethodID methodId = (*env)->GetMethodID(env, g_ctx.mainActivityClz, "getPassword",
|
|
||||||
"(Ljava/lang/String;)Ljava/lang/String;");
|
|
||||||
sprintf(ua_buf, "%lu", (unsigned long)ua);
|
|
||||||
jstring javaUA = (*env)->NewStringUTF(env, ua_buf);
|
|
||||||
jstring javaPassword = (*env)->CallObjectMethod(env, g_ctx.mainActivityObj, methodId, javaUA);
|
|
||||||
const char *password = (*env)->GetStringUTFChars(env, javaPassword, 0);
|
|
||||||
strcpy((char *)call, password);
|
|
||||||
(*env)->ReleaseStringUTFChars(env, javaPassword, password);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
jmethodID methodId = (*env)->GetMethodID(env, g_ctx.mainActivityClz,
|
jmethodID methodId = (*env)->GetMethodID(env, g_ctx.mainActivityClz,
|
||||||
"uaEvent",
|
"uaEvent",
|
||||||
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
|
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
|
||||||
|
|||||||
Reference in New Issue
Block a user