NavigationUser login |
Routing Calls from Freeswitch to ProphecyOnce Freeswitch registers with BusinessVoip, incoming calls to BusinessVoip will be routed to the Freeswitch User Agent. The next challenge is to route the calls to Prophecy. In this setup, we'll assume that you have a BusinessVoip account that includes several different telephone numbers, all of which terminate at a single Prophecy server. Here's the complete stanza for default_context.xml: <extension name="Incoming-BusinessVoIP-demo-dpn">Here's a line-by-line explanation. 1. Create an "extension," that is, create a rule to handle a particular type of call: <extension name="Incoming-BusinessVoIP-demo-dpn">2. Determine the conditions under which the rule is triggered: <condition field="destination_number" expression="username">The condition is triggered by a regular-expression match on the incoming number. In this case, we assume that any incoming call from BusinesVoip will have a distinct username — one that isn't used with any other type of incoming call. 3. Optionally, list some debugging information on the console and in the log file: <action application="info"/>This action prints all the information available when a call arrives, and can help in debugging or in finding a unique key for a particular type of calls. 4. Play a ringing sound to the caller. <action application="set" data="ringback=${us-ring}"/>After all, we're about to transfer this call, and until Prophecy picks up the call, let's play a ringing tone. 5. Prepare to "bridge" the call. <action application="set" data="no_media=true"/>Rather than re-direct the call, which doesn't seem to work with BusinessVoip — or if it does, I haven't figured it out yet — we're going to re-route the media through the Freeswitch server. This action turns off the re-direction of media. 6. Bridge the call to Prophecy. Because of limitations in the Sofia SIP UA agent, you must have the actual IP address of Prophecy to route to it. Furthermore, since you may have several different Prophecy services running, you will want to route to the correct one. E.g., on Prophecy, you will have an callrouting.xml entry for "3125551212." To reach that number, you need to find out what nubmer the caller actually dialed. This information available in Freeswitch as the variable ${sip_to_user}. (To see what other information is available, you can use the optional "info" action as described above. <action application="bridge" data="sofia/local/${sip_to_user}@192.168.32.54"/>This assumes that there's a User Agent named "local" that routes local (behind-the-firewall) calls, and that the Prophecy server is located at IP address 192.168.32.54 and that it uses the default port of 5060 to receive calls. Testing and debugging tips: Start out by routing BusinessVoip calls to a known extension that works on Freeswitch directly, such as the "portaudio" console. After that works, and you can send and receive audio, you can attempt to route to Prophecy. If your connection suddenly fails after 30 seconds or so, you likely need a STUN server or to fiddle with one of the external IP settings, as detailed in the section of how to register BusinessVoip.
|
P2006 How-To BookBasic InformationSearchRecent blog posts
New forum topicsActive forum topics |