PJSIP sound problem with apple app sandbox

36 views Asked by At

Hallo fellow programmers,

I am currently writing an sip phone application for macOS using purebasic and react. All call functions are working perfectly fine expect in the apple app sandbox.

The problem is that the callee cant hear the caller. While checking with wireshark i noticed that the sound data is missing. Vice versa the caller can hear the callee.

The microphone permission for the sandbox is set.

Here is my CallMediaState routine:

Procedure HandleCallMediaState(CallId.pjsua_call_id)
  
  Protected.pj_status_t Status
  Protected.pjsua_call_info CallInfo
  Protected.pjsua_conf_port_id PortId, PortId2
  Protected Dim CallIdArray.pjsua_call_id(20)
  Protected.unsigned CallCount = ArraySize(CallIdArray())
  Protected.i i  
  
  Status = pjsua_call_get_info(CallId, @CallInfo)
  If Status = #PJ_SUCCESS
    If CallInfo\media_status = #PJSUA_CALL_MEDIA_ACTIVE
      
      ; connect call to the user
      PortId = pjsua_call_get_conf_port(CallId) 

       pjsua_conf_connect(PortId, 0)
       pjsua_conf_connect(0, PortId)

      ; if in conference mode, connect to every other call:
      If ConferenceMode
        Status = pjsua_enum_calls(@CallIdArray(0), @CallCount)
        For i = 0 To CallCount - 1
          If CallId <> CallIdArray(i)
            PortId2 = pjsua_call_get_conf_port(CallIdArray(i))
            pjsua_conf_connect(PortId, PortId2)
            pjsua_conf_connect(PortId2, PortId)
            Debug "Connected Ports: " + Str(PortId) + " <---> " + Str(PortId2)
          EndIf
        Next
      EndIf
      
    EndIf
  Else
    Debug Get_pj_strerror(Status)
  EndIf
  
EndProcedure

Any solutions or sugestions?

Tried out different sound devices / buildscripts / compilers /permissions without solving the problem.

0

There are 0 answers