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.
Start with a show call summary that lists simple data about the
current set of calls:
Call(5002) initial(type=SIP,state=CONFIRMED) remote(type=MNCC,state=INITIAL)
Call(5001) initial(type=MNCC,state=PROCEEDING) remote(type=SIP,state=CONFIRMED)
Related: OS#1680
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 codec negotiation is still a huge todo and the initial version
will be far from perfect. We will use whatever MNCC has decided on
and then see if it is compatible in the end.
Fix releasing of the leg in case it is not routable and make the
differentation if we initiated the invite (send CANCEL) or send
a final error. The error code was randomly picked and once we have
an enum of causes we can decide where to map it to.
Check if the SDP file has any codec potentially supported by GSM.
The topic of codec selection is a complicated one and we will not
support it correctly in the beginning.
* Create a new handle
* Send the invite
* Have some state transitions
* Allow to release a call in initial unconfirmed state, confirmed
one with cancel and connected with bye
* Add simple SDP parsing to find the rtpmap/codec that is used by
gsm
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.
Reading the "releasing" log output sounded like one more message
had been sent and this code is waiting for something. Take a copy
of the call id and then print that the call has been released.