Using *unpacked* 'struct osmo_gcr_parsed' in the MNCC PDUs makes
the protocol even more complicated than it currently is, and
moreover complicates implementing MNCCv8 in the ttcn3-sip-test.
Replace 'struct osmo_gcr_parsed' in 'struct gsm_mncc' with a
fixed-length buffer, which is supposed to hold the Global Call
Reference encoded as per 3GPP TS 29.205.
Check / indicate presence of GCR using the MNCC_F_GCR flag.
Change-Id: Iaff46732948f8f5d03e42f17c35cbac8a80af49b
Fixes: Id40d7e0fed9356f801b3627c118150055e7232b1
Related: OS#5164, OS#5282
* Add GCR to mncc struct and therefore bump mncc version.
* Pass the GCR as a SIP Header to SIP UA and retrieve any such header
from incoming SIP calls, passing the GCR on to MNCC
Related: #OS5164
Depends: osmo-msc I705c860e51637b4537cad65a330ecbaaca96dd5b
Change-Id: Id40d7e0fed9356f801b3627c118150055e7232b1
Concentrate the write() to the socket in 2 places.
One for struct gsm_mncc and one for struct gsm_mncc_rtp.
Improve debugging as now all function debug print the
MNCC primitiv.
Change-Id: Ia84602955b913a3bb13de7a6a92048799f2e1955
Verify is the parsed data is at least the size of the struct, not
exactly the size. Make it accept messages with additional data, like
the SDP information the TTCN-3 testsuite is sending since
Ic9568c8927507e161aadfad1a4d20aa896d8ae30.
This change makes the size checks consistent with the two other size
checks in the file:
if (rc < sizeof(*rtp)) {
if (rc < sizeof(**mncc)) {
Related: OS#4282
Change-Id: I522ce7f206932a816a64f03d916799c3215bb8c7
The function close_connection() closes the fd without marking it as
closed. Lets set the fd to -1 and check at the beginning if it is
greater than zero. This prevents us from closing an already closed fd
again.
Related: OS#4159
Change-Id: I9742f31a37296fed15d54cf44c1f65b93abb8c8e
Add NULL checks on the return value of call_leg_other() in
update_rtp()
If the remote side has requested media change and we cannot
find the other leg, then release call. This should not
happen.
Also, Add an assert to show that we cannot be here
without call type of SIP or MNCC (not related to coverity)
Fixes: CID#202863
Change-Id: I6f1f26533a25c93f243090bc02f1bc83b9108d42
Up to now most logging is on LDEBUG, lets make more use of Log Levels.
reserve NOTICE for unusual events
INFO: normal call setup/teardown
DEBUG, well.. it's DEBUG
* BYE is not an Error.
* 4XX or 5XX response to INVITE is not an Error don't log as such.
* 183 does not necessarily mean "ringing".
Change those log messages for clarity.
Change-Id: Ie0014043d93303a87cbb8bb351e439ff78651cbe
Also removes a comment in sdp_create_file() about the
IP address in o= and c= having to be the same.
It is completely legal in SDP and often normal for the
originator and the connection information IP to be different.
Change-Id: I057573467c335fc27ead391c0bb4c775f2f6ba0a
As far as I can make out, the intention is to always store ip address in the call struct
in network byte order, whereas the ip address sent on MNCC are in host byte order.
Change-Id: I89ef26aa32a672f394699251cf560b53ae01a814
Handle MO hold and retrieve and pass this to the SIP side.
Handle the 200 from the SIP side in response to our HOLD-ing re-INVITE.
With this commit we now handle MO hold and therefore also handle
call-waiting and swapping.
Change-Id: Ife7bdab20cde92b7ce550215bab28b36a0f302e9
SIP end points can send periodic re-INVITES. Previous to this commit,
the osmo-sip-connector would send a new call SETUP to the MSC for each
re-INVITE.
Add a function to find if we already handle this call based on the nua handle.
Use this function to detect and respond with an ACK to re-INVITES.
Add a function to extract the media mode from the SDP.
In the case the re-INVITE has a=sendonly (HOLD) respond with a=recvonly
In the case that the re-INVITE changes the media connection ip/port,
forward this to the MNCC side with an MNCC_RTP_CONNECT
Change-Id: I4083ed50d0cf1b302b80354fe0c2b73fc6e14fed
In case we receive MNCC_RTP_CREATE after MNCC_DISC_IND,
check if the call is already marked in_release
and if so, send MNCC_REJ_REQ and do not proceed with
the B leg.
Related: OS#3518
Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37
LCR supports emergency calling by sending the string 'emergency' as callee to
the SIP side.
This does the same
Change-Id: I5d0adb61dfa82e7ded5f41d9bc773d546112c9f1
When the SIP call source contains + as first character,
set the TON to International so that the MS displays
caller ID correctly
Change-Id: Idcfa31aff90e04dd0aa3583957f288889b1bbefe
Use osmo_mncc_name() in timer functions and in logging
the type of MNCC message sent to the socket.
Change-Id: Ic77e0d86c91c29ff7304e620fdecb69b22127d33
Use gsm48_cc_cause_name() in logging messages
Depends-On: I296f208581ce2550805f9d96e20f7319e1199023
Change-Id: I6e3541b66cb3407f0cb23fb6e00a04685fe90757
Fixes following compilation warning:
osmo-sip-connector/src/mncc.c: In function ‘check_disc_ind’:
osmo-sip-connector/src/mncc.c:517:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (other_leg)
^~
Fixes: 008915ee41 ("Implement Cause Mapping")
Change-Id: I5bdbc29a3f82bdc92b156c1f7df68c9503f85f8f
Adds cause field to the call_leg and sip_call_leg structs.
Translates the SIP status to MNCC cause and vice versa and
uses this information in the SIP/MNCC messages at call leg
release time.
Change-Id: Ic1b80dff7e583cd6fff2b662bc6cc4bad3f81cd4
GSM 04.08 10.5.4.11 (Table 10.85) states:
Coding standards other than the standard defined for the
GSM PLMNS shall not be used if the cause can be represented
with the GSM standardized coding.
This patch adds cause coding GSM PLMS (3) and sets cause
location to "public network serving the local user" (2)
This prevents UE that pay attention to this from treating
all call termination as an error and paves the way to
adding correct cause mapping from Table 10.86
Also replaces use of magic numbers with enum constants.
Change-Id: I5d3fe3f0c9e8de26dd0c73b10b7e4fc63dff3952
Links libosmocore (libosmogsm) for access to osmo_mncc_name()
Remove reference to get_mncc_name() in src/mncc_protocol.h
Uses osmo_mncc_name() to output to debug log
which MNCC_* message was received.
Change-Id: I161d1b841ac5fe1b7e092b329ae0674cb340f5ac
We normally use the 'const' modifier whenever using read-only input
data, let's do so in the mncc parser/handler, too.
Change-Id: Ide24feb536c04fe7ef08c62b4498fdd95605b58c
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