Browse Source

MT#61371 pass `flags` to offer_answer functions

Change-Id: I82b6b9bb134e89cbc0e8794f01951f35fd9bf6e0
pull/1876/head
Richard Fuchs 1 year ago
parent
commit
eb9d4edbfd
3 changed files with 14 additions and 10 deletions
  1. +9
    -6
      daemon/call.c
  2. +3
    -3
      daemon/call_interfaces.c
  3. +2
    -1
      include/call.h

+ 9
- 6
daemon/call.c View File

@ -4584,7 +4584,8 @@ static bool call_monologues_associations_left(call_t * c) {
static int call_get_monologue_new(struct call_monologue *monologues[2], call_t *call,
const str *fromtag,
const str *totag,
const str *viabranch)
const str *viabranch,
sdp_ng_flags *flags)
{
struct call_monologue *ret, *os = NULL; /* ret - initial offer, os - other side */
@ -4676,7 +4677,8 @@ finish:
static int call_get_dialogue(struct call_monologue *monologues[2], call_t *call,
const str *fromtag,
const str *totag,
const str *viabranch)
const str *viabranch,
sdp_ng_flags *flags)
{
struct call_monologue *ft, *tt;
@ -4686,7 +4688,7 @@ static int call_get_dialogue(struct call_monologue *monologues[2], call_t *call,
/* we start with the to-tag. if it's not known, we treat it as a branched offer */
tt = call_get_monologue(call, totag);
if (!tt)
return call_get_monologue_new(monologues, call, fromtag, totag, viabranch);
return call_get_monologue_new(monologues, call, fromtag, totag, viabranch, flags);
/* if the from-tag is known already, return that */
ft = call_get_monologue(call, fromtag);
@ -4765,13 +4767,14 @@ done:
int call_get_mono_dialogue(struct call_monologue *monologues[2], call_t *call,
const str *fromtag,
const str *totag,
const str *viabranch)
const str *viabranch,
sdp_ng_flags *flags)
{
/* initial offer */
if (!totag || !totag->s)
return call_get_monologue_new(monologues, call, fromtag, NULL, viabranch);
return call_get_monologue_new(monologues, call, fromtag, NULL, viabranch, flags);
return call_get_dialogue(monologues, call, fromtag, totag, viabranch);
return call_get_dialogue(monologues, call, fromtag, totag, viabranch, flags);
}
static void media_stop(struct call_media *m) {


+ 3
- 3
daemon/call_interfaces.c View File

@ -194,7 +194,7 @@ static str *call_update_lookup_udp(char **out, enum call_opmode opmode, const ch
updated_created_from(c, addr, sin);
if (call_get_mono_dialogue(monologues, c, &fromtag, &totag, NULL))
if (call_get_mono_dialogue(monologues, c, &fromtag, &totag, NULL, NULL))
goto ml_fail;
struct call_monologue *from_ml = monologues[0];
@ -357,7 +357,7 @@ static str *call_request_lookup_tcp(char **out, enum call_opmode opmode) {
str_swap(&fromtag, &totag);
}
if (call_get_mono_dialogue(monologues, c, &fromtag, &totag, NULL)) {
if (call_get_mono_dialogue(monologues, c, &fromtag, &totag, NULL, NULL)) {
ilog(LOG_WARNING, "Invalid dialogue association");
goto out2;
}
@ -2243,7 +2243,7 @@ static const char *call_offer_answer_ng(ng_command_ctx_t *ctx, enum call_opmode
errstr = "Invalid dialogue association";
if (call_get_mono_dialogue(monologues, call, &flags.from_tag, &flags.to_tag,
flags.via_branch.s ? &flags.via_branch : NULL)) {
flags.via_branch.s ? &flags.via_branch : NULL, &flags)) {
goto out;
}


+ 2
- 1
include/call.h View File

@ -824,7 +824,8 @@ void call_make_own_foreign(call_t *c, bool foreign);
int call_get_mono_dialogue(struct call_monologue *monologues[2], call_t *call,
const str *fromtag,
const str *totag,
const str *viabranch);
const str *viabranch,
sdp_ng_flags *);
struct call_monologue *call_get_monologue(call_t *call, const str *fromtag);
struct call_monologue *call_get_or_create_monologue(call_t *call, const str *fromtag);
call_t *call_get(const str *callid);


Loading…
Cancel
Save