; 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
;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
}
);
- // 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";
+ }
}
}
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);
}
//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);