Refactoring validity check and prefix processing of dialed number

Command line help shows how many digits and what prefixes can be dialed.

Giving a station ID via command line will be checked for being valid.

The number to call the mobile statione will be checked for being valid.

Prefixes that are defined for a nework will be removed from station ID
automatically.

Multiple station ID lengths are supported:
 * C-Netz: 7 or 8 digits, depending on area code length
 * A-Netz: 5 or 7 digits; number is truncated to last 5 digits.
 * IMTS/MTS: 5 or 7 digits, depending on phone's selector switch.
This commit is contained in:
Andreas Eversberg
2021-10-07 19:35:56 +02:00
parent 3a73f31d7e
commit 423bc42429
41 changed files with 662 additions and 429 deletions

View File

@@ -71,7 +71,7 @@ void free_nmt(nmt_t *nmt)
free(nmt);
}
extern void main_mobile();
extern void main_mobile_loop();
int main(void)
{
@@ -80,7 +80,7 @@ int main(void)
int i, j;
/* this is never called, it forces the linker to add mobile functions */
if (debuglevel == -1000) main_mobile();
if (debuglevel == -1000) main_mobile_loop();
debuglevel = DEBUG_DEBUG;
dms_allow_loopback = 1;

View File

@@ -98,7 +98,7 @@ void sms_deliver_report(nmt_t *nmt, uint8_t ref, int error, uint8_t cause)
printf("(got deliver report from SMS layer)\n");
}
extern void main_mobile();
extern void main_mobile_loop();
int main(void)
{
@@ -107,7 +107,7 @@ int main(void)
int rc;
/* this is never called, it forces the linker to add mobile functions */
if (debuglevel == -1000) main_mobile();
if (debuglevel == -1000) main_mobile_loop();
debuglevel = DEBUG_DEBUG;