From 64d5123da7ae3f6e8c31401d86bd95aa84260a75 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Tue, 21 Jun 2016 10:41:08 +0000 Subject: [PATCH] patch from richard: this patch fix an issue with stateless sip requests. In some scenarios (depending of DNS replies), the request is being terminated before the message is sent. This patch fixes the issue. For stateless requests, if A/AAAA records for target of SRV record is not present in addl (additional list) of NAPTR/SRV DNS reply, we will explicitly query for those. --- src/sip/request.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/sip/request.c b/src/sip/request.c index ac3892e..b2deb5b 100644 --- a/src/sip/request.c +++ b/src/sip/request.c @@ -259,6 +259,11 @@ static int request_next(struct sip_request *req) if (req->addrl.head || req->srvl.head) goto again; } + else if (!req->stateful) { + req->resph = NULL; + terminate(req, 0, NULL); + mem_deref(req); + } return err; } @@ -427,12 +432,6 @@ static void naptr_handler(int err, const struct dnshdr *hdr, struct list *ansl, if (err) goto fail; - if (!req->stateful) { - req->resph = NULL; - terminate(req, 0, NULL); - mem_deref(req); - } - return; fail: @@ -487,12 +486,6 @@ static void srv_handler(int err, const struct dnshdr *hdr, struct list *ansl, if (err) goto fail; - if (!req->stateful) { - req->resph = NULL; - terminate(req, 0, NULL); - mem_deref(req); - } - return; fail: @@ -525,12 +518,6 @@ static void addr_handler(int err, const struct dnshdr *hdr, struct list *ansl, if (err) goto fail; - if (!req->stateful) { - req->resph = NULL; - terminate(req, 0, NULL); - mem_deref(req); - } - return; fail: