I’ve spent many hours struggling over this until I found a suitable solution. And because I tend to forget I wrote this small HOWTO! Let’s begin…
T38Modem
This is actually one of the most compicated components to compile and setup, mainly because of all the scattered information out there on the matter. I have read documentation mentioned in http://www.voipinfo.ru/forum/viewtopic.php?t=11767 (in Russian) and http://www.voip-info.org/wiki/view/T38modem+configuration+with+Asterisk and I believe I have figured out a way to join all missing parts to get this to work.
Initially we should download all the required packages for t38modem to compile.
apt-get install cvs apt-get install g++ apt-get install flex apt-get install bison apt-get install libexpat1-dev apt-get install giflib-tools (You need this to be able to fax GIF files)
I have been struggling to make t38modem 1.1.0 to work and although I was successful in sending faxes, I haven’t yet managed to make it work for incoming faxes, probably because of the codecs used. So let’s proceed with the working version 1.0.
In order to compile T38modem 1.0 we need to download a CVS version of OPAL and PWLib that still has SIP support. So we issue the following commands:
cd /root cvs -z9 -d :pserver:anonymous@openh323.cvs.sourceforge.net:/cvsroot/openh323 co ptlib_unix cvs -z9 -d :pserver:anonymous@openh323.cvs.sourceforge.net:/cvsroot/openh323 co -D "5/21/2007 23:59:59" opal cvs -z9 -d :pserver:anonymous@openh323.cvs.sourceforge.net:/cvsroot/openh323 co t38modem
Note: It is wise to compile all parts of the t38modem inside the /root directory since compilation is using static declared paths to /root/opal and or /root/pwlib
We start off by compiling everything. If you are like me you probably hate breaking up the packaging of Debian so we will install everything under /opt. (From there you can easily create a Debian package as well if you so feel like it).
cd /root/pwlib ./configure --prefix=/opt/t38modem make make install cd /root/opal ./configure --prefix=/opt/t38modem make
If you come up against this error message:
gcc -I../../../include -fPIC -g -O2 -c h263ffmpeg.cxx -o obj/h263ffmpeg.o h263ffmpeg.cxx: In member function ‘bool DynaLink::InternalOpen(const char*, const char*)’: h263ffmpeg.cxx:288: error: ‘stderr’ was not declared in this scope h263ffmpeg.cxx:288: error: ‘fprintf’ was not declared in this scope h263ffmpeg.cxx: In member function ‘BOOL H263EncoderContext::OpenCodec()’: h263ffmpeg.cxx:962: warning: deprecated conversion from string constant to ‘char*’
Edit file opal/plugins/video/H.263-ffmpeg/h263ffmpeg.cxx and add around line 98 the following:
#include <stdio.h>Finally install the library by
make install
Now let’s move to the actual t38modem:
cd /root/t38modem make USE_OPAL=1 USE_UNIX98_PTY=1 opt
Since there is no configure script in t38modem and make install would throw the binary in /usr/local/bin we will just copy it ourselves:
cp obj_linux_x86_64_opal_r/t38modem /opt/t38modem/bin/
At this point we have compiled and installed t38modem successfully. If you want to add t38modem starting on startup (/etc/init.d/t38modem) you could use a script like this:
#!/bin/bash export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/opt/t38modem/lib/ # This is needed for t38modem to find the libraries T38_PROCESSES=5 START_PORT=6060 ASTERISK_IP=xx.xx.xx.xx BIND_IP=xx.xx.xx.xx case "$1" in start) COUNTER=0 CURRENT_PORT=${START_PORT} while [ $COUNTER -lt $T38_PROCESSES ]; do COMMAND="/opt/t38modem/bin/t38modem --no-h323 -u T38modem${COUNTER} --sip-listen udp$${BIND_IP}:${CURRENT_PORT} --sip-redundancy 3 --sip-old-asn --ptty +/dev/ttyT38-${COUNTER} --route modem:.*=sip:<dn>@${ASTERISK_IP} --route sip:.*=modem:<dn>" exec $COMMAND > /dev/null 2>&1 & PID=$! echo "Starting t38modem with pid $PID (pidfile /var/run/t38modem/$COUNTER)" echo $PID > /var/run/t38modem/$COUNTER COUNTER=$[ COUNTER + 1 ] CURRENT_PORT=$[ CURRENT_PORT + 1 ] done ;; stop) echo -n "Stopping t38modem pids: " for pidfile in `ls /var/run/t38modem` do _PID=`cat /var/run/t38modem/$pidfile` kill -9 $_PID rm /var/run/t38modem/$pidfile echo -n $_PID" " done echo " Done" ;; *) echo "Usage: $0 {start|stop}" >&2 exit 1 ;; esac exit 0
If you want to change the location of PID files change the /var/run/t38modem directory to whatever it suits you. Also set ASTERISK_IP to the IP of the asterisk server, and BIND_IP to the IP the t38modem will listen for incoming SIP connection. (This is used for incoming faxes only). Finally you set the T38_PROCESSES to the number of processes you want to start. Each of the process will create a t38modem with username T38modem-xx and will start listening to port 6060 and incrementing. The devices that will be created are /dev/ttyT38-xx
Asterisk 1.6
All the above tests have been made to asterisk 1.6.0.5. T38modem 1.0 when doing the initial INVITE to asterisk to perform an outgoing call in its SDP header adds only T.38 information and no audio codecs. This by default makes asterisk to reject the call because it cannot process it correctly. In order to fix this we need to apply this patch:
--- asterisk-1.6.0.5/channels/chan_sip.c 2008-12-03 16:13:27.000000000 +0200 +++ ../asterisk-1.6.0.5/channels/chan_sip.c 2009-01-28 12:05:28.000000000 +0200 @@ -1029,7 +1029,7 @@ #define T38FAX_RATE_14400 (1 << 13) /*!< 14400 bps t38FaxRate */ /*!< This is default: NO MMR and JBIG transcoding, NO fill bit removal, transferredTCF TCF, UDP FEC, Version 0 and 9600 max fax rate */ -static int global_t38_capability = T38FAX_VERSION_0 | T38FAX_RATE_2400 | T38FAX_RATE_4800 | T38FAX_RATE_7200 | T38FAX_RATE_9600; +static int global_t38_capability = T38FAX_VERSION_0 | T38FAX_RATE_2400 | T38FAX_RATE_4800 | T38FAX_RATE_7200 | T38FAX_RATE_9600| T38FAX_RATE_12000 | T38FAX_RATE_14400;; /*@}*/ /*! brief debugging state @@ -6701,10 +6701,12 @@ } } else if (p->udptl && ( (sscanf(m, "image %d udptl t38%n", &x, &len) == 1 && len > 0) || (sscanf(m, "image %d UDPTL t38%n", &x, &len) == 1 && len > 0) )) { - if (debug) - ast_verbose("Got T.38 offer in SDP in dialog %sn", p->callid); - udptlportno = x; - numberofmediastreams++; + if (t38action != SDP_T38_INITIATE || (p->owner && p->lastinvite)) { + if (debug) + ast_verbose("Got T.38 offer in SDP in dialog %sn", p->callid); + udptlportno = x; + numberofmediastreams++; + } } else ast_log(LOG_WARNING, "Unsupported SDP media type in offer: %sn", m); if (numberofports > 1)
I haven’t tried any newer version of asterisk 1.6.x.x branch, I think this has been applied to trunk. So as you probably understand we need to compile asterisk ourselves:
wget http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-1.6.0.5.tar.gz tar xfvz asterisk-1.6.0.5.tar.gz patch -p0 < patch.diff # The above patch cd asterisk-1.6.0.5 ./configure --prefix=/opt/asterisk-1.6.0.5 make make install
(I think asterisk 1.6.0.5 has a tendency to ignore ./configuration prefix when doing install so you might need to move /var/spool/asterisk and /var/lib/asterisk to the path installed)
sip.conf configuration:
We need to add a peer for each one of the t38modems to sip.conf as well as globally enable t38pt_udptl and on each of the peers. We will create a generic options context to be used from all t38modems:
[t38modem-options](!) type = friend host = BIND_IP context = fax-out canreinvite = no disallow = all allow = g729 allow = ulaw allow = alaw t38pt_udptl = yes dtmfmode = rfc2833 nat = no qualify = yes [T38modem0](t38modem-options) port = 6060 [T38modem1](t38modem-options) port = 6061 [T38modem2](t38modem-options) port = 6062
Remember the BIND_IP configured on the t38modem startup script mentioned above? You need to set the same here so that asterisk can contact T38modems.
Also please note that you need to set canreinvite = no for t38modem to work. Additionally if the incoming calls arrive in G.729 you need to have a G.729 codec installed on your asterisk in order for T38modem to do a T.38 Re-Invite back.
extensions.conf configuration:
We need to setup a basic dialplan in order for incoming calls to be routed to t38modems and outgoing calls to be routed to the outside world:
[fax-in]
exten => _X.,1,NoOp("Incoming fax to ${EXTEN}")
exten => _X.,n(again),Set(AGAINCOUNTER=$[${AGAINCOUNTER} + 1]) ; in the loop: increase the call attempts counter
exten => _X.,n,GotoIf($[${AGAINCOUNTER} <= 20]?call:hangup) ; stop looping after 20 attempts
exten => _X.,n(call),Dial(SIP/${EXTEN}@T38modem${RAND(0,59)},20,gH) ; make the call to a random t38modem
exten => _X.,n,GotoIf($["${DIALSTATUS}" != "ANSWER"]?again:checktime) ; if it was not answered, call again
exten => _X.,n(checktime),GotoIf($[${ANSWEREDTIME} < 10]?again:hangup) ; if it was answered, but too short, call again
exten => _X.,n(hangup),Hangup() ; hangup
[fax-out]
exten => _X.,1,Dial(SIP/${EXTEN}@OUTSIDE-WORLD,60)
exten => _X.,n,Hangup()The fax-in context checks if a t38modem does not answer and retries a few times before giving up.
Hylafax 6.0
The easiest way to go is install the pre-compiled package provided by Aidan Van Dyk (aidan at ifax dot com). Edit your sources.list (/etc/apt/sources.list) to include the following:
deb http://code.highrise.ca/apt/
apt-get update apt-get install hylafax-server hylafax-client
Apt will complain about hylafax-server and hylafax-client not being verified but you can proceed without any worries. The debian package provided by Aidan Van Dyk does not contain AFM fonts used to render text files to PS. You can download them from ftp://ftp.hylafax.org/source/afm-tar.Z. If you need to see where to put it you can run gs -h and see the search paths at the end. Use one of those and add it in /etc/hylafax/hyla.conf in the FontMap option (delimeted with ‘:’)
We need to create configuration files for all t38modem instancies to our hylafax server. We create one file per t38modem instance under /etc/hylafax named config.ttyT38-xx containing:
# # HylaFAX configuration for a T38FAX Pseudo Modem # # these have been defined in config-common # SessionTracing: 0x2FFF # RingsBeforeAnswer: 1 # DynamicConfig: etc/DynamicConfig ModemType: Class1 # use class 1 interface ModemFlowControl: rtscts # default ModemRevQueryCmd: AT+FREV? # # AT#CID=10 enables ANI/DNIS reporting between the # first and second RINGs in the form: # # RING # NMBR = <calling number> # NDID = <called number> # RING # ModemResetCmds: "AT#CID=10" # enable ANI/DNIS reporting RingsBeforeAnswer: 2 # collect info between two RINGs #QualifyCID: etc/cid # CID access control list file #CIDNumber: "NMBR = " # pattern string for calling number #CIDName: "NDID = " # pattern string for called number CallIDPattern: "NMBR = " # pattern string for calling number CallIDPattern: "NDID = " # pattern string for called number # # T.38 dial modifiers # # F - enable T.38 mode request after dialing # V - disable T.38 mode request after dialing (remote host should do it) # # calling/called number dial modifiers # # L - reset and begin of calling number # D - continue of called number # #ModemDialCmd: ATDF%s # user can override F by dial V ModemDialCmd: ATDV%s # user can override V by dial F #ModemDialCmd: ATD%sF # user can't override F #ModemDialCmd: ATD%sV # user can't override V #ModemDialCmd: ATD%sVL # user can't override V or calling number
You can add additional options to each configuration file if you feel like it, you could refer to the man page of hylafax-config.
After that we need to restart hylafax so that the configuration files get populated to the location where hylafax expects them (/var/spool/hylafax):
/etc/init.d/hylafax restart
By default hylafax starts the faxgetty’s on startup, however if you want to start them during init you could add to /etc/inittab:
F1:23:respawn:/usr/sbin/faxgetty ttyT38-0 F2:23:respawn:/usr/sbin/faxgetty ttyT38-1 F3:23:respawn:/usr/sbin/faxgetty ttyT38-2 F4:23:respawn:/usr/sbin/faxgetty ttyT38-3
Or if you are using upstart (ubuntu users) create a file for each t38modem under /etc/event.d (named like the device e.g. ttyT38-0) like the following:
start on runlevel 2 start on runlevel 3 start on runlevel 4 start on runlevel 5 stop on runlevel 0 stop on runlevel 1 stop on runlevel 6 respawn exec /usr/sbin/faxgetty ttyT38-0
To reload init without rebooting type
init q
Or if you are using upstart
initctl start ttyT38-0 (and repeat for each of the t38modems you have)
Now if we do a faxstat -s we should see something along this lines:
faxstat -s HylaFAX scheduler on doom: Running Modem ttyT38-0 (): Running and idle Modem ttyT38-1 (): Running and idle Modem ttyT38-2 (): Running and idle
This means that everything is setup and ready to go. You can try to send a fax by doing:
sendfax -s a4 -m -n -D -S "Test Fax" -d file.pdf
If you feel there is a mistake anywhere please send me a note so that I can fix this.
Hey awesome post, and i noticed it very recent. I can’t wait to have t38modem working with hylafax! So i thank you for taking the time to write this very details guide.
I encountered the following problem when doing “make” for opal:
make[1]: *** Deleting file `/root/opal/lib/obj_linux_x86_r/*.dep’
g++ -D_REENTRANT -fno-exceptions -Wall -fPIC -DPIC -DNDEBUG -DPTRACING -I/root /opal/include -DPTRACING -I/root/opal/../pwlib/include -Os -felide-constructo rs -Wreorder -c /root/opal/src/sip/handlers.cxx -o /root/opal/lib/obj_linux_x86 _r/handlers.o
/root/opal/src/sip/handlers.cxx: In member function âBOOL SIPSubscribeHandler::O nReceivedPresenceNOTIFY(SIP_PDU&)â:
/root/opal/src/sip/handlers.cxx:547: error: âPXMLâ was not declared in this scop e
/root/opal/src/sip/handlers.cxx:547: error: expected `;’ before âxmlPresenceâ
/root/opal/src/sip/handlers.cxx:548: error: âPXMLElementâ was not declared in th is scope
/root/opal/src/sip/handlers.cxx:548: error: ârootElementâ was not declared in th is scope
/root/opal/src/sip/handlers.cxx:549: error: âtupleElementâ was not declared in t his scope
/root/opal/src/sip/handlers.cxx:550: error: âstatusElementâ was not declared in this scope
/root/opal/src/sip/handlers.cxx:551: error: âbasicElementâ was not declared in t his scope
/root/opal/src/sip/handlers.cxx:552: error: ânoteElementâ was not declared in th is scope
/root/opal/src/sip/handlers.cxx:554: error: âxmlPresenceâ was not declared in th is scope
/root/opal/src/sip/handlers.cxx:557: error: âxmlPresenceâ was not declared in th is scope
make[1]: *** [/root/opal/lib/obj_linux_x86_r/handlers.o] Error 1
make[1]: Leaving directory `/root/opal’
make: *** [optshared] Error 2
Any ideas what might be causing this? i’m using centos and installed all dependancies or corresponding dependencies (as some are different names in centos)
Hope to hear from you soon.
thanks
Hey! I am glad you found it useful! You need to compile and install pwlib before compiling opal. Have you done that?
Great post! Now I have one extremely important question: What provider do you use for sending T.38 faxes?
I’ve personally implemented the above solution in a large scale environment with a major Interconnection provider which I am reluctant to say, sorry. But in any case, if the SIP Provider supports T.38 fax pass-through it should work.
aaw c’mon, can you pleeeease privately email me with a provider you know that works reliably? I have tried two (gafachi and ipcomms.net), but have found they are not that reliable.
I think there might be a typo:
apt-get install csvshould beapt-get install cvs(as in CVS the version control system. I think this is repeated in a few other places.You are right. I have corrected it! Thank you very much!
mobius,
We’re trying to setup HylaFax and T.38. Everything installed fine, and we can successfully send faxes when using around 5-10 t38modems. However, when we use 200 t38modems we often get error-messages within t38-modem (input/output errors). About 40-50% of the faxes won’t go out. I believe this is sort of a shortcoming of t38modem/hylafax. I read somewhere to use dynamic libraries to overcome this. However I can’t find an answer how to install t38modem with dynamic libraries.
You say you’ve implemented this in a large scale environment. Was this also with about 200 (or 200+) modems? Did you come up with any problems?
We have noticed that sometimes t38modem 1.0 after running for a few hours without any calls, freezes. It responds to AT/ATD commands from Hylafax, however when the actual dialing is done on the asterisk side, it fails to send any data. This problem appears to be solved with t38modem 1.2.0 (which now we currently use in production for the outgoing faxes – II haven’t managed to get it to work for incoming just yet).
Thanks. Do you run one instance of t38modem (we are running 1.2.0 and are still facing problems), or do you run multiple instances of t38modem?
We run one modem per TTY. I’ve noticed that on 1.2.0 in order for the modem to stay up you need to set the verbosity to high and redirect all output to /dev/null.
Otherwise the modem crashes on its own after a while.
Can you please help. I have done everything according this HWT. After I try to start t38modem I receive following:
/opt/t38modem/bin/t38modem: error while loading shared libraries: libopal_linux_x86_r.so.2.3: cannot open shared object file: No such file or directory
I also tried to copy libopal to /opt/t38modem/bin but without success.
Thank you in advance
make USE_OPAL=1 USE_UNIX98_PTY=1 opt
g++ -DUSE_OPAL -D_REENTRANT -fno-exceptions -Wall -I/root/opal/../pwlib/include -DPTRACING -I/root/opal/include -Os -felide-constructors -Wreorder -c main_process.cxx -o obj_linux_x86_opal_r/main_process.o
main_process.cxx: In member function âBOOL T38Modem::Initialise()â:
main_process.cxx:88: error: âMyManagerâ has not been declared
main_process.cxx:137: error: âMyManagerâ has not been declared
main_process.cxx:158: error: âMyManagerâ was not declared in this scope
main_process.cxx:158: error: âmanagerâ was not declared in this scope
main_process.cxx:158: error: expected type-specifier before âMyManagerâ
main_process.cxx:158: error: expected `;’ before âMyManagerâ
I’ve setup t38modem with hylafax and opal. however when i send test fax it’s not working. It doesnt even get to asterisk console, so i wont post asterisk config as it wont be useful :
I start t38modem with: t38modem -tt -o /var/log/t38modem.log –no-h323 -u T38modem –sip-old-asn –sip-listen udp\$127.0.0.1:6060 –sip-redundancy 2 –ptty +/dev/ttyT38-1 –route “modem:.=sip:@127.0.0.1:6060″ –route “sip:.=modem:127.0.0.1:6060″
I send test fax with: sendfax -h ttyT38-1@127.0.0.1 -f email@company.com -n -D -d 213 /etc/passwd
faxstat -s: HylaFAX scheduler on pbx.selements.com.au: Running Modem faxmodem01 (): Running and idle Modem faxmodem02 (): Running and idle Modem faxmodem03 (): Running and idle Modem ttyT38-1 (): Running and idle
JID Pri S Owner Number Pages Dials TTS Status 103 126 S root 213 0:1 1:12 13:19 Busy signal detected
can anyone help point me in the right direction. sendfax -h ttyT38-1@127.0.0.1 -f email@company.com -n -D -d 213 /etc/passwd
Damir, if you try to run t38modem directly you must have specify the LIBRARY PATH beforehand.
Try doing:
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/opt/t38modem/lib/
Where /opt/t38modem/lib where you have installed the opal/ptlib libraries
Mina,
I am guessing you have changed the paths where opal or ptlib resides or you haven’t installed them yet. See the documentation up at the top.
Hello!
, , , , , , , , , ,
Anyone got this?
nufax:~/t38modem# make USE_OPAL=1 USE_UNIX98_PTY=1 opt
g++ -o obj_linux_x86_opal_r/t38modem -L/root/opal/../pwlib/lib -L/root/opal/lib ./obj_linux_x86_opal_r/pmutils.o ./obj_linux_x86_opal_r/dle.o ./obj_linux_x86_opal_r/pmodem.o ./obj_linux_x86_opal_r/pmodemi.o ./obj_linux_x86_opal_r/drivers.o ./obj_linux_x86_opal_r/t30tone.o ./obj_linux_x86_opal_r/hdlc.o ./obj_linux_x86_opal_r/t30.o ./obj_linux_x86_opal_r/fcs.o ./obj_linux_x86_opal_r/pmodeme.o ./obj_linux_x86_opal_r/enginebase.o ./obj_linux_x86_opal_r/t38engine.o ./obj_linux_x86_opal_r/audio.o ./obj_linux_x86_opal_r/drv_pty.o ./obj_linux_x86_opal_r/main_process.o ./obj_linux_x86_opal_r/ifptranscoder.o ./obj_linux_x86_opal_r/ifpmediafmt.o ./obj_linux_x86_opal_r/t38session.o ./obj_linux_x86_opal_r/opalutils.o ./obj_linux_x86_opal_r/modemep.o ./obj_linux_x86_opal_r/modemstrm.o ./obj_linux_x86_opal_r/h323cap.o ./obj_linux_x86_opal_r/h323ep.o ./obj_linux_x86_opal_r/sipep.o ./obj_linux_x86_opal_r/manager.o -lopal_linux_x86_r -lpt_linux_x86_r -lpthread -lexpat -lresolv -ldl
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Sequence::PreambleEncodeXER(PXER_Stream&) const’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Enumeration::EncodeXER(PXER_Stream&) const’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Sequence::KnownExtensionEncodeXER(PXER_Stream&, int, PASN_Object const&) const’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Sequence::UnknownExtensionsDecodeXER(PXER_Stream&)’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Sequence::UnknownExtensionsEncodeXER(PXER_Stream&) const’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Enumeration::DecodeXER(PXER_Stream&)’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Sequence::KnownExtensionDecodeXER(PXER_Stream&, int, PASN_Object&)’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Sequence::PreambleDecodeXER(PXER_Stream&)’
collect2: ld returned 1 exit status
make: *** [obj_linux_x86_opal_r/t38modem] Error 1
Aud, are you sure you have the right OPAL version compiled?
ok. sorted out. I had other opal lib laying around the system… tnx
–sip-listen udp$${BIND_IP}
I think it should be –sip-listen udp\$${BIND_IP} (backslash between udp and $)
Geerts,
I think it works as is, since it is included in quotes. Have you tried it and you had an issue?
Mobius,
In this HWT you are installing t38 1.0 but how do we get t38 1.2.0. Also is it ok to use a newer version of asterisk like 1.6.2 now, since the creation of this HWT?
Sophsol,
Well I’ve had some success with t38 1.2.0. The installation instructions is pretty much the same as above, with the major difference that you should get the latest version of OPAL and PTLIB in order to compile t38modem 1.2.0. When I say “some success” is because I’ve seen that on the outgoing faxes the system performs better on 1.2.0 but I’ve been unable to receive a fax via T38. I have tracked it down to the supported codec list of the OPAL.
My network is mostly G.729 that complicates things a lot and I haven’t been able to construct a working G.729 Opal + T.38modem 1.2.0 on a 64bit environment. If anyone has any success please do share.
Regarding the 1.6.2, I haven’t tried it to be honest. I think it should work as long as it can properly handle a INVITE without audio codecs in the SDP.
Oh and btw, in order for T38modem 1.2.0 to stay up, while forking, the only way is not to fork, enable logging and redirect it all to /dev/null.
When I put in this command it downloads the old version of t38modem:
cvs -z9 -d :pserver:anonymous@openh323.cvs.sourceforge.net:/cvsroot/openh323 co t38modem
Mobius,
Is it necessary to use the opal and ptlib from openh323. Their latest versions are 2.4.0 and 1.12.0 respectively. Does your installation edits pertain to just the openh323 versions or can I use more recent versions that I have found on sourceforge from other projects?
In order to compile t38modem 1.0 you need the exact cvs versions mentioned above otherwise it wont compile.
If you are willing to try out your luck with 1.2.0 you could get the latest version of opal/ptlib and link with them instead.
Does Opal/ptlib/t38modem need spandsp plugin to send faxes over sip connection?
RTP_T38 Raw data decode failure
2010/02/26 00:47:04.310 Media Patch:0xb7c26b90 T38_RTP Read UDPTL of size 172
2010/02/26 00:47:04.310 Media Patch:0xb7c26b90 RTP_T38 Raw data decode failure: 172 bytes.
2010/02/26 00:47:04.310 Media Patch:0xb7c26b90 T38_RTP Read UDPTL of size 172
2010/02/26 00:47:04.311 Media Patch:0xb7c26b90 RTP_T38 Raw data decode failure: 172 bytes.
2010/02/26 00:47:04.311 Media Patch:0xb7c26b90 T38_RTP Read UDPTL of size 172
2010/02/26 00:47:04.312 Media Patch:0xb7c26b90 RTP_T38 Raw data decode failure: 172 bytes.
2010/02/26 00:47:04.312 Media Patch:0xb7c26b90 T38_RTP Read UDPTL of size 172
2010/02/26 00:47:04.313 Media Patch:0xb7c26b90 RTP_T38 Raw data decode failure: 172 bytes.
2010/02/26 00:47:04.313 Pool:0xb7c67b90 Media Starting thread Media Patch:0xb7c26b90
2010/02/26 00:47:04.313 Pool:0xb7c67b90 PTLib Created thread 0x8bdedb8 Media Patch
2010/02/26 00:47:04.314 Media Patch:0xb7be5b90 PTLib Started thread 0x8bdedb8 Media Patch:0xb7be5b90
2010/02/26 00:47:04.314 Media Patch:0xb7be5b90 Patch Thread started for Patch[0x8bb6270] T38ModemMediaStream-Source-T.38 -> OpalRTPMediaStream-Sink-T.38
2010/02/26 00:47:04.314 Media Patch:0xb7be5b90 T38ModemMediaStream::ReadPacket ifp = {
type_of_msg = t30_indicator no-signal
}
2010/02/26 00:47:04.315 Media Patch:0xb7be5b90 T38ModemMediaStream::ReadPacket packet 0 size=1 type=[pt=96] ts=0
2010/02/26 00:47:04.315 Media Patch:0xb7be5b90 RTP Session 1, first sent data: ver=2 pt=[pt=96] psz=1 m=0 x=0 seq=0 ts=66472 src=5b1e2281 ccnt=0
2010/02/26 00:47:04.315 Media Patch:0xb7be5b90 T38_RTP Encoded transmitted UDPTL data :
{
seq_number = 0
primary_ifp_packet = 1 octets {
00 .
}
error_recovery = secondary_ifp_packets 0 entries {
}
}
2010/02/26 00:47:04.315 Media Patch:0xb7be5b90 T38_RTP Sending UDPTL of size 6
2010/02/26 00:47:04.316 Pool:0xb7c67b90 Media Starting thread Media Patch:0xb7be5b90
2010/02/26 00:47:04.316 Pool:0xb7c67b90 OpalCon Media stream threads started.
2010/02/26 00:47:04.316 Pool:0xb7c67b90 MySIPConnection::OnSwitchedFaxMediaStreams: NOT switched to fax
T38Modem Options: -ttttt -o /var/log/t38-0.log –sip-audio *ALaw* –sip-listen udp$77.120.121.147:6060 –sip-proxy SIP-USER:SIP-PASSWD@sip.datagroup.com.ua –sip-register SIP-USER@sip.datagroup.com.ua,SIP-PASSWD,5937977,sip.datagroup.com.ua –no-h323 –ptty +/dev/ttyT38-0 –route modem:.*=sip:@sip.datagroup.com.ua;OPAL-Force-Fax-Mode –route sip:.*=modem: -u SIP-USER
full level 5 trace: http://drop.io/jlgnlgh
I have no clue what to do now (
Solved.
enzo how did you solve it?????????? i am having same issue
It means that your carrier does not provide t38 via sip reinvite. Just replace OPAL-Force-Fax-Mode with OPAL-Disable-T38-Mode
Hi, Im sorry but I’m really noob for for linux. What do I have to do at this line exactly ?Cause what you mentioned at that this line “./configure –prefix=/opt/asterisk-1.6.0.5″ would not work,you were right.
(I think asterisk 1.6.0.5 has a tendency to ignore ./configuration prefix when doing install so you might need to move /var/spool/asterisk and /var/lib/asterisk to the path installed)
Thx
ahh okay enzo, nah i must be having another issue because im putting t38modem as a sender to a linksys 3102, via asterisk, however my linksys wont switch from ulaw to t38.. and then i get the message you posted above.
How did you fix this error?
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Sequence::PreambleEncodeXER(PXER_Stream&) const’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Enumeration::EncodeXER(PXER_Stream&) const’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Sequence::KnownExtensionEncodeXER(PXER_Stream&, int, PASN_Object const&) const’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Sequence::UnknownExtensionsDecodeXER(PXER_Stream&)’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Sequence::UnknownExtensionsEncodeXER(PXER_Stream&) const’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Enumeration::DecodeXER(PXER_Stream&)’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Sequence::KnownExtensionDecodeXER(PXER_Stream&, int, PASN_Object&)’
/root/opal/lib/libopal_linux_x86_r.so: undefined reference to `PASN_Sequence::PreambleDecodeXER(PXER_Stream&)’
collect2: ld returned 1 exit status
make: *** [obj_linux_x86_opal_r/t38modem] Error 1
could some one please clearly state the version of OPAL and PTLIB in the guide above, the link doesnt really doesnt help for those trying to download tarballs manually for any reason
its okay figured it out, strange, i set t38modem i can dial one spa3102 just fine from it and send faxes but when i dial another at another site, it wont switch from audio codec?
Mina,
Does your carrier support T.38?
What versions of opal and pwlib (or ptlib) are you using with 1.2 now? I thought I had it working with t38modem 1.2 opal 3.6.7 and ptlib 2.6.6 but I am getting packet of order and other odd errors now
Hi Justin,
I am using OPAL 3.6.6 and PTLib 2.6.5. Give it a try with those.
Hello Mobius,
I have tried this exact configuration. I have also tried Opal 3.8, PTlib 2.8 and T38modem 1.2.0. Asterisk 1.6.2 Stable,Branch and Trunk Releases. Everything compiles perfectly everytime. Problem is I can not send out any faxes. Every time I get Busy Signal Detected with faxstat -s. I have checked the logs for asterisk, t38modem, hylafax nothing jumps out that is different with any of the configurations that I use. Not sure if anybody encountered this problem and has solved it. Any suggestions would be appreciated.
Current Configuration:
Debian 2.6.26-2-686
Opal 3.8.0, PTlib 2.8.0, T38modem 1.2.0, Asterisk 1.6.2, Hylafax 6.0
Sorry I forgot to add my t38modem command line:
t38modem -n -ttt -o /var/log/t38modem.log –no-h323 -u T38modem0 –sip-listen udp$192.168.2.27:6060 –ptty +/dev/ttyT38-0 –route modem:.*=sip:@192.168.2.28 –route sip:.*=modem:
Sendfax command:
sendfax -n -D -d test.pdf
Result:
Busy signal detected. (fails everytime)
If I call a land line and I answer I hear the fax tones but never a successful send job.
I have some strange behaviour with compiled t38modem (t38modem v1.1.0 & v1.2.0, opal v3.6.6, ptlib 2.6.5, ubuntu server 9.04)
When i try ./t38modem –help
I obtain
…
…
…
Modem drivers:
PTY
Uses pseudo-tty (pty) devices to communicate with a fax application.
For Unix98 ptys the tty should match to the regexp
‘^\+.+$’
(the first character ‘+’ will be replaced by a base directory).
Options:
–pts-dir dir : Set a base directory for Unix98 scheme,
default is empty.
2010/04/02 00:15:57.823 ThreadID:0xb71046d0 PWLib Assertion fail: Function pthread_mutex_destroy failed, file ptlib/unix/tlibthrd.cxx, line 1491, Error=2
Assertion fail: Function pthread_mutex_destroy failed, file ptlib/unix/tlibthrd.cxx, line 1491, Error=2
bort, ore dump?
If I launch /etc/init.d/t38modem start
I obtain this infinite loop:
…
Starting t38modem with pid 30016 (pidfile /var/run/t38modem/0)
/etc/init.d/t38modem: 46: cannot create /var/run/t38modem/0: Directory nonexistent
/etc/init.d/t38modem: 46: COUNTER: not found
/etc/init.d/t38modem: 46: CURRENT_PORT: not found
Starting t38modem with pid 30017 (pidfile /var/run/t38modem/0)
/etc/init.d/t38modem: 46: cannot create /var/run/t38modem/0: Directory nonexistent
/etc/init.d/t38modem: 46: COUNTER: not found
/etc/init.d/t38modem: 46: CURRENT_PORT: not found
Starting t38modem with pid 30018 (pidfile /var/run/t38modem/0)
/etc/init.d/t38modem: 46: cannot create /var/run/t38modem/0: Directory nonexistent
/etc/init.d/t38modem: 46: COUNTER: not found
/etc/init.d/t38modem: 46: CURRENT_PORT: not found
Starting t38modem with pid 30019 (pidfile /var/run/t38modem/0)
/etc/init.d/t38modem: 46: cannot create /var/run/t38modem/0: Directory nonexistent
/etc/init.d/t38modem: 46: COUNTER: not found
/etc/init.d/t38modem: 46: CURRENT_PORT: not found
…
Any ideas?
Sophsol,
Are you sure your provider supports T.38? You could do a trace to see if the call gets Re-INVITEd to switch to T.38. It seems like it doesn’t.
Roberto,
This assertion does indeed occur, however it only affects –help and is nothing to worry about. I wasn’t able to make t38modem 1.2.0 to fork properly without logging. I’ve mentioned it somewhere before in the comments that in order for the modem to stay up you need to set the verbosity to high and redirect all output to /dev/null.
Otherwise the modem crashes on its own after a while.
@mobius: Hello. Great post, thank you!
To make it compile I needed to install “make”. To get rid of a startup error you need to create /var/run/t38modem manually,
I can’t run t38modem:
Starting t38modem with pid 1370 (pidfile /var/run/t38modem/0)
error loading avcodec - avcodec: cannot open shared object file: No such file or directory
error loading libavcodec.so - libavcodec.so: cannot open shared object file: No such file or directory
error loading avcodec - avcodec: cannot open shared object file: No such file or directory
error loading libavcodec.so - libavcodec.so: cannot open shared object file: No such file or directory
T38Modem Version 1.0.0
by OpenH323 Project on Unix Linux (2.6.26-2-xen-686-i686)
2010/04/06 21:30:28.639 T38Modem Version 1.0.0 by OpenH323 Project on Unix Linux (2.6.26-2-xen-686-i686) at 2010/4/6 21:30:28.639
Disabled H.323 protocol
Could not open any SIP listener from udp1369{BIND_IP}:6060
Any idea what libavcodec pkg I need to install?
@Roberto: Looks like you missed some $ on variable names like $COUNTER when creating the init.d script. When there’s no var to increment you get an infinite loop.
@Roberto: The example init.d script above uses “#!/bin/sh”. sh doesn’t know
$[]for calculations, so you need to either use bash or replaceCOUNTER=$[ COUNTER + 1 ]by
COUNTER=$(( $COUNTER + 1 ))+1
Hi all!
I get this message from asterisk:
Call from ‘T38modem0′ to extension ’0000034949217841′ rejected because extension not found.
Where could be the problem?
Thanx for the post, it’s great