From 4810e6b88649fb944782f38221995c1b406642ca Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Wed, 24 Jul 2024 22:19:10 +0300 Subject: [PATCH 1/2] Allow 100 response code in sipsess_accept --- src/sipsess/accept.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sipsess/accept.c b/src/sipsess/accept.c index 1f506dc7e..4b28675b7 100644 --- a/src/sipsess/accept.c +++ b/src/sipsess/accept.c @@ -74,7 +74,7 @@ int sipsess_accept(struct sipsess **sessp, struct sipsess_sock *sock, va_list ap; int err; - if (!sessp || !sock || !msg || scode < 101 || scode > 299 || + if (!sessp || !sock || !msg || scode < 100 || scode > 299 || !cuser || !ctype) return EINVAL; @@ -104,7 +104,7 @@ int sipsess_accept(struct sipsess **sessp, struct sipsess_sock *sock, va_start(ap, fmt); - if (scode > 100 && scode < 200) { + if (scode >= 100 && scode < 200) { err = sipsess_reply_1xx(sess, msg, scode, reason, rel100, desc, fmt, &ap); } From 51b0651cddd904fb145ef1ec75f374c7fd15d4b9 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Fri, 26 Jul 2024 12:40:31 +0300 Subject: [PATCH 2/2] Allow skiping of reply by sipsess_accept --- src/sipsess/accept.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sipsess/accept.c b/src/sipsess/accept.c index 4b28675b7..151d8a838 100644 --- a/src/sipsess/accept.c +++ b/src/sipsess/accept.c @@ -40,7 +40,7 @@ static void cancel_handler(void *arg) * @param sessp Pointer to allocated SIP Session * @param sock SIP Session socket * @param msg Incoming SIP message - * @param scode Response status code + * @param scode Response status code or zero to skip sending of reply * @param reason Response reason phrase * @param rel100 Sending 1xx reliably supported, required or disabled * @param cuser Contact username or URI @@ -74,8 +74,8 @@ int sipsess_accept(struct sipsess **sessp, struct sipsess_sock *sock, va_list ap; int err; - if (!sessp || !sock || !msg || scode < 100 || scode > 299 || - !cuser || !ctype) + if (!sessp || !sock || !msg || (scode != 0 && scode < 100) || + scode > 299 || !cuser || !ctype) return EINVAL; err = sipsess_alloc(&sess, sock, cuser, ctype, NULL, authh, aarg, aref,