mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
res_pjsip_empty_info: Respond to empty SIP INFO packets
Some SBCs require responses to empty SIP INFO packets after establishing call via INVITE, if not responded to they may drop your call after unspecified timeout of X minutes. They are identified by having no Content-Type, check for this and respond with 200 - OK message. ASTERISK-24986 #close Reported-by: Ilya Trikoz, Federico Santulli Change-Id: Ib27e4f07151e5aef28fa587e4ead36c5b87c43e0
This commit is contained in:
@@ -103,13 +103,13 @@ static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pj
|
||||
if (!body || !body->len) {
|
||||
/* need to return 200 OK on empty body */
|
||||
send_response(session, rdata, 200);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
res = body->print_body(body, buf, body->len);
|
||||
if (res < 0) {
|
||||
send_response(session, rdata, 500);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
buf[res] = '\0';
|
||||
|
||||
@@ -150,11 +150,12 @@ static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pj
|
||||
}
|
||||
|
||||
send_response(session, rdata, event ? 200 : 500);
|
||||
return event ? 0 : -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static struct ast_sip_session_supplement dtmf_info_supplement = {
|
||||
.method = "INFO",
|
||||
.priority = AST_SIP_SUPPLEMENT_PRIORITY_FIRST,
|
||||
.incoming_request = dtmf_info_incoming_request,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user