aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-03-31 08:00:26 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-03-31 08:00:26 +0000
commitdde77c472594abe21061e38a14d3530abb1d2481 (patch)
tree4bce6f5207053a468b944b60c1e5e3165ced4978
parente1ee2c88735a1ac9cc0c515d883ec3b2099610e0 (diff)
Leave retry time alone, handle "opaque" stuff in message.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2589 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xchannels/chan_sip.c16
-rwxr-xr-xpbx/pbx_spool.c3
2 files changed, 15 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 4bf464274..d7f79cef2 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -254,6 +254,7 @@ static struct sip_pvt {
char our_contact[256]; /* Our contact header */
char realm[256]; /* Authorization realm */
char nonce[256]; /* Authorization nonce */
+ char opaque[256]; /* Opaque nonsense */
char domain[256]; /* Authorization nonce */
char lastmsg[256]; /* Last Message sent/received */
int amaflags; /* AMA Flags */
@@ -4720,6 +4721,7 @@ static int reply_digest(struct sip_pvt *p, struct sip_request *req, char *header
char *realm = "";
char *nonce = "";
char *domain = "";
+ char *opaque = "";
char *c;
@@ -4754,6 +4756,17 @@ static int reply_digest(struct sip_pvt *p, struct sip_request *req, char *header
if ((c = strchr(c,',')))
*c = '\0';
}
+ } else if (!strncasecmp(c, "opaque=", strlen("opaque="))) {
+ c+=strlen("opaque=");
+ if ((*c == '\"')) {
+ opaque=++c;
+ if ((c = strchr(c,'\"')))
+ *c = '\0';
+ } else {
+ opaque = c;
+ if ((c = strchr(c,',')))
+ *c = '\0';
+ }
} else if (!strncasecmp(c, "domain=", strlen("domain="))) {
c+=strlen("domain=");
if ((*c == '\"')) {
@@ -4777,6 +4790,7 @@ static int reply_digest(struct sip_pvt *p, struct sip_request *req, char *header
strncpy(p->realm, realm, sizeof(p->realm)-1);
strncpy(p->nonce, nonce, sizeof(p->nonce)-1);
strncpy(p->domain, domain, sizeof(p->domain)-1);
+ strncpy(p->opaque, opaque, sizeof(p->opaque)-1);
build_reply_digest(p, orig_header, digest, digest_len);
return 0;
}
@@ -4808,7 +4822,7 @@ static int build_reply_digest(struct sip_pvt *p, char* orig_header, char* digest
snprintf(resp,sizeof(resp),"%s:%s:%s",a1_hash,p->nonce,a2_hash);
md5_hash(resp_hash,resp);
- snprintf(digest,digest_len,"Digest username=\"%s\", realm=\"%s\", algorithm=\"MD5\", uri=\"%s\", nonce=\"%s\", response=\"%s\"",p->peername,p->realm,uri,p->nonce,resp_hash);
+ snprintf(digest,digest_len,"Digest username=\"%s\", realm=\"%s\", algorithm=\"MD5\", uri=\"%s\", nonce=\"%s\", response=\"%s\", opaque=\"%s\"",p->peername,p->realm,uri,p->nonce,resp_hash, p->opaque);
return 0;
}
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c
index d5e2b960f..27f39c9a3 100755
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -182,9 +182,6 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f)
}
}
strncpy(o->fn, fn, sizeof(o->fn) - 1);
- /* Check sanity of times */
- if (o->retrytime < o->waittime + 5)
- o->retrytime = o->waittime + 5;
if (!strlen(o->tech) || !strlen(o->dest) || (!strlen(o->app) && !strlen(o->exten))) {
ast_log(LOG_WARNING, "At least one of app or extension must be specified, along with tech and dest in file %s\n", fn);
return -1;