MT#65603 AmSipMsg: fix sip option parser

Do not use the original iterator's position,
when removing the first token from something like:
`Supported: timer, path, replaces`

Instead build the remaining option list by appending
only those kept, trimmed tokens with commas between them.

(P.S.: this is not related to the latest SST changes)

Change-Id: I5a274072dbbc336494a0802ff7e80f0bf0b51813
master
Donat Zenichev 5 days ago
parent c6a33f4193
commit fd830c41e3

@ -195,13 +195,16 @@ void removeOptionTag(string& hdrs, const string& hdr_name, const string& tag) {
bool found = false;
for (std::vector<string>::iterator it=options_v.begin();
it != options_v.end(); it++) {
if (trim(*it, " ")==tag) {
string option = trim(*it, " ");
if (option == tag) {
found = true;
continue;
}
if (it != options_v.begin())
o_hdr = ", ";
o_hdr+=*it;
if (option.empty())
continue;
if (!o_hdr.empty())
o_hdr += ", ";
o_hdr += option;
}
if (!found)
return;

Loading…
Cancel
Save