Hi everyone,
We want to add a Cisco SBC to the SIP bridge and secure SIP and SRTP. The SBC currently offers the following crypto attributes:
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:VmzmISmJO70Qntt3ZNqw4od6XHk6m9/kD/8Qeaum|2^48
a=crypto:2 AES_CM_128_HMAC_SHA1_80 inline:j/azhfJjX2cv+xwOOH8W7aks30PDRN7MzyRML7UX|2^48 UNENCRYPTED_SRTCP
a=crypto:3 AES_CM_128_HMAC_SHA1_32 inline:5o4Q3F/jy8IqOAJggwf2gaSx/dKBhq6XeH8tnh1b|2^48
a=crypto:4 AES_CM_128_HMAC_SHA1_32 inline:ab8ZeQ4oNJpe2ORlf4zszeomouaCfCWJdJ7LV2cm|2^48 UNENCRYPTED_SRTCP
Now the SDP parser for the media packet has a problem with the session‑parameter UNENCRYPTED_SRTCP . The parser thinks that everything after the ‘|’ is part of the lifetime value, so it throws a parsing error:
“invalid lifetime parameter “2^48 UNENCRYPTED_SRTCP”: invalid exponent in 2^48 UNENCRYPTED_SRTCP: strconv.ParseUint: parsing “48 UNENCRYPTED_SRTCP”: invalid syntax”
Does anyone have an idea how to handle this?
I haven’t come across this before, so others may have different advice.
As far as I can see, LiveKit do not support UNENCRYPTED_SRTCP, you would need to adjust the Cisco SBC to offer standard SRTP crypto lines without UNENCRYPTED_SRTCP.
And, enable secure trunking as detailed here:
I have created a pull request for the livekit media kit, that such crypto lines are ignored. If the SBC sends no suitable crypto line, there will be no connection, but if there is one, we get a connection.
main ← ypkoller:ingnore-crypto-line-with-session-parameters
opened 01:48PM - 06 Jul 26 UTC
If a crypto line in the SDP offer contains `session-params`, the parser fails wi… th the following error, causing the connection setup to fail entirely:
> "error":"cannot parse srtp profile \"2 AES_CM_128_HMAC_SHA1_80 inline:j/azhfJjX2cv+xwOOH8W7aks30PDRN7MzyRML7UX|2^48 UNENCRYPTED_SRTCP\": invalid lifetime parameter \"2^48 UNENCRYPTED_SRTCP\": invalid exponent in 2^48 UNENCRYPTED_SRTCP: strconv.ParseUint: parsing \"48 UNENCRYPTED_SRTCP\": invalid syntax"}
### Cause
The parser incorrectly treats the session parameter (e.g., `"UNENCRYPTED_SRTCP"`) as part of the key lifetime, which causes `strconv.ParseUint` to fail.
### Solution / Approach
Since the LiveKit SIP Bridge currently does not process optional session parameters as defined in [RFC 4568 Section 6](https://datatracker.ietf.org/doc/html/rfc4568#section-6), these crypto lines should be safely ignored rather than causing a hard crash. Aborting the entire parsing process prevents connections from being established, even if there are alternative, valid crypto lines without session parameters available in the SDP offer.