@qusaieilouti99/call-manager 0.1.39 → 0.1.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -667,7 +667,7 @@ object CallEngine {
667
667
  val phoneAccountHandle = getPhoneAccountHandle(context)
668
668
  if (telecomManager.getPhoneAccount(phoneAccountHandle) == null) {
669
669
  val phoneAccount = PhoneAccount.builder(phoneAccountHandle, "PingMe Call")
670
- .setCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED or PhoneAccount.CAPABILITY_HOLD)
670
+ .setCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED)
671
671
  .build()
672
672
  try {
673
673
  telecomManager.registerPhoneAccount(phoneAccount)
@@ -2,12 +2,12 @@ package com.margelo.nitro.qusaieilouti99.callmanager
2
2
 
3
3
  import android.content.Context
4
4
  import android.net.Uri
5
- import android.os.Bundle // Explicit import
5
+ import android.os.Bundle
6
6
  import android.telecom.Connection
7
7
  import android.telecom.DisconnectCause
8
- import android.telecom.CallAudioState // Explicit import
8
+ import android.telecom.CallAudioState
9
9
  import android.telecom.VideoProfile
10
- import android.util.Log // Explicit import
10
+ import android.util.Log
11
11
  import org.json.JSONObject
12
12
  import java.util.UUID
13
13
 
@@ -20,7 +20,6 @@ class MyConnection(
20
20
  const val TAG = "MyConnection"
21
21
  }
22
22
 
23
- // Changed to internal val to allow access from MyConnectionService for logging
24
23
  internal val callId: String = try {
25
24
  JSONObject(callDataJson).optString("callId", UUID.randomUUID().toString())
26
25
  } catch (e: Exception) {
@@ -33,7 +32,9 @@ class MyConnection(
33
32
  JSONObject(callDataJson).optString("callType", "Audio")
34
33
  } catch (e: Exception) { "Audio" }
35
34
 
35
+ // Set connection properties and capabilities
36
36
  connectionProperties = Connection.PROPERTY_SELF_MANAGED
37
+ connectionCapabilities = Connection.CAPABILITY_SUPPORT_HOLD or Connection.CAPABILITY_MUTE // Added hold and mute capabilities
37
38
 
38
39
  if (currentCallType == "Video") {
39
40
  Log.d(TAG, "MyConnection for callId $callId initialized as VIDEO call.")
@@ -107,13 +108,13 @@ class MyConnection(
107
108
  override fun onPlayDtmfTone(digit: Char) {
108
109
  super.onPlayDtmfTone(digit)
109
110
  Log.d(TAG, "Playing DTMF tone: $digit for callId: $callId")
110
- // NOTE: DTMF_TONE is not in your current CallEventType.ts enum.
111
+ // NOTE: DTMF_TONE is not in your current CallEventType enum.
111
112
  // If you need to emit this event, you MUST add 'DTMF_TONE' to your CallEventType.ts
112
113
  // and re-run nitro-codegen. For now, it's commented out to prevent compilation error.
113
- // CallEngine.emitEvent(
114
- // CallEventType.DTMF_TONE,
115
- // JSONObject().put("callId", callId).put("digit", digit.toString())
116
- // )
114
+ CallEngine.emitEvent(
115
+ CallEventType.DTMF_TONE,
116
+ JSONObject().put("callId", callId).put("digit", digit.toString())
117
+ )
117
118
  }
118
119
 
119
120
  override fun onStopDtmfTone() {
@@ -121,10 +122,8 @@ class MyConnection(
121
122
  Log.d(TAG, "Stopping DTMF tone for callId: $callId")
122
123
  }
123
124
 
124
- override fun onConnectionEvent(event: String, extras: Bundle?) { // Resolved
125
- super.onConnectionEvent(event, extras) // Correct super call
126
- Log.d(TAG, "Connection event: $event, extras: $extras for callId: $callId")
127
- }
125
+ // REMOVED: onConnectionEvent override since it doesn't exist in the base Connection class
126
+ // If you need connection events, you can send them via sendConnectionEvent() method
128
127
 
129
128
  override fun onShowIncomingCallUi() {
130
129
  super.onShowIncomingCallUi()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qusaieilouti99/call-manager",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "description": "Call manager",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",