git-svn-id: https://svn.code.sf.net/p/freetel/code@1017 01035d8c-6547-0410-b346-abe4f...
authorhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Sun, 18 Nov 2012 23:43:22 +0000 (23:43 +0000)
committerhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Sun, 18 Nov 2012 23:43:22 +0000 (23:43 +0000)
mini-asterisk-gui2/etc/asterisk/sip.conf
mini-asterisk-gui2/voiplines.html
mini-asterisk-gui2/voiplines.js

index 5483ea2ca69fdad2b9acfa4b24541745d1b4090c..973431e3b1d5c8a1d03ec07f835767e2a72b4b01 100644 (file)
@@ -784,8 +784,8 @@ qualify=yes
 
 ; Pre-configured mini-asterisk SIP trunks
 
-;[usersipnat]               ; sipnat-mini-asterisk do not remove this comment
-; You reach your ITSP via a NAT router (most common)
+;[usersipnat]            ; sipnat-mini-asterisk do not remove this comment
+;                          You reach your ITSP via a NAT router (most common)
 ;type=friend             ; sipnat-mini-asterisk do not remove this comment
 ;context=default         ; sipnat-mini-asterisk do not remove this comment
 ;username=usernat        ; sipnat-mini-asterisk do not remove this comment
@@ -797,44 +797,44 @@ qualify=yes
 ;qualify=yes             ; sipnat-mini-asterisk do not remove this comment
 ;nat=yes                 ; sipnat-mini-asterisk do not remove this comment
 
-;[usersipnormal]          ; sipnormal-mini-asterisk do not remove this comment
-; No NAT router between your Phone system and your ITSP
-;type=friend        ; sipnormal-mini-asterisk do not remove this comment
-;context=default    ; sipnormal-mini-asterisk do not remove this comment
-;username=usersip   ; sipnormal-mini-asterisk do not remove this comment
-;secret=passwordsip ; sipnormal-mini-asterisk do not remove this comment
-;host=hostsip       ; sipnormal-mini-asterisk do not remove this comment
-;canreinvite=no     ; sipnormal-mini-asterisk do not remove this comment
-;disallow=all       ; sipnormal-mini-asterisk do not remove this comment
-;allow=ulaw,alaw    ; sipnormal-mini-asterisk do not remove this comment
-;qualify=yes        ; sipnormal-mini-asterisk do not remove this comment
-
-;[userjazmin]                     ; jazmin-mini-asterisk do not remove this comment
-;  a South Australian ITSP
-;host=hostjaz                  ; jazmin-mini-asterisk do not remove this comment
-;secret=passwordjaz            ; jazmin-mini-asterisk do not remove this comment
-;username=userjaz              ; jazmin-mini-asterisk do not remove this comment
-;fromdomain=hostjaz            ; jazmin-mini-asterisk do not remove this comment
-;fromuser=userjaz              ; jazmin-mini-asterisk do not remove this comment
-;insecure=port,invite          ; jazmin-mini-asterisk do not remove this comment
-;type=friend                   ; jazmin-mini-asterisk do not remove this comment
-;disallow=all                  ; jazmin-mini-asterisk do not remove this comment
-;allow=ulaw                    ; jazmin-mini-asterisk do not remove this comment
-;allow=alaw                    ; jazmin-mini-asterisk do not remove this comment
-;dtmfmod=rfc2833               ; jazmin-mini-asterisk do not remove this comment
-;qualify=yes                   ; jazmin-mini-asterisk do not remove this comment
-;canreinvite=no                ; jazmin-mini-asterisk do not remove this comment
-;nat=yes                       ; jazmin-mini-asterisk do not remove this comment
-
-[usertrev]               ; usertrev-mini-asterisk do not remove this comment
-; a test sip provider
-type=friend             ; usertrev-mini-asterisk do not remove this comment
-context=default         ; usertrev-mini-asterisk do not remove this comment
-username=trev        ; usertrev-mini-asterisk do not remove this comment
-secret=supertrev      ; usertrev-mini-asterisk do not remove this comment
-host=dynamic            ; usertrev-mini-asterisk do not remove this comment
-canreinvite=no          ; usertrev-mini-asterisk do not remove this comment
-disallow=all            ; usertrev-mini-asterisk do not remove this comment
-allow=ulaw,alaw         ; usertrev-mini-asterisk do not remove this comment
-qualify=yes             ; usertrev-mini-asterisk do not remove this comment
+;[usersipnormal]         ; sipnormal-mini-asterisk do not remove this comment
+;                          No NAT router between your Phone system and your ITSP
+;type=friend             ; sipnormal-mini-asterisk do not remove this comment
+;context=default         ; sipnormal-mini-asterisk do not remove this comment
+;username=usersip        ; sipnormal-mini-asterisk do not remove this comment
+;secret=passwordsip      ; sipnormal-mini-asterisk do not remove this comment
+;host=hostsip            ; sipnormal-mini-asterisk do not remove this comment
+;canreinvite=no          ; sipnormal-mini-asterisk do not remove this comment
+;disallow=all            ; sipnormal-mini-asterisk do not remove this comment
+;allow=ulaw,alaw         ; sipnormal-mini-asterisk do not remove this comment
+;qualify=yes             ; sipnormal-mini-asterisk do not remove this comment
+
+;[userjazmin]            ; jazmin-mini-asterisk do not remove this comment
+;                          a South Australian ITSP
+;host=hostjaz            ; jazmin-mini-asterisk do not remove this comment
+;secret=passwordjaz      ; jazmin-mini-asterisk do not remove this comment
+;username=userjaz        ; jazmin-mini-asterisk do not remove this comment
+;fromdomain=hostjaz      ; jazmin-mini-asterisk do not remove this comment
+;fromuser=userjaz        ; jazmin-mini-asterisk do not remove this comment
+;insecure=port,invite    ; jazmin-mini-asterisk do not remove this comment
+;type=friend             ; jazmin-mini-asterisk do not remove this comment
+;disallow=all            ; jazmin-mini-asterisk do not remove this comment
+;allow=ulaw              ; jazmin-mini-asterisk do not remove this comment
+;allow=alaw              ; jazmin-mini-asterisk do not remove this comment
+;dtmfmod=rfc2833         ; jazmin-mini-asterisk do not remove this comment
+;qualify=yes             ; jazmin-mini-asterisk do not remove this comment
+;canreinvite=no          ; jazmin-mini-asterisk do not remove this comment
+;nat=yes                 ; jazmin-mini-asterisk do not remove this comment
+
+;[usertrev]              ; usertrev-mini-asterisk do not remove this comment
+;                           a test sip provider
+;type=friend             ; usertrev-mini-asterisk do not remove this comment
+;context=default         ; usertrev-mini-asterisk do not remove this comment
+;username=trev           ; usertrev-mini-asterisk do not remove this comment
+;secret=supertrev        ; usertrev-mini-asterisk do not remove this comment
+;host=dynamic            ; usertrev-mini-asterisk do not remove this comment
+;canreinvite=no          ; usertrev-mini-asterisk do not remove this comment
+;disallow=all            ; usertrev-mini-asterisk do not remove this comment
+;allow=ulaw,alaw         ; usertrev-mini-asterisk do not remove this comment
+;qualify=yes             ; usertrev-mini-asterisk do not remove this comment
 ;nat=yes                 ; usertrev-mini-asterisk do not remove this comment
index 526934182a17754816ab79af86901dcac0aa107d..e0ca428c7d7ab6b0105e2b26f16f63afac52d4fa 100644 (file)
@@ -37,8 +37,8 @@
         <select name="provider" id="provider" onchange="changeProvider()">
              <option value="none">none</option>
              <option value="sipnat">SIP-NAT</option>
-             <option value="sipnormal">SIP</option>
-             <option value="jazmin">Jazmin</option>
+             <option value="sipnormal">SIP-Normal</option>
+             <option value="jazmin">Provider</option>
         </select>
          </td></tr>
       <tr><td> </td><td><div id=info></div> </td></tr>
index 08b75ac66b8fb602edb686e93c4a5e2af3609996..1e02b50a0fcccc276047e4b5ab6721ce415839e6 100644 (file)
@@ -174,40 +174,44 @@ function loadSipConf(doc,status) {
        }
        );
        
-               // sip info now loaded
-
-               if(siprego_line[0] == ';') { 
-                       // commented out mean no rego selected
-                       lastselection = "none";
-                       document.getElementById('user').value = "";
-                       document.getElementById('host').value = "";
-                       document.getElementById('pass').value = "";
-                       document.getElementById('info').textContent = sipnone_info;
-               } 
-               else if (siprego.indexOf(sipnat_user) != -1) {
-                       // rego line has sipnat 
-                       lastselection = "sipnat";
-                       document.getElementById('user').value = sipnat_user;
-                       document.getElementById('host').value = sipnat_host;
-                       document.getElementById('pass').value = sipnat_secret;
-                       document.getElementById('info').textContent = sipnat_info;
-               }
-               else if (siprego.indexOf(sipnormal_user) != -1) {
-                       // rego line has sipnormal
-                       lastselection = "sipnormal";
-                       document.getElementById('user').value = sipnormal_user;
-                       document.getElementById('host').value = sipnormal_host;
-                       document.getElementById('pass').value = sipnormal_secret;
-                       document.getElementById('info').textContent = sipnormal_info;
-               }
-               else if (siprego.indexOf(sipjazmin_user) != -1) {
-                       // rego line has sipjazmin
-                       lastselection = "sipjazmin";
-                       document.getElementById('user').value = sipjazmin_user;
-                       document.getElementById('host').value = sipjazmin_host;
-                       document.getElementById('pass').value = sipjazmin_secret;
-                       document.getElementById('info').textContent = sipjazmin_info;
-               }                       
+       // sip info now loaded
+
+       if(siprego_line[0] == ';') { 
+               // commented out mean no rego selected
+               lastselection = "none";
+               document.getElementById('user').value = "";
+               document.getElementById('host').value = "";
+               document.getElementById('pass').value = "";
+               document.getElementById('info').textContent = sipnone_info;
+               document.getElementById('provider').value="none";
+       } 
+       else if (siprego.indexOf(sipnat_user) != -1) {
+               // rego line has sipnat 
+               lastselection = "sipnat";
+               document.getElementById('user').value = sipnat_user;
+               document.getElementById('host').value = sipnat_host;
+               document.getElementById('pass').value = sipnat_secret;
+               document.getElementById('info').textContent = sipnat_info;
+               document.getElementById('provider').value="sipnat";
+       }
+       else if (siprego.indexOf(sipnormal_user) != -1) {
+               // rego line has sipnormal
+               lastselection = "sipnormal";
+               document.getElementById('user').value = sipnormal_user;
+               document.getElementById('host').value = sipnormal_host;
+               document.getElementById('pass').value = sipnormal_secret;
+               document.getElementById('info').textContent = sipnormal_info;
+               document.getElementById('provider').value="sipnormal";
+       }
+       else if (siprego.indexOf(sipjazmin_user) != -1) {
+               // rego line has sipjazmin
+               lastselection = "sipjazmin";
+               document.getElementById('user').value = sipjazmin_user;
+               document.getElementById('host').value = sipjazmin_host;
+               document.getElementById('pass').value = sipjazmin_secret;
+               document.getElementById('info').textContent = sipjazmin_info;
+               document.getElementById('provider').value="jazmin";
+       }                       
 }
 
 
@@ -242,6 +246,7 @@ function onClickApply() {
                }
                else {
                        // comment out old rego line
+                       // reload and restart
                        var url = '/cgi-bin/commentkey.cgi?file=/etc/asterisk/sip.conf&key=register-mini-asterisk';
                        downloadUrl(url,commentregReturn);                      
                }
@@ -302,16 +307,19 @@ function resetVoipLabelReturn(doc,status) {
            //parseSipShowPeers(line);
        }
        );
-               // init
+               
                if (lastselection == selection) {
-                       initialise();           
+                       // asterisk sip reload ..
+                       // ....check this may have to load new parms
+                       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip reload",sipReloadReturn);
                }
                else if (selection == "none") {
-                               initialise();                           
+                       // asterisk sip reload  to remove old registration
+                       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip reload",sipReloadReturn);
                }
                else {
-                       // uncomment new stuff
-                       // fillout
+                       // uncomment new selection
+                       // fillout new parms
                        // restart
                        var url = '/cgi-bin/uncommentkey.cgi?file=/etc/asterisk/sip.conf&key=register-mini-asterisk';
                        downloadUrl(url,uncommentregReturn);