Fax Empfang mit Asterisk und SpanDSP

woytkem

Neuer User
Mitglied seit
9 Jun 2005
Beiträge
27
Punkte für Reaktionen
0
Punkte
0
Hi,
Ich habe einen Asterisk aufgesetzt und nachher gelesen, daß man Faxe via SpanDSP empfangen und via email weiter leiten kann.
http://www.voip-info.org/tiki-index.php?page=Asterisk+Fax+to+email
Jetzt habe ich spandsp erst nachträglich installiert und der Faxempfang funktioniert nicht.
Muss ich Asterisk erst neu compailieren und wenn ja, wie sage ich ihm, daß er spandsp mit rein compilieren soll?
Danke im Voraus !!!
 
Ja du musst das schon neu kompilieren. Vorher musst Du aber noch Asterisk patchen. Also die dateien app_txfax.c, app_rxfax.c und app_makefile.patch runterladen und in das apps-Verzeichnis von Asterisk kopieren. Dann must du nurnoch das Makefile patchen und Asterisk neu kompilieren und installieren. Zum schluss musst Du dann noch die neuen Applikationen in der modules.conf von Asterisk eintragen.

Siehe auch hier.
 
Ich habe in yast geschaut und spandsp ist bei mir installiert (asterisk-spandsp und spandsp 0.0.2). Allerdings kann ich es nicht compilieren.
Was muss ich tun ?
./configure geht nicht.
Sorry, bin nicht sehr vertraut mit Linux...

asterisk:/usr/src/debug/spandsp-0.0.2/src/spandsp # ls
. ec_disable_detector.h schedule.h v17tx.h
.. echo.h sig_tone.h v22bis.h
adsi.h fir.h super_tone_rx.h v27ter_rx.h
alaw_ulaw.h fsk.h super_tone_tx.h v27ter_tx.h
arctan2.h hdlc.h t30.h v29rx.h
awgn.h ima_adpcm.h t31.h v29tx.h
bert.h modem_echo.h t4.h v42.h
biquad.h oki_adpcm.h time_scale.h v8.h
complex.h plc.h tone_detect.h
complex_filters.h power_meter.h tone_generate.h
dc_restore.h queue.h v17rx.h
asterisk:/usr/src/debug/spandsp-0.0.2/src/spandsp # ./configure
-bash: ./configure: No such file or directory
asterisk:/usr/src/debug/spandsp-0.0.2/src/spandsp # make
make: *** No targets specified and no makefile found. Stop.
asterisk:/usr/src/debug/spandsp-0.0.2/src/spandsp #
asterisk:/usr/src/debug/spandsp-0.0.2/src/spandsp # spandsp
-bash: spandsp: command not found
asterisk:/usr/src/debug/spandsp-0.0.2/src/spandsp #
 
woytkem schrieb:
Ich habe in yast geschaut und spandsp ist bei mir installiert (asterisk-spandsp und spandsp 0.0.2). Allerdings kann ich es nicht compilieren.
Was muss ich tun ?
./configure geht nicht.
Sorry, bin nicht sehr vertraut mit Linux...

asterisk:/usr/src/debug/spandsp-0.0.2/src/spandsp # ls
. ec_disable_detector.h schedule.h v17tx.h
.. echo.h sig_tone.h v22bis.h
adsi.h fir.h super_tone_rx.h v27ter_rx.h
alaw_ulaw.h fsk.h super_tone_tx.h v27ter_tx.h
arctan2.h hdlc.h t30.h v29rx.h
awgn.h ima_adpcm.h t31.h v29tx.h
bert.h modem_echo.h t4.h v42.h
biquad.h oki_adpcm.h time_scale.h v8.h
complex.h plc.h tone_detect.h
complex_filters.h power_meter.h tone_generate.h
dc_restore.h queue.h v17rx.h
asterisk:/usr/src/debug/spandsp-0.0.2/src/spandsp # ./configure
-bash: ./configure: No such file or directory
asterisk:/usr/src/debug/spandsp-0.0.2/src/spandsp # make
make: *** No targets specified and no makefile found. Stop.
asterisk:/usr/src/debug/spandsp-0.0.2/src/spandsp #
asterisk:/usr/src/debug/spandsp-0.0.2/src/spandsp # spandsp
-bash: spandsp: command not found
asterisk:/usr/src/debug/spandsp-0.0.2/src/spandsp #

Du hättest auch mal einfach sagen können, dass Du mit Spandsp fertig kompiliertePakete benutzt hast:
Starte asterisk mit: asterisk -vvvgc und versuch einfach aml, ein Fax zu empfangen. Dann sollte eigentlich irgend eine Fehlermeldung, oder so, erscheinen.
 
also....ich habe spandsp erst später nachinstalliert.
Neu compailiert habe ich noch nicht würde ich aber gerne machen.
app_txfax und app_rxfax sind vorhanden und im Verzeichnis /usr/lib/asterisk/modules/
app_makefile.patch ist nicht vorhanden.
Was muss dann noch ins modules.conf eingetragen werden ?
Wie patche ich das asterisk makefile ?
wo bekomme ich app_makefile.patch her ?
 
Wenn Du eine Asterisk-Version hast, bei der app_rxfax und txfax schon dabei sind, dann brauchst Du asterisk nicht zu patchen. Das patchen ist ja gerade dafür gedacht, dass die beiden Applikationen mitkompiliert werden.Und wenn du das Spandsp-Paket auch installiert hast, dann sollte eigentlich alles schon da sein. (Dann kann man das natürlich auch nicht neu kompilieren, da du die Sourcedateien ja garnicht hast!)
Schau doch erst einmal in der modules.conf nach, ob die beiden apps (rxfax und txfax) überhaupt geladen werden.

Code:
;Fax
load => app_txfax.so
load => app_rxfax.so

Vielleicht sind diese module noch deaktiviert. Dann steht da "noload" davor. Dann einfach das "no" löschen und asterisk neu starten.
 
Haben noch in module.conf gefehlt. Danke
Habe es dann nochmal versucht und diese fehlermeldungen:
Connected to Asterisk CVS-HEAD currently running on asterisk (pid = 29301)
Jul 7 11:47:31 WARNING[29302]: pbx.c:5753 pbx_builtin_setvar_old: SetVar is deprecated, please use Set instead.
Jul 7 11:47:31 WARNING[29302]: app_db.c:189 get_exec: This application has been deprecated, please use the ${DB(family/key)} function instead.
Jul 7 11:47:32 NOTICE[29302]: chan_modem_i4l.c:476 i4l_read: Fax detected, but no fax extension
Jul 7 11:47:42 NOTICE[29302]: channel.c:1884 set_format: Unable to find a path from slin to unknown
Jul 7 11:47:42 WARNING[29302]: app_rxfax.c:309 rxfax_exec: Unable to restore read format on 'Modem[i4l]/ttyI0'
Jul 7 11:47:42 NOTICE[29302]: channel.c:1884 set_format: Unable to find a path from slin to unknown
Jul 7 11:47:42 WARNING[29302]: app_rxfax.c:315 rxfax_exec: Unable to restore write format on 'Modem[i4l]/ttyI0'
Jul 7 11:47:42 WARNING[29302]: app_system.c:75 system_exec_helper: Unable to execute '/etc/asterisk/mailfax "123345" "67890" "" "" "/var/spool/asterisk/fax/67890/1120729651.0" ""'
 
Mailfax ist allerding ausführbar:
-rwxrwxrwx 1 root root 2307 Jun 29 18:13 mailfax
 
Hier nochmal mit -vvvgc
*CLI> -- Executing SetVar("Modem[i4l]/ttyI0", "CALLEDFAX=67890") in new stack
Jul 7 12:07:07 WARNING[5995]: pbx.c:5753 pbx_builtin_setvar_old: SetVar is deprecated, please use Set instead.
-- Executing Answer("Modem[i4l]/ttyI0", "") in new stack
-- Executing Goto("Modem[i4l]/ttyI0", "fax|67890|1") in new stack
-- Goto (fax,67890,1)
-- Executing Macro("Modem[i4l]/ttyI0", "faxreceive") in new stack
-- Executing SetVar("Modem[i4l]/ttyI0", "FAXFILE=/var/spool/asterisk/fax/67890/1120730827.0") in new stack
-- Executing DBget("Modem[i4l]/ttyI0", "EXTEMAIL=67890/xEmail") in new stack
Jul 7 12:07:07 WARNING[5995]: app_db.c:189 get_exec: This application has been deprecated, please use the ${DB(family/key)} function instead.
-- DBget: varname=EXTEMAIL, family=67890, key=xEmail
-- DBget: Value not found in database.
-- Executing SetVar("Modem[i4l]/ttyI0", "[email protected]") in new stack
-- Executing Goto("Modem[i4l]/ttyI0", "7") in new stack
-- Goto (macro-faxreceive,s,7)
-- Executing RxFAX("Modem[i4l]/ttyI0", "/var/spool/asterisk/fax/67890/1120730827.0.tif") in new stack
DCS with final frame tag
In state 9
Coarse carrier frequency 1699.84 (4)
Coarse carrier frequency 1699.96 (70)
Training error 0.980970
Training succeeded (constellation mismatch 0.633264)
Start rx document
TIFFOpen: /var/spool/asterisk/fax/67890/1120730827.0.tif: Cannot open.
Cannot open target TIFF file '/var/spool/asterisk/fax/67890/1120730827.0.tif'
Coarse carrier frequency 1771.07 (6)
Jul 7 12:07:18 NOTICE[5995]: channel.c:1884 set_format: Unable to find a path from slin to unknown
Jul 7 12:07:18 WARNING[5995]: app_rxfax.c:309 rxfax_exec: Unable to restore read format on 'Modem[i4l]/ttyI0'
Jul 7 12:07:18 NOTICE[5995]: channel.c:1884 set_format: Unable to find a path from slin to unknown
Jul 7 12:07:18 WARNING[5995]: app_rxfax.c:315 rxfax_exec: Unable to restore write format on 'Modem[i4l]/ttyI0'
== Spawn extension (macro-faxreceive, s, 7) exited non-zero on 'Modem[i4l]/ttyI0' in macro 'faxreceive'
== Spawn extension (fax, 67890, 1) exited non-zero on 'Modem[i4l]/ttyI0'
-- Executing System("Modem[i4l]/ttyI0", "/etc/asterisk/mailfax "12345" "67890" "" "" "/var/spool/asterisk/fax/67890/1120730827.0" """) in new stack
/etc/asterisk/mailfax: line 30: /var/spool/asterisk/fax/67890/1120730827.0.txt: No such file or directory
/etc/asterisk/mailfax: line 31: /var/spool/asterisk/fax/67890/1120730827.0.txt: No such file or directory
/etc/asterisk/mailfax: line 32: /var/spool/asterisk/fax/67890/1120730827.0.txt: No such file or directory
/etc/asterisk/mailfax: line 33: /var/spool/asterisk/fax/67890/1120730827.0.txt: No such file or directory
/etc/asterisk/mailfax: line 34: /var/spool/asterisk/fax/67890/1120730827.0.txt: No such file or directory
/etc/asterisk/mailfax: line 35: /var/spool/asterisk/fax/67890/1120730827.0.txt: No such file or directory
/etc/asterisk/mailfax: line 37: /var/spool/asterisk/fax/67890/1120730827.0.txt: No such file or directory
/etc/asterisk/mailfax: line 39: /var/spool/asterisk/fax/67890/1120730827.0.txt: No such file or directory
/etc/asterisk/mailfax: line 41: /var/spool/asterisk/fax/67890/1120730827.0.txt: No such file or directory
/etc/asterisk/mailfax: line 44: /var/spool/asterisk/fax/67890/1120730827.0.txt: No such file or directory
/etc/asterisk/mailfax: line 45: /var/spool/asterisk/fax/67890/1120730827.0.txt: No such file or directory
/etc/asterisk/mailfax: line 48: /usr/local/bin/sendEmail: No such file or directory
Jul 7 12:07:18 WARNING[5995]: app_system.c:75 system_exec_helper: Unable to execute '/etc/asterisk/mailfax "12345" "67890" "" "" "/var/spool/asterisk/fax/67890/1120730827.0" ""'
== Spawn extension (fax, h, 1) exited non-zero on 'Modem[i4l]/ttyI0'
-- Hungup 'Modem[i4l]/ttyI0'
 
Poste doch mal Deine extensions.conf.

P.S.: Nebenbei... Wen man nicht unbedingt ISDN4Linux nutzen muss, würde ich es nicht tun. Die Qualität ist sch... Das könnt auch den Faxempfang stöhren.
 
Code:
[general]
static=yes
writeprotect=no
[globals]
;CONSOLE=Console/dsp                            ; Console interface for demo
;CONSOLE=Zap/1
;CONSOLE=Phone/phone0
;IAXINFO=guest                                  ; IAXtel username/password
;IAXINFO=myuser:mypass
;TRUNK=CAPI                                     ; Trunk interface
;TRUNKMSD=1                                     ; MSD digits to strip (usually 1
 or 0)
;TRUNK=IAX2/user:pass@provider
TRUNK=Modem/g1
TRUNKMSD=1
;
; Any category other than "General" and "Globals" represent 
; extension contexts, which are collections of extensions.  
;
; Extension names may be numbers, letters, or combinations
; thereof. If an extension name is prefixed by a '_'
; character, it is interpreted as a pattern rather than a
; literal.  In patterns, some characters have special meanings:
;
;   X - any digit from 0-9
;   Z - any digit from 1-9
;   N - any digit from 2-9
;   [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
;   . - wildcard, matches anything remaining (e.g. _9011. matches 
;       anything starting with 9011 excluding 9011 itself)
;
; For example the extension _NXXXXXX would match normal 7 digit dialings, 
; while _1NXXNXXXXXX would represent an area code plus phone number
; preceeded by a one.
;
; Each step of an extension is ordered by priority, which must
; always start with 1 to be considered a valid extension.
;
; Contexts contain several lines, one for each step of each
; extension, which can take one of two forms as listed below,
; with the first form being preferred.  One may include another
; context in the current one as well, optionally with a
; date and time.  Included contexts are included in the order
; they are listed.
;
;[context]
;exten => someexten,priority,application(arg1,arg2,...)
;exten => someexten,priority,application,arg1|arg2...
;
; Timing list for includes is 
;
;   <time range>|<days of week>|<days of month>|<months>
;
;include => daytime|9:00-17:00|mon-fri|*|*
;
; ignorepat can be used to instruct drivers to not cancel dialtone upon
; receipt of a particular pattern.  The most commonly used example is
; of course '9' like this:
;
;ignorepat => 9
;
; so that dialtone remains even after dialing a 9.
;
;

[local]

;
; You can use an alternative switch type as well, to resolve
; extensions that are not known here, for example with remote 
; IAX switching you transparently get access to the remote
; Asterisk PBX
; 
[default]

;**************************** Ankommend Start ******************************

; Voicebox von SIP Phones intern
exten => 99/_[1-9].,1,Answer
exten => 99/_[1-9].,2,Wait(1)
exten => 99/_[1-9].,3,VoicemailMain(s${CALLERIDNUM})
exten => 99/_[1-9].,4,Hangup

; Voicebox von irgendeinem internen Telefon aus
exten => 98,1,Answer
exten => 98,2,Wait(1)
exten => 98,3,VoiceMailMain
exten => 98,4,HangUp

; SIPGATE einkommend
exten => xxxxx,1,Dial(SIP/55,66)
exten => xxxxx,2,Dial(Modem/g1:13579,12)
exten => xxxxx,3,Voicemail(u55)
exten => xxxxx,4,Hangup

; Ruf ankommend auf MSN 1
exten => MSN1,1,Dial(SIP/55,66)
exten => MSN1,2,Dial(Modem/g1:13579,12)
exten => MSN1,3,Voicemail(u55)
exten => MSN1,4,Hangup

; Ruf ankommend auf MSN 2 (FAX)
exten => 67890,1,SetVar(CALLEDFAX=${EXTEN}) 
exten => 67890,2,Answer 
exten => 67890,3,Goto(fax,${EXTEN},1)

; Voicebox_Abfrage von extern
exten => MSN3,1,Answer
exten => MSN3,2,Wait(1)
exten => MSN3,3,VoiceMailMain
exten => MSN3,4,HangUp

;**************************** Ankommend Stop ******************************

;**************************** Abgehend Start ******************************

; extern Gespraeche zu SIPGATE mit Kennziffer * . EXTERN:1 scheidet den * ab !!!
exten => _*.,1,SetCallerId,SIPID
exten => _*.,2,Dial(SIP/${EXTEN:1}@sipgate-1,30,trg)
exten => _*.,3,Hangup

; externe Gespraeche zur ISDN Karte mit Kennziffer 0
exten => _0.,1,Dial(Modem/g1:${EXTEN:1},60,r)
exten => _0.,2,Playback(invalid)
exten => _0.,3,Hangup

[sip-out]
exten => _X.,1,SetCallerId,xxxxxx
exten => _X.,2,Dial(SIP/${EXTEN}@sipgate-out,30,trg)
exten => _X.,3,Hangup

;**************************** Abgehend Stop ******************************

;**************************** FAX Scripte Start ******************************

[macro-faxreceive] 
exten => s,1,SetVar(FAXFILE=/var/spool/asterisk/fax/${CALLEDFAX}/${UNIQUEID}) 
exten => s,2,DBGet(EXTEMAIL=${MACRO_EXTEN}/xEmail) 
exten => s,3,NoOP() 
exten => s,4,DBGet(EXTNAME=${MACRO_EXTEN}/xName) 
exten => s,5,NoOP() 
exten => s,6,DBGet(EXTCOMPANY=${MACRO_EXTEN}/xCompany) 
exten => s,7,rxfax(${FAXFILE}.tif) 
exten => s,103,SetVar([email protected]) 
exten => s,104,Goto(7) 
exten => s,105,SetVar(EXTNAME=Unknown) 
exten => s,106,Goto(7) 
exten => s,107,SetVar(EXTCOMPANY=Company) 
exten => s,108,Goto(7) 

[fax] 
exten => 67890,1,Macro(faxreceive) 
exten => h,1,System(/etc/asterisk/mailfax "${CALLERIDNUM}" "${CALLEDFAX}" "${EXTNAME}" "${EXTEMAIL}" "${FAXFILE}" "${EXTCOMPANY}")

;**************************** FAX Scripte Stop ******************************
 
Könnte es sein, dass du in deinem Script "txt" mit "tiff" vertauscht hast?
/etc/asterisk/mailfax: line 30: /var/spool/asterisk/fax/67890/1120730827.0.txt: No such file or directory


P.S.: Bitte Consolen-Ausgaben/Config-Dateine etc. pp immer in einen Code-Block setzen, damit die Fromatierung bleibt und das ganze übersichtlicher wird. Außerdem ist dasThread dann erträglich land und übersichtlich. (Ich habe das für Dich mal gemacht)
 
Dann sieh mal im Verzeichnis /var/spool/asterisk/fax/67890/ nach, welche dateien da drin sind. Existiert das Verzeichnis überhaupt (67890). Wenn ja, stimmt da alles mit den schreibrechten?
 
Hatte das Verzeichnis nicht.
Habe es angelegt und dann noch 2-3 kleinere Problemchen im Mailfax-script angepasst.
Nun funzt alles....
Danke an Hupe !!!
Wenn ich Dir irgendwann mal mit einen Netzwerkproblem oder Fragen zu Cisco Routern helfen kann, dann lass es mich wissen !!!
 
Kostenlos!

Statistik des Forums

Themen
248,528
Beiträge
2,293,641
Mitglieder
378,033
Neuestes Mitglied
skyeball