Extensions that begin with 0 possible?


#1

Hi there,

Is it possible to have an extension that begins with a 0? (i.e. ext. 0888) AMP won’t accept any extension that begins with a 0…


#2

yes, i just tried renumbering one of mine to prefix with a zero and it was fine. AMP must filter them out. i’ll take a quick peek !!


#3

ok, there’s a script at /var/www/html/admin/common/script.js.php that needs tweaking if you want to be able to do this.


#4

what do I have to do to the script? Sorry I’m not really good at scripting… :stuck_out_tongue:

I've made the following hack in extensions.php:                         

Original:
<br><br><h6><input name="Submit" type="button" value="<?php echo _("Submit")?>" onclick="javascript:if(addNew.extension.value=='' || parseInt(addNew.extension.value)!=addNew.extension.value) {alert('<?php echo _("Please enter an extension id")?>')} else {addNew.submit();}"></h6>

Modified:
<br><br><h6><input name="Submit" type="button" value="<?php echo _("Submit")?>" onclick="javascript:if(addNew.extension.value=='') {alert('<?php echo _("Please enter an extension id")?>')} else {addNew.submit();}"></h6>

It seems to work but it eliminates all the error checking outside of an blank extension input. Does anyone know how to modify the script instead?

Thanks! Long live Asterisk.