Parse the media from session in progress and if present in alerting
connect the call early. Sadly this sets RTP to the sendrecv mode even
if we would like to keep it as recvonly.
Change-Id: I98d173abc46c67b87666ed2f193a581d6e72344b
Related: OS#1784
Besides sending the alerting request we should inform the
MS that there is in-band information now. We do not seem
to export these flags in protocol/gsm_04_08.h so hardcode
them for now (until I come up with good names for them).
Related: OS#1784
Change-Id: I80b1e1f4ca045bd63536476702a5812f27d9b36d
We are not using the RTP telephony-event here but the older dtmf
relay. We also only have a fixed DTMF duration for now.
Change-Id: Icf770fae89f7aedf6eba9a119db9b8acc7f938df
In preparation of a better show calls VTY command it is of interest
to know which number has been dialed by whom. For that store the
source/dest in there.
MNCC: Change the talloc root context to the call and don't try to
free the strings after calling the routing code
SIP: Use talloc_strdup to duplicate them.
Call: Add null check because the talloc_strdup of the SIP layer
could have failed.
I was focusing so much on the length that I didn't notice the
wrong usage of snprintf. Correct it.
Warning on Ubuntu:
mncc.c:679:3: warning: format not a string literal and no format arguments [-Wformat-security]
snprintf(mncc.imsi, 15, called);
MNCC hold to sip has not been implemented, so let me reject the
request right now. A ticket (OS#1686) has been filed to track
implementing call holding.
Have all release go through a local method first. This way we can
make sure to stop the timer. I have seen something odd (a busy loop
in the RB tree of the timer code) and we can easily avoid having a
timer run on a page of memory that has been "freed".
In case one is using a PBX it might be the easiest just to
call based on IMSI. Add a VTY option to enable/disable this
feature. It can be used to keep the number assignment outside
of the HLR database.
Add NULL check in the case of MNCC disconnect that was missing and
add an assert to show that at this point the other leg must exist.
Fixes: CID#80799, CID#80800, 80801
This will go through the stage of:
* MNCC_CALL_CONF_IND (to which we create a RTP socket)
* then we might receive a MNCC_ALERT_IND
* and finally the MNCC_SETUP_CNF
For the last two we inform the other leg about the progress.
For releasing a MT-Call we will need to send a release request
and then wait for the release confirmation. Add if/else to it.
If this turns out to be too ugly we will be able to create one
MO and one MT leg.
Initiate the setup request that should result in the call getting
all the way to the connected state at some point in time. The device
I test with sadly rejects the call too soon.
The current code can not deal with two outstanding commands. Let's
assume the user will hang up if the voice connection will fail and
we will add a general RTP_CONNECT check to tearn down a call.
Not every message might have the size of gsm_mncc and the size check
is done inside each routine. Routines that relate to calls now share
the code to check the size and the look-up to find the leg.
I had modified my code to do nothing after having sent the PROCEEDING
message. First the MS will issue a DISCONNECT.IND (which I ignored) and
then there will be REL.IND. Let's inform the other leg about this event
and let's assume the call will then be terminated.
In the long run we should print these by name and not by the number
but as the table is in OpenBSC and I did not want to copy it we will
have to cope with the numbers a little longer.
With a bit more code the logging will print:
<0001> mncc.c:233 Created call(5001) with MNCC leg(2147483659) IMSI(274018000000001)
<0001> mncc.c:178 RTP set-up continuing with call with leg(2147483659)
<0001> mncc.c:65 Got response, stopping timer on leg(2147483659)
<0002> call.c:51 call(5001) releasing.
Use %zu for size_t arguments, e.g. returned from sizeof.
The code is not tested and might be broken. Parse the setup request
of a MO call, create a new "call" with a MNCC leg and then issue the
call to create a RTP socket. Once this has been done, release the call
as the code to open a second leg has not been written yet.
Make a simple version comparison and close the socket in case of a
version mismatch. Begin to dispatch messages coming from the NITB
and log (all) unhandled messages.
Connect, re-connect and read messages from the MNCC socket. Dispatch
the event in case the system got disconnected.
Move the app definition to app.h and use it everywhere. Begin with a
new call for mncc.