Local sipswitch: xml config

Discussions about using SIP Sorcery on your own computer/server
Post Reply
markcs
Posts: 42
Joined: Sat Feb 16, 2008 5:44 pm

Local sipswitch: xml config

Post by markcs » Tue Apr 08, 2008 10:28 pm

Hi!

I managed to successfully get the binary working from this forum: https://www.mysipswitch.com/forum/viewt ... t=download

I then downloaded and compiled the sipswitch source from april 1st. It compiles fine, but I can not get the sipswitch to read the registrations.xml file.

This is the part of the config file that deals with the registrations:

Code: Select all

   <!-- SIP Registration Agent Settings -->
    <!-- <add key="RegistrationAgentDBStorageType" value="Postgresql" />
    <add key="RegistrationAgentDBConnStr" value="Server=localhost;Port=5432;User Id=postgresuser;Password=postgresPassWord;Database=sipswitch;MaxPoolSize=5;MinPoolSize=0;Timeout=5;Encoding=UNICODE;" /> -->
    <add key="RegistrationAgentDBStorageType" value="XML"/>
    <add key="RegistrationAgentDBConnStr" value="registrations.xml" />
and this is the log from sipswitch console:

Code: Select all

c:\visual\MySipSwitch1\SIPSwitch.Service\bin\Debug>sipswitchservice.exe
sipswitch starting
Starting logging initialisation.
Logging initialised.
StorageTypesConverter  unknown.
version=0.2.1.
pid=2684.
os=Microsoft Windows NT 5.1.2600 Service Pack 2.
current directory=c:\visual\MySipSwitch1\SIPSwitch.Service\bin\Debug.
SIPChannel socket on xxx.xxx.xxx.xxx:5060 listening started.
SIP Channel listener created xxx.xxx.xxx.xxx:5060.
SIPChannel socket on xxx.xxx.xxx.xxx:5085 listening started.
SIP Channel listener created xxx.xxx.xxx.xxx:5085.
The proxy console monitor was successfully started on xxx.xxx.xxx.xxx:4502.
STUNListener created xxx.xxx.xxx.xxx:3348.
Attempting to obtain random seed from random.org, timeout is 3s.
ProxyMonitor listening for clients on xxx.xxx.xxx.xxx:4502.
Random seed retrieved from random.org = 915217404.
STUN Server additional sockets, primary=xxx.xxx.xxx.xxx:37299, secondary=xxx.xxx.xxx.xxx:19950.
STUN server successfully initialised.
Starting file watch on c:\visual\MySipSwitch1\SIPSwitch.Service\bin\Debug and registrar.xml.
 Registrar realm added: mydomain.dyndns.org.
  alias added: *.
  alias added: xxx.xxx.xxx.xxx:5060.
  alias added: xxx.xxx.xxx.xxx:5085.
  alias added: local.
SIP Registrar successfully initialised.
SIPChannel socket on xxx.xxx.xxx.xxx:11006 listening started.
SIP Channel listener created xxx.xxx.xxx.xxx:11006.
NATKeepAlive Relay instantiated on xxx.xxx.xxx.xxx:11006.
NATKeepAlives for SIP Registrar enabled, endpoint is xxx.xxx.xxx.xxx:11006.
SIPRegistrationAgent thread started.
Registration agent started.
Starting file watch on c:\visual\MySipSwitch1\SIPSwitch.Service\bin\Debug and dialplan-common.rby.
Starting file watch on c:\visual\MySipSwitch1\SIPSwitch.Service\bin\Debug and dialplans.xml.
DatabaseLogger started.
SIP Proxy web service was successfully started on http://xxx.xxx.xxx.xxx:8080/.
Any ideas why the xml file isn't being read?

Also, a few other things:
- what does StorageTypesConverter unknown. mean?
- when I compiled the code I had to delete references to two files (SIPSwitch.Web\UpdateSettingsController.cs' and SIPSwitch.Web\PasswordRetriever.cs' )
- is there any easy way to add data into the sql tables I've created, or should I just use sql commands?

Thanks!

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Post by Aaron » Wed Apr 09, 2008 7:34 am

Hi markcs,

The RegistrationAgentDBStorageType and RegistrationAgentDBConnStr have been changed to SIPProvidersDBStorageType and SIPProvidersDBConnStr respectively. The format for the new SIPProviders file is:

Code: Select all

<sipproviders> 
  <sipprovider owner='user'>
    <providername>provider</providername>
    <providerusername>user</providerusername>
    <providerpassword>password</providerpassword>
    <providerserver>sipserver</providerserver>
    <provideroutboundproxy/>
    <providerfrom/>
    <providercustom/>
    <registerenabled>true</registerenabled>
    <registercontact>sip:user@10.0.0.1</registercontact>
    <registerexpiry>3600</registerexpiry>
    <registerserver/>
    <registerauthusername/>
    <registerrealm/>
  </sipprovider>
</sipproviders>
If you get StorageTypesConverter unknown it means the configuration setting was not found and is almost certainly related to the above change.

UpdateSettingsController.cs and PasswordRetriever.cs need to be added into the source tree by Guillaume (for once it's not me not having left out source code!).

The SQL below should get you started.

Code: Select all

INSERT INTO customers (customerid, firstname, lastname, initial, username, "password", companyname, broadbandprovider, whereheardabout, active, trial, suspended, inserted, emailaddress, unsubscribed, securityquestion, securityanswer) VALUES ('b9d0c6a0-a78f-4cdb-b8c4-02dd1fa52efa', NULL, NULL, NULL, 'user', 'password', NULL, NULL, NULL, '1', '1', '0', default, 'email@domain.com', '0', NULL, NULL)

INSERT INTO sipaccounts (sipaccountid, name, secret, inserted) VALUES ('1d9cbce5-5b00-485b-8148-5fd32c43baf5', 'user', 'password', default)

INSERT INTO sipproviders (providerid, "owner", providername, providerusername, providerpassword, providerserver, provideroutboundproxy, providerfrom, providercustom, inserted, registercontact, registerexpiry, registerserver, registerauthusername, registerrealm, registerenabled, registerenabledadmin, lastupdate) VALUES ('75bbba1a-cb7a-439e-a895-87ed2123de90', 'user', 'provider', 'provideruser', 'providerpassword', 'provider.server.com', NULL, NULL, NULL, default, 'sip:contact@sip.mysipswitch.com', 3600, NULL, NULL, NULL, '1','1', default)

INSERT INTO dialplans (dialplanid, username, "password", dialplancode, dialplanext, updated, lastupdate, inserted) VALUES ('e576a48f-90e8-48f8-8e93-3a0f023eff20', 'user', 'password', NULL, '#Ruby\nsys.Log("Hello World")', '1', default, default)
Regards,

Aaron

markcs
Posts: 42
Joined: Sat Feb 16, 2008 5:44 pm

Post by markcs » Wed Apr 09, 2008 9:35 pm

Thanks Aaron.. works well (with a few modifications to match the tables) except I cant get the dial plan in ruby to load properly.

For the dial plan I have exactly what you had "#Ruby\nsys.Log("Hello World")" (without the "") in the column titled 'dialplanext'

In the log I see:

Exception SIPDialPlan ProcessRequest. Type 'Ruby.Runtime.RubyContext' doesn't provide a suitable public constructor or its implementation is faulty.

Is this something wrong with my dialplan format?

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Post by Aaron » Thu Apr 10, 2008 12:00 am

Hi markcs,

I'ev seen that error before when the IronRuby.Libraries.dll library was not present. Does that file exist in the directory you are running the sipswitch from?

Regards,

Aaron

Post Reply