From 3d44fa81e19a3440ecaf9255e8204f90cdcf3597 Mon Sep 17 00:00:00 2001 From: horse69 Date: Sun, 18 Nov 2012 23:43:22 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/freetel/code@1017 01035d8c-6547-0410-b346-abe4f91aad63 --- mini-asterisk-gui2/etc/asterisk/sip.conf | 84 +++++++++++------------ mini-asterisk-gui2/voiplines.html | 4 +- mini-asterisk-gui2/voiplines.js | 86 +++++++++++++----------- 3 files changed, 91 insertions(+), 83 deletions(-) diff --git a/mini-asterisk-gui2/etc/asterisk/sip.conf b/mini-asterisk-gui2/etc/asterisk/sip.conf index 5483ea2c..973431e3 100644 --- a/mini-asterisk-gui2/etc/asterisk/sip.conf +++ b/mini-asterisk-gui2/etc/asterisk/sip.conf @@ -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 diff --git a/mini-asterisk-gui2/voiplines.html b/mini-asterisk-gui2/voiplines.html index 52693418..e0ca428c 100644 --- a/mini-asterisk-gui2/voiplines.html +++ b/mini-asterisk-gui2/voiplines.html @@ -37,8 +37,8 @@
diff --git a/mini-asterisk-gui2/voiplines.js b/mini-asterisk-gui2/voiplines.js index 08b75ac6..1e02b50a 100644 --- a/mini-asterisk-gui2/voiplines.js +++ b/mini-asterisk-gui2/voiplines.js @@ -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); -- 2.25.1