Closed carcharothellobo closed 1 year ago
A 900 internal error means something broke deep inside the library, so outside of our control. The crash, however, may be happening after we're told of the error, and if so they're right the problem may be in Janus. Which commit is this on? Line 6254 is a comment in my latest version of the code.
This is my commit:
commit ef984223dd0cfbaa07445c18748f506899678305
Author: Lorenzo Miniero <lminiero@gmail.com>
Date: Mon Nov 7 14:12:36 2022 +0100
Added check before dereferencing pointer in case of failed SUBSCRIBE
And this is my line 6254
} else if(status >= 400) {
/* Something went wrong */
JANUS_LOG(LOG_WARN, "[%s] SUBSCRIBE failed: %d %s\n", session->account.username, status, phrase ? phrase : "");
json_t *event = json_object();
json_object_set_new(event, "sip", json_string("event"));
6254 ------> if(sip->sip_call_id)
json_object_set_new(event, "call_id", json_string(sip->sip_call_id->i_id));
json_t *result = json_object();
json_object_set_new(result, "event", json_string("subscribe_failed"));
json_object_set_new(result, "code", json_integer(status));
json_object_set_new(result, "reason", json_string(phrase ? phrase : ""));
if(session->incoming_header_prefixes) {
json_t *headers = janus_sip_get_incoming_headers(sip, session);
json_object_set_new(result, "headers", headers);
}
json_object_set_new(event, "result", result);
int ret = gateway->push_event(session->handle, &janus_sip_plugin, session->transaction, event, NULL);
JANUS_LOG(LOG_VERB, " >> Pushing event to peer: %d (%s)\n", ret, janus_get_api_error(ret));
json_decref(event);
}
break;
Maybe sip
is NULL
when that error comes in. I'll add a NULL check for that.
This commit should fix the issue if that was the cause. I'll close for now, but please do let us know if it's still a problem and in case we'll reopen.
Lorenzo just to let you know that everything is ok with this fix
Hi guys, I have some weird behavior. Im running Sofia SIP in my Janus WebRTC Server, and randomly I have some crashings after SUBSCRIBE event. I had also reported this to Sofia SIP and they told me that this is a Janus issue
This is what a look in my logs, take a look the line with event r_subscribe 900 Internal error at nua_client.c:713: