aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-08-15 11:25:45 +0200
committerHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-08-15 11:25:45 +0200
commit0abaf33297d79af507c82a2dcafaa83bcb9b54ae (patch)
tree9e06db8f6c0377d28118ed6bcbe1625120a12386
parent10250e657b4c96b7b1817b8e30c3a1de0f6ad018 (diff)
paging_request() now returns the number of started paging requests
this helps the caller to determine if he will ever get called back or not (and if he should free his data structures now or not)
-rw-r--r--openbsc/src/gsm_04_11.c2
-rw-r--r--openbsc/src/paging.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/openbsc/src/gsm_04_11.c b/openbsc/src/gsm_04_11.c
index a7f69d105..277a321a8 100644
--- a/openbsc/src/gsm_04_11.c
+++ b/openbsc/src/gsm_04_11.c
@@ -1046,7 +1046,7 @@ int gsm411_send_sms_subscr(struct gsm_subscriber *subscr,
/* if not, we have to start paging */
rc = paging_request(subscr->net, subscr, RSL_CHANNEED_SDCCH,
paging_cb_send_sms, sms);
- if (rc < 0)
+ if (rc <= 0)
sms_free(sms);
return 0;
diff --git a/openbsc/src/paging.c b/openbsc/src/paging.c
index f7ee81d24..87c5a5407 100644
--- a/openbsc/src/paging.c
+++ b/openbsc/src/paging.c
@@ -247,13 +247,16 @@ int paging_request(struct gsm_network *network, struct gsm_subscriber *subscr,
int type, gsm_cbfn *cbfn, void *data)
{
struct gsm_bts *bts = NULL;
- int rc;
+ int num_pages = 0;
/* start paging subscriber on all BTS within Location Area */
do {
+ int rc;
+
bts = gsm_bts_by_lac(network, subscr->lac, bts);
if (!bts)
break;
+ num_pages++;
/* Trigger paging, pass any error to caller */
rc = _paging_request(bts, subscr, type, cbfn, data);
@@ -261,7 +264,7 @@ int paging_request(struct gsm_network *network, struct gsm_subscriber *subscr,
return rc;
} while (1);
- return 0;
+ return num_pages;
}