From: horse69 Date: Mon, 26 Nov 2012 06:49:49 +0000 (+0000) Subject: git-svn-id: https://svn.code.sf.net/p/freetel/code@1074 01035d8c-6547-0410-b346-abe4f... X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=371fb5c5c760648a838bcac033d5cc1ab9729777;p=freetel-svn-tracking.git git-svn-id: https://svn.code.sf.net/p/freetel/code@1074 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/mini-asterisk-gui2/etc/asterisk/sip.conf b/mini-asterisk-gui2/etc/asterisk/sip.conf index 418fa6a5..bd4b84fc 100644 --- a/mini-asterisk-gui2/etc/asterisk/sip.conf +++ b/mini-asterisk-gui2/etc/asterisk/sip.conf @@ -790,6 +790,8 @@ qualify=yes ;context=default ; sipnat-mini-asterisk do not remove this comment ;username=usernat ; sipnat-mini-asterisk do not remove this comment ;secret=passwordnat ; sipnat-mini-asterisk do not remove this comment +;fromdomain=fromdomainnat ; sipnat-mini-asterisk do not remove this comment +;fromuser=fromusernat ; sipnat-mini-asterisk do not remove this comment ;host=hostnat ; sipnat-mini-asterisk do not remove this comment ;canreinvite=no ; sipnat-mini-asterisk do not remove this comment ;disallow=all ; sipnat-mini-asterisk do not remove this comment @@ -803,6 +805,8 @@ qualify=yes ;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 +;fromdomain=fromdomainsip ; sipnormal-mini-asterisk do not remove this comment +;fromuser=fromusersip ; 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 diff --git a/mini-asterisk-gui2/voiplines.js b/mini-asterisk-gui2/voiplines.js index 7176b23e..5254c345 100644 --- a/mini-asterisk-gui2/voiplines.js +++ b/mini-asterisk-gui2/voiplines.js @@ -11,6 +11,8 @@ var update_time = 10; var user = ""; var host = ""; var passwd = ""; +var fromuser= ""; +var fromdomain= ""; var selection = "none"; var lastselection=""; @@ -143,6 +145,14 @@ function loadSipConf(doc,status) { var s = line.split(myregexp); sipnat_host = s[1]; // save host } + else if (line.indexOf("fromuser") != -1) { + var s = line.split(myregexp); + sipnat_fromuser = s[1]; // save + } + else if (line.indexOf("fromdomain") != -1) { + var s = line.split(myregexp); + sipnat_fromdomain = s[1]; // save + } } if (line.indexOf("sipnormal-mini-asterisk") != -1) { if (line.indexOf("username") != -1) { @@ -157,6 +167,14 @@ function loadSipConf(doc,status) { var s = line.split(myregexp); sipnormal_host = s[1]; // save host } + else if (line.indexOf("fromuser") != -1) { + var s = line.split(myregexp); + sipnormal_fromuser = s[1]; // save + } + else if (line.indexOf("fromdomain") != -1) { + var s = line.split(myregexp); + sipnormal_fromdomain = s[1]; // save + } } if (line.indexOf("jazmin-mini-asterisk") != -1) { if (line.indexOf("username") != -1) { @@ -171,6 +189,14 @@ function loadSipConf(doc,status) { var s = line.split(myregexp); sipjazmin_host = s[1]; // save host } + else if (line.indexOf("fromuser") != -1) { + var s = line.split(myregexp); + sipjazmin_fromuser = s[1]; // save + } + else if (line.indexOf("fromdomain") != -1) { + var s = line.split(myregexp); + sipjazmin_fromdomain = s[1]; // save + } } } @@ -187,6 +213,8 @@ function loadSipConf(doc,status) { document.getElementById('user').value = ""; document.getElementById('host').value = ""; document.getElementById('pass').value = ""; + document.getElementById('fromuser').value = ""; + document.getElementById('fromdomain').value = ""; document.getElementById('info').textContent = sipnone_info; document.getElementById('provider').value="none"; } @@ -196,6 +224,8 @@ function loadSipConf(doc,status) { document.getElementById('user').value = sipnat_user; document.getElementById('host').value = sipnat_host; document.getElementById('pass').value = sipnat_secret; + document.getElementById('fromuser').value = sipnat_fromuser; + document.getElementById('fromdomain').value = sipnat_fromdomain; document.getElementById('info').textContent = sipnat_info; document.getElementById('provider').value="sipnat"; } @@ -205,6 +235,8 @@ function loadSipConf(doc,status) { document.getElementById('user').value = sipnormal_user; document.getElementById('host').value = sipnormal_host; document.getElementById('pass').value = sipnormal_secret; + document.getElementById('fromuser').value = sipnormal_fromuser; + document.getElementById('fromdomain').value = sipnormal_fromdomain; document.getElementById('info').textContent = sipnormal_info; document.getElementById('provider').value="sipnormal"; } @@ -214,6 +246,8 @@ function loadSipConf(doc,status) { document.getElementById('user').value = sipjazmin_user; document.getElementById('host').value = sipjazmin_host; document.getElementById('pass').value = sipjazmin_secret; + document.getElementById('fromuser').value = sipjazmin_fromuser; + document.getElementById('fromdomain').value = sipjazmin_fromdomain; document.getElementById('info').textContent = sipjazmin_info; document.getElementById('provider').value="jazmin"; } @@ -236,6 +270,8 @@ function onClickApply() { user = document.getElementById('user').value; host = document.getElementById('host').value; passwd = document.getElementById('pass').value; + fromuser = document.getElementById('fromuser').value; + passwd = document.getElementById('fromdomain').value; // 1. Save sip.conf @@ -491,18 +527,24 @@ function changeProvider() { document.getElementById('user').value = sipnat_user; document.getElementById('host').value = sipnat_host; document.getElementById('pass').value = sipnat_secret; + document.getElementById('fromuser').value = sipnat_fromuser; + document.getElementById('fromdomain').value = sipnat_fromdomain; document.getElementById('info').textContent = sipnat_info; } else if (sell == "sipnormal" ) { // fill sipnormal document.getElementById('user').value = sipnormal_user; document.getElementById('host').value = sipnormal_host; document.getElementById('pass').value = sipnormal_secret; + document.getElementById('fromuser').value = sipnormal_fromuser; + document.getElementById('fromdomain').value = sipnormal_fromdomain; document.getElementById('info').textContent = sipnormal_info; } else if (sell == "jazmin" ) { // fill jazmin document.getElementById('user').value = sipjazmin_user; document.getElementById('host').value = sipjazmin_host; document.getElementById('pass').value = sipjazmin_secret; + document.getElementById('fromuser').value = sipjazmin_fromuser; + document.getElementById('fromdomain').value = sipjazmin_fromdomain; document.getElementById('info').textContent = sipjazmin_info; } else { // something weird happened