Browse code

fixed From printing for uac requests (!! does not expend for required header fields, uname -n output used instead)

Jiri Kuthan authored on 07/10/2003 09:09:45
Showing 1 changed files
... ...
@@ -159,6 +159,18 @@ parameter usage:
159 159
 EOF
160 160
 }
161 161
 
162
+
163
+# determine host name, typically for use in printing UAC
164
+# messages; we use today a simplistic but portable uname -n way --
165
+# no domain name is displayed ; fifo_uac expands !! to host
166
+# address only for optional header fields; uname output without
167
+# domain is sufficient for informational header fields such as
168
+# From
169
+#
170
+get_my_host() {
171
+	uname -n
172
+}
173
+
162 174
 # calculate name and domain of current user
163 175
 set_user() {
164 176
 
... ...
@@ -844,8 +856,9 @@ case $1 in
844 856
 			usage
845 857
 			exit 1
846 858
 		fi
859
+		myhost=`get_my_host`
847 860
 		RET=`fifo_cmd t_uac_dlg OPTIONS "$2" "." \
848
-			"From: sip:daemon@!!" \
861
+			"From: sip:daemon@$myhost" \
849 862
 			"To: <$2>" "Contact: <sip:daemon@!!>" "." "." \
850 863
 			| head -1 ` 
851 864
 		print_status $RET
... ...
@@ -856,8 +869,9 @@ case $1 in
856 869
 			usage
857 870
 			exit 1
858 871
 		fi
872
+		myhost=`get_my_host`
859 873
 		RET=`fifo_cmd t_uac_dlg NOTIFY "$2" "." \
860
-			"From: sip:daemon@!!" \
874
+			"From: sip:daemon@$myhost" \
861 875
 			"To: <$2>" "Event: check-sync" \
862 876
 			"Contact: <sip:daemon@!!>" "." "." |
863 877
 			head -1 `