diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt index 6bbcf197..b30e6707 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt @@ -827,15 +827,15 @@ class BaresipService: Service() { } else { val name = "callwaiting_$toneCountry" - val resourceId = applicationContext.resources.getIdentifier( + val resourceId = resources.getIdentifier( name, "raw", - applicationContext.packageName + packageName ) if (resourceId != 0) { playUnInterrupted(resourceId, 1) } else { - Log.e(TAG, "Callwaiting tone $name.wav not found\")") + Log.e(TAG, "Callwaiting tone $name.wav not found") } if (ua.account.callHistory) { CallHistoryNew(aor, peerUri, "in").add() @@ -1791,10 +1791,10 @@ class BaresipService: Service() { private fun playRingBack() { if (mediaPlayer == null) { val name = "ringback_$toneCountry" - val resourceId = applicationContext.resources.getIdentifier( + val resourceId = resources.getIdentifier( name, "raw", - applicationContext.packageName) + packageName) if (resourceId != 0) { mediaPlayer = MediaPlayer.create(this, resourceId) mediaPlayer?.isLooping = true @@ -1809,10 +1809,10 @@ class BaresipService: Service() { private fun playBusy() { if (mediaPlayer == null ) { val name = "busy_$toneCountry" - val resourceId = applicationContext.resources.getIdentifier( + val resourceId = resources.getIdentifier( name, "raw", - applicationContext.packageName) + packageName) if (resourceId != 0) { mediaPlayer = MediaPlayer.create(this, resourceId) mediaPlayer?.setOnCompletionListener {