By brackenhill_mob
#704
Many telco's in the UK provide free weekend and/or evening phone calls. It seems silly not to be able to take advantage of this by programming our OBi110's to switch lines during the times when these free calls are available. Yes, I know you can dial **8 to manually switch to the PSTN line but is your spouse/partner/flatmate/... going to remember a) to check the time and b) what this code is? I thought not ...!

The problem is that that OBi110 has no way to execute programmes, so we have to think laterally!

The solution is to use another "computer" to "fire" the relevant code to the OBi110. There is more than one way to achieve this but the method I'm going to describe is, I think, the easiest to understand. The computer will need to have the programs "cron" and "curl" installed on it. I use my router to do this (an Asus RT-N66U) but how you set this up is beyond the scope of this HOWTO but there is _lots_ of information out there on the search engines.

You will need to create 2 settings files on your "computer". I've called them UsePSTN.xml and UseSIP.xml

UsePSTN.xml needs to contain this code:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!-- OBi Configuration File
File to set default line to PSTN
-->
<ParameterList>
  <Object>
    <Name>VoiceService.1.X_FXS.1.</Name>
    <ParameterValueStruct>
      <Name>PrimaryLine</Name>
      <Value X_UseDefault="Yes"/>
    </ParameterValueStruct>
  </Object>
</ParameterList>
This is the only value which controls the PTSN setting. If you try to use anything else, the OBi110 will never be set to use the PSTN line.

UseSIP.xml needs to contain this:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!-- OBi Configuration File
File to set default line to SP1
-->
<ParameterList>
  <Object>
    <Name>VoiceService.1.X_FXS.1.</Name>
    <ParameterValueStruct>
      <Name>PrimaryLine</Name>
      <Value>SP1 Service</Value>
    </ParameterValueStruct>
  </Object>
</ParameterList>
I am going to assume that you are using SIP1 as your default voip provider. If not, you will have change the "<VALUE>SP1 Service</Value>" line to the appropriate setting that you can find under the Physical Interfaces|PHONE Port|PrimaryLine setting on the OBi110 settings web page.

You now need to create the 2 scripts which upload these files to the OBi110.

OBi-PSTN.sh contains
Code: Select all
#!/bin/sh
/opt/bin/curl -u admin:admin --form System=@/opt/OBi/UsePSTN.xml --form press=Restore --anyauth http://192.168.0.253/restore.xml
OBi-SIP.sh contains
Code: Select all
#!/bin/sh
/opt/bin/curl -u admin:admin --form System=@/opt/OBi/UseSIP.xml --form press=Restore --anyauth http://192.168.0.253/restore.xml
On your set up, you will probably need to modify the IP address in the URL to that it matches your OBi110. You might also need to change "/opt/bin/curl" to match the path to curl. If you are using a Windows PC as your "computer" you don't need the "#!/bin/sh" line.

You should now test that these files work as expected. When they are fired at the OBi110, you will see the status light turn red as the unit reboots itself with the new settings. Check that everything is working by looking at the PrimaryLine setting as detailed above.

Once everything works you just need to set up the cron jobs so fire these scripts at the appropriate time. Again how you do this is beyond the scope of this HOWTO so the search engines are your friend!

Enjoy!
sipmeup liked this
Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests

Supported Products: OBi1062 Professional OBi1…

Sorry I mean to say if I do not stop autoboot the …

How to Evaluate an IP Phone System?

CISCO SPA500S

Create a call group and add the three extensions t…