Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Fix for invite messages sent from Windows machine #191

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

kesslermichael
Copy link

Fix for invite messages sent from Windows machine (with \r\n new line characters instead of \n)

Issue number

{if exists provide related issue}

Expected behavior

Caller name should be parsed successfully from the invite message

Actual behavior

When the invite message arrives with \r\n new lines then it is not parsed properly - each parsed line ends with "\r". It causes the caller name not to be parsed because it doesn't match the corresponding regex in VSLCall.m:758 (the regex is '.+\\s<.+>')

Description of fix

Before the fix in SipInvite.m:89 the invite message was split to separate lines using "\n".
The fix is to check whether the line separators in the invite message are "\r\n" and use it if so.
Otherwise fallback to "\n".

Other info

{anything else that might be related/useful}

Copy link
Contributor

@jeremynorman89 jeremynorman89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it not use something like what is described here to make it a bit more generic?

@kesslermichael
Copy link
Author

@jeremynorman89 I agree that it might be improved.
Specifically the linked suggestion may end up with irrelevant empty lines in case of "\r\n" new line sign (like in my case).
It can be fixed by filtering out empty lines though.

@jeremynorman89
Copy link
Contributor

I think that would be a better solution still, even if you need to filter empty lines out.

@ChrisKontosEU
Copy link
Contributor

Any updates for this MR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants