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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Pod/Classes/SipInvite.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ - (NSArray *) extractValueForKey:(NSString *)key fromPacket:(char*)packet {
*/
- (NSString *) findLineContaining:(NSString *)key inPacket:(char*) packet {
NSString *packetAsString = [NSString stringWithUTF8String:packet];
NSArray *lines = [packetAsString componentsSeparatedByString:@"\n"];

NSString *lineSeparator = [packetAsString rangeOfString:@"\r\n"].location != NSNotFound ? @"\r\n" : @"\n";
NSArray *lines = [packetAsString componentsSeparatedByString:lineSeparator];

for (id line in lines) {
if ([line hasPrefix:key]) {
return [line stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"%@: ", key] withString:@""];
Expand Down