When accessing the array members via the pointer they
are still read-only, but the entries themselves are mutable.
So just make the elements constant pointers.
Also comply with the indentation style, and use tabs, not spaces.
Change-Id: I2165d0bf0b7b3ee4ad053c235dae4f60f36c1a43
In case the allocation of pcre for streams regex
fails, but not for the info, we never free
the latter one, because on returning an error,
just calling `die()`, hence no de-allocation
procedures are fulfilled.
Change-Id: I4a39b2c3043798c59fa6ec2fe0d70b1b1b27517f
Introduce a common NG commands table `ng_command_defs`
for all type of things: OP enum, name, escaped name,
short name and most important the handler.
This table operates on and returns a dedicated struct `ng_command_def`,
which has all the information required on the command (like
all type of things mentioned above) and may have either
single-parameter or double-parameter signature (for cases with
the `addr` requiring commands such as the offer command).
Also add unified signatures for X and XA handlers,
they will be used later accordingly. Most of those use single-parameter,
and those exceptional use the second one.
Also add dummy plug-functions for ping and block/unblock silence media.
The ping one doesn't have any particular handler, but because a new
structure of NG commands wants to see a real declaration of the func
handler, just give it. For the block/unblock silence media, there aren't
even handling of commands in the control NG, they are just dummy OPs,
so fulfill the actual NG commands structure, and give them dummy funcs.
Change-Id: I2064ddca1595079959a6c6843119556a8b6bf5d5
When iterating through medias, check whether there is something in;
- `->streams.head`
- `->selected_sfd`
- `->socket.local.address.family`
before to blidnly appeal to it.
If transform setup can ever produce incomplete media,
this might crash while building the response.
Change-Id: Ie75f20b111634ee3faa0af58c1eebfddbbcc843e
When iterating through the monologues medias while
looking for the media sink, filter those, which aren't audio.
Such a media type will likely have no audio subscriber,
and most probably will return with:
"There is no sink media capable of DTMF playback"
Change-Id: I86e64105e520f2a6f3ee9bbb0271830ae8d8cc69
For-cycle expects the `sink_ml` for setting the `call_media`
at the upper level of the cycle, but instead the `monologue`
is used, which is supposed to be used in the nested for-cycle.
Looks like a copy-paste typo. Major fix.
Change-Id: I225a51fde7fa8d10bac832ce5fc5444ee544e882
The loop is 1-based, but checks the outside
of bounds with `i <= 1`. If the length is 1 and
iterator is 1, this already fails.
Hence allow `i` to be 1, and also check it's not
beyound the media array length.
Change-Id: I9112fc88155fa53205c04ef35b00f6573b6816b3
If someone wants to stop the media for this particular monologue,
and it already has the MP allocated, which is marked for MoH,
then just ignore the stop media command.
This is to not let the play media/stop media procedures
overlap with potentially (previously) triggered MP via MoH.
Change-Id: If0bf4264b9c640b99f844efe5c2c8bc201a6ad16
To show that player has been created.
Additionally: add one more log line
to track that the play media is being requested.
Change-Id: I4e8eb8f282654902a96bffb70c7c241e9c78b8d5
Resolve file name conflicts between different components
Ensure shared log levels are identical across components
Encapsulates lib/*
Change-Id: If848d6fa0e4cd8eac88ce9e63ee77fc5a7a481fd
The `dialog_unconfirm()` func simply does similar
work as `__monologue_unconfirm()` but works instead
on subscriptions additionally.
So just deprecate it and then `__monologue_unconfirm()`
just takes the work on subscribers/subscriptions as well.
Change-Id: I047fd86b8eba700d0347b21137a2aa40fab01643
This wrapper should likely call the `__unsubscribe_all_from_monologue()`
instead of the `__unsubscribe_monologue_from_all()`, because
the latter is already used by another wrapper of the same name.
And "unsubscriber all from monologue" name hints that
we unsubscribe our subscribers from us.
Change-Id: I6a16ab7320c619adedd9ba7c05e0d9a401971bfe
New NG protocol commands that mix audio from a source participant
into a destination participant's stream without a full offer/answer
exchange.
- inject start: creates one-way subscription with audio_player mixing
- inject stop: removes injection and restores original codec routing
- Supports cross-call injection via source-call-id (merges calls internally)
- inject attribute persisted through Redis for HA failover
- Audio-only; matches media by media-id, index, then type fallback
Closes#2082
Change-Id: Ib88113b021a4b76bf98892eb1af60c0b36c0d6d3
The Kamailio control module unconditionally adds the current to-tag to
the control message if rtpp-flags parsing is active. This is generally
not desirable in the case of an initial subscribe-request, as we want a
generated to-tag when the existing to-tag belongs to another dialogue.
Special-case this to ignore the included to-tag if none has been given
explicitly.
Change-Id: I1dc28bfdfd086766e0b6a117c74edd0ebb75d526