some fixes on de-registering with multiple contacts.

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@604 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 19 years ago
parent f379c6e324
commit 710f0035b3

@ -177,7 +177,10 @@ bool ContactInfo::parse_uri() {
size_t p1 = 0;
int eq = 0; const char* sip_prot = "SIP:";
uri_user = ""; uri_host = ""; uri_port = ""; uri_param = "";
if (uri.empty())
return false;
while (pos<uri.length()) {
char c = uri[pos];
// DBG("(1) c = %c, st = %d\n", c, st);
@ -291,7 +294,7 @@ bool ContactInfo::parse_uri() {
case uS4: uri_port = uri.substr(p1+1, pos-p1-1); break;
case uS5: uri_param = uri.substr(p1+1, pos-p1-1); break;
case uS0:
case uS1: { DBG("ERROR while parsing uri"); return false; } break;
case uS1: { DBG("ERROR while parsing uri\n"); return false; } break;
};
return true;
}

@ -343,10 +343,14 @@ void SIPRegistration::onSipReply(AmSipReply& reply) {
if (!contacts.length()) {
DBG("received positive reply to de-Register \n");
active = false;
remove = true;
} else {
end = 0;
while (!found) {
if (contacts.length() == end)
break;
if (!server_contact.parse_contact(contacts, end, end)) {
ERROR("while parsing contact\n");
break;
@ -386,7 +390,9 @@ void SIPRegistration::onSipReply(AmSipReply& reply) {
req.from_tag,
reply.code, reply.reason));
}
DBG("no matching Contact - deregistered.\n");
active = false;
remove = true;
}
} else if (reply.code >= 300) {

Loading…
Cancel
Save