Added Setting to turn on/off SIP request/response trace to Logcat
This commit is contained in:
@ -1657,6 +1657,12 @@ Java_com_tutpro_baresip_Api_uag_1reset_1transp(JNIEnv *env, jobject thiz, jboole
|
||||
(void)uag_reset_transp(reg, reinvite);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_tutpro_baresip_Api_uag_1enable_1sip_1trace(JNIEnv *env, jobject thiz, jboolean enable) {
|
||||
LOGD("enabling sip trace (%d)\n", enable);
|
||||
(void)uag_enable_sip_trace(enable);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_tutpro_baresip_Api_net_1debug(JNIEnv *env, jobject thiz) {
|
||||
net_debug_log();
|
||||
|
||||
@ -12,6 +12,7 @@ object Api {
|
||||
external fun video_codecs(): String
|
||||
external fun uag_current_set(uap: String)
|
||||
external fun uag_reset_transp(reg: Boolean, reinvite: Boolean)
|
||||
external fun uag_enable_sip_trace(enable: Boolean)
|
||||
external fun ua_account(ua: String): String
|
||||
external fun ua_alloc(uri: String): String
|
||||
external fun ua_update_account(ua: String): Int
|
||||
|
||||
@ -1146,6 +1146,7 @@ class BaresipService: Service() {
|
||||
var filesPath = ""
|
||||
var downloadsPath = ""
|
||||
var logLevel = 2
|
||||
var sipTrace = false
|
||||
|
||||
val uas = ArrayList<UserAgent>()
|
||||
val status = ArrayList<Int>()
|
||||
|
||||
@ -17,13 +17,14 @@ import android.widget.AdapterView
|
||||
|
||||
class ConfigActivity : AppCompatActivity() {
|
||||
|
||||
internal lateinit var autoStart: CheckBox
|
||||
internal lateinit var listenAddr: EditText
|
||||
internal lateinit var dnsServers: EditText
|
||||
internal lateinit var certificateFile: CheckBox
|
||||
internal lateinit var caFile: CheckBox
|
||||
internal lateinit var debug: CheckBox
|
||||
internal lateinit var reset: CheckBox
|
||||
private lateinit var autoStart: CheckBox
|
||||
private lateinit var listenAddr: EditText
|
||||
private lateinit var dnsServers: EditText
|
||||
private lateinit var certificateFile: CheckBox
|
||||
private lateinit var caFile: CheckBox
|
||||
private lateinit var debug: CheckBox
|
||||
private lateinit var sipTrace: CheckBox
|
||||
private lateinit var reset: CheckBox
|
||||
|
||||
private var oldAutoStart = ""
|
||||
private var oldListenAddr = ""
|
||||
@ -105,6 +106,9 @@ class ConfigActivity : AppCompatActivity() {
|
||||
oldLogLevel = dbCv[0]
|
||||
debug.isChecked = oldLogLevel == "0"
|
||||
|
||||
sipTrace = findViewById(R.id.SipTrace) as CheckBox
|
||||
sipTrace.isChecked = BaresipService.sipTrace
|
||||
|
||||
reset = findViewById(R.id.Reset) as CheckBox
|
||||
reset.isChecked = false
|
||||
|
||||
@ -242,6 +246,9 @@ class ConfigActivity : AppCompatActivity() {
|
||||
save = true
|
||||
}
|
||||
|
||||
BaresipService.sipTrace = sipTrace.isChecked
|
||||
Api.uag_enable_sip_trace(sipTrace.isChecked)
|
||||
|
||||
if (reset.isChecked) {
|
||||
Config.reset(this)
|
||||
save = false
|
||||
@ -337,6 +344,10 @@ class ConfigActivity : AppCompatActivity() {
|
||||
findViewById(R.id.DebugTitle) as TextView-> {
|
||||
Utils.alertView(this, getString(R.string.debug), getString(R.string.debug_help))
|
||||
}
|
||||
findViewById(R.id.SipTraceTitle) as TextView-> {
|
||||
Utils.alertView(this, getString(R.string.sip_trace),
|
||||
getString(R.string.sip_trace_help))
|
||||
}
|
||||
findViewById(R.id.ResetTitle) as TextView-> {
|
||||
Utils.alertView(this, getString(R.string.reset_config),
|
||||
getString(R.string.reset_config_help))
|
||||
|
||||
@ -207,6 +207,34 @@
|
||||
</CheckBox>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:orientation="horizontal" >
|
||||
<TextView
|
||||
android:id="@+id/SipTraceTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toStartOf="@id/SipTrace"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@android:color/black"
|
||||
android:onClick="onClick"
|
||||
android:text="@string/sip_trace" >
|
||||
</TextView>
|
||||
<CheckBox
|
||||
android:id="@+id/SipTrace"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="end"
|
||||
android:checked="false" >
|
||||
</CheckBox>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@ -306,6 +306,10 @@
|
||||
Tehdasasetus on 800x600.</string>
|
||||
<string name="debug">Lokiviestit</string>
|
||||
<string name="debug_help">Jos merkitty, baresip tuottaa debug- ja info-tason Logcat-viestejä.</string>
|
||||
<string name="sip_trace">SIP-sanomien jäljitys</string>
|
||||
<string name="sip_trace_help">Jos merkitty ja jos Lokiviestit on merkitty, Logcat-viestit
|
||||
sisältävät myös lähetetyt ja vastaanotetut SIP-sanomat. On aina merkitsemättä sovelluksen
|
||||
käynnistyessä.</string>
|
||||
<string name="reset_config">Palauta oletusasetukset</string>
|
||||
<string name="reset_config_help">Jos merkitty, oletusasetukset palautetaan, kun
|
||||
baresip seuraavan kerran käynnistetään.
|
||||
|
||||
@ -272,7 +272,10 @@
|
||||
<string name="video_size_help">Size of transmitted video frames (width x height).
|
||||
Factory default is 800x600.</string>
|
||||
<string name="debug">Debug</string>
|
||||
<string name="debug_help">Provides debug and info level log message availability in Logcat.</string>
|
||||
<string name="debug_help">If checked, provides debug and info level log messages to Logcat.</string>
|
||||
<string name="sip_trace">SIP Trace</string>
|
||||
<string name="sip_trace_help">If checked and if Debug is checked, provides also SIP
|
||||
request and response trace to Logcat. Unchecked automatically at baresip start.</string>
|
||||
<string name="reset_config">Reset to Factory Defaults</string>
|
||||
<string name="reset_config_help">If checked, settings are reset to factory default values.</string>
|
||||
<string name="read_cert_error">Failed to read file \'cert.pem\' from Download directory.</string>
|
||||
|
||||
Reference in New Issue
Block a user