Success + a Caller ID Question II

Gert Doering (gert@greenie.muc.de)
Mon, 17 May 1999 00:45:21 +0200


Hi,

On Sun, May 16, 1999 at 01:17:51PM -0700, Daniel Swan wrote:
> >> is it like "cnd-program general.cnd"?? 
> >Yes.  Why don't you just try it?
> 
> Did try it previously, with no success.  However, knowing this is 
> the 'right' path, I have continued to pursue this angle.
> 
> In both my mgetty.config, and voice.conf, I have added the 
> statement "cnd-program /usr/local/bin/program.cnd" near the end of the file.

Warning: make sure that "near the end of the file" doesn't fall into a
port-specific section (meaning that it would only be active for ttyS3, for
example).  The concept of global and per-port settings is explained in
great lengths in the comments in the sample config file, and in the mgetty
URL I sent last time.

> The file program.cnd consists of only the statement "touch /itworks".  
> By my understanding, program.cnd should be kicked off after the first 
> ring of EVERY call, but /itworks has never been created. 

Not after the *first* ring, but immediately before answering (so if 
"rings 3" is set, this will be after the 3rd ring, etc.).

> I have debug level set to 5.  In vgetty.modem, the statement following 
> statement appears : 
> "05/16 13:41:51 dem   conf lib: read: 'cnd-program /usr/local/bin/program.cnd' "

It should go in mgetty.config, not in voice.conf.  But I think I wrote
that last time already.

> I won't take any more of your valuable time, however, I would appreciate 
> it if you could please mail me examples of such a working setup, 
> possibly your own,  including  voice.conf, mgetty.config, and 
> "program.cnd" files.  

mgetty.config is no problem (but it's pretty ugly, so you won't like it),
voice.conf is not related to this, program.cnd could look like this (my
actual "cbackhack" program is pretty gross)...

------------ mgetty.config ------------
# global defaults

debug 4

  fax-id +49-89-35655025
fax-server-file /etc/faxpoll-xfax.ctl

port-owner uucp
port-group uucp
port-mode 0664

fax-owner gert
fax-group fax
fax-mode 0640

# port specific stuff

# Zoom V.FX 28.8

	port NOT_CONNECTED
#port tty1a
  fax-id +49-89-DOERING
  debug 5
  init-chat "" ATQ0E1V1H0 OK ATL0M0S0=0 OK AT&K3 OK
  switchbd 19200
  data-only y

# ZyXEL 2864
port tty5c
  debug 5
  init-chat "" AT&FS2=255 OK ATN1S0=0S13.2=1 OK 
  speed 38400
  statistics-chat "" AT OK ATI2 OK
  statistics-file /tmp/statistics.2864
  #modem-type cls2
  fax-server-file /usr/spool/fax/test/faxpoll.ctl

# ZyXEL 2864 / Test
port tty5d
  debug 5
  speed 38400
  rings 2
  need-dsr y
  fax-max-speed 14400
  init-chat "" ATQ0V1H0 OK ATS0=0L2N0&D3&C1 OK 
  post-init-chat "" AT OK
  msn-list 35655071 023 025 024
  cnd-program /usr/local/etc/mgetty+sendfax/cbackhack
##########^^^^^^^^^^^^ this is valid only for "tty5d"^^^^^^^^^^^^^^^^^
#  login-conf-file /tmp/blafub

# Zoom V.FX 28.8

#port tty2a
#port tty5b
#  debug 5
#  init-chat "" ATQ0E1V1H0 OK ATL0M0S0=0 OK AT&K3 OK
#  data-only y
#  switchbd 19200

# USR Courier V.34
port tty5b
  debug 6
  init-chat "" AT&F1 OK ATS40=6 OK AT&B1&H1&R2 OK

# ZyXEL 
port tty4c
  #port-owner neko
  fax-only n
  debug 7
  fax-max-speed 7200
  #get-cnd-chat "" ATI2 OK
  statistics-chat "" AT OK ATI2 OK
  statistics-file /tmp/statistics.tty4c
  #init-chat "" \d\d\d+++\d\d\dATQ0E1V1H0 OK ATS0=0S2=255&D3&H3&N0&K4 OK
  init-chat "" ATQ0E1V1H0L7M3 OK ATS0=0S2=255&D3 OK

# ZyXEL schwarz
port tty5a
  fax-only n
  rings 5
  debug 5
  init-chat "" ATQ0E1V1H0L7M3 OK ATS0=0S2=255&D3 OK
  speed 38400

# MultiTech MT1432BG

port NOT_CONNECTED
  init-chat "" ATE0E1V1H0 OK ATL0M0S0=0 OK
  modem-type cls2

# MultiTech MT2834BG

port NOT_CONNECTED
  init-chat "" ATH0&F OK ATX4&D3 OK ATQ0L0M0S0=0 OK
  modem-type auto

port tty11
  login-prompt login:\040\040\041\040\040
  port-owner gert
  port-mode 0666
------------ cbackhack, shortened ------------
#!/bin/sh
#
# cbackhack -- initiate a callback/uucp call by mobile call to ZyXEL DI
#              (and log number to syslog)
#
from=$2
to=$5

exec >>/tmp/cbh 2>&1
date 
echo "cbh: args: $@"
echo "cbh: from='$from', to='$to'" 

/usr/bin/logger -p local1.info "ISDN CALL: tty: $1 from '$from' to '$to'"

# Gert's mobile phone -> initiate UUCP call
# Neko's mobile phone -> initiate modem callback
case $from in
    1772160221)
	case $to in
	    *35655025)
		echo "UUCP call to MOBILE"
		/usr/lib/uucp/uucico -r1 -S mobile -x2
		exit 1;;
	    *35655073)
		echo "Modem Callback call to $MCB"
		/usr/local/sbin/callback -x6 -l tty5b:tty5c:tty4c $MCB
		exit 1;;
	esac
	;;
    177xOFFx3213331)
	echo "Modem Callback call to $MCB"
	/usr/local/sbin/callback -x6 -l tty5b:tty5c:tty4c $MCB
	exit 1;;
    8935655023)
	echo "Local Call -> Reject"
	exit 1;;
esac

case $to in
    *35655023|35655024|35655073|35655100|35655101)
	echo "Voice Call -> Reject"
	exit 1;;
esac

echo "Accept Call"
exit 0
------------ cbackhack, shortened ------------

> Many statements in the various config files are commented out and 
> accompanied by explanations.  
> Such an addition for cnd-program may be something to consider.

cnd-program is too complex for that, so it's documented to great lengths
in the "caller ID" section of the config file.  I sent that URL in my last
mail.

> BTW, regarding those dumping pvftools, when I send you guys the 
> relevant info, do you want me to attach the core file?

No - without the actual binary, the core is not useful.  If you can use
GDB, the output of the gdb "where" command would be very helpful, though.

gert
-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             gert@greenie.muc.de
fax: +49-89-35655025                        gert.doering@physik.tu-muenchen.de