secure sipsorcery service

Jan 3, 2015 at 2:43 PM
Edited Jan 3, 2015 at 2:48 PM
Can you please help me to understand how to get sipsorcery service converted from http to https? As per the current code Sipsorcery-Allinone.exe starts the services in http.
Coordinator
Jan 11, 2015 at 2:11 AM
Do you mean provisioning or callmanager service?

Unfortunately it's a bit involved unless you are able to run IIS on the same machine and have it handle the SSL side of things (this is how the sipsorcery.com service operates).

It is possible to configure self hosted WCF services to use SSL see http://blogs.msdn.com/b/james_osbornes_blog/archive/2010/12/10/selfhosting-a-wcf-service-over-https.aspx and http://msdn.microsoft.com/en-us/library/ms733791.aspx but as mentioned above it's pretty involved.
Jan 11, 2015 at 3:17 AM
aaronc wrote:
Do you mean provisioning or callmanager service?

Unfortunately it's a bit involved unless you are able to run IIS on the same machine and have it handle the SSL side of things (this is how the sipsorcery.com service operates).

It is possible to configure self hosted WCF services to use SSL see http://blogs.msdn.com/b/james_osbornes_blog/archive/2010/12/10/selfhosting-a-wcf-service-over-https.aspx and http://msdn.microsoft.com/en-us/library/ms733791.aspx but as mentioned above it's pretty involved.
Thank you for your reply. I am running IIS on the same machine but running sipsorcery service (provisioning or call manager) as self hosted WCF service (as a windows service) as per the guide. Can you please help me on how to get this configured within IIS?
Coordinator
Jan 13, 2015 at 7:58 AM
Below is the WCF configuration used by the sipsorcery.com web service in IIS.

You are probably only interested in the callmanager and provisioning services so can strip the rest out.

The provisioning service replaces the need to have the provisioning service hosted by the sipsorcery-allinone.exe since all the provisioning operations are database operations and don't need to be passed through to the SIP server.

The callmanager pass thru service acts like a proxy and DOES require the callmanager service to be hosted by the sipsorcery-allinone.exe. It passes through the request to the SIP server so that calls can be initiated etc.
 <system.serviceModel>
      <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="false" />
      <extensions>
        <behaviorExtensions>
          <add name="ProvisioningInstanceProvider" type="SIPSorcery.Web.Services.InstanceProviderExtensionElement, SIPSorcery.Web.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
        </behaviorExtensions>
      </extensions>
      <services>
        <service name="SIPSorcery.Web.Service.IsAliveService" behaviorConfiguration="NormalServiceBehavior">
          <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
          <endpoint address="" behaviorConfiguration="WebBehavior" binding="webHttpBinding" bindingConfiguration="secureWeb" contract="SIPSorcery.Web.Service.IIsAliveService"/>
        </service>
        <service name="SIPSorcery.Web.Services.SIPProvisioningWebService" behaviorConfiguration="ProvisioningServiceBehaviors">
          <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
          <endpoint address="" binding="basicHttpBinding" bindingConfiguration="secureHttp" contract="SIPSorcery.Web.Services.IProvisioningService"/>
          <endpoint address="rest" behaviorConfiguration="WebBehavior" binding="webHttpBinding" bindingConfiguration="secureWeb" contract="SIPSorcery.Web.Services.IProvisioningServiceREST"/>
        </service>
        <service name="SIPSorcery.Web.Services.CallManagerPassThruService" behaviorConfiguration="CallManagerServiceBehaviors">
          <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
          <endpoint address="" behaviorConfiguration="WebBehavior" binding="webHttpBinding" contract="SIPSorcery.Web.Services.ICallManagerServices"/>
          <endpoint address="" behaviorConfiguration="WebBehavior" binding="webHttpBinding" bindingConfiguration="secureWeb" contract="SIPSorcery.Web.Services.ICallManagerServices"/>
        </service>
        <service name="SIPSorcery.Web.Services.SIPNotifierService" behaviorConfiguration="NotificationsServiceBehavior">
          <endpoint binding="basicHttpBinding" bindingConfiguration="secureHttp" contract="SIPSorcery.Web.Services.INotifications"/>
          <endpoint address="notificationsmex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
        </service>
        <service name="SIPSorcery.Web.Service.SIPSorceryInviteService" behaviorConfiguration="NormalServiceBehavior">
          <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
          <endpoint address="" binding="basicHttpBinding" bindingConfiguration="secureHttp" contract="SIPSorcery.Web.Service.ISIPSorceryInviteService"/>
          <endpoint address="rest" behaviorConfiguration="WebBehavior" binding="webHttpBinding" bindingConfiguration="secureWeb" contract="SIPSorcery.Web.Service.ISIPSorceryInviteServiceREST"/>
        </service>
      </services>
      <client>
        <endpoint name="CallManagerSvc" address="http://67.222.131.147:8080/callmanager" binding="basicHttpBinding" contract="SIPSorcery.Web.Services.ICallManagerServices"/>
        <endpoint name="SIP1" address="http://67.222.131.147:8090/notifications" binding="basicHttpBinding" bindingConfiguration="LargeMessagesBindingConfiguration" contract="SIPSorcery.SIP.App.ISIPMonitorPublisher" />
      </client>
      <behaviors>
        <serviceBehaviors>
          <behavior name="NormalServiceBehavior">
            <serviceMetadata httpsGetEnabled="true"/>
            <serviceDebug includeExceptionDetailInFaults="true"/>
          </behavior>
          <behavior name="ProvisioningServiceBehaviors">
            <ProvisioningInstanceProvider/>
            <serviceMetadata httpsGetEnabled="True"/>
            <serviceDebug includeExceptionDetailInFaults="true"/>
          </behavior>
          <behavior name="CallManagerServiceBehaviors">
            <serviceMetadata httpsGetEnabled="True"/>
            <serviceDebug includeExceptionDetailInFaults="true"/>
          </behavior>
          <behavior name="NotificationsServiceBehavior">
            <serviceMetadata httpsGetEnabled="true"/>
            <serviceDebug includeExceptionDetailInFaults="true"/>
            <serviceThrottling maxConcurrentSessions="100"/>
          </behavior>
        </serviceBehaviors>
        <endpointBehaviors>
          <behavior name="WebBehavior">
            <webHttp/>
          </behavior>
        </endpointBehaviors>
      </behaviors>
      <bindings>
        <basicHttpBinding>
          <binding name="LargeMessagesBindingConfiguration">
            <readerQuotas maxStringContentLength="40000"/>
          </binding>
          <binding name="secureHttp">
            <security mode="Transport"/>
            <readerQuotas maxStringContentLength="1000000"/>
          </binding>
        </basicHttpBinding>
        <webHttpBinding>
          <binding name="secureWeb">
            <security mode="Transport"/>
          </binding>
        </webHttpBinding>
      </bindings>
    </system.serviceModel>
Marked as answer by plachira on 1/17/2015 at 8:37 AM
Jan 17, 2015 at 3:46 PM
Thank you for your help. I am able to host notificationspull.svc in IIS as https://localhost/notificationspull.svc. But the issue is it is not showing notifications when trying with sliverlight client's console link.

http://localhost:8080/notificationspull.svc is working without any issues.
Coordinator
Jan 18, 2015 at 7:48 AM
Did you change the IP address of the client node in the XML config I posted?

In the snippet below you need to replace http://67.222.131.147:8090/notifications with the address you are using in the sipsorcery-allinone.exe which is probably http://localhost:8080/notificationspull.svc.
<endpoint name="SIP1" address="http://67.222.131.147:8090/notifications" binding="basicHttpBinding" bindingConfiguration="LargeMessagesBindingConfiguration" contract="SIPSorcery.SIP.App.ISIPMonitorPublisher" />
Jan 18, 2015 at 7:31 PM
aaronc wrote:
Did you change the IP address of the client node in the XML config I posted?

In the snippet below you need to replace http://67.222.131.147:8090/notifications with the address you are using in the sipsorcery-allinone.exe which is probably http://localhost:8080/notificationspull.svc.
<endpoint name="SIP1" address="http://67.222.131.147:8090/notifications" binding="basicHttpBinding" bindingConfiguration="LargeMessagesBindingConfiguration" contract="SIPSorcery.SIP.App.ISIPMonitorPublisher" />
Yes. I have already changed IP address of the client node to http://localhost:8080/notificationspull.svc.
Jan 19, 2015 at 12:14 AM
plachira wrote:
aaronc wrote:
Did you change the IP address of the client node in the XML config I posted?

In the snippet below you need to replace http://67.222.131.147:8090/notifications with the address you are using in the sipsorcery-allinone.exe which is probably http://localhost:8080/notificationspull.svc.
<endpoint name="SIP1" address="http://67.222.131.147:8090/notifications" binding="basicHttpBinding" bindingConfiguration="LargeMessagesBindingConfiguration" contract="SIPSorcery.SIP.App.ISIPMonitorPublisher" />
Yes. I have already changed IP address of the client node to http://localhost:8080/notificationspull.svc.
SIPSorcery.Web.Services.SIPMonitorClientManagerHost service was not configured in my sipsorcery-allinone.exe. Now it is working fine. Thank you.