///How to Backup/Restore Avaya to IIS7.5

How to Backup/Restore Avaya to IIS7.5

Want create site? Find Free WordPress Themes and plugins.

In IIS7 and IIS7.5 which runs on Windows Server 2008 or Windows Server 2008 R2, it is not possible to use the WebDav PUT command without ‘authentication’.
This is a problem for your Avaya VOIP phones. Avaya uses the PUT command to backup a phone configuration and to store contacts.

Now, there are 3 possible options:

  1. Install Apache on Windows or Linux. I know many of you guys don’t like this…Especially because you need to configure and update/patch it.
  2. Use a WebDav server like IP Tel from Avaya. However, that program looks like a Windows95 program,.. is it supported at all. ?
  3. Install my Avaya script / workarround! I’ll tell you how it works below.

My Avaya WebDav workarround:

  1. Install IIS on a Workstation or Server. You might have already installed IIS for phones to download the firmware and settings file.
    Make sure to have the WebDav module UNinstalled! (If you install it and disable it inside the IIS Manager, it will not work!)
  2. Install the URL Rewrite module of IIS.
  3. Add a rewrite rule on your backup directory which looks like this:
    Avaya IIS Rewrite Screenshot
    (click to enlarge)

  4. Use the following script:

avayaupload.asp


< %
'#THIS IS THE ONLY VARIABLE NEEDED! PLEASE END WITH A SLASH!!#
backup_dir	= "c:\inetpub\wwwroot\backup\"

uri = Request.ServerVariables("REQUEST_URI")
filename	= Right( uri, Len(uri) - InStrRev(uri,"/",Len(uri)) )

If UCase(Request.ServerVariables("HTTP_METHOD"))="PUT" Then

 If Request.Totalbytes>0 Then
  sourcedata = Request.BinaryRead(Request.Totalbytes)
  SaveBinaryData backup_dir&filename, sourcedata
  Response.Status="201 Created"
 End If

Else

 Set fs = CreateObject("Scripting.FileSystemObject")
 If fs.FileExists (backup_dir&filename) Then
  filecontent = ReadBinaryFile(backup_dir&filename)
  response.binarywrite filecontent
 End If
End If


Function SaveBinaryData(FileName, ByteArray)
  Const adTypeBinary = 1
  Const adSaveCreateOverWrite = 2
  
  'Create Stream object
  Dim BinaryStream
  Set BinaryStream = CreateObject("ADODB.Stream")
  
  'Specify stream type - we want To save binary data.
  BinaryStream.Type = adTypeBinary

  'Open the stream And write binary data To the object
  BinaryStream.Open
  BinaryStream.Write ByteArray
  
  'Save binary data To disk
  BinaryStream.SaveToFile FileName, adSaveCreateOverWrite
End Function


Function ReadBinaryFile(FileName)
  Const adTypeBinary = 1
  
  'Create Stream object
  Dim BinaryStream
  Set BinaryStream = CreateObject("ADODB.Stream")
  
  'Specify stream type - we want To get binary data.
  BinaryStream.Type = adTypeBinary
  
  'Open the stream
  BinaryStream.Open
  
  'Load the file data from disk To stream object
  BinaryStream.LoadFromFile FileName
  
  'Open the stream And get binary data from the object
  ReadBinaryFile = BinaryStream.Read
End Function

%>

Don’t forget to give the backup directory Write permissions (NTFS) for the IUSR account.

Did you find apk for android? You can find new Free Android Games and apps.
By | 2017-01-11T14:37:09+00:00 October 17th, 2011|Technical|25 Comments

25 Comments

  1. jmaduncan 15 December 2015 at 23:09

    I am in the same place as Marcus from last year in that I have set this up added the PUT verbs etc. and the phone tells me Backup Successful but the file never shows up in the backup folder. Or anywhere else for that matter. I also get a message 200 in the IIS logs. Any help would be appreciated.

    Thanks

  2. Steve 2 November 2015 at 17:50

    Hi Marcus, I have the same issue as you, it says that the backup is successful on the handset but the IIS server is not updated.

    Did you ever find a solution for this?

    Thanks

    Steve

  3. Tareq 4 August 2015 at 11:32

    Hi Roel

    I am trying to set this up, i did all the changes you suggested, but the backup is still failing, restoring is fine.

    do the phones need to be using the latest version?

  4. mnemonic 27 November 2014 at 16:05

    Hi there, i did what Roel post here and i can successfully create backups for my phones, but restore is really not working. Is it possible to modify urlrewrite for GET command or may be someone may changes asp script?

    thank you.

  5. Marcus 21 November 2014 at 17:00

    Ive spent nearly two days trying to get this work! i must be missing something….

    Ive tried on Windows 2012 R2, and then reverted back to a Windows 2008 R2 back. Ive installed url rewrite, setup the handlers, and set NTFS perms on the backup folder.

    In IIS, i see the phone connecting via PUT and uploading the file with 200 (success), and on the phone i get no errors! If i manaully perform a backup it says on the handset “Backup successful” but no text file is created in the backup folder!!!

    So i’m really at a loss what to do.

    I’d really appreciate any assistance.

  6. kevin 20 March 2014 at 15:13

    Hey All,

    Having same issue with 9650’s not backing up to 7.5 iis. Updated phones to latest 3.2.2 but still nothing. Tried adding username and password in the settings file still nothing.

    Trying the above pasted the asp script in to a txt file and renamed it asp and called it avayaupload. Added Rewrite and the rule but still get backup failed.

    Can someone tell me where and how you put the PUT command in the asp handlers please?

    Thanks

    Kevin

  7. Justin 10 June 2013 at 13:39

    Roel,

    Thanks a bunch for the script! I also had to add the PUT command to the handlers like Robin suggested. Unfortunately in “this” situation we were forced to use IIS 7.5 as thats what was running on the host that was intended for phone backups.

    I have noticed that MV_IPTel does have memory leak with uploading files via WebDav. I have not yet used apache but that is a good suggestion and work around to MV_IPTel. It looks as Avaya’s Utility server runs Apache and is enabled for WebDav, although I have not tested it out yet.

    # WebDAV module configuration section.
    #

    # Location of the WebDAV lock database.
    DAVLockDB /var/lib/dav/lockdb

    Dav On

    With my testing on IIS7.5 w/ 2008r2 everything worked as should, we backed up phones, added contacts, backed up call logs and cleared the values and allowed them to pull the backups without any issues.

    Thanks again for taking your time and building the script.

  8. Duane 19 April 2013 at 17:04

    Thjank you for all the good information.

    Backups are working fine on my IIS7.5 using the above information, but I am unable to retreive from the Avaya 9620 backed up files. The Manual restore indicates Retreival Failed. I look a tthe IIS logs and it indicates the Get has a result of 200

    2013-04-19 15:58:22 x.x.18.7 GET /backups/214_96xxdata.txt – 80 – x.x.115.12 AVAYA/SPICE/v3.1+(9620)/Std/0.1 200 0 0 15

    which looks successful to me… but really is not.

    Any suggestions at what else I should look at?

  9. Rodney Beede 12 February 2013 at 22:23

    That applies to the ASP solution. Using Apache one can avoid allowing remote shell/code execution.

  10. Rodney Beede 12 February 2013 at 22:21

    The downside is you have a security vulnerability that allows anyone on the same network as your phones to upload and overwrite files anywhere on your server. This would allow an attacker to gain a remote shell on your server.

  11. Roel 21 December 2012 at 15:14

    Good contribution, Jeroen! Did you discovered that yourself?
    -Roel

  12. Jeroen 21 December 2012 at 15:08

    Actually: MV_IPtel is supported. Configuring Apache on Windows takes editing the following steps:

    – Dowload and install Apache 2.2 for windows
    – create directory “var” in /Apache2.2/
    – create direcrory “backup” in /Apache2.2/
    – Edit two config files as described below:

    – edit Apache2.2/conf/

    #below three rules uncommented for backup Avaya IP phones
    #
    LoadModule dav_module modules/mod_dav.so
    LoadModule dav_fs_module modules/mod_dav_fs.so
    LoadModule dav_lock_module modules/mod_dav_lock.so
    #

    edit httpd-dav.conf in Apache2.2/conf/extra

    DavLockDB “D:/Program Files (x86)/Apache Software Foundation/Apache2.2/var/DavLock”

    Alias /backup “D:/Program Files (x86)/Apache Software Foundation/Apache2.2/backup”

    Dav On

    Order Allow,Deny
    Allow from all

    AuthType Basic
    AuthName DAV-upload

    #below 3 rowes commented for Avaya Phones to disable Digest Authentication

    # AuthUserFile “D:/Program Files (x86)/Apache Software Foundation/Apache2.2/user.passwd”
    # AuthDigestProvider file

    # Allow universal read-access, but writes are restricted
    # to the admin user.

    #below 3 rows commented for Avaya Phones.

    #
    # require user admin
    #

    All done!

  13. Confluence: Helpdesk 31 July 2012 at 23:24

    Avaya Utility Server Config….

    See first: …

  14. Phil 29 May 2012 at 20:58

    I am new to this and would like to get this working in order to backup my 9650 and 9611G phones. I have windows server 2008 r2. I open the URL Rewrite module and right click to add rules, my options are inbound rules, inbound and outbound rules, outbound rules and search engine optimization (SEO). In your screen shot it shows just “edit rules”. Not sure if I am doing this right. Also, I am not sure where to add your script. Any additional help would be great. Thanks

  15. Leo 22 May 2012 at 14:36

    I strucled all day with this.
    When I chanced the patern in the role from “txt” to 1*.txt it works.
    The 1 is for our nummers starts with 1.
    We are using w2008 R2 with IIS 7.5

  16. Robin 4 May 2012 at 16:47

    Okay, got it, sorry for false panic. ASP wasn’t installed, once it was, I went to the backup directory, selected handler mappings, opened up aspclassic, hit ‘request restrictions’, and added PUT to the verb list. Way more than a phone guy really wanted to know about IIS…

    =-]

  17. Robin 4 May 2012 at 16:10

    Hi, I’m so close. How do you add PUT to *.asp? Many thanks for this note all, very helpful.

  18. Jay 2 May 2012 at 21:58

    Ok, figured it out. I needed to add PUT to the list of allowed verbs for the *.asp handler mapping.

  19. Jay 2 May 2012 at 21:46

    I get nothing but a 405 error in the logfile with the PUT command. Do I need to setup a handler mapping or something?

  20. inam 13 April 2012 at 16:14

    Thanks. Good old firefox :)

  21. Roel Broersma 13 April 2012 at 12:58

    I can still see it on the blog.

  22. inam 13 April 2012 at 12:38

    Please can you repost the image avaya-rewrite-screenshot.png. Its not on the blog anymore. I am new to rewrite so this would be helpful

  23. Kormen 22 February 2012 at 09:00

    Hi!

    I’ts not working always drop a “method not allowed” error. why?

  24. Stephen Cattaneo 18 October 2011 at 13:09

    Here is my original version in PHP. http://www.stephenjc.com/2010/08/19/avaya-backup-and-restore-on-iis-7-5/

    I am just not a ASP fan thats why I wrote it in PHP.

Leave A Comment

The store is not open yet, we're planning a launch date of 20 March 2017 ! Dismiss