Added config option for subscriber number prefix.

master
MelwareDE 2008-07-07 20:29:19 +00:00
parent b45e940762
commit d2b4bdd349
5 changed files with 17 additions and 3 deletions

View File

@ -4,6 +4,8 @@ CHANGES
HEAD
------------------
- added config setting 'faxdetecttime' to limit the fax detection for a given amount of seconds.
- added config option for subscriber prefix. Some lines may show local calls without area code
signaled as subscriber-number. Here the complete prefix including area code must be added.
chan_capi-1.1.1

2
README
View File

@ -50,7 +50,7 @@ This chan_capi version includes:
- Reject call waiting (ACO)
- DID for Point to Point mode (a.k.a overlap receiving)
- Rx/Tx gains using positive linar value (rxgain=1.0, txgain=1.0 means no change)
- (Inter)national dialing prefix (for callerid) configurable in capi.conf
- (Inter)national/subscriber dialing prefix (for callerid) configurable in capi.conf
- CLI command "capi info" shows B channel status of chan_capi
- Catch all MSN (incomingmsn=*)
- Some configuration enhancements (msn=123,124,125)

View File

@ -6,8 +6,9 @@
; general section
[general]
nationalprefix=0
internationalprefix=00
nationalprefix=0 ; or for example "+49"
internationalprefix=00 ; or for example "+"
;subscriberprefix=+4969 ; prefix including area code (some lines need this)
rxgain=1.0 ;linear receive gain (1.0 = no change)
txgain=1.0 ;linear transmit gain (1.0 = no change)
language=de ;set default language

View File

@ -160,6 +160,7 @@ static int interface_task;
static char capi_national_prefix[AST_MAX_EXTENSION];
static char capi_international_prefix[AST_MAX_EXTENSION];
static char capi_subscriber_prefix[AST_MAX_EXTENSION];
static char default_language[MAX_LANGUAGE] = "";
@ -2933,6 +2934,8 @@ static void capidev_handle_info_indication(_cmsg *CMSG, unsigned int PLCI, unsig
p2 = capi_national_prefix;
} else if (val == CAPI_ETSI_NPLAN_INTERNAT) {
p2 = capi_international_prefix;
} else if (val == CAPI_ETSI_NPLAN_SUBSCRIBER) {
p2 = capi_subscriber_prefix;
}
}
cc_verbose(3, 1, VERBOSE_PREFIX_3 "%s: info element REDIRECTION NUMBER '(%s)%s'\n",
@ -3703,6 +3706,9 @@ static void capidev_handle_connect_indication(_cmsg *CMSG, unsigned int PLCI, un
else if ((callernplan & 0x70) == CAPI_ETSI_NPLAN_INTERNAT)
snprintf(i->cid, (sizeof(i->cid)-1), "%s%s%s",
i->prefix, capi_international_prefix, CID);
else if ((callernplan & 0x70) == CAPI_ETSI_NPLAN_SUBSCRIBER)
snprintf(i->cid, (sizeof(i->cid)-1), "%s%s%s",
i->prefix, capi_subscriber_prefix, CID);
else
snprintf(i->cid, (sizeof(i->cid)-1), "%s%s",
i->prefix, CID);
@ -6217,6 +6223,7 @@ static int capi_eval_config(struct ast_config *cfg)
/* prefix defaults */
cc_copy_string(capi_national_prefix, CAPI_NATIONAL_PREF, sizeof(capi_national_prefix));
cc_copy_string(capi_international_prefix, CAPI_INTERNAT_PREF, sizeof(capi_international_prefix));
cc_copy_string(capi_subscriber_prefix, CAPI_SUBSCRIBER_PREF, sizeof(capi_subscriber_prefix));
#ifdef CC_AST_HAS_VERSION_1_4
/* Copy the default jb config over global_jbconf */
@ -6238,6 +6245,8 @@ static int capi_eval_config(struct ast_config *cfg)
cc_copy_string(capi_national_prefix, v->value, sizeof(capi_national_prefix));
} else if (!strcasecmp(v->name, "internationalprefix")) {
cc_copy_string(capi_international_prefix, v->value, sizeof(capi_international_prefix));
} else if (!strcasecmp(v->name, "subscriberprefix")) {
cc_copy_string(capi_subscriber_prefix, v->value, sizeof(capi_subscriber_prefix));
} else if (!strcasecmp(v->name, "language")) {
cc_copy_string(default_language, v->value, sizeof(default_language));
} else if (!strcasecmp(v->name, "rxgain")) {

View File

@ -162,6 +162,7 @@ typedef struct fax3proto3 B3_PROTO_FAXG3;
#define CAPI_NATIONAL_PREF "0"
#define CAPI_INTERNAT_PREF "00"
#define CAPI_SUBSCRIBER_PREF ""
#define ECHO_TX_COUNT 5 /* 5 x 20ms = 100ms */
#define ECHO_EFFECTIVE_TX_COUNT 3 /* 2 x 20ms = 40ms == 40-100ms ... ignore first 40ms */
@ -561,6 +562,7 @@ struct cc_capi_controller {
#define CAPI_ETSI_DISCONNECT 0x45
/* ETSI 300 102-1 Numbering Plans */
#define CAPI_ETSI_NPLAN_SUBSCRIBER 0x40
#define CAPI_ETSI_NPLAN_NATIONAL 0x20
#define CAPI_ETSI_NPLAN_INTERNAT 0x10