Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call failed with cause: Code: [488], Cause: Incompatible SDP, Reason: Not acceptable here #524

Open
tallyssonDev-cportal opened this issue Feb 19, 2025 · 7 comments
Labels
Out of scope The problem described isnt an issue with this package, its likely something else in their setup

Comments

@tallyssonDev-cportal
Copy link

Describe the bug
I can't make calls with dart-sip-ua, and I don't know what else I can do. I have configured SIP using the examples below, but without success. Is there something I forgot or did wrong?

Examples on my code
Obs.: The debug prints are in Brazilian Portuguese because it's my native languag

local_sip_impl.dart

[...]

class LocalSipImpl extends SipService {
  final StreamController<CallStatus> _callStateController =
    StreamController<CallStatus>.broadcast();
  final SIPUAHelper _sipHelper = SIPUAHelper();

  Call? _incomingCall;

  CallStatus _currentCallStatus = CallStatus.connecting;
  CallStatus get currentCallStatus => _currentCallStatus;

  LocalSipImpl({
    required super.baseUrl,
    required super.codec,
    required super.dtmf,
  });

  @override
  Stream<CallStatus> get onCallStateChanged => _callStateController.stream;

  void updateCallStatus(CallStatus status) {
    _currentCallStatus = status;
    _callStateController.add(status);
  }


  @override
  Future<bool> connect(String branch, String password) async {
    debugPrint('CallStatus atual: $currentCallStatus');
    debugPrint('sipID: $branch, sipPassword: $password');
    try {
      debugPrint('Buscando conexão com o SIP...');

      UaSettings settings = UaSettings();

      settings.uri = 'sip:$branch@${Config.sip.sipDomain}';
      settings.displayName = branch;
      settings.authorizationUser = branch;
      settings.password = password;
      settings.userAgent = 'SIP Client';
      settings.dtmfMode = Config.sip.dtmf;
      settings.transportType = TransportType.TCP;
      settings.host = Config.sip.sipDomain;
      settings.port = Config.sip.sipPort.toString();
      settings.register = true;
      settings.register_expires = 600;
      settings.iceServers = [
        {'urls': 'stun:stun.l.google.com:19302'}
      ];
      settings.iceTransportPolicy = IceTransportPolicy.ALL;
      settings.sip_message_delay = 1;
      settings.realm = Config.sip.sipDomain;
      settings.ha1 = null;

      debugPrint('Settings: $settings');
      await _sipHelper.start(settings);

      _sipHelper.addSipUaHelperListener(_SipEventHandler(this));
      updateCallStatus(CallStatus.loggedIn);
      return true;
    } catch (e) {
      _callStateController.add(CallStatus.loginFailed);
      debugPrint('Erro ao conectar ao servidor SIP: $e');
      return false;
    }
  }

  @override
  Future<void> makeCall(String sipUri) async {
    try {
      bool micGranted = await _requestMicrophonePermission();
      debugPrint('Resultado da permissão de microfone: $micGranted');
      if (!micGranted) {
        updateCallStatus(CallStatus.error);
        return;
      }

      await _sipHelper.call(sipUri, voiceOnly: true);
      
      updateCallStatus(CallStatus.calling);
      
      _sipHelper.addSipUaHelperListener(_SipEventHandler(this));
      
      debugPrint('Chamada iniciada para: $sipUri');
    } catch (e) {
      updateCallStatus(CallStatus.error);
      debugPrint('Erro ao fazer a chamada: $e');
      rethrow;
    }
  }

[...]

config.dart

[...]

class SipConfig {
  const SipConfig();
  final String codec = "g711";
  final DtmfMode dtmf = DtmfMode.RFC2833;
  final String sipId = "211";
  final String sipPassword = "password"; 
  final String sipDomain = "192.168.104.2"; 
  final String sipPort = "5060";
}

[...]

Logs

I/flutter (15978): Chamei a permissão de microfone
I/flutter (15978): Status da permissão de microfone: PermissionStatus.granted
I/flutter (15978): Resultado da permissão de microfone: true
I/flutter (15978): [2025-02-19 10:35:50.961] Level.debug ua.dart:252 ::: call()
I/flutter (15978): [2025-02-19 10:35:50.964] Level.debug rtc_session.dart:70 ::: new
I/flutter (15978): [2025-02-19 10:35:50.967] Level.debug rtc_session.dart:238 ::: connect()
I/flutter (15978): Chamada iniciada para: 203
I/flutter (15978): Status do call state mudou: CallStatus.calling
I/org.webrtc.Logging(15978): NativeLibrary: Loading native library: jingle_peerconnection_so
I/org.webrtc.Logging(15978): NativeLibrary: Loading library: jingle_peerconnection_so
D/nativeloader(15978): Load /data/app/~~G9latNBixnMaCo6MHtP6fw==/com.cportal.vipmobile-ufyhNGSQoYvaNNgUS0Eysg==/base.apk!/lib/arm64-v8a/libjingle_peerconnection_so.so using ns clns-4 from class loader (caller=/data/app/~~G9latNBixnMaCo6MHtP6fw==/com.cportal.vipmobile-ufyhNGSQoYvaNNgUS0Eysg==/base.apk): ok
I/org.webrtc.Logging(15978): PeerConnectionFactory: PeerConnectionFactory was initialized without an injected Loggable. Any existing Loggable will be deleted.
I/org.webrtc.Logging(15978): WebRtcAudioManagerExternal: Sample rate is set to 48000 Hz
I/org.webrtc.Logging(15978): WebRtcAudioManagerExternal: Sample rate is set to 48000 Hz
I/org.webrtc.Logging(15978): JavaAudioDeviceModule: createAudioDeviceModule
I/org.webrtc.Logging(15978): JavaAudioDeviceModule: HW NS will be used.
I/org.webrtc.Logging(15978): JavaAudioDeviceModule: HW AEC will be used.
I/org.webrtc.Logging(15978): JavaAudioDeviceModule: Low latency mode will be used.
I/org.webrtc.Logging(15978): WebRtcAudioEffectsExternal: ctor@[name=main, id=2]
I/org.webrtc.Logging(15978): WebRtcAudioRecordExternal: ctor@[name=main, id=2]
I/org.webrtc.Logging(15978): WebRtcAudioTrackExternal: ctor@[name=main, id=2]
I/org.webrtc.Logging(15978): JavaAudioDeviceModule: setNoiseSuppressorEnabled: true
W/org.webrtc.Logging(15978): WebRtcAudioRecordExternal: SetNoiseSuppressorEnabled(true)
E/org.webrtc.Logging(15978): WebRtcAudioEffectsExternal: Attempting to enable or disable nonexistent NoiseSuppressor.
I/org.webrtc.Logging(15978): EglBase14Impl: Using OpenGL ES version 2
W/VideoCapabilities(15978): Unrecognized profile/level 0/3 for video/mpeg2
W/VideoCapabilities(15978): Unrecognized profile/level 0/3 for video/mpeg2
I/org.webrtc.Logging(15978): WebRtcAudioRecordExternal: enableBuiltInAEC(true)
I/org.webrtc.Logging(15978): WebRtcAudioEffectsExternal: setAEC(true)
I/org.webrtc.Logging(15978): WebRtcAudioRecordExternal: enableBuiltInNS(true)
I/org.webrtc.Logging(15978): WebRtcAudioEffectsExternal: setNS(true)
I/org.webrtc.Logging(15978): PeerConnectionFactory: onNetworkThreadReady
I/org.webrtc.Logging(15978): PeerConnectionFactory: onWorkerThreadReady
I/org.webrtc.Logging(15978): PeerConnectionFactory: onSignalingThreadReady
I/flutter (15978): [2025-02-19 10:35:51.375] Level.debug rtc_session.dart:1655 ::: emit "peerconnection"
I/flutter (15978): [2025-02-19 10:35:51.376] Level.debug rtc_session.dart:3219 ::: newRTCSession()
I/flutter (15978): [2025-02-19 10:35:51.380] Level.debug sip_ua_helper.dart:234 ::: newRTCSession => Instance of 'EventNewRTCSession'
I/flutter (15978): Call state changed: CallStateEnum.CALL_INITIATION
I/flutter (15978): Call state changed: CallStateEnum.CALL_INITIATION
I/flutter (15978): Call state changed: CallStateEnum.CALL_INITIATION
I/flutter (15978): Status do call state mudou: CallStatus.calling
I/flutter (15978): Status do call state mudou: CallStatus.calling
I/flutter (15978): Status do call state mudou: CallStatus.calling
I/FlutterWebRTCPlugin(15978): getUserMedia(audio): mandatory: [], optional: [googNoiseSuppression: true, googEchoCancellation: true, echoCancellation: true, googEchoCancellation2: true, googDAEchoCancellation: true]
D/FlutterWebRTCPlugin(15978): MediaStream id: 05743d33-78a1-40cb-b2f6-58c4bb03644e
I/flutter (15978): [2025-02-19 10:35:51.593] Level.debug rtc_session.dart:3224 ::: session connecting
I/flutter (15978): [2025-02-19 10:35:51.595] Level.debug rtc_session.dart:3225 ::: emit "connecting"
I/flutter (15978): [2025-02-19 10:35:51.598] Level.debug sip_ua_helper.dart:277 ::: call connecting
I/flutter (15978): Call state changed: CallStateEnum.CONNECTING
I/flutter (15978): Call state changed: CallStateEnum.CONNECTING
I/flutter (15978): Call state changed: CallStateEnum.CONNECTING
I/flutter (15978): [2025-02-19 10:35:51.607] Level.debug rtc_session.dart:1662 ::: createLocalDescription()
I/flutter (15978): Status do call state mudou: CallStatus.connecting
I/flutter (15978): Status do call state mudou: CallStatus.connecting
I/flutter (15978): Status do call state mudou: CallStatus.connecting
I/AudioManager(15978): In isSpeakerphoneOn(), calling application: com.cportal.vipmobile
I/AudioManager(15978): In stopBluetoothSco(), calling application: com.cportal.vipmobile
I/AudioManager(15978): In setSpeakerphoneOn(), on: true, calling application: com.cportal.vipmobile
I/flutter (15978): Call state changed: CallStateEnum.STREAM
I/flutter (15978): Call state changed: CallStateEnum.STREAM
I/flutter (15978): Call state changed: CallStateEnum.STREAM
I/flutter (15978): Status do call state mudou: CallStatus.error
I/flutter (15978): Status do call state mudou: CallStatus.error
I/flutter (15978): Status do call state mudou: CallStatus.error
I/org.webrtc.Logging(15978): WebRtcAudioRecordExternal: enableBuiltInAEC(true)
I/org.webrtc.Logging(15978): WebRtcAudioEffectsExternal: setAEC(true)
I/org.webrtc.Logging(15978): WebRtcAudioRecordExternal: enableBuiltInNS(true)
I/org.webrtc.Logging(15978): WebRtcAudioEffectsExternal: setNS(true)
I/org.webrtc.Logging(15978): NetworkMonitor: Start monitoring with native observer -5476376645335915520 fieldTrialsString: 
W/org.webrtc.Logging(15978): NetworkMonitorAutoDetect: Unable to obtain permission to request a cellular network.
I/org.webrtc.Logging(15978): NetworkMonitorAutoDetect: Network handle: 432902426637 becomes available: 100
D/FlutterWebRTCPlugin(15978): onIceGatheringChangeGATHERING
D/FlutterWebRTCPlugin(15978): onIceCandidate
D/FlutterWebRTCPlugin(15978): onIceCandidate
D/FlutterWebRTCPlugin(15978): onIceCandidate
I/org.webrtc.Logging(15978): NetworkMonitorAutoDetect: handle: 432902426637 capabilities changed: [ Transports: WIFI Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&VALIDATED&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED&NOT_VCN_MANAGED LinkUpBandwidth>=54727Kbps LinkDnBandwidth>=58221Kbps TransportInfo: <SSID: <unknown ssid>, BSSID: 02:00:00:00:00:00, MAC: 02:00:00:00:00:00, Security type: 4, Supplicant state: COMPLETED, HE Eight Max VHT Spatial Streams Supported AP: false, Eight Max VHT Spatial streams support: false, Wi-Fi standard: 5, RSSI: -56, Link speed: 390Mbps, Tx Link speed: 390Mbps, Max Supported Tx Link speed: 433Mbps, Rx Link speed: 390Mbps, Max Supported Rx Link speed: 433Mbps, Frequency: 5240MHz, Net ID: -1, Metered hint: false, score: 60, CarrierMerged: false, SubscriptionId: -1, IsPrimary: -1> SignalStrength: -56 UnderlyingNetworks: Null]
I/org.webrtc.Logging(15978): NetworkMonitorAutoDetect: handle: 432902426637 link properties changed
D/FlutterWebRTCPlugin(15978): onIceCandidate
D/FlutterWebRTCPlugin(15978): onIceCandidate
D/FlutterWebRTCPlugin(15978): onIceCandidate
I/flutter (15978): [2025-02-19 10:35:52.634] Level.debug rtc_session.dart:1722 ::: emit "sdp"
I/flutter (15978): [2025-02-19 10:35:52.640] Level.debug rtc_session.dart:2395 ::: emit "sending" [request]
I/flutter (15978): [2025-02-19 10:35:52.653] Level.debug socket_transport.dart:128 ::: Socket Transport send()
I/flutter (15978): [2025-02-19 10:35:52.663] Level.debug sip_message.dart:276 ::: Outgoing Message: SipMethod.INVITE body: v=0
I/flutter (15978): o=- 2952910561285795517 2 IN IP4 127.0.0.1
I/flutter (15978): s=-
I/flutter (15978): t=0 0
I/flutter (15978): a=group:BUNDLE 0
I/flutter (15978): a=extmap-allow-mixed
I/flutter (15978): a=msid-semantic: WMS 05743d33-78a1-40cb-b2f6-58c4bb03644e
I/flutter (15978): m=audio 22744 UDP/TLS/RTP/SAVPF 111 63 9 102 0 8 13 110 126
I/flutter (15978): c=IN IP4 177.92.76.186
I/flutter (15978): a=rtcp:9 IN IP4 0.0.0.0
I/flutter (15978): a=candidate:2849099679 1 udp 2122260223 192.168.101.168 46485 typ host generation 0 network-id 3 network-cost 10
I/flutter (15978): a=candidate:1137877947 1 udp 2122129151 127.0.0.1 49212 typ host generation 0 network-id 1
I/flutter (15978): a=candidate:1392423219 1 udp 2122202367 ::1 39510 typ host generation 0 network-id 2
I/flutter (15978): a=candidate:3178788655 1 tcp 1518149375 127.0.0.1 38653 typ host tcptype passive generation 0 network-id 1
I/flutter (15978): a=candidate:2891212199 1 tcp 1518222591 ::1 37141 typ host tcptype passive generation 0 network-id 2
I/flutter (15978): a=candidate:3174492316 1 udp 1686052607 177.92.76.186 22744 typ srflx raddr 192.168.101.168 rport 46485 generation 0 network-id 3 network-cost 10
I/flutter (15978): [2025-02-19 10:35:52.667] Level.debug tcp_socket.dart:134 ::: send()
I/flutter (15978): [2025-02-19 10:35:52.671] Level.debug tcp_socket_impl.dart:62 ::: send: 
I/flutter (15978): 
I/flutter (15978): INVITE sip:[email protected] SIP/2.0
I/flutter (15978): Via: SIP/2.0/TCP zfm9tvrzvkbf.invalid;branch=z9hG4bK7386513800000000
I/flutter (15978): Max-Forwards: 69
I/flutter (15978): To: <sip:[email protected]>
I/flutter (15978): From: "211" <sip:[email protected]>;tag=fbnv0zsgd9
I/flutter (15978): Call-ID: py9896yoynk51o4ay4w6
I/flutter (15978): CSeq: 9576 INVITE
I/flutter (15978): Contact: <sip:[email protected];transport=TCP;ob>
I/flutter (15978): Content-Type: application/sdp
I/flutter (15978): Session-Expires: 120
I/flutter (15978): Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
I/flutter (15978): Supported: timer,ice,replaces,outbound
I/flutter (15978): User-Agent: SIP Client
I/flutter (15978): Content-Length: 1981
I/flutter (15978): 
I/flutter (15978): v=0
I/flutter (15978): o=- 2952910561285795517 2 IN IP4 127.0.0.1
I/flutter (15978): s=-
I/flutter (15978): t=0 0
I/flutter (15978): a=group:BUNDLE 0
I/flutter (15978): a=extmap-allow-mixed
I/flutter (15978): a=msid-semantic: WMS 05743d33-78a1-40cb-b2f6-58c4bb03644e
I/flutter (15978): m=audio 22744 UDP/TLS/RTP/SAVPF 111 63 9 102 0 8 13 110 126
I/flutter (15978): c=IN IP4 177.92.76.186
I/flutter (15978): a=rtcp:9 IN IP4 0.0.0.0
I/flutter (15978): a=candidate:2849099679 1 udp 2122260223 192.168.101.168 46485 typ host generation 0 network-id 3 network-cost 10
I/flutter (15978): a=candidate:1137877947 1 udp 2122
I/flutter (15978): [2025-02-19 10:35:52.692] Level.debug tcp_socket.dart:167 ::: Received TcpSocket data
I/flutter (15978): [2025-02-19 10:35:52.697] Level.debug socket_transport.dart:273 ::: received binary message:
I/flutter (15978): 
I/flutter (15978): SIP/2.0 401 Unauthorized
I/flutter (15978): Via: SIP/2.0/TCP zfm9tvrzvkbf.invalid;branch=z9hG4bK7386513800000000;received=192.168.101.168
I/flutter (15978): From: "211" <sip:[email protected]>;tag=fbnv0zsgd9
I/flutter (15978): To: <sip:[email protected]>;tag=as2f2e85f9
I/flutter (15978): Call-ID: py9896yoynk51o4ay4w6
I/flutter (15978): CSeq: 9576 INVITE
I/flutter (15978): Server: IPBX-2.11.0(11.25.3)
I/flutter (15978): Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
I/flutter (15978): Supported: replaces, timer
I/flutter (15978): WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="346dda26"
I/flutter (15978): Content-Length: 0
I/flutter (15978): 
I/flutter (15978): 
I/flutter (15978): [2025-02-19 10:35:52.736] Level.debug socket_transport.dart:128 ::: Socket Transport send()
I/flutter (15978): [2025-02-19 10:35:52.738] Level.debug tcp_socket.dart:134 ::: send()
I/flutter (15978): [2025-02-19 10:35:52.742] Level.debug digest_authentication.dart:198 ::: authenticate() | using qop=null [a2:INVITE:sip:[email protected]]
I/flutter (15978): [2025-02-19 10:35:52.747] Level.debug digest_authentication.dart:204 ::: authenticate() | response generated
I/flutter (15978): [2025-02-19 10:35:52.757] Level.debug socket_transport.dart:128 ::: Socket Transport send()
I/flutter (15978): [2025-02-19 10:35:52.759] Level.debug sip_message.dart:276 ::: Outgoing Message: SipMethod.INVITE body: v=0
I/flutter (15978): o=- 2952910561285795517 2 IN IP4 127.0.0.1
I/flutter (15978): s=-
I/flutter (15978): t=0 0
I/flutter (15978): a=group:BUNDLE 0
I/flutter (15978): a=extmap-allow-mixed
I/flutter (15978): a=msid-semantic: WMS 05743d33-78a1-40cb-b2f6-58c4bb03644e
I/flutter (15978): m=audio 22744 UDP/TLS/RTP/SAVPF 111 63 9 102 0 8 13 110 126
I/flutter (15978): c=IN IP4 177.92.76.186
I/flutter (15978): a=rtcp:9 IN IP4 0.0.0.0
I/flutter (15978): a=candidate:2849099679 1 udp 2122260223 192.168.101.168 46485 typ host generation 0 network-id 3 network-cost 10
I/flutter (15978): a=candidate:1137877947 1 udp 2122129151 127.0.0.1 49212 typ host generation 0 network-id 1
I/flutter (15978): a=candidate:1392423219 1 udp 2122202367 ::1 39510 typ host generation 0 network-id 2
I/flutter (15978): a=candidate:3178788655 1 tcp 1518149375 127.0.0.1 38653 typ host tcptype passive generation 0 network-id 1
I/flutter (15978): a=candidate:2891212199 1 tcp 1518222591 ::1 37141 typ host tcptype passive generation 0 network-id 2
I/flutter (15978): a=candidate:3174492316 1 udp 1686052607 177.92.76.186 22744 typ srflx raddr 192.168.101.168 rport 46485 generation 0 network-id 3 network-cost 10
I/flutter (15978): [2025-02-19 10:35:52.761] Level.debug tcp_socket.dart:134 ::: send()
I/flutter (15978): [2025-02-19 10:35:52.763] Level.debug invite_client.dart:90 ::: Timer D expired for transaction z9hG4bK7386513800000000
I/flutter (15978): [2025-02-19 10:35:52.764] Level.debug tcp_socket_impl.dart:62 ::: send: 
I/flutter (15978): 
I/flutter (15978): ACK sip:[email protected] SIP/2.0
I/flutter (15978): Via: SIP/2.0/TCP zfm9tvrzvkbf.invalid;branch=z9hG4bK7386513800000000
I/flutter (15978): Max-Forwards: 69
I/flutter (15978): To: <sip:[email protected]>;tag=as2f2e85f9
I/flutter (15978): From: "211" <sip:[email protected]>;tag=fbnv0zsgd9
I/flutter (15978): Call-ID: py9896yoynk51o4ay4w6
I/flutter (15978): CSeq: 9576 ACK
I/flutter (15978): Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
I/flutter (15978): Supported: outbound
I/flutter (15978): User-Agent: SIP Client
I/flutter (15978): Content-Length: 0
I/flutter (15978): 
I/flutter (15978): [2025-02-19 10:35:52.769] Level.debug tcp_socket_impl.dart:62 ::: send: 
I/flutter (15978): 
I/flutter (15978): INVITE sip:[email protected] SIP/2.0
I/flutter (15978): Via: SIP/2.0/TCP zfm9tvrzvkbf.invalid;branch=z9hG4bK8589517220000000
I/flutter (15978): Max-Forwards: 69
I/flutter (15978): To: <sip:[email protected]>
I/flutter (15978): From: "211" <sip:[email protected]>;tag=fbnv0zsgd9
I/flutter (15978): Call-ID: py9896yoynk51o4ay4w6
I/flutter (15978): CSeq: 9577 INVITE
I/flutter (15978): Authorization: Digest algorithm=MD5, username="211", realm="asterisk", nonce="346dda26", uri="sip:[email protected]", response="5b4c63bd8816bdd90749087ad992e66e"
I/flutter (15978): Contact: <sip:[email protected];transport=TCP;ob>
I/flutter (15978): Content-Type: application/sdp
I/flutter (15978): Session-Expires: 120
I/flutter (15978): Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
I/flutter (15978): Supported: timer,ice,replaces,outbound
I/flutter (15978): User-Agent: SIP Client
I/flutter (15978): Content-Length: 1981
I/flutter (15978): 
I/flutter (15978): v=0
I/flutter (15978): o=- 2952910561285795517 2 IN IP4 127.0.0.1
I/flutter (15978): s=-
I/flutter (15978): t=0 0
I/flutter (15978): a=group:BUNDLE 0
I/flutter (15978): a=extmap-allow-mixed
I/flutter (15978): a=msid-semantic: WMS 05743d33-78a1-40cb-b2f6-58c4bb03644e
I/flutter (15978): m=audio 22744 UDP/TLS/RTP/SAVPF 111 63 9 102 0 8 13 110 126
I/flutter (15978): c=IN IP4 177.92.76.186
I/flutter (15978): a=rtcp:9 
I/flutter (15978): [2025-02-19 10:35:52.788] Level.debug tcp_socket.dart:167 ::: Received TcpSocket data
I/flutter (15978): [2025-02-19 10:35:52.790] Level.debug socket_transport.dart:273 ::: received binary message:
I/flutter (15978): 
I/flutter (15978): SIP/2.0 488 Not acceptable here
I/flutter (15978): Via: SIP/2.0/TCP zfm9tvrzvkbf.invalid;branch=z9hG4bK8589517220000000;received=192.168.101.168
I/flutter (15978): From: "211" <sip:[email protected]>;tag=fbnv0zsgd9
I/flutter (15978): To: <sip:[email protected]>;tag=as2f2e85f9
I/flutter (15978): Call-ID: py9896yoynk51o4ay4w6
I/flutter (15978): CSeq: 9577 INVITE
I/flutter (15978): Server: IPBX-2.11.0(11.25.3)
I/flutter (15978): Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
I/flutter (15978): Supported: replaces, timer
I/flutter (15978): Content-Length: 0
I/flutter (15978): 
I/flutter (15978): 
I/flutter (15978): [2025-02-19 10:35:52.801] Level.debug socket_transport.dart:128 ::: Socket Transport send()
I/flutter (15978): [2025-02-19 10:35:52.804] Level.debug tcp_socket.dart:134 ::: send()
I/flutter (15978): [2025-02-19 10:35:52.808] Level.debug rtc_session.dart:2415 ::: receiveInviteResponse()  current status: 1 
I/flutter (15978): [2025-02-19 10:35:52.813] Level.debug rtc_session.dart:3268 ::: session failed
I/flutter (15978): [2025-02-19 10:35:52.814] Level.debug rtc_session.dart:3271 ::: emit "_failed"
I/flutter (15978): [2025-02-19 10:35:52.817] Level.debug rtc_session.dart:1501 ::: close()
I/flutter (15978): [2025-02-19 10:35:52.819] Level.debug rtc_session.dart:3282 ::: emit "failed"
I/flutter (15978): [2025-02-19 10:35:52.821] Level.debug sip_ua_helper.dart:288 ::: call failed with cause: Code: [488], Cause: Incompatible SDP, Reason: Not acceptable here
I/flutter (15978): Call state changed: CallStateEnum.FAILED
@mikaelwills
Copy link
Collaborator

mikaelwills commented Feb 20, 2025

@tallyssonDev-cportal Theres FAQ's in the read me of the package that answers this.
I need to put the FAQ's in an issue template.

You need to setup your server codecs

@tallyssonDev-cportal
Copy link
Author

@mikaelwills Is there no way to add to the plugin a choice of which codecs can be used to solve this SDP issue?

And one more question, of the listed codecs, are those that work for the plugin or those that don't?

And thanks for the feedback!

@mikaelwills
Copy link
Collaborator

@tallyssonDev-cportal The codecs that are used come deep from within the WebRTC package, I think they're also determined by what hardware is being used so you really arent able to 'choose'.
Basically its far beyong the scope of this package to try and add or select what codecs you want.

The ones listed in the FAQ are ones I observed in my outgoing SDP invite.
If im right about the above I should probably ammend the FAQ to say something like: Send an invite out, observe which codecs are present in your SDP and make sure your server supports them.

In FreePBX for example there's list of checkboxes for codecs, make sure these ones are ticked. Easy.

@mikaelwills mikaelwills added Out of scope The problem described isnt an issue with this package, its likely something else in their setup and removed bug Something isn't working labels Feb 20, 2025
@mikaelwills
Copy link
Collaborator

mikaelwills commented Feb 20, 2025

@tallyssonDev-cportal Actuallty yea so looking in your SDP there is:

I/flutter (15978): m=audio 22744 UDP/TLS/RTP/SAVPF 111 63 9 102 0 8 13 110 126

These numbers: 111 63 9 102 0 8 13 110 126
refer to which codecs you need to make your server support

Their names are defined here:
https://en.wikipedia.org/wiki/RTP_payload_formats

Also chagtGPT provided this insight:

111: Typically used for Opus
63: G.722
9: G.711u (PCMU)
102: iLBC
0: PCMA
8: PCMU
13: G.722.1
110: G.729
126: iSAC

So these ^^ are what you should tick in your PBX server.

I will ammend the FAQ's to find that line in your SDP then put in that link plus the gpt response and any other materials I find

@tallyssonDev-cportal
Copy link
Author

@mikaelwills I will look for this alternative and then come back with the result, thank you!

@mounarezgui
Copy link

mounarezgui commented Feb 27, 2025

We are experiencing the same issue with setRemoteDescription for the answer from the remote when they pick the call, with version 1.0.1.
It looks like it's unable to accept "a=msid-semantic: WMS 47CC7768-F6E6-45AC-A89C-4A8233F328BB" any idea why?

Following the sdp:

v=0
o=- 1739799970014 1739799970017 IN IP4 195.192.208.35
s=CROWN
c=IN IP4 195.192.208.35
t=0 0
a=group:BUNDLE 0
a=msid-semantic: WMS 47CC7768-F6E6-45AC-A89C-4A8233F328BB
a=extmap-allow-mixed
a=fingerprint:sha-256 82:86:FD:7C:91:DF:0F:65:46:57:C0:D7:DF:6B:4B:AE:7A:3D:DC:65:D3:9E:2B:30:40:FF:09:BA:8E:C6:B6:64
a=ice-ufrag:xxxxxx
a=ice-pwd:xxxxxxxxxxxxx
a=ice-options:trickle
a=ice-lite
m=audio 59031 UDP/TLS/RTP/SAVPF 111 9 8 0 126
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10;useinbandfec=1
a=rtcp-fb:111 transport-cc
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:126 telephone-event/8000
a=fmtp:126 0-16
a=msid:47CC7768-F6E6-45AC-A89C-4A8233F328BB 47E596DB-8D4E-4758-AAAF-3D21D5B84473
a=sendrecv
a=ssrc:1645542616 cname:PITotJMhbQzhV/vO
a=setup:passive
a=end-of-candidates
a=rtcp-xr:voip-metrics stat-summary=loss,dup,jitt
a=candidate:0 1 UDP 2122252543 195.192.208.35 59031 typ host
a=candidate:1 1 TCP 2105524479 195.192.208.35 59031 typ host tcptype passive
a=rtcp-mux

@mikaelwills
Copy link
Collaborator

mikaelwills commented Feb 27, 2025

@mounarezgui

Your SDP codecs line: m=audio 59031 UDP/TLS/RTP/SAVPF 111 9 8 0 126

Go into your server and tick these codecs:

111 Opus | High-quality, low-latency (48 kHz)
9 G722 | Wideband codec (16 kHz)
8 PCMA (G711a) | A-law PCM (8 kHz)
0 PCMU (G711u) | µ-law PCM (8 kHz)
126 telephone-event | DTMF (RFC 4733, out-of-band tones)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Out of scope The problem described isnt an issue with this package, its likely something else in their setup
Projects
None yet
Development

No branches or pull requests

3 participants