Browse Source

MT#61372 add explicit support for 18x responses

Allow to-tag updates in answers only until a non-provisional response is
received. Add a flag to optionally suppress this feature.

Change-Id: I67110ede662f618ba5a355500d3d84050e6318cc
pull/1884/head
Richard Fuchs 1 year ago
parent
commit
6189d0b315
5 changed files with 21 additions and 2 deletions
  1. +9
    -1
      daemon/call.c
  2. +3
    -0
      daemon/call_interfaces.c
  3. +7
    -0
      docs/ng_control_protocol.md
  4. +1
    -1
      include/call.h
  5. +1
    -0
      include/call_interfaces.h

+ 9
- 1
daemon/call.c View File

@ -3005,6 +3005,13 @@ int monologue_offer_answer(struct call_monologue *monologues[2], sdp_streams_q *
__C_DBG("this="STR_FORMAT" other="STR_FORMAT, STR_FMT(&receiver_ml->tag), STR_FMT(&sender_ml->tag)); __C_DBG("this="STR_FORMAT" other="STR_FORMAT, STR_FMT(&receiver_ml->tag), STR_FMT(&sender_ml->tag));
if (flags->opmode == OP_OFFER)
ML_CLEAR(receiver_ml, FINAL_RESPONSE);
else if (flags->opmode == OP_ANSWER && flags->message_type == SIP_REPLY && flags->code >= 200)
ML_SET(sender_ml, FINAL_RESPONSE);
else
ML_CLEAR(sender_ml, FINAL_RESPONSE);
for (__auto_type sp_iter = streams->head; sp_iter; sp_iter = sp_iter->next) { for (__auto_type sp_iter = streams->head; sp_iter; sp_iter = sp_iter->next) {
struct stream_params *sp = sp_iter->data; struct stream_params *sp = sp_iter->data;
__C_DBG("processing media stream #%u", sp->index); __C_DBG("processing media stream #%u", sp->index);
@ -4812,7 +4819,8 @@ static int call_get_dialogue(struct call_monologue *monologues[2], call_t *call,
// Allow an updated/changed to-tag in answers unless the flag to // Allow an updated/changed to-tag in answers unless the flag to
// suppress this feature is set. A changed to-tag will be stored // suppress this feature is set. A changed to-tag will be stored
// as a tag alias. // as a tag alias.
if (!flags || flags->opmode != OP_ANSWER || flags->new_branch)
if (!flags || flags->opmode != OP_ANSWER || flags->new_branch
|| (ML_ISSET(ft, FINAL_RESPONSE) && !flags->provisional))
ft = __monologue_create(call); ft = __monologue_create(call);
} }


+ 3
- 0
daemon/call_interfaces.c View File

@ -1147,6 +1147,9 @@ void call_ng_flags_flags(str *s, unsigned int idx, helper_arg arg) {
case CSH_LOOKUP("port-latching"): case CSH_LOOKUP("port-latching"):
out->port_latching = 1; out->port_latching = 1;
break; break;
case CSH_LOOKUP("provisional"):
out->provisional = 1;
break;
case CSH_LOOKUP("record-call"): case CSH_LOOKUP("record-call"):
out->record_call = 1; out->record_call = 1;
break; break;


+ 7
- 0
docs/ng_control_protocol.md View File

@ -1081,6 +1081,13 @@ Spaces in each string may be replaced by hyphens.
Forces *rtpengine* to retain its local ports during a signalling exchange even when the Forces *rtpengine* to retain its local ports during a signalling exchange even when the
remote endpoint changes its port. remote endpoint changes its port.
* `provisional`
Disables special behaviour when operating on a message that was triggered
by a SIP response with a non-provisional (>= 200) status code.
Specifically, setting this flag allows for changed or updated to-tag even
after a final SIP response has been received.
* `record call` * `record call`
Identical to setting `record call` to `on` (see below). Identical to setting `record call` to `on` (see below).


+ 1
- 1
include/call.h View File

@ -219,7 +219,7 @@ enum {
#define ML_FLAG_DTMF_INJECTION_ACTIVE 0x00040000 #define ML_FLAG_DTMF_INJECTION_ACTIVE 0x00040000
#define ML_FLAG_DETECT_DTMF 0x00080000 #define ML_FLAG_DETECT_DTMF 0x00080000
#define ML_FLAG_NO_RECORDING 0x00100000 #define ML_FLAG_NO_RECORDING 0x00100000
/* unused 0x00200000 */
#define ML_FLAG_FINAL_RESPONSE 0x00200000
#define ML_FLAG_BLOCK_SHORT 0x00400000 #define ML_FLAG_BLOCK_SHORT 0x00400000
#define ML_FLAG_BLOCK_MEDIA 0x00800000 #define ML_FLAG_BLOCK_MEDIA 0x00800000
#define ML_FLAG_SILENCE_MEDIA 0x01000000 #define ML_FLAG_SILENCE_MEDIA 0x01000000


+ 1
- 0
include/call_interfaces.h View File

@ -237,6 +237,7 @@ struct sdp_ng_flags {
directional:1, directional:1,
fatal:1, fatal:1,
new_branch:1, new_branch:1,
provisional:1,
/* to_tag is used especially by delete handling */ /* to_tag is used especially by delete handling */
to_tag_flag:1; to_tag_flag:1;
}; };


Loading…
Cancel
Save