From: drowe67 Date: Wed, 10 Feb 2010 04:44:35 +0000 (+0000) Subject: comment for each voip line X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=3b848ff0dbfdbe60a60f6e8e4ee50a1b537efcc7;p=freetel-svn-tracking.git comment for each voip line git-svn-id: https://svn.code.sf.net/p/freetel/code@147 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/mini-asterisk-gui/cgi-bin/set_voiplines.pl b/mini-asterisk-gui/cgi-bin/set_voiplines.pl index 3fd3b91c..8682fa96 100644 --- a/mini-asterisk-gui/cgi-bin/set_voiplines.pl +++ b/mini-asterisk-gui/cgi-bin/set_voiplines.pl @@ -66,9 +66,12 @@ while () { 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 () { } else { # comment out unused mini-asterisk stanzas - print ";$_"; + if (/^;;/) { + # special csse for comment lines + print "$_"; + } + else { + print ";$_"; + } } } diff --git a/mini-asterisk-gui/cgi-bin/voiplines.js b/mini-asterisk-gui/cgi-bin/voiplines.js index 12201255..66e62e8f 100644 --- a/mini-asterisk-gui/cgi-bin/voiplines.js +++ b/mini-asterisk-gui/cgi-bin/voiplines.js @@ -3,4 +3,5 @@ function changeProvider() { $('user').value = users[provider]; $('pass').value = passwords[provider]; $('host').value = hosts[provider]; + $('comment').innerHTML = comments[provider]; } diff --git a/mini-asterisk-gui/cgi-bin/voiplines.pl b/mini-asterisk-gui/cgi-bin/voiplines.pl index 68318edb..b6262195 100644 --- a/mini-asterisk-gui/cgi-bin/voiplines.pl +++ b/mini-asterisk-gui/cgi-bin/voiplines.pl @@ -16,6 +16,7 @@ my %host = (); # host name keyed on provider my $provider_current = "none"; push (@providers, "none"); +$comment{"none"} = " "; while () { @@ -57,6 +58,10 @@ while () { 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 "\n"; @@ -115,8 +122,8 @@ foreach (@providers) { print "\n"; print "User:\n"; -print "Password:\n"; -print "Host:\n"; +print "Password:\n"; +print "Host:\n"; #print "\nXXX $provider_current $stanza_current} $voip{$stanza_current}\n"; @@ -128,3 +135,6 @@ else { } print "Voip Line Status:$icon\n"; +print " \n"; +print "
 $comment{$provider_current}
\n"; +print " \n"; diff --git a/mini-asterisk-gui/cgi-bin/voiplines.sh b/mini-asterisk-gui/cgi-bin/voiplines.sh index 1e8c292d..69b0d644 100644 --- a/mini-asterisk-gui/cgi-bin/voiplines.sh +++ b/mini-asterisk-gui/cgi-bin/voiplines.sh @@ -48,7 +48,7 @@ cat <  
-

VOIP Line

+

VOIP Line

  EOF @@ -56,7 +56,6 @@ EOF perl ./voiplines.pl cat <  Sometimes it takes a few seconds to connect your Voip Line. After clicking OK refresh diff --git a/mini-asterisk-gui/etc/asterisk/sip.conf b/mini-asterisk-gui/etc/asterisk/sip.conf index cc89a127..02384e68 100644 --- a/mini-asterisk-gui/etc/asterisk/sip.conf +++ b/mini-asterisk-gui/etc/asterisk/sip.conf @@ -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