Home
Configure for a new phone or modify layout
- Details
Configure for a new phone or modify layout
By changing a few things in the admin interface you can change what is displayed on the phone.
It looks confusing at first.. and maybe I will fix that later.
But first thing first.
How we detect the phone.
We sample match a key word in the header of the phone.
Each phone will use it's own browser. That browser has a string of characters.
for example: A Polycom 501 will have "Microbrowser/1.1 PolycomSoundPointIP-SPIP_501-UA/3.1.3.0439"
This will also depend on the firmware version as well. Those last few number might change a little.
This is why we have the Match header field.
If I set the Match header to "polycom" ( use small case ) it will find the word in the above string and match.
You can be exact as you like. if you had a Polycom 301 you might want to change it to be more specific.
Since a polycom 301 displays less characters per page you'd want to find one for each phone that works.
So you can take advantage of the better phones and still support the old phones.
Is New
Is New = yes, These will appear if you don't have a match with the phones browser and whats is stored under Browser Agent.
So if you connect a new type of phone it will make a entry and set this to Yes.
When matching header we only search for ones with Is new = no
So after you configure the new entry set this to no.
But if you have wide watch like Match header = polycom
and you want this for all polycoms. just leave the new entries by any Polycom to Is New = yes.
So you might have entries for polcom 501,polycom 30x all set to Is new = yes
But you have 1 rule that matches all them so it's ok :)
Replacement In String
In the admin interface you can setup a few things.
The Top of the XML/HTML/XHTML and the bottom
You will also setup each line item per phonebook
Also called "Extension per record" and "AddressBook per Record"
The 2 above will be displayed per item in phone book. one is used for extension and the other for the asterisk phone book.
So the output will look like this:
TOP XML/HTML
..each line item
BOTTOM XML/HTML
Thats is the basic structure
Here are the values you will substitute when making your XML:
See some of the already made rules.
Replace vars:
$dir$ = current directory name: Extensions|Address Book
$num$ = number or extension
$NAME$ = name associated with number or extension
$RelPath$ = Realitve path /admin/config.php?type=tool&display=xmlphonedirectory
$NP$ = next page number
$LP$ = last page number
$CP$ = current page number
$TM1$ = replace in TOP XML/HTML with your menu item Top1
$TM2$ = replace in TOP XML/HTML with your menu item Top2
$TM3$ = replace in TOP XML/HTML with your menu item Top3
$BM1$ = replace in BOTTOM XML/HTML with your menu item Bot1
$BM2$ = replace in BOTTOM XML/HTML with your menu item Bot2
$BM3$ = replace in BOTTOM XML/HTML with your menu item Bot3
Query Vars:
t= directory type e|a
page= list page if more then your items per page number.
XML Phone Directory Overview
- Details
XML Phone Directory Overview
This module will let you point your IP phone(s) at your FreePBX server.
If your phone supports XML/HTML/XHTML then you will 2 directories no your screen.
- Extensions
- Asterisk Phone Book
Setup - xml phone directory
- Details
XML Phone Directory Setup
In order for a IP phone to connect to the freePBX XML Phone Directory.
You will have to do a few things.
Create new User in FreePBX:
Click Setup. Under Basic Heading. Click Administrators
You will need to create a new user called xmldirectory .
You can set any password.
Allow only modules XML Directory
Edit header_auth.php:
Change you header_auth.php file.
You will need to edit the file: /admin/header_auth.php
After the block Logout.( logout block ends with the 2 lines below. )
exit;
}
Add:
//XML Phone Login added by xmlphonedirectory if( !isset( $_SESSION['AMP_user'] ) ) {
if( isset($_GET['display']) )
{ if( $_GET['display'] == "xmlphonedirectory" ) { if( IsIpARegedSIP( $_SERVER['REMOTE_ADDR'] ) == true ) { $_SESSION['AMP_user'] = new ampuser("xmldirectory"); } }
} }
Now we need to add the sip security function:
Go to the very bottom of /admin/header_auth.php
Above the last line. the last line is.
?>
Add:
//function added by xmlphonedirectory function IsIpARegedSIP($CheckIP) { global $astman; $response = $astman->send_request('Command',array('Command'=>'sip show peers')); $new_value = $response['data']; $MyList = split("\n",$new_value) ; if( count( $MyList) > 4 ) { for($ix=2;$ix< (count($MyList)-2);$ix++ ) { $matches = preg_split("/[\s,]+/", $MyList[$ix]); if( $CheckIP == $matches[1] ) { return true; } } } return false; }
Now save your file!
This will make it so only ip address in the "sip users" can access the file.
They will be logged in as xmldirectory
web.config redirect browsers
- Details
Using web.config - Redirecting browsers with 301, 302, and 307 status codes on IIS 7 and IIS 7.5
The web.config file allows you to redirect browsers from one site, directory or page, to another site, directory, or page. Response redirect status codes have many uses, but they are most often used after remodeling or changing the layout of a web site.
While some web.config sections require that the containing directory is set as an application, this isn't one of them. A simple web.config with a httpRedirect section may be placed in any directory, and the directory does NOT need to be set as an application.
What are http response redirects?
HTTP response redirect status codes are used to redirect web requests for a web site or directory, to another location. The redirect could target another page or directory on the same domain, a different base domain, or to a page or directory on another domain.
Web.config based redirects
- <httpRedirect enabled="true" destination="http://foo.com" httpResponseStatus="Permanent" /> <!-- 301 permanent redirect -->
- <httpRedirect enabled="true" destination="http://foo.com" httpResponseStatus="Found" /> <!-- 302 found redirect -->
- <httpRedirect enabled="true" destination="http://foo.com" httpResponseStatus="Temporary" /> <!-- 307 temporary redirect -->
- <httpRedirect enabled="true" destination="http://www.foo.com/foo.htm" exactDestination="true" /> <!-- 302 (found) redirect, to a specific page or directory -->
301 permanent redirect - Moved permanently
The requested resource has been assigned a new permanent URI and any future references to this resource should use the new URL.
- Permanently redirect a site or subdirectory to another domain.
- <httpRedirect enabled="true" destination="http://foonew.com" httpResponseStatus="Permanent" />
- Permanently redirect a site or subdirectory to a subdirectory on the same domain.
- <httpRedirect enabled="true" destination="http://foo.com/newdir" httpResponseStatus="Permanent" />
- Permanently redirect a site or subdirectory to a specific page.
- <httpRedirect enabled="true" destination="http://foo.com/foo.htm" exactDestination="true" httpResponseStatus="Permanent" />
The requested resource resides temporarily under a different URL. Since the redirection might be altered on occasion, the client should continue to use the old URL for future requests
- Redirect a site or subdirectory to a specific page.
- <httpRedirect enabled="true" destination="http://foo.com/overloaded.txt" exactDestination="true" httpResponseStatus="Found" />
The requested resource resides temporarily under a different URL. Since the redirection might be altered on occasion, the client should continue to use the old URL for future requests
- Temporarily redirect a site or subdirectory to a specific page.
- <httpRedirect enabled="true" destination="http://foo.com/overloaded.txt" exactDestination="true" httpResponseStatus="Temporary" />
Using HTTP redirects
- Use a text editor to create a file named web.config
- Save the web.config file with the appropriate content
- Place the web.config file in the directory that you wish to redirect. If you wish to redirect the entire site, place the web.config in the web root. If you wish to redirect foo.com/google to google.com, place the web.config in the /google directory of the web root
Detailed web.config content
Let's redirect foo.com/olddir to somewhere else.
- If there isn't an existing web.config in the "olddir" directory, your new web.config should look something like this
<?xml version="1.0"?> <configuration> <system.webServer> <httpRedirect enabled="true" destination="http://foo.com/newdir" httpResponseStatus="Permanent" /> </system.webServer> </configuration>
- If there is an existing web config, without a <system.webServer> section... Your new web.config should look like this
<?xml version="1.0"?> <configuration> <system.web> ..existing text.. ..existing text.. </system.web> <system.webServer> <httpRedirect enabled="true" destination="http://foo.com/newdir" httpResponseStatus="Permanent" /> </system.webServer> </configuration>
- If your existing web.config already has a <system.webServer> section, just add the <httpRedirect> section
<configuration> <system.web> .. existing text .. .. existing text .. </system.web> <system.webServer> <security> <ipSecurity allowUnlisted="true"> <add ipAddress="83.116.19.53"/> <add ipAddress="83.116.119.0" subnetMask="255.255.255.0"/> </ipSecurity> </security> <httpRedirect enabled="true" destination="http://foo.com/newdir" httpResponseStatus="Permanent" /> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>
Redirecting specific pages
Maybe we want to redirect a few specific pages within the foo.com/searchengines directory, to various targets. We would place the following web.config in the foo.com/searchengines directory.
<?xml version="1.0"?> <configuration> <location path="bing.htm"> <system.webServer> <httpRedirect enabled="true" destination="http://bing.com" httpResponseStatus="Permanent" /> </system.webServer> </location> <location path="google.htm"> <system.webServer> <httpRedirect enabled="true" destination="http://google.com" httpResponseStatus="Permanent" /> </system.webServer> </location> <location path="yahoo.htm"> <system.webServer> <httpRedirect enabled="true" destination="http://yahoo.com" httpResponseStatus="Permanent" /> </system.webServer> </location> </configuration>
Page 37 of 40