Commit Graph

60 Commits

Author SHA1 Message Date
Harald Welte 115d1036d6 rename rsl_channel_release to rsl_rf_channel_release
and add some more comments to help understand the complex release
procedures.
2009-08-10 11:43:22 +02:00
Harald Welte 3ac7f10450 add code to GSM 04.08 to send MRPCI message once we have classmark2
* afert we receive a CM SERVICE REQUEST
* after we receive a PAGING RESPONSE
2009-08-10 10:12:45 +02:00
Harald Welte e58ca7c181 revert commit b400dd8f64 regarding NECI=0
As it turns out, we start to allocate SDCCH for voice calls.  Since we
don't yet implement switching from SDCCH to TCH during call setup,
this leads to various problems.
2009-08-10 02:14:46 +02:00
Harald Welte b400dd8f64 We're using NECI=0, but the channel reauest reasons we're seeing from MS's are wrong
So we don't know what's the problem.  Using the NECI=1 tables makes us allocate SDCCH
for MO SMS, which is good.
2009-08-10 00:26:50 +02:00
Harald Welte ee5ad16582 ensure we send the LOCATION UPDATE ACCEPT before issuing any signal 2009-08-09 19:07:00 +02:00
Harald Welte 1a6f79818e move search for existing lchan for subscriber to new function
There's now a new function called 'lchan_for_subscr()' which can be
used to determine if there is any existing lchan for this subscriber.
2009-08-09 18:52:33 +02:00
Harald Welte 76042188e0 first 'working' SMS implementation
we now have the full path from the MS into the database (SUBMIT), as well as
back from the database to the MS (DELIVER).  The database gets correctly
updated once a SMS has been successfully delivered.

What's still missing is the periodic scan over all undelivered messages,
trying to deliver them to the respective MS.  So far, you have to manually
trigger this on the telnet interface with 'sms send pending 1'
2009-08-08 16:03:15 +02:00
Harald Welte a1b285861e gsm_04_08 no longer needs to iterate over all BTS in LAC
this task is performed by the paging.c code already.
2009-08-01 19:31:47 +02:00
Harald Welte e34e117ff1 Merge branch 'master' into sms 2009-07-29 18:05:54 +02:00
Harald Welte 9943c5bbac generalize channel activation / channel mode modify
* we only need one piece of code to calculate rsl_ie_chan_mode from
  our run-time data structures (gsm_lchan)
* add some more channel modes for TCH/H and data
* use enum's to make the compiler warn us about unhandled enum values
* make sure the caller determines the (signalling,speech,data) mode
2009-07-29 15:41:29 +02:00
Harald Welte 13cac66bb7 postpone IPAC_BIND until we do a LCHAN_MODIFY
only after the LCHAN_MODIFY we know the final mode of the channel,
so we have to postpone our IPAC_BIND until then to make sure we set
the correct speech codec.
2009-07-29 12:10:35 +02:00
Harald Welte 2f33d01aaf Merge branch 'master' into sms 2009-07-28 18:40:45 +02:00
Harald Welte 805f64486b add RTP proxy mode for ip.access
Up until now, we only supported direct RTP streams between ip.access BTS.
With this commit, the user can specify '-P' to the command line to enable
a RTP/RTCP proxy inside OpenBSC.  The nanoBTS will then send all their voice
data to OpenBSC, which will relay it to the respective destination BTS (which
can be the same BTS).

The default behaviour remains unchanged.  Without '-P' on the command line,
RTP/RTCP is exchanged directly.
2009-07-28 18:25:29 +02:00
Harald Welte 3366a94d6c Merge branch 'master' into sms
Conflicts:
	openbsc/include/openbsc/transaction.h
	openbsc/src/gsm_04_11.c
	openbsc/src/transaction.c
2009-07-28 00:44:49 +02:00
Harald Welte 7bfc267496 move allocation of talloc contexts into link-time constructor
This is much more optimal than checking if the context exists every
time we allocate the respective object.
2009-07-28 00:41:45 +02:00
Harald Welte b8b4073e18 look-up by (subscriber, protocol, transaction_id) tuple
... rather than the previous incomplete (lchan, transaction_id) tuple
2009-07-23 21:58:40 +02:00
Harald Welte b49248bf48 move allocating new transaction_ids to transaction.c 2009-07-23 21:39:00 +02:00
Harald Welte 78283ef151 move allocating new transaction_ids to transaction.c 2009-07-23 21:36:44 +02:00
Harald Welte 88f0425197 Merge branch 'master' into sms 2009-07-23 21:24:28 +02:00
Harald Welte 6f5aee07e5 trans->transaction_id now reflects the actual (unshifted) value 2009-07-23 21:21:14 +02:00
Harald Welte 39e2eadc99 centralize the code that needs to deal with transaction_id
There were many places in the code where we had to explicitly
reference the transaction_id and put it into a packet.  By introducing
and optional gsm_trans parameter to gsm48_sendmsg(), we can implement
this code once rather than dozens of time.
2009-07-23 21:13:03 +02:00
Harald Welte 761e944182 make sure subscr->net is always set
since a subscriber is an element of the gsm_network, we have to ensure
subscr->net is always set correctly.  We do this by using gsm_network
as an argument to all functions that resolve or create a subscriber.
2009-07-23 19:21:02 +02:00
Harald Welte b3c3faee94 remove bogus 'network' member of 'struct gsm_transaction'
Since a transaction is associated to a gsm_subscriber, and the subsciber
is part of a network, we don't need to have a dedicated transaction->network
pointer.
2009-07-23 19:10:19 +02:00
Harald Welte aa0b29c265 gms_transactions data model reorganization
This changeset factors out gsm_transaction as something independent
of call control in preparation to re-use the code from SMS.  A
transaction is uniquely identified by either its callref, or by
a tuple of (transaction_id, protocol, subscriber).
2009-07-23 19:10:12 +02:00
Harald Welte 596fed40f0 remove bogus 'network' member of 'struct gsm_transaction'
Since a transaction is associated to a gsm_subscriber, and the subsciber
is part of a network, we don't need to have a dedicated transaction->network
pointer.
2009-07-23 19:06:52 +02:00
Harald Welte dcaf5654db gms_transactions data model reorganization
This changeset factors out gsm_transaction as something independent
of call control in preparation to re-use the code from SMS.  A
transaction is uniquely identified by either its callref, or by
a tuple of (transaction_id, protocol, subscriber).
2009-07-23 18:56:43 +02:00
Harald Welte 9176bd46e3 make sure subscr->net is always set
since a subscriber is an element of the gsm_network, we have to ensure
subscr->net is always set correctly.  We do this by using gsm_network
as an argument to all functions that resolve or create a subscriber.
2009-07-23 18:46:00 +02:00
Harald Welte ae05d247af Merge branch 'master' into sms 2009-07-19 18:49:15 +02:00
Harald Welte ae0f2362bb send DEACTIVATE SACCH when sending RR CHANEL RELEASE
As per specification, we first send the RR CHANNEL RELEASE to the MS,
and then tell the BTS to disable the SACCH on that channel.
2009-07-19 18:36:49 +02:00
Harald Welte 7543eb72d0 fix copy+paste mistake in ecnoding short net name in mm info 2009-07-19 17:51:36 +02:00
Harald Welte 20855547bf rename ip.access structure field members and variables
to reflect that we now know their true names/meanings
2009-07-12 09:50:35 +02:00
Harald Welte f0465bd6cb Merge branch 'master' into sms 2009-07-05 14:10:01 +02:00
Harald Welte c2e302dc84 Store classmark1/2/3 in equipment SQL table
For further evaluation/analysis, this patch stores the classmark 1, 2 and 3
values of every equipment in the SQL database.  We can use this non-volatile
data to determine the supported features for each handset that we've ever
seen on our network.
2009-07-05 14:08:13 +02:00
Harald Welte 5a691b5290 fix measurement report parsing of MEAS VALID logic
As Dieter points out, the logic level is inverted. 0 means valid.
2009-07-05 04:05:44 +02:00
Harald Welte 24516ea2d6 make sure we always schedule a location updating reject
IT sems that if a MS uses the TMSI of a previous network, we did not start
the reject timer.  Thanks to Andreas Eversberg.
2009-07-04 10:18:00 +02:00
Harald Welte 4a3464c565 remove bogus extra check for data->imsi[0] in mncc_send
As Andreas points out, we already check for this condition some 10 lines
below, no need to check twice.
2009-07-04 10:11:24 +02:00
Harald Welte 1a5c6bd88c gsm48 lchan signal handling: use correct pointer
As Andreas Eversberg has pointed out, we need to use signal_data
rather than handler_data.
2009-07-04 09:35:21 +02:00
Harald Welte a0368540ab cosmetic cleanup of LOCATION UPDATE REQ print-out 2009-06-27 03:09:45 +02:00
Harald Welte 10d0e67e2c add new DMEAS debug category for measurement reporting
disable it by default
2009-06-27 03:09:38 +02:00
Harald Welte 470ec29b0d use taloc_zero() rather than talloc() and explisit memset() 2009-06-26 20:25:23 +02:00
Harald Welte c05677b036 fix two segfaults
* when paging callback is called, we need to consider a failed paging
  operation (i.e. lchan == NULL)
* we have to zero-initialize every transaction that is allocated
2009-06-26 20:17:06 +02:00
Harald Welte 9b11e8741d zero-initialize some more memory that we allocate 2009-06-26 19:42:28 +02:00
Harald Welte 316c825fcd fix MNCC memory leak
after passing the mncc structure (contained in msgb) to the mncc layer,
we have to release its memory.  This leak was discovered as a direct result of
using talloc.
2009-06-26 19:40:48 +02:00
Harald Welte 966636f39f use named variant when allocating msgb's
when we generate a talloc report (SIGUSR1), we can now see which system
allocated a given msgb, this helps memory leak debugging
2009-06-26 19:39:35 +02:00
Harald Welte e441d9c361 switch to dynamically allocated BTS and TRX data structures
This makes it much easier to do run-time configuration using the vty
interface.
2009-06-21 16:17:15 +02:00
Harald Welte 2cf161be08 introduce talloc all over OpenBSC 2009-06-20 22:36:41 +02:00
Andreas Eversberg c079be4d38 mncc: Add IMSI to gsm_mncc
This allows us to do subscriber lookups based on IMSI and e.g. establish
MT calls to subscribers with no assigned extension.
2009-06-15 23:22:09 +02:00
Andreas Eversberg 7563ac97c4 Use correct cause value and cause location
Fixed indication of cause value and location.
Replaced plain cause numbers by definitions from header file.
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index f323a2a..39e7b1f 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -1865,8 +1865,7 @@ int mncc_release_ind(struct gsm_network *net, struct gsm_trans *trans,

 	memset(&rel, 0, sizeof(rel));
 	rel.callref = callref;
-	mncc_set_cause(&rel, GSM48_CAUSE_LOC_PRN_S_LU,
-		       GSM48_CC_CAUSE_UNASSIGNED_NR);
+	mncc_set_cause(&rel, location, value);
 	return mncc_recvmsg(net, trans, MNCC_REL_IND, &rel);
 }

@@ -1879,7 +1878,9 @@ void free_trans(struct gsm_trans *trans)
 	/* send release to L4, if callref still exists */
 	if (trans->callref) {
 		/* Ressource unavailable */
-		mncc_release_ind(trans->network, trans, trans->callref, 1, 47);
+		mncc_release_ind(trans->network, trans, trans->callref,
+			GSM48_CAUSE_LOC_PRN_S_LU,
+			GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
 		if (trans->state != GSM_CSTATE_NULL)
 			new_cc_state(trans, GSM_CSTATE_NULL);
 	}
@@ -1960,7 +1961,7 @@ static int setup_trig_pag_evt(unsigned int hooknum, unsigned int event,
 				subscr->extension);
 			/* Temporarily out of order */
 			mncc_release_ind(transt->network, transt, transt->callref,
-					 1, 27);
+					 1, GSM48_CC_CAUSE_DEST_OOO);
 			transt->callref = 0;
 			free_trans(transt);
 			break;
@@ -2270,7 +2271,8 @@ static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg)
 			"This is not allowed!\n");
 		/* Temporarily out of order */
 		rc = mncc_release_ind(trans->network, trans, trans->callref,
-				      1, 47);
+				      GSM48_CAUSE_LOC_PRN_S_LU,
+				      GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
 		trans->callref = 0;
 		free_trans(trans);
 		return rc;
@@ -2287,7 +2289,8 @@ static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg)
 	if ((trans_id_mask & 0x007f) == 0x7f) {
 		/* no free transaction ID */
 		rc = mncc_release_ind(trans->network, trans, trans->callref,
-				      1, 47);
+				      GSM48_CAUSE_LOC_PRN_S_LU,
+				      GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
 		trans->callref = 0;
 		free_trans(trans);
 		return rc;
@@ -3373,14 +3376,18 @@ int mncc_send(struct gsm_network *net, int msg_type, void *arg)
 				"unknown callref %d\n", data->called.number,
 				get_mncc_name(msg_type), data->callref);
 			/* Invalid call reference */
-			return mncc_release_ind(net, NULL, data->callref, 1, 81);
+			return mncc_release_ind(net, NULL, data->callref,
+				GSM48_CAUSE_LOC_PRN_S_LU,
+				GSM48_CC_CAUSE_INVAL_TRANS_ID);
 		}
 		if (!data->called.number[0] && !data->called.imsi[0]) {
 			DEBUGP(DCC, "(bts - trx - ts - ti) "
 				"Received '%s' from MNCC with "
 				"no number or IMSI\n", get_mncc_name(msg_type));
 			/* Invalid number */
-			return mncc_release_ind(net, NULL, data->callref, 1, 28);
+			return mncc_release_ind(net, NULL, data->callref,
+				GSM48_CAUSE_LOC_PRN_S_LU,
+				GSM48_CC_CAUSE_INV_NR_FORMAT);
 		}
 		/* New transaction due to setup, find subscriber */
 		if (data->called.number[0])
@@ -3394,7 +3401,9 @@ int mncc_send(struct gsm_network *net, int msg_type, void *arg)
 				"unknown subscriber %s\n", data->called.number,
 				get_mncc_name(msg_type), data->called.number);
 			/* Unknown subscriber */
-			return mncc_release_ind(net, NULL, data->callref, 1, 1);
+			return mncc_release_ind(net, NULL, data->callref,
+				GSM48_CAUSE_LOC_PRN_S_LU,
+				GSM48_CC_CAUSE_UNASSIGNED_NR);
 		}
 		/* If subscriber is not "attached" */
 		if (!subscr->lac) {
@@ -3404,14 +3413,18 @@ int mncc_send(struct gsm_network *net, int msg_type, void *arg)
 				get_mncc_name(msg_type), data->called.number);
 			subscr_put(subscr);
 			/* Temporarily out of order */
-			return mncc_release_ind(net, NULL, data->callref, 1, 27);
+			return mncc_release_ind(net, NULL, data->callref,
+				GSM48_CAUSE_LOC_PRN_S_LU,
+				GSM48_CC_CAUSE_DEST_OOO);
 		}
 		/* Create transaction */
 		if (!(trans = calloc(1, sizeof(struct gsm_trans)))) {
 			DEBUGP(DCC, "No memory for trans.\n");
 			subscr_put(subscr);
 			/* Ressource unavailable */
-			mncc_release_ind(net, NULL, data->callref, 1, 47);
+			mncc_release_ind(net, NULL, data->callref,
+				GSM48_CAUSE_LOC_PRN_S_LU,
+				GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
 			return -ENOMEM;
 		}
 		trans->callref = data->callref;
2009-06-14 22:14:12 +08:00
Andreas Eversberg 71aab45bbe Fix lchan refcounting in case of IMSI DETACH
Removed lchan_put() after IMSI detach function.
We don't need to put lchan, because we don't hold a ressource.
2009-06-14 22:09:12 +08:00
Harald Welte 92f70c5773 04.08: Make mncc-harald branch work
This fixes two reasons for crashes due to uninitialized memory or
wrong pointer passing introduced in my own mncc modifications
2009-06-12 01:54:08 +08:00