Dieses Wiki ist ein Archiv bis 2023. Das aktuelle Wiki findet sich unter https://wiki.hamburg.ccc.de/

Difference between revisions of "VoIP:Konfiguration neu"

From CCCHHWiki
Jump to: navigation, search
(fax_fancy eingetragen: Test des neuen Faxempfangs-Skripts mit OCR, GPG-Signatur und Multipage-Vereinzelung)
m (Backup der alten Version)
Line 89: Line 89:
  
  
[fax]
+
[fax_alt]
  
 
exten => _X.,1,SetVar(CALLEDFAX=${EXTEN})
 
exten => _X.,1,SetVar(CALLEDFAX=${EXTEN})
Line 95: Line 95:
 
exten => _X.,3,SetVar(FAXFILE=/var/spool/asterisk/fax/${CALLEDFAX}-${UNIQUEID})
 
exten => _X.,3,SetVar(FAXFILE=/var/spool/asterisk/fax/${CALLEDFAX}-${UNIQUEID})
 
exten => _X.,4,rxfax(${FAXFILE}.tif)
 
exten => _X.,4,rxfax(${FAXFILE}.tif)
exten => h,1,system(/usr/local/bin/mailfax ${FAXFILE} ${EMAIL} ${CALLERIDNUM})
+
exten => h,1,system(/usr/local/bin/mailfax.old ${FAXFILE} ${EMAIL} ${CALLERIDNUM})
  
[fax_fancy]
+
[mailfax]
; neues Faxempfangs-Skript mit OCR und GPG-Signatur
 
  
exten => _X.,1,SetVar(CALLEDFAX=${EXTEN})
+
exten => _X.,1,Set(CALLEDFAX=${EXTEN})
 +
exten => _X.,2,Answer
 +
exten => _X.,3,Set(FAXFILE=/var/spool/asterisk/fax/${CALLEDFAX}-${CALLERIDNUM}-${UNIQUEID})
 +
exten => _X.,4,rxfax(${FAXFILE}.tif)
 +
exten => h,1,system(/usr/local/bin/mailfax "${FAXFILE}" "${EMAIL}" "${CALLERIDNUM}" "${CALLEDFAX}")
 +
 
 +
[mailfax_fancy]
 +
 
 +
exten => _X.,1,Set(CALLEDFAX=${EXTEN})
 
exten => _X.,2,Answer
 
exten => _X.,2,Answer
exten => _X.,3,SetVar(FAXFILE=/var/spool/asterisk/fax/${CALLEDFAX}-${UNIQUEID})
+
exten => _X.,3,Set(FAXFILE=/var/spool/asterisk/fax/${CALLEDFAX}-${CALLERIDNUM}-${UNIQUEID})
 
exten => _X.,4,rxfax(${FAXFILE}.tif)
 
exten => _X.,4,rxfax(${FAXFILE}.tif)
exten => h,1,system(/usr/local/bin/mailfax_fancy ${FAXFILE} ${EMAIL} ${CALLERIDNUM})
+
exten => h,1,system(/usr/local/bin/mailfax_fancy2 "${FAXFILE}" "${EMAIL}" "${CALLERIDNUM}" "${CALLEDFAX}")
  
  
Line 138: Line 145:
 
; die normalen telefone
 
; die normalen telefone
  
exten => 4018010,1,Dial(misdn/2/23|5)            ; gruppenruf
+
exten => 4018010,1,Dial(misdn/2/23|15)            ; gruppenruf
exten => 4018010,2,Playback(cccansage)           ; Ansage-Text
+
exten => 4018010,2,Playback(cccansage)
 
 
  
 
exten => 40180123,1,Dial(misdn/2/23)            ; auch
 
exten => 40180123,1,Dial(misdn/2/23)            ; auch
  
 
exten => 40180126,1,Dial(misdn/2/26)            ; telefon
 
exten => 40180126,1,Dial(misdn/2/26)            ; telefon
 +
 +
;; bitte andere Funktionsnummer fuer Vanity-Durchwahlen
 +
; z.B. 8XX
 +
exten => 40180127,1,Dial(misdn/2/27|15) ; Alx sein Handset
 +
exten => 40180127,2,Voicemail(6259@default) ;
  
 
exten => 40180131,1,NoOp()                    ; voicebox
 
exten => 40180131,1,NoOp()                    ; voicebox
Line 155: Line 166:
  
 
exten => 40180140,1,SetVar(EMAIL=mail@ccc.de)
 
exten => 40180140,1,SetVar(EMAIL=mail@ccc.de)
exten => 40180140,2,Goto(fax,${EXTEN},1)
+
exten => 40180140,2,Goto(mailfax,${EXTEN:6},1)
  
 
exten => 40180141,1,Dial(misdn/2/41)            ; analog fax
 
exten => 40180141,1,Dial(misdn/2/41)            ; analog fax
  
 
exten => 40180142,1,SetVar(EMAIL=mail@ccc.de)
 
exten => 40180142,1,SetVar(EMAIL=mail@ccc.de)
exten => 40180142,2,Goto(fax,${EXTEN},1)
+
exten => 40180142,2,Goto(mailfax,${EXTEN:6},1)
  
 
exten => 40180150,1,SetVar(EMAIL=mail@hamburg.ccc.de)
 
exten => 40180150,1,SetVar(EMAIL=mail@hamburg.ccc.de)
exten => 40180150,2,Goto(fax,${EXTEN},1)
+
exten => 40180150,2,Goto(mailfax,${EXTEN:6},1)
  
 
exten => 40180151,1,SetVar(EMAIL=zahlstelle@ccc.de)
 
exten => 40180151,1,SetVar(EMAIL=zahlstelle@ccc.de)
exten => 40180151,2,Goto(fax,${EXTEN},1)
+
exten => 40180151,2,Goto(mailfax,${EXTEN:6},1)
  
 
exten => 40180152,1,SetVar(EMAIL=vorstand@ccc.de)
 
exten => 40180152,1,SetVar(EMAIL=vorstand@ccc.de)
exten => 40180152,2,Goto(fax,${EXTEN},1)
+
exten => 40180152,2,Goto(mailfax,${EXTEN:6},1)
  
 
exten => 40180153,1,SetVar(EMAIL=pressesprecher@ccc.de)
 
exten => 40180153,1,SetVar(EMAIL=pressesprecher@ccc.de)
exten => 40180153,2,Goto(fax,${EXTEN},1)
+
exten => 40180153,2,Goto(mailfax,${EXTEN:6},1)
  
 
exten => 40180154,1,SetVar(EMAIL=ds@ccc.de)
 
exten => 40180154,1,SetVar(EMAIL=ds@ccc.de)
exten => 40180154,2,Goto(fax,${EXTEN},1)
+
exten => 40180154,2,Goto(mailfax,${EXTEN:6},1)
  
 
exten => 40180155,1,SetVar(EMAIL=anonymizer@ccc.de)
 
exten => 40180155,1,SetVar(EMAIL=anonymizer@ccc.de)
exten => 40180155,2,Goto(fax,${EXTEN},1)
+
exten => 40180155,2,Goto(mailfax,${EXTEN:6},1)
  
 
exten => 40180156,1,SetVar(EMAIL=mail@ccc.de)
 
exten => 40180156,1,SetVar(EMAIL=mail@ccc.de)
exten => 40180156,2,Goto(fax,${EXTEN},1)
+
exten => 40180156,2,Goto(mailfax,${EXTEN:6},1)
  
 
exten => 40180157,1,SetVar(EMAIL=packbart@hamburg.ccc.de)
 
exten => 40180157,1,SetVar(EMAIL=packbart@hamburg.ccc.de)
exten => 40180157,2,Goto(fax_fancy,${EXTEN},1)
+
exten => 40180157,2,Goto(mailfax,${EXTEN:6},1)
 +
 
 +
exten => 4018015801,1,SetVar(EMAIL=bayer@hamburg.ccc.de)
 +
exten => 4018015801,2,Goto(mailfax,${EXTEN:6},1)
 +
 
 +
;exten => 4018016,1,MeetMe(1234)                    ; Konferenz
  
;exten => 4018016,1,MeetMe()                    ; Konferenz
 
  
 
exten => _40180192XX,1,NoOp()                  ; chaos-vpn Koeln
 
exten => _40180192XX,1,NoOp()                  ; chaos-vpn Koeln
 
exten => _40180193XX,1,NoOp()                  ; chaos-vpn Berlin
 
exten => _40180193XX,1,NoOp()                  ; chaos-vpn Berlin
exten => _40180194XX,1,NoOp()                  ; chaos-vpn Hamburg
+
 
 +
 
 +
;;
 +
;; Haukes Test, Durchwahl ins Chaos-VPN, noch nicht ins Wiki malen,
 +
;; es gibt bereits eine bessere Variante
 +
exten => 40180194240,1,Dial(IAX2/packbartvpnhome/${EXTEN:10},60,r)
 +
exten => _4018019424Z.,1,Dial(IAX2/packbartvpnhome/${EXTEN:10},60,r)
 +
;;
 +
;; dies muss per include geloest werden, da es sonst vor alle Nummern sortiert wird
 +
;exten => _40180194!,1,Busy                  ; chaos-vpn Hamburg
 +
;;exten => _40180194XX,1,NoOp()                  ; chaos-vpn Hamburg
 +
 
 +
 
 
exten => _40180195XX,1,NoOp()                  ; chaos-vpn Hannover
 
exten => _40180195XX,1,NoOp()                  ; chaos-vpn Hannover
 
exten => _40180196XX,1,NoOp()                  ; chaos-vpn MetaRheinMain
 
exten => _40180196XX,1,NoOp()                  ; chaos-vpn MetaRheinMain
Line 202: Line 229:
 
[pbx-trunk]
 
[pbx-trunk]
  
 +
; ignorepat => 0
 
; dialout via iaxfwd
 
; dialout via iaxfwd
  
exten => _11.,1,SetCallerId,${FWDCIDNAME}
+
;exten => _11.,1,SetCallerId,${FWDCIDNAME}
exten => _11.,2,Dial(IAX2/${FWDNUMBER}:${FWDPASSWORD}@iax2.fwdnet.net/${EXTEN:2},60,r)
+
;exten => _11.,2,Dial(IAX2/${FWDNUMBER}:${FWDPASSWORD}@iax2.fwdnet.net/${EXTEN:2},60,r)
exten => _11.,3,Congestion
+
;exten => _11.,3,Congestion
 +
; deaktiviert um das Faxproblem mal probehalber zu fixen
 +
 
  
 
; dialout via isdn
 
; dialout via isdn
  
 +
;exten => _0X.,1,Background('beep')
 +
exten => _0X.,1,Dial(misdn/1/${EXTEN:1})
 
;exten => _0X.,1,Dial(misdn/1/${EXTEN:1}||Tt)
 
;exten => _0X.,1,Dial(misdn/1/${EXTEN:1}||Tt)
 
exten => _0X.,1,Dial(misdn/1/${EXTEN:1})
 
  
 
; internal fax machines
 
; internal fax machines
Line 218: Line 248:
 
exten => _4X,1,Goto(wall-trunk,401801${EXTEN},1)
 
exten => _4X,1,Goto(wall-trunk,401801${EXTEN},1)
 
exten => _5X,1,Goto(wall-trunk,401801${EXTEN},1)
 
exten => _5X,1,Goto(wall-trunk,401801${EXTEN},1)
 +
;extrem gef�hrlich...
 +
  
 
; internal phones
 
; internal phones
  
exten => _XX,1,Dial(misdn/1/${EXTEN}||Tt)      ; dect und isdn phones
+
exten => _ZX,1,Dial(misdn/2/${EXTEN}||Tt)      ; dect und isdn phones
  
 
; testphones
 
; testphones
Line 227: Line 259:
 
;exten => 100,1,Dial(Zap/g3/${EXTEN}||Tt)      ; isdn testphone von pirx
 
;exten => 100,1,Dial(Zap/g3/${EXTEN}||Tt)      ; isdn testphone von pirx
 
;exten => 666,1,Dial(IAX2/iaxphone||Tt)        ; iax testphone von ali
 
;exten => 666,1,Dial(IAX2/iaxphone||Tt)        ; iax testphone von ali
 +
 +
 +
 +
;;
 +
;; Haukes Test, Durchwahl ins Chaos-VPN, noch nicht ins Wiki malen,
 +
;; es gibt bereits eine bessere Variante
 +
exten => 94240,1,Dial(IAX2/packbartvpnhome/${EXTEN:4},60,r)
 +
exten => _9424Z.,1,Dial(IAX2/packbartvpnhome/${EXTEN:4},60,r)
 +
exten => 987,1,Answer
 +
exten => 987,2,MP3Player(http://orange-01.live.sil.at:8000/)
 +
exten => 989,1,Playback(tt-weasels)
 +
exten => 989,2,Playback(demo-echotest)
 +
exten => 989,3,Echo
 +
exten => 989,4,Playback(demo-echodone)
 +
exten => 989,5,Hangup
 +
  
 
include => voicemail
 
include => voicemail
 
include => catchall
 
include => catchall
 
</pre>
 
</pre>
 +
 
=== /etc/asterisk/modules.conf ===
 
=== /etc/asterisk/modules.conf ===
 
<pre>
 
<pre>

Revision as of 12:05, 19 February 2006

Hilfreiche Doku

Asterisk und misdn unter Debian

Software, Treiber

  • Debian Stable/Sarge, mit Addons von Haegar/debian.sdinet.de
  • Linux 2.6.15 aus Haegars Tree (svn, 2.6.15.1+ubuntu+sdinet6)
  • misdn-Treiber so wie im Kernel vorhanden

misdn Konfiguration

/etc/misdn_init.conf

#
# Configuration file for your misdn hardware
#
# Usage: /etc/init.d/misdn-init start|stop|restart|config|scan|help
#

#
# Card Settings
#

card=1,hfcpci
card=2,hfcpci

#
# Port settings
#
# Syntax: <port_type>=<port_number>[,<port_number>...]
#
#    <port_type>    te_ptp   - TE-Mode, PTP
#                   te_ptmp  - TE-Mode, PTMP
#                   nt_ptp   - NT-Mode, PTP
#                   nt_ptmp  - NT-Mode, PTMP
#    <port_number>  port that should be considered
#

# Karte 1 (unten) extern = PTP, TE-Modus
te_ptp=1
# Karte 2 (oben) intern = PTMP, NT-Modus
nt_ptmp=2

#
# Port Options
#

# keine ...

/etc/asterisk/misdn.conf

[general]
debug=2
method=standard
tracefile=/var/log/misdn.trace
appnd_digits2exten=yes
bridging=no

[default]
context=pbx-trunk
language=de
nationalprefix=0
internationalprefix=00
rxgain=0
txgain=0
dialplan=0

; interner ISDN-Bus (PTMP = Mehrgeraeteanschluss)
[NTports]
context=pbx-trunk
ports=2
msn=*

; externer ISDN-Bus (PTP = Anlagenanschluss)
[TEports]
context=wall-trunk
ports=1
msn=*

Asterisk Konfiguration

/etc/asterisk/extensions.conf


[general]

FWDNUMBER=714542 ; your calling number
FWDCIDNAME="ccchh"; your caller id
FWDPASSWORD=k40sf0n ; your password
FWDRINGS=sip/office ; the phone to ring


[fax_alt]

exten => _X.,1,SetVar(CALLEDFAX=${EXTEN})
exten => _X.,2,Answer
exten => _X.,3,SetVar(FAXFILE=/var/spool/asterisk/fax/${CALLEDFAX}-${UNIQUEID})
exten => _X.,4,rxfax(${FAXFILE}.tif)
exten => h,1,system(/usr/local/bin/mailfax.old ${FAXFILE} ${EMAIL} ${CALLERIDNUM})

[mailfax]

exten => _X.,1,Set(CALLEDFAX=${EXTEN})
exten => _X.,2,Answer
exten => _X.,3,Set(FAXFILE=/var/spool/asterisk/fax/${CALLEDFAX}-${CALLERIDNUM}-${UNIQUEID})
exten => _X.,4,rxfax(${FAXFILE}.tif)
exten => h,1,system(/usr/local/bin/mailfax "${FAXFILE}" "${EMAIL}" "${CALLERIDNUM}" "${CALLEDFAX}")

[mailfax_fancy]

exten => _X.,1,Set(CALLEDFAX=${EXTEN})
exten => _X.,2,Answer
exten => _X.,3,Set(FAXFILE=/var/spool/asterisk/fax/${CALLEDFAX}-${CALLERIDNUM}-${UNIQUEID})
exten => _X.,4,rxfax(${FAXFILE}.tif)
exten => h,1,system(/usr/local/bin/mailfax_fancy2 "${FAXFILE}" "${EMAIL}" "${CALLERIDNUM}" "${CALLEDFAX}")


[fromiaxfwd]

exten => ${FWDNUMBER},1,Dial(${FWDRINGS},20,r)

[voicemail]

exten => 6000,1,VoiceMailMain()
exten => 6000,2,Hangup()
exten => 4018016000,1,VoiceMailMain()
exten => 4018016000,2,Hangup()

exten => _6XXX,1,Voicemail(${EXTEN:-4}@default)
exten => _6XXX,2,Hangup()
exten => _4018016XXX,1,Voicemail(${EXTEN:-4}@default)
exten => _4018016XXX,2,Hangup()

[catchall]

exten => h,1,Hangup

exten => i,1,Playtones(!950/330,!1400/330,!1800/330,0)
exten => i,2,Hangup

exten => t,1,Playtones(!950/330,!1400/330,!1800/330,0)
exten => t,2,Hangup


[wall-trunk]

; die normalen telefone

exten => 4018010,1,Dial(misdn/2/23|15)             ; gruppenruf
exten => 4018010,2,Playback(cccansage)

exten => 40180123,1,Dial(misdn/2/23)            ; auch

exten => 40180126,1,Dial(misdn/2/26)            ; telefon

;; bitte andere Funktionsnummer fuer Vanity-Durchwahlen
; z.B. 8XX
exten => 40180127,1,Dial(misdn/2/27|15)		; Alx sein Handset
exten => 40180127,2,Voicemail(6259@default)	;

exten => 40180131,1,NoOp()                     ; voicebox

exten => 40180139,1,Dial(misdn/2/39)            ; telefon



; faxen

exten => 40180140,1,SetVar(EMAIL=mail@ccc.de)
exten => 40180140,2,Goto(mailfax,${EXTEN:6},1)

exten => 40180141,1,Dial(misdn/2/41)            ; analog fax

exten => 40180142,1,SetVar(EMAIL=mail@ccc.de)
exten => 40180142,2,Goto(mailfax,${EXTEN:6},1)

exten => 40180150,1,SetVar(EMAIL=mail@hamburg.ccc.de)
exten => 40180150,2,Goto(mailfax,${EXTEN:6},1)

exten => 40180151,1,SetVar(EMAIL=zahlstelle@ccc.de)
exten => 40180151,2,Goto(mailfax,${EXTEN:6},1)

exten => 40180152,1,SetVar(EMAIL=vorstand@ccc.de)
exten => 40180152,2,Goto(mailfax,${EXTEN:6},1)

exten => 40180153,1,SetVar(EMAIL=pressesprecher@ccc.de)
exten => 40180153,2,Goto(mailfax,${EXTEN:6},1)

exten => 40180154,1,SetVar(EMAIL=ds@ccc.de)
exten => 40180154,2,Goto(mailfax,${EXTEN:6},1)

exten => 40180155,1,SetVar(EMAIL=anonymizer@ccc.de)
exten => 40180155,2,Goto(mailfax,${EXTEN:6},1)

exten => 40180156,1,SetVar(EMAIL=mail@ccc.de)
exten => 40180156,2,Goto(mailfax,${EXTEN:6},1)

exten => 40180157,1,SetVar(EMAIL=packbart@hamburg.ccc.de)
exten => 40180157,2,Goto(mailfax,${EXTEN:6},1)

exten => 4018015801,1,SetVar(EMAIL=bayer@hamburg.ccc.de)
exten => 4018015801,2,Goto(mailfax,${EXTEN:6},1)

;exten => 4018016,1,MeetMe(1234)                    ; Konferenz


exten => _40180192XX,1,NoOp()                  ; chaos-vpn Koeln
exten => _40180193XX,1,NoOp()                  ; chaos-vpn Berlin


;;
;; Haukes Test, Durchwahl ins Chaos-VPN, noch nicht ins Wiki malen,
;; es gibt bereits eine bessere Variante
exten => 40180194240,1,Dial(IAX2/packbartvpnhome/${EXTEN:10},60,r)
exten => _4018019424Z.,1,Dial(IAX2/packbartvpnhome/${EXTEN:10},60,r)
;;
;; dies muss per include geloest werden, da es sonst vor alle Nummern sortiert wird
;exten => _40180194!,1,Busy                  ; chaos-vpn Hamburg
;;exten => _40180194XX,1,NoOp()                  ; chaos-vpn Hamburg


exten => _40180195XX,1,NoOp()                  ; chaos-vpn Hannover
exten => _40180196XX,1,NoOp()                  ; chaos-vpn MetaRheinMain

exten => 40180199,1,Dial(misdn/2/99)            ; lockpickerphone (noch)

include => voicemail
include => catchall


[pbx-trunk]

; ignorepat => 0
; dialout via iaxfwd

;exten => _11.,1,SetCallerId,${FWDCIDNAME}
;exten => _11.,2,Dial(IAX2/${FWDNUMBER}:${FWDPASSWORD}@iax2.fwdnet.net/${EXTEN:2},60,r)
;exten => _11.,3,Congestion
;	deaktiviert um das Faxproblem mal probehalber zu fixen


; dialout via isdn

;exten => _0X.,1,Background('beep')
exten => _0X.,1,Dial(misdn/1/${EXTEN:1})
;exten => _0X.,1,Dial(misdn/1/${EXTEN:1}||Tt)

; internal fax machines

exten => _4X,1,Goto(wall-trunk,401801${EXTEN},1)
exten => _5X,1,Goto(wall-trunk,401801${EXTEN},1)
;extrem gef�hrlich...


; internal phones

exten => _ZX,1,Dial(misdn/2/${EXTEN}||Tt)      ; dect und isdn phones

; testphones

;exten => 100,1,Dial(Zap/g3/${EXTEN}||Tt)      ; isdn testphone von pirx
;exten => 666,1,Dial(IAX2/iaxphone||Tt)        ; iax testphone von ali



;;
;; Haukes Test, Durchwahl ins Chaos-VPN, noch nicht ins Wiki malen,
;; es gibt bereits eine bessere Variante
exten => 94240,1,Dial(IAX2/packbartvpnhome/${EXTEN:4},60,r)
exten => _9424Z.,1,Dial(IAX2/packbartvpnhome/${EXTEN:4},60,r)
exten => 987,1,Answer
exten => 987,2,MP3Player(http://orange-01.live.sil.at:8000/)
exten => 989,1,Playback(tt-weasels)
exten => 989,2,Playback(demo-echotest)
exten => 989,3,Echo
exten => 989,4,Playback(demo-echodone)
exten => 989,5,Hangup


include => voicemail
include => catchall

/etc/asterisk/modules.conf

[modules]

autoload=yes

noload => pbx_gtkconsole.so
noload => pbx_kdeconsole.so
noload => app_intercom.so
noload => chan_alsa.so

;load => chan_modem.so

; pirx: res_features vor chan_misdn laden (vgl. http://www.voip-info.org/wiki-Asterisk+mISDN+channels)
load => res_features.so
load => chan_misdn.so
load => res_musiconhold.so

; pirx: app_rxfax, app_txfax sind manuell zu installieren (s.u.)
load => app_txfax.so
load => app_rxfax.so

[global]

;chan_modem.so=yes
chan_msidn.so=yes

Fax

libtiff

Vor allen Weiterungen benötgen wir libtiff 3.7.1 (neue Versionen sollen teilweise nicht richtig funktioneren).

wget ftp://ftp.remotesensing.org/pub/libtiff/old/tiff-3.7.1.tar.gz
tar xvfz tiff-3.7.1.tar.gz
cd tiff-3.7.1
./configure --prefix=/usr
make
make install

spandsp

Zur Faxkonfiguration wird zunächst spandsp benötigt [[1]].

wget http://soft-switch.org/downloads/spandsp/spandsp-0.0.2pre23/spandsp-0.0.2pre23.tar.gz
./configure --prefix=/usr
make
make install

Asterisk Applikationen

cd /usr/src/asterisk/apps
wget http://soft-switch.org/downloads/spandsp/spandsp-0.0.2pre23/asterisk-1.2.x/app_rxfax.c
wget http://soft-switch.org/downloads/spandsp/spandsp-0.0.2pre23/asterisk-1.2.x/app_txfax.c
wget http://soft-switch.org/downloads/spandsp/spandsp-0.0.2pre23/asterisk-1.2.x/apps_Makefile.patch
patch -p0 < apps_Makefile.patch
cd ..
make
make install

--Pirx 20:19, 4 Feb 2006 (CET)