Forráskód Böngészése

tm: check whether or not 100 response has already been sent

- Do not send the 100 Trying response when it has already been sent
The script writer can do it for example before t_relay().
Miklos Tirpak 16 éve
szülő
commit
a3fe154263
2 módosított fájl, 6 hozzáadás és 3 törlés
  1. 3 2
      modules/tm/t_funcs.c
  2. 3 1
      modules/tm/t_suspend.c

+ 3 - 2
modules/tm/t_funcs.c

@@ -342,8 +342,9 @@ int t_relay_to( struct sip_msg  *p_msg , struct proxy_l *proxy, int proto,
 
 	/* INVITE processing might take long, particularly because of DNS
 	   look-ups -- let upstream know we're working on it */
-	if (p_msg->REQ_METHOD==METHOD_INVITE && (t->flags&T_AUTO_INV_100))
-	{
+	if (p_msg->REQ_METHOD==METHOD_INVITE && (t->flags&T_AUTO_INV_100)
+		&& (t->uas.status < 100)
+	) {
 		DBG( "SER: new INVITE\n");
 		if (!t_reply( t, p_msg , 100 ,
 			cfg_get(tm, tm_cfg, tm_auto_inv_100_r)))

+ 3 - 1
modules/tm/t_suspend.c

@@ -65,7 +65,9 @@ int t_suspend(struct sip_msg *msg,
 
 	/* send a 100 Trying reply, because the INVITE processing
 	will probably take a long time */
-	if (msg->REQ_METHOD==METHOD_INVITE && (t->flags&T_AUTO_INV_100)) {
+	if (msg->REQ_METHOD==METHOD_INVITE && (t->flags&T_AUTO_INV_100)
+		&& (t->uas.status < 100)
+	) {
 		if (!t_reply( t, msg , 100 ,
 			"trying -- your call is important to us"))
 				DBG("SER: ERROR: t_suspend (100)\n");