# Ztdummy modue for Asterisk Timing.

## arndawg

I'm trying to get the ztdummy timing software to work so I can use app_meetme in Asterisk.

I've compiled asterisk with a simple

emerge asterisk

that installed net-misc/asterisk-1.0.11_p1

So how do I go on installing ztdummy? I tried to emerge asterisk with zaptel flag set but that just gave me some errors. Probably because i don't have any digium hardware. I know the ztdummy module is in the zaptel package so how do I install and load it? 

I did read this but it just got me confused.

http://www.voip-info.org/wiki-Asterisk+timer+ztdummy

Any help would be appriciated. And as always when I post on the gentoo forums: I must warn you that I probably don't know what you guys are talking about, so keep it simple.

Thanks.

----------

## novazur

 *arndawg wrote:*   

> So how do I go on installing ztdummy? I tried to emerge asterisk with zaptel flag set

 

That is the good way.

 *arndawg wrote:*   

> but that just gave me some errors.

 

what kind of error ?

 *arndawg wrote:*   

> Probably because i don't have any digium hardware.

 

Not sure !

----------

## arndawg

Ok it worked now. I emerged asterisk with zaptel useflag set without getting errors. Didn't work before.   :Shocked: 

So where do I go on from here? 

```
 

# /etc/init.d/zaptel start

 * Starting zaptel ...

Notice: Configuration file is /etc/zaptel.conf

line 142: Unable to open master device '/dev/zap/ctl' 
```

Perhaps i'm on the wrong path here? 

Thanks for trying to help me.

----------

## novazur

Maybe could you try to set ZAP_FORCE_CREATE to "yes" in /etc/conf.d/zaptel, and restart zaptel.

And, did you load ztdummy module ?

```
# modprobe ztdummy
```

----------

## arndawg

No change. 

Now I know how I got the errors. Emerging zaptel with rtc flag set 

I'm not sure what information is relevant, so i'll just post this: 

```
>>> Compiling source in /var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10 ...

cc -O2 -mtune=i686 -pipe -I. -g -Wall -DBUILDING_TONEZONE    -DSTANDALONE_ZAPATA -DZAPTEL_CONFIG=\"/etc/zaptel.conf\"   -c -o gendigits.o gendigits.c

cc -o gendigits gendigits.o -lm

./gendigits

cc -O2 -mtune=i686 -pipe -I. -g -Wall -DBUILDING_TONEZONE    -DSTANDALONE_ZAPATA -DZAPTEL_CONFIG=\"/etc/zaptel.conf\"    makefw.c   -o makefw

./makefw tormenta2.rbt tor2fw > tor2fw.h

Loaded 69900 bytes from file

cc -O2 -mtune=i686 -pipe -I. -g -Wall -DBUILDING_TONEZONE    -DSTANDALONE_ZAPATA -DZAPTEL_CONFIG=\"/etc/zaptel.conf\"   -c -o ztcfg.o ztcfg.c

cc -c -fPIC -O2 -mtune=i686 -pipe -I. -g -Wall -DBUILDING_TONEZONE    -DSTANDALONE_ZAPATA -DZAPTEL_CONFIG=\"/etc/zaptel.conf\" -DBUILDING_TONEZONE -o zonedata.lo zonedata.c

cc -c -fPIC -O2 -mtune=i686 -pipe -I. -g -Wall -DBUILDING_TONEZONE    -DSTANDALONE_ZAPATA -DZAPTEL_CONFIG=\"/etc/zaptel.conf\" -DBUILDING_TONEZONE -o tonezone.lo tonezone.c

ar rcs libtonezone.a zonedata.lo tonezone.lo

cc -o ztcfg ztcfg.o -lm -L. libtonezone.a

cc -O2 -mtune=i686 -pipe -I. -g -Wall -DBUILDING_TONEZONE    -DSTANDALONE_ZAPATA -DZAPTEL_CONFIG=\"/etc/zaptel.conf\"   -c -o torisatool.o torisatool.c

cc -o torisatool torisatool.o

cc -O2 -mtune=i686 -pipe -I. -g -Wall -DBUILDING_TONEZONE    -DSTANDALONE_ZAPATA -DZAPTEL_CONFIG=\"/etc/zaptel.conf\"   -c -o ztmonitor.o ztmonitor.c

cc -o ztmonitor ztmonitor.o

cc -c ztspeed.c

cc -o ztspeed ztspeed.o

cc -O2 -mtune=i686 -pipe -I. -g -Wall -DBUILDING_TONEZONE    -DSTANDALONE_ZAPATA -DZAPTEL_CONFIG=\"/etc/zaptel.conf\"   -c -o zttool.o zttool.c

cc -o zttool zttool.o -lnewt

cc -O2 -mtune=i686 -pipe -I. -g -Wall -DBUILDING_TONEZONE    -DSTANDALONE_ZAPATA -DZAPTEL_CONFIG=\"/etc/zaptel.conf\"    zttest.c   -o zttest

make -C /usr/src/linux SUBDIRS=/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10 modules

make[1]: Entering directory `/usr/src/linux-2.6.17-gentoo-r4'

  CC [M]  /var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.o

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c: In function `zt_chan_write':

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c:1761: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c: In function `ioctl_load_zone':

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c:2408: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c: In function `zt_common_ioctl':

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c:2760: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c:2820: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c:2823: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c:2905: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c:2935: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c: In function `zt_chanandpseudo_ioctl':

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c:3657: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c:3667: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c:3670: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c:3729: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c:3733: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c: At top level:

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/zaptel.c:176: warning: 'fcstab' defined but not used

  CC [M]  /var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/tor2.o

  CC [M]  /var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/torisa.o

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/torisa.c:1145: warning: 'set_tor_base' defined but not used

  CC [M]  /var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/wcusb.o

  CC [M]  /var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/wcfxo.o

  CC [M]  /var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/wcfxs.o

  CC [M]  /var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/ztdynamic.o

  CC [M]  /var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/ztd-eth.o

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/ztd-eth.c:185: warning: initialization from incompatible pointer type

  CC [M]  /var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/wct1xxp.o

  CC [M]  /var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/wct4xxp.o

  CC [M]  /var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/wcte11xp.o

  CC [M]  /var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/ztdummy.o

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/ztdummy.c:124: error: conflicting types for 'rtc_interrupt'

include/linux/rtc.h:199: error: previous declaration of 'rtc_interrupt' was here

/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/ztdummy.c:124: error: conflicting types for 'rtc_interrupt'

include/linux/rtc.h:199: error: previous declaration of 'rtc_interrupt' was here

make[2]: *** [/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10/ztdummy.o] Error 1

make[1]: *** [_module_/var/tmp/portage/zaptel-1.0.10-r1/work/zaptel-1.0.10] Error 2

make[1]: Leaving directory `/usr/src/linux-2.6.17-gentoo-r4'

make: *** [linux26] Error 2

!!! ERROR: net-misc/zaptel-1.0.10-r1 failed.

Call stack:

  ebuild.sh, line 1539:   Called dyn_compile

  ebuild.sh, line 939:   Called src_compile

  zaptel-1.0.10-r1.ebuild, line 148:   Called die

!!! (no error message)

!!! If you need support, post the topmost build error, and the call stack if relevant.

```

----------

## novazur

Oh ! first, I never saw the version you used !

I only use unstable packages :

```
# grep net-misc /etc/portage/package.keywords

net-misc/asterisk

net-misc/asterisk-addons

net-misc/asterisk-app_rtxfax

net-misc/zaptel
```

Then, I don't use RTC flag, so, if you want it, I suppose you should remove it from your kernel and you won't have conflict anymore (I suppose).

ztdumy is it loaded without error or not (when you comile without rtc USE) ?

----------

## arndawg

Okay- I'm upgrading now. Have to sleep now. only 6 hours til I have to get up to work.

I'm not sure if i really need the rtc flag. So i'll just skip it for now. I only used it because I heard someone was having trouble getting MOH working without it. 

```

[ebuild     U ] net-misc/zaptel-1.2.6 [1.0.10-r1] USE="-bri -ecaggressive% -eckb1% -ecmark% -ecmark2% -ecmark3% -ecmg2% -ecsteve% -ecsteve2% -florz% -rtc -ukcid -watchdog% -zapnet% -zapras%" 660 kB

[ebuild     U ] net-misc/asterisk-1.2.9_p1 [1.0.11_p1] USE="alsa gtk mmx ssl% zaptel -bri -curl% -debug -doc -h323% -hardened -lowmem% -mysql -nosamples% -odbc% -osp% -postgres -pri -speex -sqlite% -ukcid" 10,327 kB

```

Will continue to test this at work in about 6-7 hours.

How's net-misc/asterisk-app_rtxfax working for you? 

Never had any luck with SpanDSP. 

Thanks and good night.

----------

## novazur

You could use zaptel-1.2.7 instead of 1.2.6 (I had issues with conferences and 1.2.6).

I've made an ebuild for it : https://bugs.gentoo.org/show_bug.cgi?id=135083#c5

I don't use RTC in zaptel, but I have a TDM400P card, so I don't use ztdummy. I just used it few days before receiving my card, so I don't really remember well if I used rtc USE or not.

asterisk_app_rtxfax seems to work well for me, but I have a problem to detect incoming faxes. I have to route them manually to 666 extension (my config is built by FreePBX), and I don't use fax very often, so I didn't spend a lot of time on it.

PS : sorry for my bad english.

----------

