From 826f980c3e5d44bc7e7ac95b0f4be9bd65bf16d1 Mon Sep 17 00:00:00 2001 From: gernot Date: Thu, 10 Apr 2003 21:29:51 +0000 Subject: [PATCH] - 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 --- NEWS | 7 +++++++ docs/manual.docbook | 12 ++++++++++-- scripts/answering_machine.confin | 5 ++++- scripts/cs_helpers.pyin | 16 +++++++++++++--- scripts/fax.confin | 6 ++++-- scripts/incoming.py | 24 +++++++++++++++--------- scripts/waves/unbekannt.la | Bin 0 -> 6400 bytes src/backend/connection.cpp | 21 ++++++++++++++------- 8 files changed, 67 insertions(+), 24 deletions(-) create mode 100644 scripts/waves/unbekannt.la diff --git a/NEWS b/NEWS index c8e63c0..607d5c5 100644 --- a/NEWS +++ b/NEWS @@ -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 diff --git a/docs/manual.docbook b/docs/manual.docbook index 855f4ab..3706ecd 100644 --- a/docs/manual.docbook +++ b/docs/manual.docbook @@ -754,7 +754,10 @@ make install When this list is set to *, all 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. - + + If for any reason no destination 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 - which means "no destination number available". This option is optional. If not given, the user can't send or receive fax documents. @@ -900,7 +903,12 @@ make install 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 *, all 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. + This is only useful for a setup with only one user which wants to receive any call. + + If for any reason no destination 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 - which means "no destination number available". + This option is optional. If not set, the user won't receive voice calls. diff --git a/scripts/answering_machine.confin b/scripts/answering_machine.confin index 8d964b5..291a624 100644 --- a/scripts/answering_machine.confin +++ b/scripts/answering_machine.confin @@ -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=",,..." (optional, defaults to empty string) # diff --git a/scripts/cs_helpers.pyin b/scripts/cs_helpers.pyin index ec9cf4c..c052b3e 100644 --- a/scripts/cs_helpers.pyin +++ b/scripts/cs_helpers.pyin @@ -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 # diff --git a/scripts/fax.confin b/scripts/fax.confin index 8f1ab54..b74e779 100644 --- a/scripts/fax.confin +++ b/scripts/fax.confin @@ -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=",,..." (optional, defaults to empty string) # If given, this string indicates email-addresses where the received faxes diff --git a/scripts/incoming.py b/scripts/incoming.py index 25ff568..8ac1ccd 100644 --- a/scripts/incoming.py +++ b/scripts/incoming.py @@ -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, diff --git a/scripts/waves/unbekannt.la b/scripts/waves/unbekannt.la new file mode 100644 index 0000000000000000000000000000000000000000..3703f6f783f2a220a76852762066958a29cd1689 GIT binary patch literal 6400 zcmYLN4M-d5*6tcmI|F*JLfuV3+Xzu-c9U%cZ4-!F1+57vtI%!}=(Y*?GxObeSHZRk zXdA(wneWEE3UxOD+a{oKW;gCC)OG^8t6*&c@vegIO~AGZ_%pK`cO&#C0sYRT3*TEi zKj(eUbI$v7-g71l1C52oVDE1XgYi5DjTLaQF|3Hl^s%@I!?4UNJU|x<2)F`vSfv zsPqwvsdwtPw#s|6C+C>v_U+EbJMS7RhH%CGj*gBij}=yzd-ltmhJ~C5s?v0pzqr1> zN)cvD9+a&g@z!PCv97J&=kxWB_0QaSb@SD==MCveU+#ss7uJ0BN?FZNPEOg2npr#L zIIhaw-)X*h@BEMFDyF{q>5s3!{^5rkzn0fsy!83+|M=wZADmXzzrFkEA76iVc3-=F z=iQy>Mb8dRvEurUwI^%CKJUS+e}DhW`Hu#2Pks9FZy*2mw;$Gy9)17Gzy9&bFCUz{ z>K{J!x9|S*$HT$Visy|ZBO?cIYR2xby}iA*RlnL+(|Ggy-@m`~M)C5GuYdavR8Ltu z&;RT9-+%e)=SPpq+CKdB>;K%neP%$`K2-61T)mty7uJl+qbKliPJ@8M!zdmV-MfY?byoW zVoss+=HGw0^scL|C4`&*F3-XnQ{eGucRLpq~&SJv3Q*-Ury$?EXJ?$#LaO1oG+j#(00am<;t1I3Rr!9C=%BfX_c6#X6%*@qWLtW(Ynew#@ zPcC=#?&|oZ_U(g_rx)Kfc22abY*s~m@0RcWs^Zuh<9M8~sprgL#gwMM9dr*WCiV_p ziu(P_moMk;pUJj*ml|dcPB%85J}4Smq7&B#>#JVZD;E8=Dbj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GP<8gr%46=tOi)w6K}M=$$rsktBoZa_lBB?3W3L#$jK^H3Vl z^fFvPtE%(TG0oVr!-fi)n4yxQy{0%;YMgU((x5@$$aIjh1Q-E=EXYS#+6cQ{#tK0+ z&X8hS2||g>^0EL)1~DQ96OQ7zK1B-%d`{>wyM`J-F-*Wc2uffSoyGz@7oy1&VZc~| zVpx==VEz#SC0PWc;46n`NQ~lfhya>~)!`w$2tC763`%1-&BBqyK%isd4;-+du&H2S z;mR_$U7!b7(E(rqG*}WH6z5+6EU0Hj3A&&F|3C}$pa;4{ z)8b7O!cF88A3-Mmff0DiAl|zmb^u63h`M;@4iFw_!EmM*UNck~=FG&1tRMn`K!Try lNC~7sA+kUZ@ce%R$zOQ!CO(U%L~S^yu=j%Zk027r{{y4-z+?ab literal 0 HcmV?d00001 diff --git a/src/backend/connection.cpp b/src/backend/connection.cpp index e918212..96f3023 100644 --- a/src/backend/connection.cpp +++ b/src/backend/connection.cpp @@ -2,7 +2,7 @@ @brief Contains Connection - Encapsulates a CAPI connection with all its states and methods. @author Gernot Hillier - $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