|
|
|
@ -45,7 +45,7 @@ static int tx_delay = 0;
|
|
|
|
|
static int clip = 0;
|
|
|
|
|
static int cid_bell = 0;
|
|
|
|
|
static int cid_dtmf = 0;
|
|
|
|
|
static int cid_date = 0;
|
|
|
|
|
static int clip_date = 0;
|
|
|
|
|
static int enblock = 4;
|
|
|
|
|
static int recall = 0;
|
|
|
|
|
static int ringing_types_incoming[SUBSCRIBER_MAX] = { 0 };
|
|
|
|
@ -59,7 +59,7 @@ static const char *cc_argv[MAX_CC_ARGS];
|
|
|
|
|
|
|
|
|
|
static void print_usage(const char *app)
|
|
|
|
|
{
|
|
|
|
|
printf("Usage: %s -s <socketname> [<options>]\n", app);
|
|
|
|
|
printf("Usage: %s -s <socketname> [--clip --clip-date] [--recall] [<options>]\n", app);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void print_help()
|
|
|
|
@ -71,8 +71,8 @@ static void print_help()
|
|
|
|
|
printf(" Give a config file to use. If it starts with '~/', path is at home dir.\n");
|
|
|
|
|
printf(" Each line in config file is one option, '-' or '--' must not be given!\n");
|
|
|
|
|
debug_print_help();
|
|
|
|
|
printf(" -s --socket <path>\n");
|
|
|
|
|
printf(" Path to UNIX socket that provides layer 1 connection to an PSTN device\n");
|
|
|
|
|
printf(" -s --socket <name>\n");
|
|
|
|
|
printf(" Abstract UNIX socket that provides layer 1 connection to a PSTN device\n");
|
|
|
|
|
printf(" -n --name <interface name>\n");
|
|
|
|
|
printf(" Give name of this interface. It will be sent in each call towards\n");
|
|
|
|
|
printf(" -I --subscriber <subscriber id>\n");
|
|
|
|
@ -85,17 +85,17 @@ static void print_help()
|
|
|
|
|
printf(" Give a delay in milliseconds. This is required for modem/fax. Audio\n");
|
|
|
|
|
printf(" toward ISDN interface is buffered with the given delay.\n");
|
|
|
|
|
printf(" This feature alters dejittering strategy.\n");
|
|
|
|
|
printf(" --clip [--cid-date]\n");
|
|
|
|
|
printf(" --clip [--clip-date]\n");
|
|
|
|
|
printf(" Enable caller ID, optionally with date info. (disabled by default)\n");
|
|
|
|
|
printf(" --clip-date\n");
|
|
|
|
|
printf(" Send date+time with caller ID.\n");
|
|
|
|
|
printf(" --cid-bell\n");
|
|
|
|
|
printf(" Use Bell 202 to modulate caller ID, rather than V.23 (default).\n");
|
|
|
|
|
printf(" Note that both systems are so similar (and have equal center frequency),\n");
|
|
|
|
|
printf(" Note that both systems are so similar (and have same center frequency),\n");
|
|
|
|
|
printf(" so that it does not matter which one is used. (my oppinion!)\n");
|
|
|
|
|
printf(" --cid-dtmf D\n");
|
|
|
|
|
printf(" Use DTMF with given start digit 'D' for default, rather than FSK.\n");
|
|
|
|
|
printf(" 'D' is used in Taiwan, 'A' in Brazil...\n");
|
|
|
|
|
printf(" --cid-date\n");
|
|
|
|
|
printf(" Send date+time with caller ID. (May cause errors on some phones.)\n");
|
|
|
|
|
printf(" --enblock off | <seconds>\n");
|
|
|
|
|
printf(" Enable en-block dialing, to collect number before setup. The value\n");
|
|
|
|
|
printf(" given is the number of seconds to wait for more digits to be dialed.\n");
|
|
|
|
@ -137,17 +137,17 @@ static void print_recall()
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define OPT_TX_DELAY 256
|
|
|
|
|
#define OPT_TX_CLIP 257
|
|
|
|
|
#define OPT_TX_CID_BELL 258
|
|
|
|
|
#define OPT_TX_CID_DTMF 259
|
|
|
|
|
#define OPT_TX_CID_DATE 260
|
|
|
|
|
#define OPT_TX_ENBLOCK 261
|
|
|
|
|
#define OPT_TX_RECALL 262
|
|
|
|
|
#define OPT_TX_RING_I 'R'
|
|
|
|
|
#define OPT_TX_RING_H 264
|
|
|
|
|
#define OPT_ULAW 265
|
|
|
|
|
#define OPT_SERVING 266
|
|
|
|
|
#define OPT_TX_DELAY 256
|
|
|
|
|
#define OPT_TX_CLIP 257
|
|
|
|
|
#define OPT_TX_CLIP_DATE 258
|
|
|
|
|
#define OPT_TX_CID_BELL 259
|
|
|
|
|
#define OPT_TX_CID_DTMF 260
|
|
|
|
|
#define OPT_TX_ENBLOCK 261
|
|
|
|
|
#define OPT_TX_RECALL 262
|
|
|
|
|
#define OPT_TX_RING_I 'R'
|
|
|
|
|
#define OPT_TX_RING_H 264
|
|
|
|
|
#define OPT_ULAW 265
|
|
|
|
|
#define OPT_SERVING 266
|
|
|
|
|
|
|
|
|
|
static void add_options(void)
|
|
|
|
|
{
|
|
|
|
@ -158,9 +158,9 @@ static void add_options(void)
|
|
|
|
|
option_add('I', "subscriber", 1);
|
|
|
|
|
option_add(OPT_TX_DELAY, "tx-delay", 1);
|
|
|
|
|
option_add(OPT_TX_CLIP, "clip", 0);
|
|
|
|
|
option_add(OPT_TX_CLIP_DATE, "clip-date", 0);
|
|
|
|
|
option_add(OPT_TX_CID_BELL, "cid-bell", 0);
|
|
|
|
|
option_add(OPT_TX_CID_DTMF, "cid-dtmf", 1);
|
|
|
|
|
option_add(OPT_TX_CID_DATE, "cid-date", 0);
|
|
|
|
|
option_add(OPT_TX_ENBLOCK, "enblock", 1);
|
|
|
|
|
option_add(OPT_TX_RECALL, "recall", 0);
|
|
|
|
|
option_add(OPT_TX_RING_I, "ringing-type-incoming", 1);
|
|
|
|
@ -211,6 +211,9 @@ static int handle_options(int short_option, int argi, char **argv)
|
|
|
|
|
case OPT_TX_CLIP:
|
|
|
|
|
clip = 1;
|
|
|
|
|
break;
|
|
|
|
|
case OPT_TX_CLIP_DATE:
|
|
|
|
|
clip_date = 1;
|
|
|
|
|
break;
|
|
|
|
|
case OPT_TX_CID_BELL:
|
|
|
|
|
cid_bell = 1;
|
|
|
|
|
break;
|
|
|
|
@ -221,9 +224,6 @@ static int handle_options(int short_option, int argi, char **argv)
|
|
|
|
|
}
|
|
|
|
|
cid_dtmf = argv[argi][0];
|
|
|
|
|
break;
|
|
|
|
|
case OPT_TX_CID_DATE:
|
|
|
|
|
cid_date = 1;
|
|
|
|
|
break;
|
|
|
|
|
case OPT_TX_ENBLOCK:
|
|
|
|
|
enblock = atoi(argv[argi]);
|
|
|
|
|
break;
|
|
|
|
@ -333,7 +333,7 @@ int main(int argc, char *argv[])
|
|
|
|
|
if (!pstn_ep)
|
|
|
|
|
goto error;
|
|
|
|
|
|
|
|
|
|
rc = pstn_init(pstn_ep, name, socketname, subscribers, subscriber_num, serving_location, tx_delay, clip, cid_bell, cid_dtmf, cid_date, enblock, recall, ringing_types_incoming, ringing_type_hold, tones_type, law);
|
|
|
|
|
rc = pstn_init(pstn_ep, name, socketname, subscribers, subscriber_num, serving_location, tx_delay, clip, cid_bell, cid_dtmf, clip_date, enblock, recall, ringing_types_incoming, ringing_type_hold, tones_type, law);
|
|
|
|
|
if (rc) {
|
|
|
|
|
PDEBUG(DTEL, DEBUG_ERROR, "Endpoint initializing failed!\n");
|
|
|
|
|
goto error;
|
|
|
|
|