aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2017-11-04 17:08:57 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2017-11-05 17:00:01 +0100
commite9583d56615256f3d365aace1f02ae99361111c7 (patch)
tree38c799d426e9f644e7e08d4f47dad8f6c1944701
parentaeb31a7a34fc2accd0c840d7d8e91bc4a946c7d9 (diff)
R2000: Make recall work when call is directly answered by call_up_setup
It is not recommended to use recall function with built-in MNCC (auto-answer), because the phone is not fast enough to switch back to call control channel and so it misses the first paging. But anyway it works. Also the channel layout is checked for having traffic and control channel.
-rw-r--r--src/r2000/r2000.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/src/r2000/r2000.c b/src/r2000/r2000.c
index 1271292..8c148f5 100644
--- a/src/r2000/r2000.c
+++ b/src/r2000/r2000.c
@@ -36,7 +36,7 @@
#define CUT_OFF_EMPHASIS_R2000 300 //FIXME: use real cut-off / time constant
-#define PAGE_TRIES 2 /* how many times trying to page */
+#define PAGE_TRIES 3 /* how many times trying to page */
#define IDENT_TIME 3.0 /* time to wait for identity response */
#define ALERT_TIME 60.0 /* time to wait for party to answer */
#define DIAL1_TIME 1.0 /* time to wait for party to dial digits 1..10 */
@@ -427,7 +427,7 @@ int r2000_create(int band, int channel, enum r2000_chan_type chan_type, const ch
r2000 = (r2000_t *)sender;
if ((r2000->sysinfo.chan_type == CHAN_TYPE_CC || r2000->sysinfo.chan_type == CHAN_TYPE_CC_TC)
&& (chan_type == CHAN_TYPE_CC || chan_type == CHAN_TYPE_CC_TC)) {
- PDEBUG(DCNETZ, DEBUG_NOTICE, "More than one control channel is not supported, please use traffic channels!\n");
+ PDEBUG(DCNETZ, DEBUG_NOTICE, "More than one control channel is not supported, please define other channels as traffic channels!\n");
return -EINVAL;
}
}
@@ -469,12 +469,6 @@ int r2000_create(int band, int channel, enum r2000_chan_type chan_type, const ch
if (rc < 0)
goto error;
- r2000->pre_emphasis = pre_emphasis;
- r2000->de_emphasis = de_emphasis;
- rc = init_emphasis(&r2000->estate, samplerate, CUT_OFF_EMPHASIS_R2000);
- if (rc < 0)
- goto error;
-
/* init audio processing */
rc = dsp_init_sender(r2000);
if (rc < 0) {
@@ -500,7 +494,6 @@ void r2000_check_channels(void)
sender_t *sender;
r2000_t *r2000;
int cc = 0, tc = 0, combined = 0;
- int note = 0;
for (sender = sender_head; sender; sender = sender->next) {
r2000 = (r2000_t *) sender;
@@ -515,26 +508,18 @@ void r2000_check_channels(void)
}
}
if (cc && !tc) {
- if (note)
- PDEBUG(DR2000, DEBUG_NOTICE, "\n");
PDEBUG(DR2000, DEBUG_NOTICE, "*** Selected channel(s) can be used for control only.\n");
- PDEBUG(DR2000, DEBUG_NOTICE, "*** No call from the mobile phone is possible on this channel.\n");
+ PDEBUG(DR2000, DEBUG_NOTICE, "*** No call is possible at all!\n");
PDEBUG(DR2000, DEBUG_NOTICE, "*** Use combined 'CC/TC' instead!\n");
- note = 1;
}
if (tc && !cc) {
- if (note)
- PDEBUG(DR2000, DEBUG_NOTICE, "\n");
PDEBUG(DR2000, DEBUG_NOTICE, "*** Selected channel(s) can be used for traffic only.\n");
- PDEBUG(DR2000, DEBUG_NOTICE, "*** No call is possible at all!\n");
+ PDEBUG(DR2000, DEBUG_NOTICE, "*** No register/call is possible at all!\n");
PDEBUG(DR2000, DEBUG_NOTICE, "*** Use combined 'CC/TC' instead!\n");
- note = 1;
}
if (combined) {
- if (note)
- PDEBUG(DR2000, DEBUG_NOTICE, "\n");
- PDEBUG(DR2000, DEBUG_NOTICE, "*** Selected combined 'CC/TC' some phones might reject this.\n");
- note = 1;
+ PDEBUG(DR2000, DEBUG_NOTICE, "*** Selected (non standard) combined 'CC/TC'.\n");
+ PDEBUG(DR2000, DEBUG_NOTICE, "Phones might reject this, but non of my phones does, so it's ok.\n");
}
}
@@ -878,7 +863,7 @@ static void timeout_in_ident(r2000_t *r2000)
/* page again ... */
if (--r2000->page_try) {
- r2000_page(r2000, r2000->page_try, (r2000->callref) ? STATE_IN_ASSIGN: STATE_RECALL_ASSIGN);
+ r2000_page(r2000, r2000->page_try, (r2000->state == STATE_IN_IDENT) ? STATE_IN_ASSIGN: STATE_RECALL_ASSIGN);
return;
}
@@ -920,13 +905,15 @@ static int setup_call(r2000_t *r2000)
/* make call toward network */
PDEBUG(DR2000, DEBUG_INFO, "Setup call to network.\n");
+ /* must set callref, since MNCC may directly call call_down_answer to trigger recall, nested in call_up_setup */
+ r2000->callref = callref;
rc = call_up_setup(callref, subscriber2string(&r2000->subscriber), r2000->subscriber.dialing);
if (rc < 0) {
PDEBUG(DR2000, DEBUG_NOTICE, "Call rejected (cause %d), releasing.\n", -rc);
+ r2000->callref = 0;
r2000_release(r2000);
return rc;
}
- r2000->callref = callref;
return 0;
}