Skip to content

Commit

Permalink
res_pjsip_session: Send Session Interval too small response
Browse files Browse the repository at this point in the history
Handle session interval lower than endpoint's configured minimum timer
when sending first answer. Timer setting is checked during this step and
needs to handled appropriately.
Before this change, no response was sent at all. After this change a
response with 422 Session Interval too small is sent to UAC.
  • Loading branch information
btriller authored and asterisk-org-access-app[bot] committed Aug 31, 2023
1 parent 088b51e commit 468df4a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions res/res_pjsip_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -4053,15 +4053,20 @@ static int new_invite(struct new_invite *invite)
* so let's go ahead and send a 100 Trying out to stop any
* retransmissions.
*/
if (pjsip_inv_initial_answer(invite->session->inv_session, invite->rdata, 100, NULL, NULL, &tdata) != PJ_SUCCESS) {
if (tdata) {
pjsip_inv_send_msg(invite->session->inv_session, tdata);
} else {
pjsip_inv_terminate(invite->session->inv_session, 500, PJ_TRUE);
}
goto end;
}

ast_trace(-1, "%s: Call (%s:%s) to extension '%s' sending 100 Trying\n",
ast_sip_session_get_name(invite->session),
invite->rdata->tp_info.transport->type_name,
pj_sockaddr_print(&invite->rdata->pkt_info.src_addr, buffer, sizeof(buffer), 3),
invite->session->exten);
if (pjsip_inv_initial_answer(invite->session->inv_session, invite->rdata, 100, NULL, NULL, &tdata) != PJ_SUCCESS) {
pjsip_inv_terminate(invite->session->inv_session, 500, PJ_TRUE);
goto end;
}
ast_sip_session_send_response(invite->session, tdata);

sdp_info = pjsip_rdata_get_sdp_info(invite->rdata);
Expand Down

0 comments on commit 468df4a

Please sign in to comment.