astoeckel / femtosip

Minimal Python SIP implementation ringing phones as a door bell replacement
GNU Affero General Public License v3.0
48 stars 15 forks source link

Add PJSIP compatibility, remove redundant semicolons #5

Closed waffle-stomper closed 2 years ago

waffle-stomper commented 2 years ago

Firstly, thank you so much for femtosip. It was exactly what I needed to complete a personal project.

PJSIP compatibility

PJSIP on FreePBX/Asterisk sends extra keys in the WWW-Authenticate field. E.g.

Digest realm="asterisk",nonce="1234567890/aabbccddeeff00112233445566778899",opaque="a1b2c3d4e5f6",algorithm=md5,qop="auth"

The existing regex for parsing WWW-Authenticate doesn't match when extra keys are present and femtosip crashes.

This is fixed in 4f54a14d2d825be05c0757e95d9d1181373fa916 by matching zero or more additional characters after the nonce value.

Redundant semicolons

Some lines ended in semicolons. While this is technically valid in Python, it's discouraged.

astoeckel commented 2 years ago

Awesome, thank you so much for testing femtosip with other base stations and for taking your time to write this PR! Looks all good to me.