BelledonneCommunications / linphone-sdk

Mirror for linphone-sdk (https://gitlab.linphone.org/BC/public/linphone-sdk.git)
GNU Affero General Public License v3.0
107 stars 81 forks source link

Lihphone fails with 488 to INVITE with 2 optional streams (encrypted and plain) #334

Open davidcsi opened 1 year ago

davidcsi commented 1 year ago

Hello guys!

I've been testing the sdk and we need to send an optional SDES media to linphone, which is accepted by other clients Linphone's sdk fails when sending multiple a=media

it should select the encrypted stream and accept the call, but it's failing with 488

v=0
o=FreeSWITCH 1693399738 1693399739 IN IP4 1.2.3.4
s=FreeSWITCH
c=IN IP4 1.2.3.4
t=0 0
m=audio 32102 RTP/SAVP 0 102 3 101 13 104
a=rtpmap:0 PCMU/8000
a=rtpmap:102 opus/48000/2
a=fmtp:102 useinbandfec=1; maxaveragebitrate=18000; maxplaybackrate=8000; sprop-maxcapturerate=8000; ptime=20; minptime=10; maxptime=120
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=rtpmap:13 CN/8000
a=rtpmap:104 CN/48000
a=rtcp-mux
a=rtcp:32102 IN IP4 1.2.3.4
a=crypto:1 AEAD_AES_256_GCM_8 inline:RAljZYCchVcceasO2doiQaz461C3K8Ijzm3A7CyeshLJXer7tOijXcO7Fik=
a=crypto:2 AEAD_AES_256_GCM inline:E5iU8QoUrWuumMzXqBQokss2XXOm18SMeVv9SuoVcT9zJhHFjUQSjO1vqKo=
a=crypto:3 AEAD_AES_128_GCM_8 inline:JdqsXoCKFJF9sA5SyYPoWej4nTggwxHo5rNE4A==
a=crypto:4 AEAD_AES_128_GCM inline:MpFds95p8kkosg11k6kIxEBZUivYki6PaaCgcA==
a=crypto:5 AES_256_CM_HMAC_SHA1_80 inline:O7rTJv0ZIuS/urU1lEvPsZ52NTo/lvgy3UTRwHD8dWsMTMv2uSXxY7AoUcM8wQ==
a=crypto:6 AES_192_CM_HMAC_SHA1_80 inline:Czu7np9lokleKf2dauHET1qouK2xW3E8J/nTwSY27FfFObq2wHA=
a=crypto:7 AES_CM_128_HMAC_SHA1_80 inline:IOkAuD619xKkBjULk7bcwHYC6xNLQnEhtmBraZv7
a=crypto:8 AES_256_CM_HMAC_SHA1_32 inline:OXwUw2wDYa+eliv1SDF/J5fcOIpDhz/uhx8m7reWeprfjGSpGixR57M8byzjsA==
a=crypto:9 AES_192_CM_HMAC_SHA1_32 inline:8lnsRKF948mh+Zjwot/OBdxXjuoFeJ2ysrEV3Y1cTlW/RqApwKQ=
a=crypto:10 AES_CM_128_HMAC_SHA1_32 inline:qf1BoGThmoYx6bDhiKuAZhg26ohr0IgRM1nWoTe4
a=crypto:11 AES_CM_128_NULL_AUTH inline:POJxaIo4J382nD2dQN3UKqKSFXEnyJjwmEjbEI3l
a=ptime:20
m=audio 32102 RTP/AVP 0 102 3 101 13 104
a=rtpmap:0 PCMU/8000
a=rtpmap:102 opus/48000/2
a=fmtp:102 useinbandfec=1; maxaveragebitrate=18000; maxplaybackrate=8000; sprop-maxcapturerate=8000; ptime=20; minptime=10; maxptime=120
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=rtpmap:13 CN/8000
a=rtpmap:104 CN/48000
a=rtcp-mux
a=rtcp:32102 IN IP4 1.2.3.4
a=ptime:20
  1. To Reproduce (mandatory) Send a call to linphone from FS with the flag: rtp_secure_media=optional

  2. Expected behavior (mandatory) Linphone select encryption if configured to do so.

  3. Please complete the following information (mandatory)

    • Device: realme C35, iphone 8.
    • OS: android 13
    • Version of the SDK 5.2.94
    • Where you did got it from: local build
  4. SDK logs (mandatory)

2023-08-30 17:44:00:677 belle-sip-message-New server dialog [0x28054a500] , local tag [ViNmda3], remote tag [j22SQ3Kc2262D]
2023-08-30 17:44:00:677 liblinphone-message-op [0x11d65d6c0] : setOrUpdateDialog() current=[0x0] new=[0x28054a500]
2023-08-30 17:44:00:677 liblinphone-message-New incoming call from ["+[PHONE]" <sip:+[PHONE]@4.3.2.1>] to [sip:[PHONE]@mydomain.com]
2023-08-30 17:44:00:691 belle-sip-message-belle_sip_object_to_alloc_string(): hint buffer was too short while doing to_string() for belle_sdp_raw_attribute_t, retrying
2023-08-30 17:44:00:691 liblinphone-message-Found payload PCMU/8000 fmtp=
2023-08-30 17:44:00:691 liblinphone-message-Found payload opus/48000 fmtp=useinbandfec=1; maxaveragebitrate=18000; maxplaybackrate=8000; sprop-maxcapturerate=8000; ptime=20; minptime=10; maxptime=120
2023-08-30 17:44:00:691 liblinphone-message-Found payload GSM/8000 fmtp=
2023-08-30 17:44:00:691 liblinphone-message-Found payload telephone-event/8000 fmtp=0-15
2023-08-30 17:44:00:691 liblinphone-message-Found payload CN/8000 fmtp=
2023-08-30 17:44:00:691 liblinphone-message-Found payload CN/48000 fmtp=
2023-08-30 17:44:00:691 mediastreamer-error-Unsupported crypto suite 'AEAD_AES_256_GCM_8' with parameters ''
2023-08-30 17:44:00:691 liblinphone-warning-Failed to parse crypto-algo: 'AEAD_AES_256_GCM_8'
2023-08-30 17:44:00:691 liblinphone-warning-sdp has a strange a= line (1 AEAD_AES_256_GCM_8 inline:RAljZYCchVcceasO2doiQaz461C3K8Ijzm3A7CyeshLJXer7tOijXcO7Fik=)
2023-08-30 17:44:00:691 mediastreamer-error-Unsupported crypto suite 'AEAD_AES_128_GCM_8' with parameters ''
2023-08-30 17:44:00:692 liblinphone-warning-Failed to parse crypto-algo: 'AEAD_AES_128_GCM_8'
2023-08-30 17:44:00:692 liblinphone-warning-sdp has a strange a= line (3 AEAD_AES_128_GCM_8 inline:JdqsXoCKFJF9sA5SyYPoWej4nTggwxHo5rNE4A==)
2023-08-30 17:44:00:692 mediastreamer-error-Unsupported crypto suite 'AES_192_CM_HMAC_SHA1_80' with parameters ''
2023-08-30 17:44:00:692 liblinphone-warning-Failed to parse crypto-algo: 'AES_192_CM_HMAC_SHA1_80'
2023-08-30 17:44:00:692 liblinphone-warning-sdp has a strange a= line (6 AES_192_CM_HMAC_SHA1_80 inline:Czu7np9lokleKf2dauHET1qouK2xW3E8J/nTwSY27FfFObq2wHA=)
2023-08-30 17:44:00:692 mediastreamer-error-Unsupported crypto suite 'AES_192_CM_HMAC_SHA1_32' with parameters ''
2023-08-30 17:44:00:692 liblinphone-warning-Failed to parse crypto-algo: 'AES_192_CM_HMAC_SHA1_32'
2023-08-30 17:44:00:692 liblinphone-warning-sdp has a strange a= line (9 AES_192_CM_HMAC_SHA1_32 inline:8lnsRKF948mh+Zjwot/OBdxXjuoFeJ2ysrEV3Y1cTlW/RqApwKQ=)
2023-08-30 17:44:00:692 mediastreamer-error-Unsupported crypto suite 'AES_CM_128_NULL_AUTH' with parameters ''
2023-08-30 17:44:00:692 liblinphone-warning-Failed to parse crypto-algo: 'AES_CM_128_NULL_AUTH'
2023-08-30 17:44:00:692 liblinphone-warning-sdp has a strange a= line (11 AES_CM_128_NULL_AUTH inline:POJxaIo4J382nD2dQN3UKqKSFXEnyJjwmEjbEI3l)
2023-08-30 17:44:00:692 liblinphone-message-Found: 6 valid crypto lines
2023-08-30 17:44:00:693 liblinphone-message-Found payload PCMU/8000 fmtp=
2023-08-30 17:44:00:693 liblinphone-message-Found payload opus/48000 fmtp=useinbandfec=1; maxaveragebitrate=18000; maxplaybackrate=8000; sprop-maxcapturerate=8000; ptime=20; minptime=10; maxptime=120
2023-08-30 17:44:00:693 liblinphone-message-Found payload GSM/8000 fmtp=
2023-08-30 17:44:00:693 liblinphone-message-Found payload telephone-event/8000 fmtp=0-15
2023-08-30 17:44:00:693 liblinphone-message-Found payload CN/8000 fmtp=
2023-08-30 17:44:00:693 liblinphone-message-Found payload CN/48000 fmtp=
2023-08-30 17:44:00:694 liblinphone-message-Start measurement of [Get call log.].
2023-08-30 17:44:00:695 liblinphone-message-Duration of [Get call log.]: 0ms.
2023-08-30 17:44:00:697 liblinphone-message-New MediaSession [0x281d832b8] initialized (liblinphone version: 5.2.94)
2023-08-30 17:44:00:698 liblinphone-message-MainDb::addEvent() of type ConferenceCallStarted (value 3)
2023-08-30 17:44:00:698 liblinphone-message-Insert new conference call in database: 2beb8044-c221-123c-4cb9-0ae3932257e3
2023-08-30 17:44:00:698 liblinphone-message-Updating sip address display name in database: `sip:+[PHONE]@4.3.2.1`.
2023-08-30 17:44:00:707 liblinphone-message-Linphone core [0x11a8c2600] notified [call_log_updated]
2023-08-30 17:44:00:707 liblinphone-message-Rtp bundle is disabled.
2023-08-30 17:44:00:708 liblinphone-message-Found media local-ip from signaling: 192.168.0.14
2023-08-30 17:44:00:709 liblinphone-warning-Disabling stream at index 1 from copyOldStreams().
2023-08-30 17:44:00:710 bctbx-warning-BctbxException occurred: 
2023-08-30 17:44:00:711 liblinphone-message-[LIME]  /Users/derek.ma/Git/linphone/sdk/lime/src/lime_localStorage.cpp:269 Cannot find Lime User sip:[PHONE]@mydomain.com;gr=urn:uuid:da7f4bc7-e4ef-00a9-8cdf-2efdeff742e3 in DB while setting up identity key for ZRTP auxiliary secret
2023-08-30 17:44:00:711 liblinphone-message-stream#0 [audio] in state [Stopped]: multicast role is [inactive]
2023-08-30 17:44:00:712 ortp-message-RtpSession bound to [0.0.0.0] ports [55492] [52693]
2023-08-30 17:44:00:712 liblinphone-message-Configured srtp crypto suite: AES_CM_128_HMAC_SHA1_80 
2023-08-30 17:44:00:712 liblinphone-message-Configured srtp crypto suite: AES_CM_128_HMAC_SHA1_32 
2023-08-30 17:44:00:712 liblinphone-message-Configured srtp crypto suite: AES_256_CM_HMAC_SHA1_80 
2023-08-30 17:44:00:712 liblinphone-message-Configured srtp crypto suite: AES_256_CM_HMAC_SHA1_32 
2023-08-30 17:44:00:712 liblinphone-message-Configured srtp crypto suite: AEAD_AES_128_GCM 
2023-08-30 17:44:00:712 liblinphone-message-Configured srtp crypto suite: AEAD_AES_256_GCM 
2023-08-30 17:44:00:712 mediastreamer-message-Creating ZRTP engine on rtp session [0x11aa13400] ssrc 0xace9e603
2023-08-30 17:44:00:714 ortp-message-rtp_session_enable_network_simulation:DISABLING NETWORK SIMULATION
2023-08-30 17:44:00:714 mediastreamer-message-Setting DSCP to 46 for MSAudio stream.
2023-08-30 17:44:00:714 liblinphone-message-Created stream of type audio at index 0: stream#0 [audio] in state [Stopped]
2023-08-30 17:44:00:714 liblinphone-message-Disabled stream at index 1
2023-08-30 17:44:00:715 liblinphone-message-[MS2AudioStream] setting type of soundcard 0x281a41d10 to voice
2023-08-30 17:44:00:715 liblinphone-message-[MS2AudioStream] setting type of soundcard 0x281a41d10 to voice
2023-08-30 17:44:00:715 liblinphone-message-Doing SDP offer/answer process of type incoming
2023-08-30 17:44:00:715 liblinphone-message-Declining mline 0, no corresponding stream in local capabilities description.
2023-08-30 17:44:00:715 liblinphone-message-Doing offer/answer processing with specific provider for codec [opus]
2023-08-30 17:44:00:715 liblinphone-message-No match for GSM/8000/1
2023-08-30 17:44:00:715 liblinphone-message-No match for CN/8000/1
2023-08-30 17:44:00:715 liblinphone-message-No match for CN/48000/1
2023-08-30 17:44:00:715 liblinphone-message-[Initiate Incoming Stream] Found matching configurations: local configuration index 0 remote offered configuration index 0
2023-08-30 17:44:00:715 liblinphone-error-Unable to retrieve contact address from proxy confguration for call session 0x281d832b8 (local address sip:[PHONE]@mydomain.com remote address "+[PHONE]" <sip:+[PHONE]@4.3.2.1>).
2023-08-30 17:44:00:715 liblinphone-warning-Session [0x281d832b8] will be declined: 
2023-08-30 17:44:00:716 liblinphone-warning-- negotiated SDP is empty
2023-08-30 17:44:00:716 liblinphone-warning-- negotiated security is compatible with core settings
2023-08-30 17:44:00:716 liblinphone-message-MainDb::addEvent() of type ConferenceCallStarted (value 3)
2023-08-30 17:44:00:716 liblinphone-warning-Cannot add ConferenceCallStarted event as conference call is already stored in db for call-id: 2beb8044-c221-123c-4cb9-0ae3932257e3
2023-08-30 17:44:00:716 liblinphone-error-MainDb::addEvent() of type ConferenceCallStarted failed.
2023-08-30 17:44:00:716 liblinphone-message-Linphone core [0x11a8c2600] notified [call_log_updated]
2023-08-30 17:44:00:716 belle-sip-message-channel [0x1317d8000]: message sent to [TLS://mydomain.com:443], size: [623] bytes
SIP/2.0 488 Not acceptable here
Via: SIP/2.0/TLS mydomain.com:443;received=1.2.3.4;branch=z9hG4bK0e7a.8ff9950a4023cdc80a748a825fa2382d.0
From: "+[PHONE]" <sip:+[PHONE]@4.3.2.1>;tag=j22SQ3Kc2262D
To: <sip:[PHONE]@mydomain.com>;tag=ViNmda3
Call-ID: 2beb8044-c221-123c-4cb9-0ae3932257e3
CSeq: 72162128 INVITE
User-Agent: Unknown
Supported: replaces, outbound, gruu, path
Content-Length: 0

Many thanks!!

davidcsi commented 1 year ago

Hello! Any help with this?

Thanks