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.
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.
In case the MNCC server is crashing we need to release all calls,
use the event emitted by the MNCC connection and iterate over all
calls and call the release function.
Right now a call has two legs, the initial one and the remote. In
general this will allow a SIP to SIP, SIP to MNCC and MNCC to MNCC
structure in the future.
This code is capable of creating an agent that will bind on the
configured local address. The next steps are to configure the
library in terms of allowed features and prepare call handling.
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.
* It is written in C and using libosmovty and other data structures
* It is using sofia-sip for the SIP handling as a good library for
such a task
* It is using glib for the sofia-sip event loop integration. In the
future we can write our own root context but right now that looks
like a necessary evil. No glib usage is allowed in this code and
only sofia-glib is linked.