Welcome to GotSpeech.NET Sign in | Join | Help

Verbal Input

Eliminating the keyboard...one spoken word at at time...
Speech Server 2007 marries FreeSwitch - Part 4 – Receiving Calls

Now that we have FreeSwitch installed on the same box as Speech Server 2007, its time to setup FreeSwitch so that it can receive phone calls from the PSTN and pass those calls off to Speech Server 2007. As you recall, one of the requirements that I had for www.VerbalBusiness.com was that the speech end of things needed to be able to receive calls fom the PSTN.

My first task was to find an ITSP that provided origination service. There are tons of them out there, but I decided on www.DidForSale.com, their home page is shown below

For $ 8.99 US per month they gave me a DID with 20 channels. Which from my understanding means that 20 people could be calling the VerbalBusiness voice app at the same time and all of them would get through. Caller # 21 would get a busy signal...but since the site is just starting out, 20 simultaneous callers is probably not going to happen for a while.

Also, once you signup for an account, they will give you a test DID for 6 hours so that you can play with their service before giving them any money. So I will run through the process of getting a test DID and using that DID as our incomming number for the application.

First thing you need to do is to signup for an account. Simply click on the 'SignUp' link on the toolbar that you see at the top of their home page. The process is straight forward so I won't cover it here.

Once you have an account you can login by clicking on the 'My Account' link which takes you to this login page

Once you get past the 'Login' page you will arrive at your main account page as shown below

 

The first thing to do is to get a test DID.

Click on the 'Testing Centre' link on the left hand menu and you will be taken to the following page

 

Click on the "Select DID >>" link in the middle of the page. You will be redirected to the following page

At the time that I was doing this blog post, there were 6 DIDs available for testing. Lets select the first one 312-780-0494 by selecting its radio button and then clicking on the 'Submit' button. This DID is now reserver for our use for a period of 6 hours. After the 6 hours have expired the DID will return to the testing pool. However you can go back and reserve it for another 6 hours should you need to.

Next step is to tell DIDforSale.com the IP Address of the box where we have FreeSwitch setup. I will use a ficticious IP Address here of 72.38.20.169. In order to setup this IP address, click the 'Manage IP' link in the left hand menu, which will take you to the following page

At this point, enter the following for each field

  • Description: FreeSwitch Test Environment
  • IP:  72.38.20.169
  • Port: 5080

FreeSwitch defaults to using port 5080 to receive calls. Click the 'Add' button and your IP address and Port will be saved.

The last step is to associate the IP address that we just entered with the test DID we obtained earlier. Click on the 'Manage DID' link on the left hand side menu and you will be taken to the following page.

 

Next, click on the Search button and the following screen will be displayed

Next, put a check in the boxes as shown by the red arrows and then click the 'Save' button, as shown below

 

What this has done is associate our test DID that we obtained earlier with the IP address of the box we have FreeSwitch running on. This now means that when ever someone dials 312-780-0494, DIDforSale.com will pass that call off to IP address 72.38.20.169 on port 5080, which is our FreeSwitch box. End result is that our FreeSwitch should now answer calls placed to 312-780-0494.

So thats it for setup at the ITSP, now lets turn our attention to finishing the FreeSwitch setup. FreeSwitch will now answer calls made to 312-780-0494, but after it has answered the call, we need it to pass the call off to Speech Serevr 2007

This is done by creating a dialplan. The file will be called "Inbound_3127800494 .xml" and will be located in the FreeSwitch\conf\dialplan\public folder as shown below

This is a simple XML file that can be created with any text editor. The contents of Inbound_3127800494 .xml are as follows

<extension name="Inbound_3127800494">
  <condition field='destination_number' expression='3127800494'>
    <action application="bridge" data="sofia/internal/3127800494@127.0.0.1:5060;transport=tcp"/>
  </condition>
</extension>

What this file does is it tells FreeSwitch to send any call received from 312-780-0494 directly to 127.0.0.1:5060  (our Speech Server Speech installation) using TCP as the transport protocol.

Save the newly created XML file and then restart FreeSwitch and Speech Server 2007. Please remember from Part # 1 to start FreeSwitch first and then start Speech Server 2007.

Lastly, since the call to FreeSwitch will be arriving on port 5080, I had to open Port 5080 in Windows Firewall which is running on the box.

Thats all there is to it. Now when you dial 312-780-0494 Speech Server will answer the call. You will also see all kinds of messages showing up in the DOS box that was openned by FreeSwitch. These messages are a little hard to read, but provide valuable information into what FreeSwitch is doing when the call arrives.

So thats about it for Part 4. The next instalment will be called "Speech Server 2007 marries FreeSwitch - Part 5 – Placing Calls", and will describe in detail the setup for making calls from Speech Server 2007 and getting FreeSwitch to forward them off to the PSTN.

Thanks for reading

Posted: Friday, January 08, 2010 12:23 PM by bcxml

Comments

satish_infy said:

Excellent article. Bless you.

# February 23, 2010 5:43 AM

statcom said:

Hello Brian

I am having a little trouble with two boxes. One for FS and the other for MSS. I know setting up MSS for FS is trivial. But how can I setup FS for MSS? Do I have to consider MSS a gateway?

TSS

# July 24, 2010 6:31 PM

statcom said:

I have two points to make.

1. One of the problems I had with incoming call was an usual firewall issue and fixed by opening ports. But I guess it's not practical to have separate boxes for FS and MSS because MSS requires to open firewall for virtually all ports in order to receive incoming calls from FS. I didn't have to do that for outbound calls.

2. After following your article "Speech Server 2007 marries FreeSwitch - Part 5", FS was not calling MSS any more because outbound bridge extension condition in one of FS XML files ate all incoming calls. I am looking for right conditions to process both inbound and outbound calls.

# July 24, 2010 11:03 PM
Anonymous comments are disabled