Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

<?xml version="1.0" encoding="utf-8"?>
<html>

Introduction

You can provision phones through their configuration interface (init files, xml files, web GUI). However, as soon as you have more than a few phones provisioning becomes a repetitive and error-prone process. You can write a provisioning script or even provisioning UI. Or you can add support for the phone models to sipXconfig and let it provision your phones.

...

You do not have to contribute your plugin to SIPfoundry. However if you do, sipXconfig team will keep your code up-to-date with platform changes.

Table of Contents

Prerequisites

Adding support will require basic experience in XML, Java and Linux. Before you start developing you need to know how to download, build and install sipXconfig and become familiar with sipXconfig web interface.

...

Panel

<bean id="acmePhone" ...>
<property name="ldapManager" ref="ldapManager"/>
</bean>

...

Panel
title'neoconf/src/org/sipfoundry/sipxconfig/phone/acme/AcmePhone.java

...

'
No Format

{panel}
  
...
  public setLdapManager(LdapManager ldapManager) {
      m_ldapManager = ldapManager;
  }
  ...
{panel}

...

-- MichalBielicki
Q: How does one know what services are available or their names?
-- Lazyboy
A: No great way, but every part of the system is available from Spring so if it's configurable it's available somewhere.
Browse all *.beans.xml files. This also looks promising http://opensource.atlassian.com/confluence/spring/display/BDOC/Home

...

Here the first half of what my file looks like{{Box File|

Panel
title'etc/unmanagedPhone/config.vm

...

'
Panel
Wiki Markup
No Format
 {noformat}
 #foreach ($group in $phone.Settings.Values)
 [$\{group.Name\}]
 #foreach ($setting in $group.Values)
 $\{setting.ProfileName\}=$!\{setting.Value\}
 #end

 ...

...



 

This template will copy all settings directly into the configuration file. Because of the simplicity of this method the setting groups and settings must be organized exactly how the config file breaks its settings into INI sections. The is fine for generating profiles, but may not always be helpful for the user. This is fine for now, however if this changes then settings can be filtered before passing them to Velocity or Velocity can call filter methods from java.

Step 6: Creating a unit test - AcmePhoneTest.java

...

Panel
title'AcmePhoneTest.java

...

panel
'
No Format

 ...


    public void testGenerateTypicalProfile() throws Exception
{
AcmePhone phone = new
 {
        AcmePhone phone = new AcmePhone();


        // call this to inject dummy

...

noformat
Panel
 data

        PhoneTestDriver.supplyTestData(phone);
StringWriter actualWriter = new


        StringWriter actualWriter = new StringWriter();


        phone.generateProfile(actualWriter)
;
InputStream expectedProfile =
;
        InputStream expectedProfile = getClass().getResourceAsStream("expected-config");

String expected =

        String expected = IOUtils.toString(expectedProfile);


        expectedProfile.close();


        assertEquals(expected, actualWriter.toString());

}

    }
 ...

}}

This instructs your phone to generate a configuration into memory, then compares the configuration to what you expect it to be. Here we use a utility class

...

  • Niels Ohlmeier added support for the Snom Phones
  • Hannu Strang added support for the Grandstream Phones
  • Hannu Strang also added support for Cisco Phones
  • Michal Bielicki added support for the Hitachi wireless Phones
  • Michal Bielicki also upgraded support for the Snom Phones
  • Douglas Hubler added support for Polycom Phones
  • Sen Heng added support for the Linksys Phones
  • Sen Heng also added support for the New Cisco Phones
  • Your name here and your phone here

...