Browse code

fixed to send BYE even if REFER failed

Jiri Kuthan authored on 21/08/2003 15:15:42
Showing 1 changed files
... ...
@@ -116,7 +116,7 @@ line==4 { print $0; next; }
116 116
 # main
117 117
 
118 118
 # set up exit cleaner
119
-trap "rm -f $dlg $fifo_reply; exit" 0
119
+trap "rm -f $dlg $fifo_reply; exit 1" 0
120 120
 
121 121
 # set up FIFO communication
122 122
 
... ...
@@ -200,14 +200,14 @@ EOF
200 200
 
201 201
 # report REFER status
202 202
 wait $fifo_job
203
-ret="$?"
203
+ref_ret="$?"
204 204
 
205
-if [ "$ret" -ne "0" ] ; then
205
+if [ "$ref_ret" -ne "0" ] ; then
206 206
 	echo "refer failed"
207
-	exit 1
207
+else
208
+	echo "refer succeeded"
208 209
 fi
209 210
 
210
-echo "refer succeeded"
211 211
 
212 212
 # well, URI is trying to call TARGET but still maintains the
213 213
 # dummy call we established with previous INVITE transaction:
... ...
@@ -239,3 +239,8 @@ if [ "$ret" -ne "0" ] ; then
239 239
 	exit 1
240 240
 fi
241 241
 echo "bye succeeded"
242
+
243
+# clean-up
244
+trap 0
245
+rm -f $dlg $fifo_reply
246
+exit $ref_ret