don't try to register none voip line
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 10 Feb 2010 00:18:35 +0000 (00:18 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 10 Feb 2010 00:18:35 +0000 (00:18 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@146 01035d8c-6547-0410-b346-abe4f91aad63

mini-asterisk-gui/cgi-bin/set_voiplines.pl
mini-asterisk-gui/cgi-bin/voiplines.sh

index 980931f2e751a3ae980f8edca8f7f5517203d4fd..3fd3b91ca4e33e6142ee8e01ba00c62f0aeea42f 100644 (file)
@@ -3,13 +3,14 @@
 # David Rowe 12 Jan 2010
 #
 # Replaces fields in sip.conf, outputs new sip.conf contents to stdout
+# Gets run when "OK" is pressed on the Voip Lines screen
 
 $user = $ARGV[0];
 $pass = $ARGV[1];
 $host = $ARGV[2];
 $provider_new = $ARGV[3];
 
-# We need to slurp up the mini asterisk provider and spit them
+# We need to slurp up the mini asterisk providers and spit them
 # back out.  All must be commented out except for the one that
 # is selected.  Hopefully non-mini asterisk content of sip.conf
 # won't be affected.
@@ -44,9 +45,15 @@ while (<SIP>) {
            # at the moment (one VOIP line)
 
            #print "XX provider_new='$provider_new' '$1' '$2' '$3'\n";
-                   
-            # note fine /$user seems to be necessary so that incoming VOIP
-           # calls work.  I really doin't get the syntax but messed around for
+               
+           # commentout register if "none" selected
+
+           if ($user eq "none") {
+               print ";";
+           }
+
+            # note final /$user seems to be necessary so that incoming VOIP
+           # calls work.  I really don't get the syntax but messed around for
            # hours until it worked!
 
            print "register => $user\@$user/$user; $3\n";
index 410394001d1d208bdde42c73e8e68403efaf3e8b..1e8c292df86d57a23a672a524c58a4eee74de29e 100644 (file)
@@ -58,7 +58,7 @@ perl ./voiplines.pl
 cat <<EOF
       <tr><td>&nbsp</td></tr>
 
-      <tr><td colspan="2">Sometime it takes a few seconds to connect
+      <tr><td colspan="2">Sometimes it takes a few seconds to connect
                           your Voip Line.  After clicking OK refresh
                           your browser to update Voip Line status.
                           </td></tr>