char our_contact[256]; /* Our contact header */
char realm[256]; /* Authorization realm */
char nonce[256]; /* Authorization nonce */
+ char domain[256]; /* Authorization nonce */
int amaflags; /* AMA Flags */
int pendinginvite; /* Any pending invite */
int pendingbye; /* Need to send bye after we ack? */
char tmp[256] = "";
char *realm = "";
char *nonce = "";
+ char *domain = "";
char *c;
if ((c = strchr(c,',')))
*c = '\0';
}
+ } else if (!strncasecmp(c, "domain=", strlen("domain="))) {
+ c+=strlen("domain=");
+ if ((*c == '\"')) {
+ domain=++c;
+ if ((c = strchr(c,'\"')))
+ *c = '\0';
+ } else {
+ domain = c;
+ if ((c = strchr(c,',')))
+ *c = '\0';
+ }
} else
c = strchr(c,',');
if (c)
/* copy realm and nonce for later authorization of CANCELs and BYEs */
strncpy(p->realm, realm, sizeof(p->realm)-1);
strncpy(p->nonce, nonce, sizeof(p->nonce)-1);
-
+ strncpy(p->domain, domain, sizeof(p->domain)-1);
build_reply_digest(p, orig_header, digest, digest_len);
return 0;
}
char resp_hash[256];
char uri[256] = "";
- if (strlen(p->uri))
+ if (strlen(p->domain))
+ strncpy(uri, p->domain, sizeof(uri) - 1);
+ else if (strlen(p->uri))
strncpy(uri, p->uri, sizeof(uri) - 1);
else
snprintf(uri, sizeof(uri), "sip:%s@%s",p->username, inet_ntoa(p->sa.sin_addr));