diff --git a/README_IMINITEL.txt b/README_IMINITEL.txt
index 9f06964..4fb6765 100644
--- a/README_IMINITEL.txt
+++ b/README_IMINITEL.txt
@@ -38,7 +38,7 @@ connexion effective au service Minitel (le plus souvent par modem).
 
 Dans le cas de I-Minitel, la connexion au service est TCP/IP d'un bout 
 l'autre et la machine supportant xteld aura un role de routeur d'accs aux
-services I-Minitel. En particuliers:
+services I-Minitel. En particulier:
 
    * Le premier client xtel initialise la connexion PPP de xteld vers le
      serveur 3622. xteld mets alors en place la route vers le serveur
@@ -64,11 +64,12 @@ la connexion PPP. Ce script est localis
 xtel.services (rpertoire /usr/X11R6/lib/X11/xtel). Les fichiers de
 configuration pppd sont les suivants:
 
- /etc/ppp/ip-up.iminitel  Script d'initialisation de la route I-Minitel,
+ /etc/ppp/ip-up.d/iminitel  Script d'initialisation de la route I-Minitel,
                           excut  la connexion
 
- /etc/ppp/ip-down.iminitelScript excut lors de la coupure de connexion
+ /etc/ppp/ip-down.d/iminitel Script excut lors de la coupure de connexion
                           I-Minitel
+
                           Chat-script de composition, contient le numro
  /etc/ppp/chat-iminitel   d'appel 3622 et les caractristiques
                           de la connexion PPP (login/password)
diff --git a/config.c b/config.c
index 50cbfba..187e0fa 100644
--- a/config.c
+++ b/config.c
@@ -25,6 +25,7 @@ static char rcsid[] = "$Id: config.c,v 1.14 1998/10/16 08:49:01 pierre Exp $";
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <ctype.h>
 #ifdef USE_SYSLOG
 #include <syslog.h>
 #endif /* USE_SYSLOG */
@@ -205,7 +206,7 @@ lecture_configuration_lignes ()
 {	
     FILE *fp;
     register int i;
-    char *p, sep[2] = {0, 0};
+    char *p, sep[3] = {0, 0, 0};
 
     if ((fp = fopen (FICHIER_DEFINITION_LIGNES, "r")) == NULL) {
       sprintf (buf, "Erreur a l'ouverture du fichier %s", FICHIER_DEFINITION_LIGNES);
@@ -300,11 +301,27 @@ lecture_configuration_lignes ()
 	    definition_lignes[i].type_dialer = DIALER_MODEM;	    
 	}
 
-	definition_lignes[i].delai = atoi (next_token (NULL, "\n"));
+	/*
+	 * Ajoute NL  la liste des sparateurs pour autoriser une fin de ligne
+	 * aprs le champ dlai
+	 */
+	sep[1] = '\n';
+	definition_lignes[i].delai = atoi (next_token (NULL, sep));
 
-#ifdef DEBUG_XTELD1
+	/*
+	 * colonne 8 = tempo entre 2 ioctls (pour vieux modems)
+	 * 0 par dfaut, i.e. colonne non prsente.
+	 * saisie en millisecondes, stockage en microsecondes.
+	 */
+	p = next_token (NULL, "\n");
+	if (isdigit(*p))
+	    definition_lignes[i].tempo = atoi(p)*1000;
+	else
+	    definition_lignes[i].tempo = 0;
+
+#ifdef DEBUG_XTELD
 	if (!flag_old_config)
-	    log_debug ("LIGNES: %s %s %d %d %d >%s< %d", definition_lignes[i].device, definition_lignes[i].nom, definition_lignes[i].speed, definition_lignes[i].cs, definition_lignes[i].parity, definition_lignes[i].chat, definition_lignes[i].delai);
+	    log_debug ("LIGNES: %s %s %d %d %d >%s< %d (%d)", definition_lignes[i].device, definition_lignes[i].nom, definition_lignes[i].speed, definition_lignes[i].cs, definition_lignes[i].parity, definition_lignes[i].chat, definition_lignes[i].delai, definition_lignes[i].tempo);
 	else
 	    log_debug ("LIGNES: %s %s %d", definition_lignes[i].nom, definition_lignes[i].chat, definition_lignes[i].delai);
 #endif
diff --git a/demon.h b/demon.h
index 98acd1b..6759eb5 100644
--- a/demon.h
+++ b/demon.h
@@ -96,6 +96,7 @@ struct definition_ligne {
     char *chat;			/* chat-script */
     char type_dialer;		/* type du dialer */
     int delai;			/* timeout du dialogue Modem */
+    int tempo;			/* tempos entre ioctl (pour vieux modems) en s */
 };
 
 /*
@@ -132,8 +133,10 @@ struct definition_ligne {
 #endif /* NO_NETWORK */
 
 /* Fichier d'tat I-Minitel */
-#define IMINITEL_FILE            "/tmp/.iminitel"
+#define IMINITEL_FILE            "/var/run/iminitel"
 #define IMINITEL_TIMEOUT         45
+/* Fichier de lock de la session PPP I-Minitel */
+#define IMINITEL_LOCKFILE        "/var/run/ppp-iminitel.pid"
 
 /* Base /proc */
 #define PROC_BASE                "/proc"
diff --git a/dial.c b/dial.c
index b70e9ab..6b4d35c 100644
--- a/dial.c
+++ b/dial.c
@@ -58,6 +58,8 @@ static char rcsid[] = "$Id: dial.c,v 1.17 1998/10/02 15:00:49 pierre Exp $";
 static char nom_lck[256];
 extern char type_client;
 
+static int try_lock (char *lock_file);
+
 /*
  * fonction UNDIAL
  */
@@ -81,7 +83,7 @@ char *telno, *device;
 {
     char buf[80], erreur;
     struct stat statb;
-    int fdlck, fd;
+    int fd;
 
     for (numero_ligne = 0 ; numero_ligne != nb_lignes && definition_lignes[numero_ligne].type_dialer != DIALER_M1 ; numero_ligne++) 
 	;
@@ -96,7 +98,7 @@ char *telno, *device;
         /*
 	 * Recherche la premiere ligne non deja utilise par un programme UUCP
 	 */
-	for (;;) {
+	while (numero_ligne < nb_lignes) {
 #ifdef SVR4
 	    if (stat (definition_lignes[numero_ligne].nom, &statb) != 0) {
 		erreur_a_xtel ("mydial()", errno);
@@ -109,19 +111,9 @@ char *telno, *device;
 #ifdef DEBUG_XTELD
 	    log_debug( "ligne= %s, device= %s, lock= %s", definition_lignes[numero_ligne].nom, definition_lignes[numero_ligne].device, nom_lck);
 #endif
-	    /* Si le lock existe */
-	    if (stat (nom_lck, &statb) == 0) {
-		if (numero_ligne == nb_lignes-1) {
-		    /* Dommage, c'etait la derniere :-( */
-		    erreur_a_xtel ("[0] Aucun MODEM disponible !", 0);
-		    return (-1);
-		}
-	    }
-	    else {
-	      /* Sinon, on verifie que le device corresponde */
-	      if (device == NULL || strcmp (device, definition_lignes[numero_ligne].device) == 0)
-		break;
-	      else {
+	    /* On verifie que le device corresponde */
+	    if (device != NULL && strcmp (device, definition_lignes[numero_ligne].device) != 0) {
+		/* sinon on passe  la ligne suivante */
 		if (numero_ligne == nb_lignes - 1) {
 #ifdef DEBUG_XTELD
 		  log_debug ("%s != %s", device, definition_lignes[numero_ligne].device);
@@ -129,32 +121,39 @@ char *telno, *device;
 		  erreur_a_xtel ("[2] Pas de device correspondant !", 0);
 		  return -1;
 		}
-	      }
+		numero_ligne++;
+		continue;
+	    }
+	    /* Si c'est le bon device, on tente du poser le lock */
+	    if (try_lock( nom_lck ) < 0) {
+		/* le modem est occup... on passe au suivant */
+		numero_ligne++;
+	    }
+	    else {
+		break;
 	    }
-	    
-	  once_again:
-	    numero_ligne++;
 	}
-	
-#ifdef DEBUG_XTELD
-	log_debug ("creation de %s", nom_lck);
-#endif
-
-	/* on cree un fichier semaphore LCK..ttyxx */
-	if ((fdlck = open (nom_lck, O_WRONLY|O_EXCL|O_CREAT, 0644)) < 0) {
-	    erreur_a_xtel (nom_lck, errno);
+	if (numero_ligne >= nb_lignes) {
+	    /* Dommage, c'etait la derniere :-( */
+	    erreur_a_xtel ("[0] Aucun MODEM disponible !", 0);
 	    return (-1);
 	}
 	
-	/* on ecrit le PID dedans */
-	sprintf (buf, "%10d\n", getpid ());
-	write (fdlck, buf, strlen (buf));
-	close (fdlck);
-	
 #ifdef DEBUG_XTELD
 	log_debug ("Ouverture de la ligne %s", definition_lignes[numero_ligne].nom);
 #endif
 	/* ouvre la ligne */
+	if (definition_lignes[numero_ligne].tempo > 0) {
+	    /*
+	     * Pour les vieux modems, dans certains cas, il faut rinitialiser le
+	     * port srie avant de pouvoir communiquer avec le modem.
+	     * Ceci est effectu en ouvrant puis refermant le device avec un certain
+	     * dlai entre chaque opration.
+	     */
+	    fd = open (definition_lignes[numero_ligne].nom, O_RDWR|O_NDELAY);
+	    usleep(definition_lignes[numero_ligne].tempo);
+	    close(fd);
+	}
 	if ((fd = open (definition_lignes[numero_ligne].nom, O_RDWR|O_NDELAY)) < 0) {
 	    /* Derniere ligne, on passe l'erreur */
 	    if (numero_ligne == nb_lignes-1) {
@@ -169,13 +168,13 @@ char *telno, *device;
 	}
 
 	/* Init des parametres de la ligne */
-	init_tty (fd, definition_lignes[numero_ligne].speed, definition_lignes[numero_ligne].cs, definition_lignes[numero_ligne].parity, definition_lignes[numero_ligne].flags, definition_lignes[numero_ligne].type_dialer);
+	init_tty (fd, definition_lignes[numero_ligne].speed, definition_lignes[numero_ligne].cs, definition_lignes[numero_ligne].parity, definition_lignes[numero_ligne].flags, definition_lignes[numero_ligne].type_dialer, definition_lignes[numero_ligne].tempo);
 
 #ifdef DEBUG_XTELD
 	log_debug ("Dialogue Modem...");
 #endif
 
-	erreur = do_chat (fd, definition_lignes[numero_ligne].chat, (unsigned long)definition_lignes[numero_ligne].delai, telno, NULL, 0);
+	erreur = do_chat (fd, definition_lignes[numero_ligne].chat, (unsigned long)definition_lignes[numero_ligne].delai, definition_lignes[numero_ligne].tempo, telno, NULL, 0);
 
 	/*
 	 * Test de l'erreur en sortie
@@ -196,8 +195,10 @@ char *telno, *device;
 		erreur_a_xtel (nom_lck, errno);
 	    }
 	    close (fd);
-	    numero_ligne++;
 	}
+
+    once_again:
+	numero_ligne++;
     }
 
     /*
@@ -208,3 +209,93 @@ char *telno, *device;
 
     return (-1);
 }
+
+/* Verrouille la ligne serie (retourne 0 si ok, -1 si erreur) */
+static int try_lock (char *lock_file)
+{
+  char buf[256];
+  struct stat statb;
+  int fd, n;
+  pid_t pid;
+
+  /* Test du lock */
+  do {
+      fd = open( lock_file, O_CREAT | O_EXCL | O_WRONLY, 0644 );
+      if (fd < 0) {
+	  /* erreur lors de la cration du fichier de lock */
+	  if (errno == EEXIST) {
+	      /* le fichier existe : voir si le programme qui l'a cr existe toujours */
+	      fd = open( lock_file, O_RDONLY );
+	      if (fd >= 0) {
+		  n = read( fd, buf, 11 );
+		  close( fd );
+		  if (n > 0) {
+		      buf[n] = '\0';
+		      pid = atoi(buf);
+		      /* teste l'existence du processus ayant cr le fichier */
+		      if (pid == 0 || kill(pid,0) == -1 && errno == ESRCH) {
+			  if (unlink(lock_file) == 0) {
+#ifdef DEBUG_XTELD
+			      log_debug ("Removed stale lock %s (pid %d)", lock_file, pid);
+#endif
+			      /* et on retente la cration dudit fichier */
+			      fd = -1;
+			  }
+			  else {
+#ifdef DEBUG_XTELD
+			      log_debug ("Can't remove stale lock %s", lock_file);
+#endif
+			      return -1;
+			  }
+		      }
+		      else {
+#ifdef DEBUG_XTELD
+			  char *line = strrchr( lock_file, '/' )+6; /* aprs le /LCK.. */
+			  log_debug ("Device %s is already locked by pid %d", line, pid);
+#endif
+			  return -1;
+		      }
+		  }
+		  else {
+#ifdef DEBUG_XTELD
+		      log_debug ("Can't read pid from lock file %s", lock_file);
+#endif
+		      return -1;
+		  }
+	      }
+	      else if (errno != ENOENT) {
+		  /* il ne vient pas d'tre effac par un autre programme */
+		  /* c'est donc un vrai problme */
+#ifdef DEBUG_XTELD
+		  log_debug ("%s: %s", lock_file, strerror(errno));
+#endif
+		  return -1;
+	      }
+	  }
+	  else {
+	      /* fichier impossible  crer */
+#ifdef DEBUG_XTELD
+	      log_debug ("Can't create lock file %s (%s)", lock_file, strerror(errno));
+#endif
+	      return -1;
+	  }
+      }
+  } while (fd < 0);
+
+  /* Le lock est pos ; il faut y inscrire le pid de ce programme */
+  sprintf (buf, "%10d\n", getpid());
+  if (write (fd, buf, 11) != 11) {
+#ifdef DEBUG_XTELD
+      log_debug ("Error writing to file %s (%s)", lock_file, strerror(errno));
+#endif
+      close (fd);
+      return -1;
+  }
+#ifdef DEBUG_XTELD
+  log_debug ("fichier lock %s cree", nom_lck);
+#endif
+
+  close (fd);
+  return 0;
+}
+
diff --git a/globald.h b/globald.h
index 5c34446..c3864c3 100644
--- a/globald.h
+++ b/globald.h
@@ -74,9 +74,9 @@ int ian_valide (int, char);
 void ian_init (char*);
 
 /* modem.c */
-void init_tty (int, int, int, int, int, int);
+void init_tty (int, int, int, int, int, int, int);
 void restore_tty (int);
-int do_chat (int, char*, unsigned long, char*, char*, int);
+int do_chat (int, char*, unsigned long, int, char*, char*, int);
 void init_debug (char*);
 void close_debug (void);
 #else
diff --git a/iminitel/connect_iminitel.sh b/iminitel/connect_iminitel.sh
index 0680e50..b829f03 100755
--- a/iminitel/connect_iminitel.sh
+++ b/iminitel/connect_iminitel.sh
@@ -1,17 +1,8 @@
 #!/bin/sh
 # $Id: connect_iminitel.sh,v 1.2 2001/02/11 00:16:52 pierre Exp $
-IMINITEL_FILE=/tmp/.iminitel
 
 case "$1" in
     start)
-	# Test lock
-	if [ -r ${IMINITEL_FILE} ]; then
-	    exit 1
-	fi
-
-	# Pose le lock
-	echo -n > ${IMINITEL_FILE}
-
 	# Appel serveur 3622
 	/usr/sbin/pppd call iminitel ipparam iminitel
 	exit $?
@@ -19,10 +10,9 @@ case "$1" in
 
     stop)
 	# Si ppp est encore actif, on coupe
-	if [ -r ${IMINITEL_FILE} ]; then
-	    . ${IMINITEL_FILE}
-	    # Tue de demon pppd
-	    kill `cat /var/run/${IMINITEL_INTERFACE}.pid`
+	if [ -r /var/run/ppp-iminitel.pid ]; then
+	    # Tue le demon pppd
+	    kill `head -1 /var/run/ppp-iminitel.pid`
 	fi    
 	;;
 
diff --git a/iminitel/iminitel b/iminitel/iminitel
index faaadb8..390285c 100644
--- a/iminitel/iminitel
+++ b/iminitel/iminitel
@@ -3,3 +3,4 @@ connect '/usr/sbin/chat -v -f /etc/ppp/chat-iminitel'
 noauth
 lock
 idle 120
+linkname iminitel
diff --git a/iminitel/ip-down.iminitel b/iminitel/ip-down.iminitel
index 7ad8d86..cc6ef4f 100755
--- a/iminitel/ip-down.iminitel
+++ b/iminitel/ip-down.iminitel
@@ -2,6 +2,6 @@
 # $Id: ip-down.iminitel,v 1.1 2001/02/05 09:34:59 pierre Exp $
 # I-Minitel
 if [ "$6" = "iminitel" ]; then
-    rm -f /tmp/.iminitel
+    rm -f /var/run/iminitel
 fi
 
diff --git a/iminitel/ip-up.iminitel b/iminitel/ip-up.iminitel
index 10718c1..2a93654 100755
--- a/iminitel/ip-up.iminitel
+++ b/iminitel/ip-up.iminitel
@@ -19,10 +19,14 @@ if [ "$6" = "iminitel" ]; then
 	shift
 	i=`expr $i + 1`
     done
-    /sbin/route add -host $1 gw ${IMINITEL_ADDR}
-    cat <<EOF > /tmp/.iminitel
-IMINITEL_SERVER=$1
+    /sbin/route add -host ${1} gw ${IMINITEL_ADDR}
+    # cre le fichier d'tat I-Minitel.
+    # Utilise un nommage temporaire pour tre sr que tout son contenu sera
+    # disponible lors de la lecture (asynchrone) par xteld.
+    cat <<EOF > /var/run/iminitel.tmp
+IMINITEL_SERVER=${1}
 IMINITEL_INTERFACE=${IMINITEL_INTERFACE}
 EOF
+    mv /var/run/iminitel.tmp /var/run/iminitel
 fi
 
diff --git a/imprime.c b/imprime.c
index 7a545d7..cd0b8d3 100644
--- a/imprime.c
+++ b/imprime.c
@@ -28,26 +28,37 @@ static void imprime_page_courante (mode)
 int mode;
 {
     FILE *fp;
-    char cmd[256], n[256];
+    int fd = -1;
+    char cmd[256];
+    char n[] = "/var/tmp/xtelXXXXXX";
+    /* cre le fichier de telle faon qu'il soit impossible de le dtourner
+     * avec un lien symbolique pralablement tabli.
+     */
+    if (mktemp(n) != NULL)
+	fd = open (n, O_CREAT | O_EXCL | O_WRONLY, 0600);
 
-    sprintf (n, "/tmp/xtel%d.ppm", getpid());
-    if ((fp = fopen (n, "w")) == NULL) {
+    if (fd < 0) {
 	perror (n);
-	exit (1);
     }
-
-    if (mode == VIDEOTEX) {
-	videotexDumpScreen (ecran_minitel, fp);
-	sprintf (cmd, rsc_xtel.commandeImpression, n);
-    }
-    else { /* ASCII */
-	videotexConversionAscii (ecran_minitel, fp);
-	sprintf (cmd, rsc_xtel.commandeImpressionAscii, n);
+    else if ((fp = fdopen( fd, "wb" )) == NULL) {
+	close (fd);
+	unlink (n);
+	perror (n);
     }
+    else {
+	if (mode == VIDEOTEX) {
+	    videotexDumpScreen (ecran_minitel, fp);
+	    sprintf (cmd, rsc_xtel.commandeImpression, n);
+	}
+	else { /* ASCII */
+	    videotexConversionAscii (ecran_minitel, fp);
+	    sprintf (cmd, rsc_xtel.commandeImpressionAscii, n);
+	}
 
-    fclose (fp);
-    system (cmd);
-    unlink (n);
+	fclose (fp);
+	system (cmd);
+	unlink (n);
+    }
 }
 
 void imprime_page_courante_ascii (w, client_data, call_data)
diff --git a/make_xtel_lignes.sh b/make_xtel_lignes.sh
index 608beb3..5fa371c 100644
--- a/make_xtel_lignes.sh
+++ b/make_xtel_lignes.sh
@@ -27,10 +27,8 @@ if [ "$M" = "" ]; then
     exit 1
 fi
 
-if [ -r $XTEL_LIGNES ]; then
-    echo "Copie de l'ancien $XTEL_LIGNES sur ${XTEL_LIGNES}.$$"
-    mv $XTEL_LIGNES ${XTEL_LIGNES}.$$
-fi
+NEW_XTEL_LIGNES=$XTEL_LIGNES.$$
+rm -f $NEW_XTEL_LIGNES
 
 j=0
 for i in 0 1 2 3
@@ -111,9 +109,9 @@ do
 		echo -n "Quel votre prfixe d'appel (exemple: 0w) ? "
 		read c < /dev/tty	
 		    
-		echo "# $m $MDM" >> $XTEL_LIGNES
-		echo "modem${j}${2}/dev/${TTYLINE}${2}$3${2}7${2}E${2}$4 atdt$c\\T\\r CONNECT${2}30" | sed -e 's/-/ /g' >> $XTEL_LIGNES
-		echo >> $XTEL_LIGNES
+		echo "# $m $MDM" >> $NEW_XTEL_LIGNES
+		echo "modem${j}${2}/dev/${TTYLINE}${2}$3${2}7${2}E${2}$4 atdt$c\\T\\r CONNECT${2}30" | sed -e 's/-/ /g' >> $NEW_XTEL_LIGNES
+		echo >> $NEW_XTEL_LIGNES
 		j=`expr $j + 1`
 	    else
 		sleep 1
@@ -121,7 +119,11 @@ do
 	fi
 done
 
-if [ ! -r $XTEL_LIGNES -a -r ${XTEL_LIGNES}.$$ ]; then
-    echo "Aucun modem dtect, restauration du $XTEL_LIGNES"
-    mv ${XTEL_LIGNES}.$$ $XTEL_LIGNES
+if [ ! -r $NEW_XTEL_LIGNES ]; then
+    echo "Aucun modem dtect."
+else
+    if [ $j -gt 1 ]; then s="s"; fi
+    echo "$j modem$s dtect$s, cration du $XTEL_LIGNES"
+    if [ -f $XTEL_LIGNES ]; then mv ${XTEL_LIGNES} $XTEL_LIGNES.old ; fi
+    mv $NEW_XTEL_LIGNES $XTEL_LIGNES
 fi
diff --git a/mdmdetect.c b/mdmdetect.c
index 4c72c59..871b886 100644
--- a/mdmdetect.c
+++ b/mdmdetect.c
@@ -43,6 +43,7 @@ static char rcsid[] = "$Id: mdmdetect.c,v 1.3 2001/02/11 00:02:58 pierre Exp $";
 #endif /* SVR4 */
 
 #define TIMEOUT_READ		5
+#define TEMPO			1000000
 
 #ifndef __FreeBSD__
 #ifndef __GLIBC__
@@ -100,7 +101,8 @@ static void check_and_lock (char *line)
 {
   char buf[256];
   struct stat statb;
-  FILE *fplock;
+  int fd, n;
+  pid_t pid;
 
   /* A la mode UUCP... */
 #ifdef SVR4
@@ -116,19 +118,64 @@ static void check_and_lock (char *line)
 #endif /* SVR4 */
 
   /* Test du lock */
-  if (stat (lock_file, &statb) == 0) {
-    fprintf (stderr, "Lock file %s already exists, exiting.\n", lock_file);
-    the_end (1);
-  }
+  do {
+      fd = open( lock_file, O_CREAT | O_EXCL | O_WRONLY, 0644 );
+      if (fd < 0) {
+	  /* erreur lors de la cration du fichier de lock */
+	  if (errno == EEXIST) {
+	      /* le fichier existe : voir si le programme qui l'a cr existe toujours */
+	      fd = open( lock_file, O_RDONLY );
+	      if (fd >= 0) {
+		  n = read( fd, buf, 11 );
+		  close( fd );
+		  if (n > 0) {
+		      buf[n] = '\0';
+		      pid = atoi(buf);
+		      /* teste l'existence du processus ayant cr le fichier */
+		      if (pid == 0 || kill(pid,0) == -1 && errno == ESRCH) {
+			  if (unlink(lock_file) == 0) {
+			      fprintf (stderr, "Removed stale lock %s (pid %d)\n", lock_file, pid);
+			      /* et on retente la cration dudit fichier */
+			      fd = -1;
+			  }
+			  else {
+			      fprintf (stderr, "Can't remove stale lock %s\n", lock_file);
+			      the_end (1);
+			  }
+		      }
+		      else {
+			  fprintf (stderr, "Device %s is already locked by pid %d\n", line, pid);
+			  the_end (1);
+		      }
+		  }
+		  else {
+		      fprintf (stderr, "Can't read pid from lock file %s\n", lock_file);
+		      the_end (1);
+		  }
+	      }
+	      else if (errno != ENOENT) {
+		  /* il ne vient pas d'tre effac par un autre programme */
+		  /* c'est donc un vrai problme */
+		  fprintf (stderr, "%s: %s\n", lock_file, sys_errlist[errno]);
+		  the_end (1);
+	      }
+	  }
+	  else {
+	      /* fichier impossible  crer */
+	      fprintf (stderr, "Can't create lock file %s (%s)\n", lock_file, sys_errlist[errno]);
+	      the_end (1);
+	  }
+      }
+  } while (fd < 0);
 
-  /* Pose le lock */
-  if (!(fplock = fopen (lock_file, "w"))) {
-      fprintf (stderr, "%s: %s\n", lock_file, sys_errlist[errno]);
+  /* Le lock est pos ; il faut y inscrire le pid de ce programme */
+  sprintf (buf, "%10d\n", getpid());
+  if (write (fd, buf, 11) != 11) {
+      fprintf (stderr, "Error writing to file %s (%s)\n", lock_file, sys_errlist[errno]);
+      close (fd);
       the_end (1);
   }
-  
-  fprintf (fplock, "%10d\n", getpid());
-  fclose (fplock);
+  close (fd);
 }
 
 /* Lecture d'une ligne terminee par '\n' */
@@ -191,27 +238,20 @@ int port;
 }
 
 /* Recherche de mot-cle */
-static int check_for_kw (int fd, char *builder, char *kw, char *s)
+static char* check_for_kw (int fd, char *s)
 {
-  char modem_string[4096], chat_script[256];
+  static char modem_string[4096], chat_script[256];
 
   fprintf (stderr, "."); fflush (stderr);
 
   sprintf (chat_script, "%s\r OK", s);
-  if (do_chat (fd, chat_script, TIMEOUT_READ, NULL, modem_string, sizeof(modem_string)) != 0)
-    return 0;
+  if (do_chat (fd, chat_script, TIMEOUT_READ, TEMPO, NULL, modem_string, sizeof(modem_string)) != 0)
+    return NULL;
 
   if (debug)
-    log_debug ("[%s] check_for_kw %s: reponse= %s", builder, kw, modem_string);
-
-  if (strstr (modem_string, kw)) {
-      if (debug)
-	log_debug ("%s trouve !", kw);
+    log_debug ("reponse= %s", modem_string);
 
-      return 1;
-  }
-      
-  return 0;
+  return modem_string;
 }
 
 
@@ -219,7 +259,8 @@ main (ac, av)
 int ac;
 char **av;
 {
-  char *cp, *str1, *str2;
+  char cmd[6];
+  char *cp, *fab, *modem_string, *reponse;
   register int i;
   int found = 0;
 #ifdef DEBUG_XTELD
@@ -285,7 +326,29 @@ char **av;
     }
   }
 
-  if (!query) {
+  if (query) {
+    /* Lecture de la liste des modems */
+    while (read_a_line (fdl, buf, sizeof(buf)) > 0) {
+
+      if (debug)
+	log_debug ("(%s)", buf);
+
+      if (buf[0] == '#' || buf[0] == '\n')
+	continue;
+
+      /* Fabricant */
+      if (buf[0] == '[') {
+	fab = strdup (&buf[1]);
+	fab[strlen(fab)-2] = 0;
+	if (query)
+	  printf ("%s\n", fab);
+
+	continue;
+      }
+    }
+  }
+
+  else {
     /* Test et lock de la ligne */
     check_and_lock (cp);
 
@@ -296,65 +359,53 @@ char **av;
     }
 
     /* Ligne en mode 'raw' */
-    init_tty (fd, B9600, CS8, 2, 0, 0);
+    init_tty (fd, B9600, CS8, 2, 0, 0, TEMPO);
 
     /* Test de presence de modem */
-    if (do_chat (fd, "AT\r OK", 3, NULL, NULL, 0)) {
+    if (do_chat (fd, "AT\r OK", 3, TEMPO, NULL, NULL, 0)) {
       /* On insiste un peu */
-      if (do_chat (fd, "AT\r OK", 3, NULL, NULL, 0)) {
+      if (do_chat (fd, "AT\r OK", TEMPO, 3, NULL, NULL, 0)) {
 	fprintf (stderr, "Pas de modem prsent !\n");
 	the_end (1);
       }
     }
-  }
-
-  /* Lecture de la liste des modems */
-  while (read_a_line (fdl, buf, sizeof(buf)) > 0) {
-
-    if (debug)
-      log_debug ("(%s)", buf);
-
-    if (buf[0] == '#' || buf[0] == '\n')
-      continue;
-
-    /* Fabricant */
-    if (buf[0] == '[') {
-      str1 = strdup (&buf[1]);
-      str1[strlen(str1)-2] = 0;
-      if (query)
-	printf ("%s\n", str1);
-
-      continue;
-    }
-
-    /* Si on a specifie un fabricant, teste le nom */
-    if (query || (builder && strcmp (str1, builder)))
-      continue;
-      
-    /* Mot-cle a tester */
-    str2 = next_token (buf, ":");
-
-    if (!str2) {
-      fprintf (stderr, "Erreur de lecture %s\n", modem_list);
-      the_end (1);
-    }
-
-    /* Interrogation par ATI puis ATIx */
-    found = 0;
-    if ((found = check_for_kw (fd, str1, str2, "ATI")) == 0) {
-      for (i = '0' ; i <= '9' ; i++) {
-	char cmd[6];
 
-	sprintf (cmd, "ATI%c", i);
-	if ((found = check_for_kw (fd, str1, str2, cmd)) > 0) {
-	  break;
+    /* interrogation du modem sur l'ensemble des registres de configuration */
+    strcpy (cmd, "ATI");
+    for (i = -1 ; !found && i <= 9 ; i++) {
+      if (i >= 0)
+	sprintf (cmd, "ATI%d", i);
+      if ((reponse = check_for_kw (fd, cmd)) != NULL) {
+	/* on a une rponse : rechercher dans la base */
+	lseek (fdl, 0, 0);
+	found = 0;
+	while (!found && read_a_line (fdl, buf, sizeof(buf)) > 0) {
+	  if (debug)
+	    log_debug ("(%s)", buf);
+	  if (buf[0] == '#' || buf[0] == '\n') {
+	    /* commentaire ou ligne blanche */
+	  }
+	  else if (buf[0] == '[') {
+	    /* Fabricant */
+	    fab = strdup (&buf[1]);
+	    fab[strlen(fab)-2] = 0;
+	  }
+	  else if (!builder || strcmp (builder, fab)==0) {
+	    /* description d'un modem */
+	    modem_string = next_token (buf, ":");   /* Mot-cl  tester */
+	    if (strstr (reponse, modem_string)) {
+	      if (debug)
+		log_debug ("%s trouve !", modem_string);
+	      found = 1;
+	    }
+	  }
 	}
       }
     }
 
     if (found) {
       if (debug)
-	log_debug ("str2= %s buf= %s", str2, buf);
+	log_debug ("builder= %s modem id= %s", fab, modem_string);
 
       puts ("\n");
 
diff --git a/modem.c b/modem.c
index 3652484..3e0e63f 100644
--- a/modem.c
+++ b/modem.c
@@ -61,7 +61,7 @@ static struct termio term_sauve, term;
 static struct termiox termx;
 #endif /* lectra && SVR4 && !sun || hpux */
 
-#ifndef SYSLOG
+#ifndef USE_SYSLOG
 static FILE *fp_console;
 #endif
 static char prefix[256];
@@ -89,13 +89,13 @@ void close_debug ()
 
 /* Syslog or not syslog ? */
 #ifdef USE_SYSLOG
-void log_debug (fmt, p1, p2, p3, p4, p5, p6, p7)
+void log_debug (fmt, p1, p2, p3, p4, p5, p6, p7, p8)
 char *fmt;
-int  p1, p2, p3, p4, p5, p6, p7;
+int  p1, p2, p3, p4, p5, p6, p7, p8;
 {
     char msg[256];
 
-    sprintf (msg, fmt, p1, p2, p3, p4, p5, p6, p7);
+    sprintf (msg, fmt, p1, p2, p3, p4, p5, p6, p7, p8);
     syslog (LOG_INFO, msg);
 }
 
@@ -105,12 +105,12 @@ char *s;
     syslog (LOG_ERR, s);
 }
 #else
-void log_debug (fmt, p1, p2, p3, p4, p5, p6, p7)
+void log_debug (fmt, p1, p2, p3, p4, p5, p6, p7, p8)
 char *fmt;
-int  p1, p2, p3, p4, p5, p6, p7;
+int  p1, p2, p3, p4, p5, p6, p7, p8;
 {
     fprintf (fp_console, "%s[%d] ", prefix, getpid());
-    fprintf (fp_console, fmt, p1, p2, p3, p4, p5, p6, p7);
+    fprintf (fp_console, fmt, p1, p2, p3, p4, p5, p6, p7, p8);
     fprintf (fp_console, "\n\r");
 }
 
@@ -151,13 +151,15 @@ int n;
 }
 
 /* Init des parametres de ligne */
-void init_tty (int fd, int speed, int csize, int parity, int flags, int dialer)
+void init_tty (int fd, int speed, int csize, int parity, int flags, int dialer, int tempo)
 {
 #ifdef NO_TERMIO
   ioctl (fd, TIOCGETP, &term);
+  usleep(tempo);
   memcpy ((char *)&term_sauve, (char *)&term, sizeof(struct sgttyb));
   term.sg_flags |= RAW;
   ioctl (fd, TIOCSETP, &term);
+  usleep(tempo);
 	
   /* Flags, pour l'instant RTS/CTS */
   /* FIXME: comment passer la ligne en RTS/CTS sans termio ? */
@@ -166,9 +168,11 @@ void init_tty (int fd, int speed, int csize, int parity, int flags, int dialer)
 
 #ifdef USE_TERMIOS
   ioctl (fd, TIOCGETA, &term);
+  usleep(tempo);
   memcpy ((char *)&term_sauve, (char *)&term, sizeof(struct termios));
 #else
   ioctl (fd, TCGETA, &term);
+  usleep(tempo);
   memcpy ((char *)&term_sauve, (char *)&term, sizeof(struct termio));
 #endif /* USE_TERMIOS */
 	
@@ -185,7 +189,8 @@ void init_tty (int fd, int speed, int csize, int parity, int flags, int dialer)
    */
   term.c_cflag &= ~(CSIZE|CSTOPB);
   term.c_cflag |= (CREAD|HUPCL);
-  term.c_ispeed = term.c_ospeed = speed;
+  cfsetispeed (&term, speed);
+  cfsetospeed (&term, speed);
 #else
   term.c_cflag &= ~(CSIZE|CBAUD|CLOCAL);
 
@@ -236,35 +241,44 @@ void init_tty (int fd, int speed, int csize, int parity, int flags, int dialer)
   /* Affectation des parametres */
 #ifdef USE_TERMIOS
   ioctl (fd, TIOCSETA, &term);
+  usleep(tempo);
 #else
   ioctl (fd, TCSETA, &term);
+  usleep(tempo);
 #endif /* USE_TERMIOS */
 #endif /* NO_TERMIO */
 }
 
 /* Restauration des parametres */
-void restore_tty (fd)
+void restore_tty (int fd)
 {
 #ifdef ultrix
   int temp = 0;
 #endif
+  int tempo = 0;
  
    /* remet la ligne en l'etat */
 #ifdef NO_TERMIO
   term.sg_ispeed = term.sg_ospeed = B0;
   ioctl (fd, TIOCSETP, &term);
+  usleep(tempo);
   ioctl (fd, TIOCSETP, &term_sauve);
+  usleep(tempo);
 #else
 #ifdef USE_TERMIOS
-  term.c_ispeed = B0;
-  term.c_ospeed = B0;
+  cfsetispeed (&term, B0);
+  cfsetospeed (&term, B0);
   ioctl (fd, TIOCSETAW, &term);
+  usleep(tempo);
   ioctl (fd, TIOCSETA, &term_sauve);
+  usleep(tempo);
 #else
   term.c_cflag &= ~CBAUD;
   term.c_cflag |= B0;
   ioctl (fd, TCSETAW, &term);
+  usleep(tempo);
   ioctl (fd, TCSETA, &term_sauve);
+  usleep(tempo);
 #endif /* USE_TERMIOS */
 #endif /* NO_TERMIO */
 #ifdef ultrix
@@ -277,10 +291,11 @@ void restore_tty (fd)
 /* 
  * Dialogue avec le Modem (chatons, chatons...)
  */
-int do_chat (fd, chat_script, tmax, telno, reply_buf, reply_size)
+int do_chat (fd, chat_script, tmax, tempo, telno, reply_buf, reply_size)
 int fd;
 char *chat_script;
 unsigned long tmax;
+int tempo;
 char *telno, *reply_buf;
 int reply_size;
 {
@@ -288,7 +303,6 @@ int reply_size;
     int i, erreur, fin, nbread, cmodem;
     char *pt_chat, c, *q;
 
-    delai_maxi.tv_sec = tmax;
     erreur = 0;
     pt_chat = chat_script;
     fin = 0;
@@ -307,16 +321,20 @@ int reply_size;
      *  (comme le Hayes Optima par exemple)...
      */
 #ifdef USE_TERMIOS
-    ioctl (fd, TCIOCGETA, &term);
+    ioctl (fd, TIOCGETA, &term);
+    usleep(tempo);
 #else
     ioctl (fd, TCGETA, &term);
+    usleep(tempo);
 #endif /* USE_TERMIOS */
     if ((term.c_cflag | CLOCAL) == 0) {
 	term.c_cflag |= CLOCAL;
 #ifdef USE_TERMIOS
-	ioctl (fd, TCIOCSETA, &term);
+	ioctl (fd, TIOCSETA, &term);
+	usleep(tempo);
 #else
 	ioctl (fd, TCSETA, &term);
+	usleep(tempo);
 #endif /* USE_TERMIOS */
 	cmodem = 1;
     }
@@ -475,6 +493,7 @@ int reply_size;
 	for (;;) {
 	    
 	    t_a_lire = a_lire;
+	    delai_maxi.tv_sec = tmax;
 	    nbread = select (32, &t_a_lire, NULL, NULL, &delai_maxi);
 
 	    /* Si il y a qque chose a lire */
@@ -565,9 +584,10 @@ int reply_size;
 		/* erreur read */
 		else {
 #ifdef DEBUG_XTELD
-		    log_debug ("Erreur read !");
+		    log_debug ("Erreur read ! (errno=%d)",errno);
 #endif
-		    erreur = 1;
+		    /*erreur = 1;*/
+		    if (++erreur > 10)
 		    break;
 		}
 	    }
@@ -592,9 +612,11 @@ int reply_size;
     if (cmodem) {
 	term.c_cflag &= ~CLOCAL;
 #ifdef USE_TERMIOS
-	ioctl (fd, TCIOCSETA, &term);
+	ioctl (fd, TIOCSETA, &term);
+	usleep(tempo);
 #else
 	ioctl (fd, TCSETA, &term);
+	usleep(tempo);
 #endif /* USE_TERMIOS */
     }
 #endif
diff --git a/modem.list b/modem.list
index e277e50..85af66b 100644
--- a/modem.list
+++ b/modem.list
@@ -41,3 +41,7 @@ KORTEX 336:Novafax-336:|:38400:\dATZ\r-OK-ATM2\r-OK-AT+MS=3\x2C0\x2C1200\x2C1200
 ACCURA:ACCURA-288/336:,:38400:\datm1&k3\r-OK-atb2\r-OK
 RCV56:Accura-56K:,:38400:\dat&fm1e0&k3f3\r-OK
 SMO14400:OPTIMA-144:,:38400:\datm1&k3\r-OK-atb2\r-OK
+
+[SAGEM]
+TELSAT 14402:TelSat 14402:,:38400:\dATZ0\r-OK
+
diff --git a/xtel.lignes b/xtel.lignes
index e25c5c0..d637670 100644
--- a/xtel.lignes
+++ b/xtel.lignes
@@ -17,7 +17,10 @@ modem0,/dev/modem,1200,7,E,\dat\r OK atm1b2\r OK atdt\T\r CONNECT,30
 #modem0,/dev/modem,1200,7,E,\dat\r OK ATM1S27=16&N2S40=1S9=100&N2\r OK atdt\T\r CONNECT,30
 
 # Modem USR Sporter 56K
-#modem0,/dev/modem,1200,7,E,\dat\r OK AT&F1M1S27=16S34=8S40=6&N2S9=100&B2 OK atdt\T\r CONNECT,30
+#modem0,/dev/modem,1200,7,E,\dat\r OK AT&F1M1S27=16S34=8S40=6&N2S9=100&B2\r OK atdt\T\r CONNECT,30
+
+#Modem USR Courier I-modem externe bios 2.50
+#modem0,/dev/modem,38400,7,E,\dat\r OK AT&f1m1l1b0*v2=3s34=8&n2s27=16s40=1s9=100&b2\r OK atdt\T\r CONNECT,30
 
 # Minitel 1
 #modem0,/dev/modem,1200,7,E,minitel1,30
diff --git a/xtel.man b/xtel.man
index 27c867e..2780c01 100644
--- a/xtel.man
+++ b/xtel.man
@@ -1,6 +1,6 @@
 .\" Copyright (c) 1991-98 Lectra-Systemes
 .\" $Id: xtel.man,v 1.10 1998/10/02 15:09:58 pierre Exp $
-.TH XTEL n "Lectra-Systemes" "10/98"
+.TH XTEL 1 "Lectra-Systemes" "10/98"
 .UC 5
 .SH NOM
 xtel \- Emulateur MINITEL 
diff --git a/xteld.c b/xteld.c
index 6a20893..f55599c 100644
--- a/xteld.c
+++ b/xteld.c
@@ -64,6 +64,7 @@ static char rcsid[] = "$Id: xteld.c,v 1.33 2001/02/13 09:40:49 pierre Exp $";
 #include <time.h>
 #include <signal.h>
 #include <string.h>
+#include <fcntl.h>
 
 #ifdef NO_TERMIO
 #include <sgtty.h>
@@ -204,9 +205,13 @@ static int read_iminitel_file ()
   char buf[256];
 
   if (stat (IMINITEL_FILE, &statb) < 0) {
-    /* Ne devrait pas arriver */
-    erreur_a_xtel (IMINITEL_FILE, errno);
-    exit (1);
+    if (errno != ENOENT) {
+      /* Ne devrait pas arriver */
+      erreur_a_xtel (IMINITEL_FILE, errno);
+      exit (1);
+    }
+    else
+      return 0;
   }
 
   /* Fichier non vide, on lit les parametres */
@@ -435,10 +440,12 @@ static void deconnexion ()
 	/* signal a XTEL la deconnexion */
 	write (XTELD_OUTPUT, CHAINE_REPONSE_DECONNEXION, 1);
 	
+#if 0 /* symlink attack vulnerability */
 	/* supprime le fichier de log */
 	sprintf (buf, "/tmp/.xtel-%s", utilisateur);
 	unlink (buf);
-	
+#endif
+
 	if ((fplog= fopen(FICHIER_LOG, "a")) != NULL) {
 	    long t= time(0), duree;
 	    char *at= ctime(&t);
@@ -696,7 +703,7 @@ char *service_teletel;
       if (!strncmp (device_associe, "@tcp", 4) || !strncmp (device_associe, "@imi", 4)) {
 	char *tcp_port;
 	int maxtime;
-	struct stat statb;
+	int fd;
 
 	/* Valide la saisie */
 	saisie_active = 1;
@@ -708,17 +715,63 @@ char *service_teletel;
 	if (!strncmp (device_associe, "@imi", 4)) {
 	  strcpy (iminitel_script, code_teletel);
 
+	  /* On vrifie si dj connect (i.e. existence du fichier lock
+	   * /var/run/ppp-iminitel.pid qui contient le pid du processus ppp
+	   * normalement encore actif) */
+	  fd = open( IMINITEL_LOCKFILE, O_RDONLY );
+	  if (fd >= 0) {
+	      /* le fichier existe : voir si le programme qui l'a cr existe toujours */
+	      char buf[20];
+	      int n;
+	      /* lit la premire ligne contenant le PID du processus qui l'a cr */
+	      n = read( fd, buf, sizeof(buf) );
+	      close( fd );
+	      if (n > 0) {
+		  /* rcupre le PID */
+		  pid_t pid;
+		  buf[n] = '\0';
+		  pid = (pid_t)atoi( buf );
+		  /* teste l'existence du processus ayant cr le fichier */
+		  if (pid == 0 || (kill(pid,0) == -1 && errno == ESRCH)) {
+		      if (unlink(IMINITEL_LOCKFILE) == 0) {
+#ifdef DEBUG_XTELD
+			  log_debug ("Removed stale lock %s (pid %d)", IMINITEL_LOCKFILE, pid);
+#endif
+			  /* et on redmarrera la connexion ppp */
+			  fd = -1;
+		      }
+		      else {
+			  erreur_a_xtel (IMINITEL_LOCKFILE, errno);
+			  return;
+		      }
+		  }
+		  else {
+		      /* le processus existe encore -> connexion suppose active */
+		  }
+	      }
+	  }
+	  else if (errno != ENOENT) {
+	      /* il ne vient pas d'tre effac par un autre programme */
+	      /* c'est donc un vrai problme */
+	      erreur_a_xtel (IMINITEL_LOCKFILE, errno);
+	      return;
+	  }
 	  /* Si pas deja connecte, on lance la connexion */
-	  if (stat (IMINITEL_FILE, &statb) < 0) {
-	    /* Execution du script de connexion avec option 'start' */
-	    sprintf (buf, "%s/%s start", XTEL_LIBDIR, iminitel_script);
+	  if (fd < 0) {
+	      /* Effacer ventuellement le fichier d'tat I-Minitel */
+	      if (unlink( IMINITEL_FILE ) < 0 && errno != ENOENT) {
+		  erreur_a_xtel( IMINITEL_FILE, errno );
+		  return;
+	      }
+	      /* Execution du script de connexion avec option 'start' */
+	      sprintf (buf, "%s/%s start", XTEL_LIBDIR, iminitel_script);
 #ifdef DEBUG_XTELD
-	    log_debug ("execute: %s", buf);
+	      log_debug ("execute: %s", buf);
 #endif
-	    if (system (buf) != 0) {
-	      erreur_a_xtel (buf, errno);
-	      exit (1);
-	    }
+	      if (system (buf) != 0) {
+		  erreur_a_xtel (buf, errno);
+		  exit (1);
+	      }
 	  }
 
 	  /* Temps maxi d'attente de connexion */
@@ -1006,6 +1059,7 @@ char *service_teletel;
     signal(SIGTERM, SIG_DFL);
 
     /* creation du fichier de log */
+#if 0 /* symlink attack vulnerability */
     sprintf (buf, "/tmp/.xtel-%s", utilisateur);
     if ((fplog = fopen (buf, "w"))) {
 #ifdef DEBUG_XTELD
@@ -1019,6 +1073,7 @@ char *service_teletel;
 	fprintf (fplog, "SERVICE = %s\n", service);
 	fclose (fplog);
     }
+#endif
     
     if ((fplog= fopen(FICHIER_LOG, "a")) != NULL) {
 	char *at;
diff --git a/xteld.man b/xteld.man
index 68b45a9..8fc1b18 100644
--- a/xteld.man
+++ b/xteld.man
@@ -1,6 +1,6 @@
 .\" Copyright (c) 1991-98 Lectra-Systemes
 .\" $Id: xteld.man,v 1.10 2001/02/11 00:11:35 pierre Exp $
-.TH XTELD n "Lectra-Systemes" "10/98"
+.TH XTELD 8 "Lectra-Systemes" "10/98"
 .UC 5
 .SH NOM
 xteld \- dmon de l'mulateur Minitel XTEL
@@ -23,7 +23,7 @@ Edition) comment client 
 
 .SH UTILISATION
 .LP
-\fIxteld\fP utilise le fichier \fB"/usr/X11R6/lib/X11/xtel/xtel\.services"\fP
+\fIxteld\fP utilise le fichier \fB"/usr/X11R6/lib/X11/xtel/xtel.services"\fP
 (sous Xfree86) qui contient la liste des services disponibles sous la forme :
 .sp
 .I "[Nom du device,]"
@@ -116,7 +116,7 @@ La derni
 (mot\-cl \fIDirect\fP), l'utilisateur saisira directement le numro lors de la 
 composition dans \fIxtel\fP.
 .LP
-On utilise galement le fichier \fB"/usr/X11R6/lib/X11/xtel/xtel\.lignes"\fP
+On utilise galement le fichier \fB"/usr/X11R6/lib/X11/xtel/xtel.lignes"\fP
 qui dfinit les lignes disponibles et la procdure de composition. Ce fichier est de
 la forme :
 .sp
@@ -128,7 +128,8 @@ la forme :
 .I "[Parit,]"
 .I "chat-script avec le modem"
 ,
-.I "delai maxi de rponse du modem en secondes."
+.I "delai maxi de rponse du modem en secondes"
+.I "[,temporisation entre commandes en millisecondes.]"
 .sp
 Et ce pour chaque ligne utilisable. Si le premier champs (nom du device) est rpt
 sur plusieurs lignes, cela signifie que plusieurs modem physiques sont associs au
@@ -157,15 +158,21 @@ Si le chat-script est remplace par la chaine \fIminitel2\fP, la ligne est defini
 comme utilisant un \fBMinitel 2\fP comme modem.
 .sp
 Si le chat-script est remplace par la chaine \fIminitel1\fP, la ligne est dfinie
-comme utilisant un \fBMinitel 1/1B\fI comme modem. A ce moment la, le menu "Services"
+comme utilisant un \fBMinitel 1/1B\fP comme modem. A ce moment la, le menu "Services"
 ne sera pas affich dans xtel et l'utilisateur devra composer son numro  la main
 (le M1/M1B ne sachant thoriquement pas composer de numro).
+.sp
+Le champ temporisation est optionnel et peut contenir une dure (en ms)
+d'attente entre l'envoi de chaque commande au modem dans la phase
+d'initialisation.  Il permet un meilleur support de certains anciens modems qui
+n'acceptaient pas de recevoir un flot de commande trop rapide.  S'il n'est pas
+prcis, aucune temporisation n'est effectue (c'est le comportement standard de \fIxteld\fP).
 .sp 2
 .B "Exemples :"
 .in +10
 .nf
 /dev/cua0,\\dat\\r OK atdt\\T\\r CONNECT,30
-v23,/dev/cua1,1200,7,E,\\dat\\r OK atdt\\T\\r CONNECT,30
+v23,/dev/cua1,1200,7,E,\\dat\\r OK atdt\\T\\r CONNECT,30,250
 tvr,/dev/cua2:rtscts,9600,8,N,\\dat\\r OK atdt\\T\\r CONNECT,30
 .fi
 .in -10
@@ -188,6 +195,12 @@ Le d
 secondes maxi. Si le dlai est dpass, \fIxteld\fP essayera sur la ligne suivante du fichier
 jusqu' un succs ou la fin du fichier.
 .sp
+La ligne
+.I v23
+dclare aussi une temporisation de
+.I 250ms
+entre chaque commande transmise au modem.
+.sp
 .B "Remarques :"
 .sp
 Le format du chat-script accepte les squences suivantes :
