Pārlūkot izejas kodu

bye sent even on refer failure; forward-porting

Jiri Kuthan 22 gadi atpakaļ
vecāks
revīzija
439f2cba93
1 mainītis faili ar 10 papildinājumiem un 5 dzēšanām
  1. 10 5
      examples/ctd.sh

+ 10 - 5
examples/ctd.sh

@@ -116,7 +116,7 @@ line==4 { print $0; next; }
 # main
 # main
 
 
 # set up exit cleaner
 # set up exit cleaner
-trap "rm -f $dlg $fifo_reply; exit" 0
+trap "rm -f $dlg $fifo_reply; exit 1" 0
 
 
 # set up FIFO communication
 # set up FIFO communication
 
 
@@ -200,14 +200,14 @@ EOF
 
 
 # report REFER status
 # report REFER status
 wait $fifo_job
 wait $fifo_job
-ret="$?"
+ref_ret="$?"
 
 
-if [ "$ret" -ne "0" ] ; then
+if [ "$ref_ret" -ne "0" ] ; then
 	echo "refer failed"
 	echo "refer failed"
-	exit 1
+else
+	echo "refer succeeded"
 fi
 fi
 
 
-echo "refer succeeded"
 
 
 # well, URI is trying to call TARGET but still maintains the
 # well, URI is trying to call TARGET but still maintains the
 # dummy call we established with previous INVITE transaction:
 # dummy call we established with previous INVITE transaction:
@@ -239,3 +239,8 @@ if [ "$ret" -ne "0" ] ; then
 	exit 1
 	exit 1
 fi
 fi
 echo "bye succeeded"
 echo "bye succeeded"
+
+# clean-up
+trap 0
+rm -f $dlg $fifo_reply
+exit $ref_ret