[Pkg-voip-commits] [janus] 28/282: Fixed endless retransmissions on incoming calls

Jonas Smedegaard dr at jones.dk
Wed Dec 20 21:53:25 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.2.6-1
in repository janus.

commit 94c23247198e2f4528670e3500a1051685f7569e
Author: Lorenzo Miniero <lminiero at gmail.com>
Date:   Wed Apr 26 18:40:56 2017 +0200

    Fixed endless retransmissions on incoming calls
---
 plugins/janus_sipre.c | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/plugins/janus_sipre.c b/plugins/janus_sipre.c
index 1c60091..ee2e204 100644
--- a/plugins/janus_sipre.c
+++ b/plugins/janus_sipre.c
@@ -3436,14 +3436,7 @@ void janus_sipre_mqueue_handler(int id, void *data, void *arg) {
 			mbuf_printf(mb, "%s", session->temp_sdp);
 			mbuf_set_pos(mb, 0);
 			/* Send the 200 OK */
-			int err = sipsess_accept(&session->stack.sess, session->stack.sess_sock,
-				session->stack.invite, 200, "OK",
-				session->account.display_name ? session->account.display_name : session->account.username,
-				"application/sdp", mb,
-				janus_sipre_cb_auth, session, FALSE,
-				janus_sipre_cb_offer, janus_sipre_cb_answer,
-				janus_sipre_cb_established, NULL, NULL,
-				janus_sipre_cb_closed, session, NULL);
+			int err = sipsess_answer(session->stack.sess, 200, "OK", mb, NULL);
 			if(err != 0) {
 				JANUS_LOG(LOG_ERR, "Error attempting to send the 200 OK: %d (%s)\n", err, strerror(err));
 				/* Tell the browser... */
@@ -3480,8 +3473,8 @@ void janus_sipre_mqueue_handler(int id, void *data, void *arg) {
 			JANUS_LOG(LOG_WARN, "[SIPre-%s] Sending response code %d\n", session->account.username, payload->rcode);
 			/* Send the response code */
 			int err = 0;
-			if(payload->rcode < 200) {
-				/* Progress: 1xx */
+			if(session->stack.sess == NULL) {
+				/* We still need to accept the connection */
 				err = sipsess_accept(&session->stack.sess, session->stack.sess_sock,
 					session->stack.invite, payload->rcode, janus_sipre_error_reason(payload->rcode),
 					session->account.display_name ? session->account.display_name : session->account.username,
@@ -3490,10 +3483,19 @@ void janus_sipre_mqueue_handler(int id, void *data, void *arg) {
 					janus_sipre_cb_offer, janus_sipre_cb_answer,
 					janus_sipre_cb_established, NULL, NULL,
 					janus_sipre_cb_closed, session, NULL);
-				//~ err = sipsess_progress(session->stack.sess, payload->rcode, janus_sipre_error_reason(payload->rcode), NULL, NULL);
 			} else {
-				/* 2xx, 3xx, 4xx, 5xx */
-				err = sip_treply(NULL, sipstack, payload->msg, payload->rcode, janus_sipre_error_reason(payload->rcode));
+				/* Connection already accepted */
+				if(payload->rcode < 200) {
+					/* 1xx */
+					err = sipsess_progress(session->stack.sess, payload->rcode, janus_sipre_error_reason(payload->rcode), NULL, NULL);
+				} else if(payload->rcode < 300) {
+					/* 2xx */
+					err = sipsess_answer(session->stack.sess, payload->rcode, janus_sipre_error_reason(payload->rcode), NULL, NULL);
+				} else {
+					/* 3xx, 4xx, 5xx, 6xx */
+					err = sipsess_reject(session->stack.sess, payload->rcode, janus_sipre_error_reason(payload->rcode), NULL);
+				}
+				//~ err = sip_treply(NULL, sipstack, payload->msg, payload->rcode, janus_sipre_error_reason(payload->rcode));
 			}
 			if(err != 0) {
 				JANUS_LOG(LOG_ERR, "Error attempting to send the %d error code: %d (%s)\n", payload->rcode, err, strerror(err));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/janus.git



More information about the Pkg-voip-commits mailing list