Aastra XML directory addition for remote dundi extensions

If you are using the aastra xml scripts and want to add remote extensions in your dundi cloud to the directory on the phone here is a fairly simple fix that i did.

First create a file called extensions.ini in your /etc/asterisk directory. Make sure it’s owner and group are asterisk.
in the file add your remote extension names and numbers in this format.

name=Remote Extension 1
name=Remote Extension 2
name=Joe RemoteUser

and so on.

Now go to your /var/www/html/aastra/asterisk directory and find the directory.php file. Open it and scroll to the spot that says

$directory[$index]['number'] = $key;

	# Sort Directory

its about line 145. Now in between the last } and the #Sort Directory insert this

Add Remote Extensions

	$remote_array=parse_ini_file($ASTERISK_LOCATION.'extensions.ini', true);
	foreach($remote_array as $key=>$value)
			$directory[$index]['name'] = $value['name'];
			$directory[$index]['number'] = $value['dial'];

Save and close. Now anything you add to the extensions.ini file will show on your phones. Only tested this with the 57i and 57i Ct phones.

Now I know it is a bit of a pain to create the file and maintain if you have many changes but it works for my purposes and if you can use it be my guest. Now warranties that it will not totally bugger your system though. I have it on 7 sites and works fine.

I’m trying to figure out how i can can create the file a different way so you don’t have to use nano or other text editor. I’ll keep you posted.