- support empty destination number for incoming calls correctly (austrian

telecom does this (sic))
- core now returns "-" instead of "??" for "no number available" (much nicer
  in my eyes)
- new wave file used in remote inquiry for "unknown number"


git-svn-id: https://svn.ibp.de/svn/capisuite/trunk/capisuite@87 4ebea2bb-67d4-0310-8558-a5799e421b66
This commit is contained in:
gernot 2003-04-10 21:29:51 +00:00
parent 49c8d9a178
commit 826f980c3e
8 changed files with 67 additions and 24 deletions

7
NEWS
View File

@ -8,6 +8,13 @@
* scripts: the *_email settings from fax.conf and answering_machine.conf
now allow to set multiple addresses to send the mails to
* scripts: the "*_numbers" settings from fax.conf and answering_machine.conf
now support the special sign "-" for "no destination number available"
(e.g. needed for the austrian "Global Call")
* core: use "-" instead of "??" for "no number available", e.g. important
for the call_from and call_to parameters of scripts
0.4.1a (tag CAPISUITE_041a):
============================
* fixed a bug in the rc-script of CapiSuite which made

View File

@ -754,7 +754,10 @@ make install</screen>
<para>When this list is set to <literal>*</literal>,
<emphasis>all</emphasis> incoming calls will be accepted for this user (use with care!).
This is only useful for a setup with only one user which wants to receive any call as fax.
</para>
</para>
<para>If for any reason <emphasis>no destination</emphasis> number is signalled for special
MSNs (austrian telecom seems to do this for the main MSN, where it is called "Global Call"),
you can use the special sign <literal>-</literal> which means "no destination number available".</para>
<para>This option is optional. If not given, the user can't send or receive fax documents.</para>
</listitem>
</varlistentry>
@ -900,7 +903,12 @@ make install</screen>
are allowed. The answering machine script does also automatic fax detection, so a fax can
be sent to this number. When this list is set to <literal>*</literal>,
<emphasis>all</emphasis> incoming calls will be accepted for this user (use with care!).
This is only useful for a setup with only one user which wants to receive any call.</para>
This is only useful for a setup with only one user which wants to receive any call.
<para>If for any reason <emphasis>no destination</emphasis> number is signalled for special MSNs
(austrian telecom seems to do this for the main MSN, where it is called "Global Call"), you can
use the special sign <literal>-</literal> which means "no destination number available".</para>
<para>This option is optional. If not set, the user won't receive voice calls.</para>
</listitem>
</varlistentry>

View File

@ -1,4 +1,4 @@
# $Id: answering_machine.confin,v 1.4 2003/04/10 20:54:44 gernot Exp $
# $Id: answering_machine.confin,v 1.5 2003/04/10 21:29:51 gernot Exp $
#
# This is the configuration file for the answering machine scripts distributed
# with CapiSuite
@ -98,6 +98,9 @@ record_silence_timeout="5"
# This list contains the numbers on which this user wants to receive incoming
# voice calls. The values are separated by commas. You can also use the special
# entry "*" which stands for accepting ALL incoming calls (use with care!).
# The special character "-" stands for "no destination number available". That
# is necessary for example for the austrian "Global Call" where no number is
# signalled when the main MSN is called (sic).
#
# voice_email="<mailaddress1>,<mailaddress2>,..." (optional, defaults to empty string)
#

View File

@ -2,7 +2,7 @@
# -----------------------------------------------------------
# copyright : (C) 2002 by Gernot Hillier
# email : gernot@hillier.de
# version : $Revision: 1.5 $
# version : $Revision: 1.6 $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -263,7 +263,8 @@ def writeDescription(filename,content):
# @brief say a german number
#
# All numbers from 0 to 99 are said correctly, while all larger ones are
# split into numbers and only the numbers are said one after another
# split into numbers and only the numbers are said one after another.
# An input of "-" produces the word "unbekannt" (unknown)
#
# @param call reference to the call
# @param number the number to say
@ -271,7 +272,9 @@ def writeDescription(filename,content):
# @param config the ConfigParser instance holding the configuration info
def sayNumber(call,number,curr_user,config):
import capisuite
if (len(number)==2 and number[0]!="0"):
if (number=="-" or number=="??"): # "??" is needed for backward compatibility to versions <= 0.4.1a
capisuite.audio_send(call,getAudio(config,curr_user,"unbekannt.la"),1)
elif (len(number)==2 and number[0]!="0"):
if (number[0]=="1"):
if (number[1]=="0"):
capisuite.audio_send(call,getAudio(config,curr_user,"10.la"),1)
@ -309,6 +312,13 @@ def sayNumber(call,number,curr_user,config):
capisuite.audio_send(call,getAudio(config,curr_user,i+".la"),1)
# $Log: cs_helpers.pyin,v $
# Revision 1.6 2003/04/10 21:29:51 gernot
# - support empty destination number for incoming calls correctly (austrian
# telecom does this (sic))
# - core now returns "-" instead of "??" for "no number available" (much nicer
# in my eyes)
# - new wave file used in remote inquiry for "unknown number"
#
# Revision 1.5 2003/04/10 20:54:44 gernot
# - allow multiple mail addresses to be set as fax_email or voice_email
#

View File

@ -1,4 +1,4 @@
# $Id: fax.confin,v 1.5 2003/04/10 20:54:44 gernot Exp $
# $Id: fax.confin,v 1.6 2003/04/10 21:29:51 gernot Exp $
#
# This is the fax configuration file for the scripts distributed with CapiSuite
#
@ -126,7 +126,9 @@ fax_headline="Sent by CapiSuite (www.CapiSuite.de)"
# fax calls. The values are separated by commas. The first number is also
# used as our own number for outgoing calls. This overrides outgoing_MSN.
# You can also use the special entry "*" which stands for accepting ALL
# incoming calls as fax (use with care!)
# incoming calls as fax (use with care!). The special character "-" stands for
# "no destination number available". That is necessary for example for the austrian
# "Global Call" where no number is signalled when the main MSN is called (sic).
#
# fax_email="<mailaddress1>,<mailaddress2>,..." (optional, defaults to empty string)
# If given, this string indicates email-addresses where the received faxes

View File

@ -2,7 +2,7 @@
# ----------------------------------------------------
# copyright : (C) 2002 by Gernot Hillier
# email : gernot@hillier.de
# version : $Revision: 1.5 $
# version : $Revision: 1.6 $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -183,8 +183,9 @@ def voiceIncoming(call,call_from,call_to,curr_user,config):
if (os.access(userannouncement,os.R_OK)):
capisuite.audio_send(call,userannouncement,1)
else:
capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"anrufbeantworter-von.la"),1)
cs_helpers.sayNumber(call,call_to,curr_user,config)
if (call_to!="-"):
capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"anrufbeantworter-von.la"),1)
cs_helpers.sayNumber(call,call_to,curr_user,config)
capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"bitte-nachricht.la"),1)
if (action!="none"):
@ -330,12 +331,10 @@ def remoteInquiry(call,userdir,curr_user,config):
descr=cs_helpers.readConfig(filename[:-2]+"txt")
capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"nachricht.la"),1)
cs_helpers.sayNumber(call,str(i+1),curr_user,config)
if (descr.get('GLOBAL','call_from')!="??"):
capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"von.la"),1)
cs_helpers.sayNumber(call,descr.get('GLOBAL','call_from'),curr_user,config)
if (descr.get('GLOBAL','call_to')!="??"):
capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"fuer.la"),1)
cs_helpers.sayNumber(call,descr.get('GLOBAL','call_to'),curr_user,config)
capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"von.la"),1)
cs_helpers.sayNumber(call,descr.get('GLOBAL','call_from'),curr_user,config)
capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"fuer.la"),1)
cs_helpers.sayNumber(call,descr.get('GLOBAL','call_to'),curr_user,config)
capisuite.audio_send(call,cs_helpers.getAudio(config,curr_user,"am.la"),1)
calltime=time.strptime(descr.get('GLOBAL','time'))
cs_helpers.sayNumber(call,str(calltime[2]),curr_user,config)
@ -403,6 +402,13 @@ def newAnnouncement(call,userdir,curr_user,config):
# History:
#
# $Log: incoming.py,v $
# Revision 1.6 2003/04/10 21:29:51 gernot
# - support empty destination number for incoming calls correctly (austrian
# telecom does this (sic))
# - core now returns "-" instead of "??" for "no number available" (much nicer
# in my eyes)
# - new wave file used in remote inquiry for "unknown number"
#
# Revision 1.5 2003/03/20 09:12:42 gernot
# - error checking for reading of configuration improved, many options got
# optional, others produce senseful error messages now if not found,

BIN
scripts/waves/unbekannt.la Normal file

Binary file not shown.

View File

@ -2,7 +2,7 @@
@brief Contains Connection - Encapsulates a CAPI connection with all its states and methods.
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.4 $
$Revision: 1.5 $
*/
/***************************************************************************
@ -61,15 +61,15 @@ Connection::Connection (_cmsg& message, Capi* capi_in):
Connection::Connection (Capi* capi, _cdword controller, string call_from_in, bool clir, string call_to_in, service_t service, string faxStationID, string faxHeadline) throw (CapiExternalError, CapiMsgError)
:call_if(NULL),capi(capi),plci_state(P01),ncci_state(N0),plci(0),service(service), buffer_start(0), buffers_used(0),
file_for_reception(NULL), file_to_send(NULL), call_from(call_from_in), call_to(call_to_in), connect_ind_msg_nr(0),
disconnect_cause(0), debug(capi->debug), debug_level(capi->debug_level), error(capi->error), keepPhysicalConnection(false),
file_for_reception(NULL), file_to_send(NULL), call_from(call_from_in), call_to(call_to_in), connect_ind_msg_nr(0),
disconnect_cause(0), debug(capi->debug), debug_level(capi->debug_level), error(capi->error), keepPhysicalConnection(false),
our_call(true), disconnect_cause_b3(0)
{
pthread_mutex_init(&send_mutex, NULL);
pthread_mutex_init(&receive_mutex, NULL);
if (debug_level >= 1) {
debug << prefix() << "Connection object created for outgoing call from " << call_from << " to " << call_to
debug << prefix() << "Connection object created for outgoing call from " << call_from << " to " << call_to
<< " service " << dec << service << endl;
}
if (debug_level >= 2) {
@ -903,7 +903,7 @@ Connection::getNumber(_cstruct capi_input, bool isCallingNr)
int length=capi_input[0];
if (!length) // no info element given
return "??";
return "-";
char *nr=new char[length];
memcpy (nr,&capi_input[2],length-1); // copy only number
@ -916,7 +916,7 @@ Connection::getNumber(_cstruct capi_input, bool isCallingNr)
// (see ETS 300 102-1, chapter 4.5), we'll add the prefix "0" or "+"
if (a.empty()) {
a="??";
a="-";
} else if (isCallingNr && ((capi_input[1] & 0x70) == 0x20)) { //  national number
a='0'+a;
} else if (isCallingNr && ((capi_input[1] & 0x70) == 0x10)) { // international number
@ -979,6 +979,13 @@ Connection::buildBconfiguration(_cdword controller, service_t service, string fa
/* History
$Log: connection.cpp,v $
Revision 1.5 2003/04/10 21:29:51 gernot
- support empty destination number for incoming calls correctly (austrian
telecom does this (sic))
- core now returns "-" instead of "??" for "no number available" (much nicer
in my eyes)
- new wave file used in remote inquiry for "unknown number"
Revision 1.4 2003/04/04 09:17:59 gernot
- buildBconfiguration() now checks the abilities of the given controller
and throws an error if it doesn't support the service