Add "morsegerman" parameter; fix german tone pattern timings

- Parameter "morsegerman" for option "local-tones" will generate morse-a dialtone (pre-1979).
- Fixed german tone pattern timings according to 1TR110-1 Chapter 8
  * Busy tone: 480ms on / 480ms off
  * Hangup tone: 480ms on / 480ms off
  * Old german ringing: 1000ms on / 4000ms off
  * Old german busy/hangup tone: 125ms on / 475ms off
This commit is contained in:
Dennis Grunert 2024-02-04 00:28:45 +01:00 committed by Andreas Eversberg
parent 5ed88bacae
commit 56b8bf97d7
6 changed files with 38 additions and 20 deletions

View File

@ -1934,6 +1934,9 @@ int process_progress(call_t *call, osmo_cc_msg_t *msg, struct l3_msg *l3m, int c
case TONES_TYPE_OLDGERMAN:
tone = TONE_GERMAN_OLDDIALTONE;
break;
case TONES_TYPE_MORSEGERMAN:
tone = TONE_GERMAN_MORSEDIALTONE;
break;
default:
tone = TONE_AMERICAN_DIALTONE;
}
@ -1949,6 +1952,7 @@ int process_progress(call_t *call, osmo_cc_msg_t *msg, struct l3_msg *l3m, int c
tone = TONE_GERMAN_RINGING;
break;
case TONES_TYPE_OLDGERMAN:
case TONES_TYPE_MORSEGERMAN:
tone = TONE_GERMAN_OLDRINGING;
break;
default:
@ -1965,6 +1969,7 @@ int process_progress(call_t *call, osmo_cc_msg_t *msg, struct l3_msg *l3m, int c
tone = TONE_GERMAN_BUSY;
break;
case TONES_TYPE_OLDGERMAN:
case TONES_TYPE_MORSEGERMAN:
tone = TONE_GERMAN_OLDBUSY;
break;
default:
@ -1978,6 +1983,7 @@ int process_progress(call_t *call, osmo_cc_msg_t *msg, struct l3_msg *l3m, int c
tone = TONE_GERMAN_HANGUP;
break;
case TONES_TYPE_OLDGERMAN:
case TONES_TYPE_MORSEGERMAN:
tone = TONE_GERMAN_OLDHANGUP;
break;
default:
@ -1990,6 +1996,7 @@ int process_progress(call_t *call, osmo_cc_msg_t *msg, struct l3_msg *l3m, int c
tone = TONE_GERMAN_GASSENBESETZT;
break;
case TONES_TYPE_OLDGERMAN:
case TONES_TYPE_MORSEGERMAN:
tone = TONE_GERMAN_OLDHANGUP;
break;
default:
@ -2002,6 +2009,7 @@ int process_progress(call_t *call, osmo_cc_msg_t *msg, struct l3_msg *l3m, int c
tone = TONE_SPECIAL_INFO;
break;
case TONES_TYPE_OLDGERMAN:
case TONES_TYPE_MORSEGERMAN:
tone = TONE_SPECIAL_INFO;
break;
default:

View File

@ -26,6 +26,7 @@
#define TONES_TYPE_AMERICAN 1
#define TONES_TYPE_GERMAN 2
#define TONES_TYPE_OLDGERMAN 3
#define TONES_TYPE_MORSEGERMAN 4
#define DIRECTION_ORIGINATOR 0
#define DIRECTION_TERMINATOR 1

View File

@ -134,7 +134,7 @@ static void print_help()
printf(" Send AOC-S charging information\n");
printf(" --time-no-seconds\n");
printf(" Send date/time IE without seconds\n");
printf(" -T --local-tones german | oldgerman | american\n");
printf(" -T --local-tones german | oldgerman | morsegerman | american\n");
printf(" Send locally generated tones, if not provided by remote interface.\n");
printf(" -D --debug-misdn\n");
printf(" Enables mISDN stack debugging.\n");
@ -268,6 +268,8 @@ static int handle_options(int short_option, int argi, char **argv)
local_tones = TONES_TYPE_GERMAN;
else if (!strcasecmp(argv[argi], "oldgerman"))
local_tones = TONES_TYPE_OLDGERMAN;
else if (!strcasecmp(argv[argi], "morsegerman"))
local_tones = TONES_TYPE_MORSEGERMAN;
else {
fprintf(stderr, "Invalid tones type given!\n");
return -EINVAL;

View File

@ -258,6 +258,11 @@ static struct pattern {
{SIZE_GO, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{7956, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
{TONE_GERMAN_MORSEDIALTONE,
{DATA_GO, DATA_S, DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL},
{SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL},
{1600, 2400, 5600, 6400, 0, 0, 0, 0, 0, 0} },
{TONE_AMERICAN_DIALTONE,
{DATA_DT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{SIZE_DT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
@ -292,7 +297,7 @@ static struct pattern {
{TONE_GERMAN_OLDRINGING,
{DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{8000, 40000, 0, 0, 0, 0, 0, 0, 0, 0} },
{8000, 32000, 0, 0, 0, 0, 0, 0, 0, 0} },
{TONE_AMERICAN_RINGING,
{DATA_RI, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
@ -317,12 +322,12 @@ static struct pattern {
{TONE_GERMAN_BUSY,
{DATA_GA, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} },
{3840, 3840, 0, 0, 0, 0, 0, 0, 0, 0} },
{TONE_GERMAN_OLDBUSY,
{DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{1000, 5000, 0, 0, 0, 0, 0, 0, 0, 0} },
{1000, 3800, 0, 0, 0, 0, 0, 0, 0, 0} },
{TONE_AMERICAN_BUSY,
{DATA_BU, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
@ -332,12 +337,12 @@ static struct pattern {
{TONE_GERMAN_HANGUP,
{DATA_GA, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} },
{3840, 3840, 0, 0, 0, 0, 0, 0, 0, 0} },
{TONE_GERMAN_OLDHANGUP,
{DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
{1000, 5000, 0, 0, 0, 0, 0, 0, 0, 0} },
{1000, 3800, 0, 0, 0, 0, 0, 0, 0, 0} },
{TONE_AMERICAN_HANGUP,
{DATA_DT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},

View File

@ -177,12 +177,13 @@
#define TONE_OFF 0x0000
#define TONE_GERMAN_DIALTONE 0x0001
#define TONE_GERMAN_OLDDIALTONE 0x0002
#define TONE_AMERICAN_DIALTONE 0x0003
#define TONE_GERMAN_DIALPBX 0x0004
#define TONE_GERMAN_OLDDIALPBX 0x0005
#define TONE_AMERICAN_DIALPBX 0x0006
#define TONE_GERMAN_RINGING 0x0007
#define TONE_GERMAN_OLDRINGING 0x0008
#define TONE_GERMAN_MORSEDIALTONE 0x0003
#define TONE_AMERICAN_DIALTONE 0x0004
#define TONE_GERMAN_DIALPBX 0x0005
#define TONE_GERMAN_OLDDIALPBX 0x0006
#define TONE_AMERICAN_DIALPBX 0x0007
#define TONE_GERMAN_RINGING 0x0008
#define TONE_GERMAN_OLDRINGING 0x0009
#define TONE_AMERICAN_RINGPBX 0x000b
#define TONE_GERMAN_RINGPBX 0x000c
#define TONE_GERMAN_OLDRINGPBX 0x000d
@ -195,7 +196,7 @@
#define TONE_AMERICAN_HANGUP 0x0014
#define TONE_SPECIAL_INFO 0x0015
#define TONE_GERMAN_GASSENBESETZT 0x0016
#define TONE_GERMAN_AUFSCHALTTON 0x0016
#define TONE_GERMAN_AUFSCHALTTON 0x0017
/* MPH_INFORMATION_IND */
#define L1_SIGNAL_LOS_OFF 0x0010

View File

@ -181,12 +181,13 @@
#define TONE_OFF 0x0000
#define TONE_GERMAN_DIALTONE 0x0001
#define TONE_GERMAN_OLDDIALTONE 0x0002
#define TONE_AMERICAN_DIALTONE 0x0003
#define TONE_GERMAN_DIALPBX 0x0004
#define TONE_GERMAN_OLDDIALPBX 0x0005
#define TONE_AMERICAN_DIALPBX 0x0006
#define TONE_GERMAN_RINGING 0x0007
#define TONE_GERMAN_OLDRINGING 0x0008
#define TONE_GERMAN_MORSEDIALTONE 0x0003
#define TONE_AMERICAN_DIALTONE 0x0004
#define TONE_GERMAN_DIALPBX 0x0005
#define TONE_GERMAN_OLDDIALPBX 0x0006
#define TONE_AMERICAN_DIALPBX 0x0007
#define TONE_GERMAN_RINGING 0x0008
#define TONE_GERMAN_OLDRINGING 0x0009
#define TONE_AMERICAN_RINGPBX 0x000b
#define TONE_GERMAN_RINGPBX 0x000c
#define TONE_GERMAN_OLDRINGPBX 0x000d
@ -199,7 +200,7 @@
#define TONE_AMERICAN_HANGUP 0x0014
#define TONE_SPECIAL_INFO 0x0015
#define TONE_GERMAN_GASSENBESETZT 0x0016
#define TONE_GERMAN_AUFSCHALTTON 0x0016
#define TONE_GERMAN_AUFSCHALTTON 0x0017
/* MPH_INFORMATION_IND */
#define L1_SIGNAL_LOS_OFF 0x0010