comment for each voip line
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 10 Feb 2010 04:44:35 +0000 (04:44 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 10 Feb 2010 04:44:35 +0000 (04:44 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@147 01035d8c-6547-0410-b346-abe4f91aad63

mini-asterisk-gui/cgi-bin/set_voiplines.pl
mini-asterisk-gui/cgi-bin/voiplines.js
mini-asterisk-gui/cgi-bin/voiplines.pl
mini-asterisk-gui/cgi-bin/voiplines.sh
mini-asterisk-gui/etc/asterisk/sip.conf

index 3fd3b91ca4e33e6142ee8e01ba00c62f0aeea42f..8682fa9620e1676d264803a06f19b3ae54e9998f 100644 (file)
@@ -66,9 +66,12 @@ while (<SIP>) {
     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) {
 
@@ -97,7 +100,13 @@ while (<SIP>) {
        }
        else {
            # comment out unused mini-asterisk stanzas
-           print ";$_";
+           if (/^;;/) {
+               # special csse for comment lines
+               print "$_";
+           }
+           else {
+               print ";$_";
+           }
        }
     }
 
index 12201255d5ea005661dcff9aade7048eec9578d0..66e62e8fab037d6bc85bc62996656248a707d5cb 100644 (file)
@@ -3,4 +3,5 @@ function changeProvider() {
        $('user').value = users[provider];
        $('pass').value = passwords[provider];
        $('host').value = hosts[provider];
+        $('comment').innerHTML = comments[provider];
 }
index 68318edb23837f694df092eed971e3e66e3a4fcc..b62621955520ec40a6d165c76da823f73bf85ed1 100644 (file)
@@ -16,6 +16,7 @@ my %host = ();     # host name keyed on provider
 
 my $provider_current = "none";
 push (@providers, "none");
+$comment{"none"} = "&nbsp;";
 
 while (<SIP>) { 
 
@@ -57,6 +58,10 @@ while (<SIP>) {
        if (/^;*host=(.*)/) {
            $host{$provider} = $1;
        }
+
+       if (/^;; (.*)/) {
+           $comment{$provider} = $1;
+       }
     }
 
     $state = $next_state;
@@ -87,10 +92,12 @@ print "var hosts = new Array();\n";
 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";
 
@@ -115,8 +122,8 @@ foreach (@providers) {
 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";
 
@@ -128,3 +135,6 @@ else {
 }
 print "<tr $tt_status><td>Voip Line Status:</td><td>$icon</td></tr>\n";
 
+print "<tr><td>&nbsp</td></tr>\n";
+print "<tr><td colspan=\"2\"><div id=\"comment\">&nbsp;$comment{$provider_current}</div></td></tr>\n";
+print "<tr><td>&nbsp</td></tr>\n";
index 1e8c292df86d57a23a672a524c58a4eee74de29e..69b0d6442be8602a10cbd0b7b3a865217065a85d 100644 (file)
@@ -48,7 +48,7 @@ cat <<EOF
     <table align="right" width=600>
       <tr><td>&nbsp</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>&nbsp</td></tr>
 EOF
@@ -56,7 +56,6 @@ EOF
 perl ./voiplines.pl
 
 cat <<EOF
-      <tr><td>&nbsp</td></tr>
 
       <tr><td colspan="2">Sometimes it takes a few seconds to connect
                           your Voip Line.  After clicking OK refresh
index cc89a127880c67ce610dd05b365cc2767d7a6c15..02384e6807e26b98a790a0f9a062f2e994d14b38 100644 (file)
@@ -581,6 +581,7 @@ qualify=yes
 ; 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
@@ -593,6 +594,7 @@ qualify=yes
 ;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
@@ -604,6 +606,7 @@ qualify=yes
 ;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