else {
# OK, we are in an mini-asterisk stanza
- # strip off any leading ";"
+ # strip off leading ";", except for comments lines which start
+ # with ;;
- $_ =~ s/^\;//;
+ unless (/^;;/) {
+ $_ =~ s/^\;//;
+ }
if ($provider eq $provider_new) {
}
else {
# comment out unused mini-asterisk stanzas
- print ";$_";
+ if (/^;;/) {
+ # special csse for comment lines
+ print "$_";
+ }
+ else {
+ print ";$_";
+ }
}
}
my $provider_current = "none";
push (@providers, "none");
+$comment{"none"} = " ";
while (<SIP>) {
if (/^;*host=(.*)/) {
$host{$provider} = $1;
}
+
+ if (/^;; (.*)/) {
+ $comment{$provider} = $1;
+ }
}
$state = $next_state;
print "var users = new Array();\n";
print "var passwords = new Array();\n";
print "var stanzas = new Array();\n";
+print "var comments = new Array();\n";
foreach (@providers) {
print "hosts[\'$_\'] = \'$host{$_}\';\n";
print "users[\'$_\'] = \'$user{$_}\';\n";
print "passwords[\'$_\'] = \'$pass{$_}\';\n";
+ print "comments[\'$_\'] = \"$comment{$_}\";\n";
}
print "</script>\n";
print "</select></td></tr>\n";
print "<tr $tt_user><td>User:</td><td><input type=\"text\" name=\"user\" id=\"user\" value=\"$user{$provider_current}\"></td></tr>\n";
-print "<tr $tt_pass><td>Password:</td><td><input type=\"password\" name=\"pass\" id=\"pass\" value=\"$pass{$provider_current}\"></td></tr>\n";
-print "<tr $tt_host><td>Host:</td><td><input type=\"text\" name=\"host\" id=\"host\" value=\"$host{$provider_current}\"></td></tr>\n";
+print "<tr $tt_pass><td >Password:</td><td><input type=\"password\" name=\"pass\" id=\"pass\" value=\"$pass{$provider_current}\"></td></tr>\n";
+print "<tr $tt_host><td >Host:</td><td><input type=\"text\" name=\"host\" id=\"host\" value=\"$host{$provider_current}\"></td></tr>\n";
#print "\nXXX $provider_current $stanza_current} $voip{$stanza_current}\n";
}
print "<tr $tt_status><td>Voip Line Status:</td><td>$icon</td></tr>\n";
+print "<tr><td> </td></tr>\n";
+print "<tr><td colspan=\"2\"><div id=\"comment\"> $comment{$provider_current}</div></td></tr>\n";
+print "<tr><td> </td></tr>\n";
<table align="right" width=600>
<tr><td> </td></tr>
<form action="set_voiplines.sh" method="get">
- <tr><td onMouseOver="popUp(event,'voiplines_voiplines')" onmouseout="popUp(event,'voiplines_voiplines')" align="left" valign="top"><h2>VOIP Line</h2></td></tr>
+ <tr><td onMouseOver="popUp(event,'voiplines_voiplines')" onmouseout="popUp(event,'voiplines_voiplines')" align="left" valign="top" colspan="3"><h2>VOIP Line</h2></td></tr>
<tr><td> </td></tr>
EOF
perl ./voiplines.pl
cat <<EOF
- <tr><td> </td></tr>
<tr><td colspan="2">Sometimes it takes a few seconds to connect
your Voip Line. After clicking OK refresh
; Pre-configured mini-asterisk SIP trunks
;[user] ; "SIP-NAT" mini-asterisk do not remove this comment
+;; You reach your ITSP via a NAT router (most common)
;type=friend
;context=default
;username=user
;nat=yes
;[user] ; "SIP" mini-asterisk do not remove this comment
+;; No NAT router between your Phone system and your ITSP
;type=friend
;context=default
;username=user
;qualify=yes
;[user] ; "OEG" mini-asterisk do not remove this comment
+;; OEG are a South Australian ITSP
;host=voip.oeg.com.au
;secret=pass
;username=your user number