Вы находитесь на странице: 1из 3

FreeSwitch StarPound Integration - User Registration

Overview
The current starpound implementation requires the SIP phones register to Kamailio/SER and anchors the media to Asterisk/FreeSwtich for INVITE messages to solve NATing problem. This approach does not work when Asterisk/FreeSwitch server is behind a firewall. In EC2 environment, all servers are behind a virtual firewall. Note: Amazon EC2 (Elastic Cloud Computing) is a virtual server hosting environment. StarPound will use this environment to provide its hosted solutions. In order for StarPound to work with EC2, the SIP phones have to register to a media server (Asterisk or FreeSwitch). We are only planning to use FreeSwitch in EC2 environment. As a test, we've installed a Fedora Core 8 instance with StarPound CORE, kamailio, and Freeswtich installed. The PBX users and agents are first created using StarPound Management Console, and then manually created in FreeSwtich (XML files in conf/directory). This approach solved NATing problem. We were able to make outbound and receive inbound calls. In order to seemlessly using FreeSwitch as the registration server (get rid of the mannual user creation), we need to configure FreeSwitch to relay the registration request to StarPound. StarPound needs to provide a SIP registration service that processing the XML sent from FS and returns with a proper XML message.

FreeSwitch Configuration
FreeSwitch directory should be configured to use Mod XML Curl module. FreeSwitch upon receiving the registration message, it will send XML request (w/ Mod XML Curl ) to StarPound application server for user verification. Add the following section to the <freeswitch>/conf/auto_load_configs/xml_curl.conf: <configuration name="xml_curl.conf" description="cURL XML Gateway"> <bindings> <binding name="directory fetcher"> <param name="gateway-url" value="http://<server>:<port>" bindings="directory"/> </binding> </bindings> </configuration>

Example data exchange


When FreeSwitch bootup it sends POST to the server with the following data: POST / HTTP/1.1 User-Agent: freeswitch-xml/1.0 Host: localhost:8081 Accept: */* Content-Type: application/x-www-form-urlencoded Content-Length: 122 hostname=domU-12-31-39-03-C1F7&section=directory&tag_name=domain&key_name=name&key_value=10.249.194.9&domain=10.2 49.194.9 When FreeSwtich receives REGISTRATION request, it sends POST to the server with the following data: POST / HTTP/1.1 User-Agent: freeswitch-xml/1.0 Host: localhost:8081 Accept: */* Content-Type: application/x-www-form-urlencoded Content-Length: 815 hostname=domU-12-31-39-03-C1-F7&section=directory &tag_name=domain &key_name=name &key_value=uat.pbx.starpoundtech.net &action=sip_auth &sip_profile=doublenat5090 &sip_user_agent=X-Lite%20release%201014k%20stamp%2047051 &sip_auth_username=1002 &sip_auth_realm=uat.pbx.starpoundtech.net &sip_auth_nonce=e19c6876-446e-434b-ab2c-f7656d54e836 &sip_auth_uri=sip%3Auat.pbx.starpoundtech.net &sip_contact_user=1002 &sip_contact_host=66.156.89.185 &sip_to_user=1002 &sip_to_host=uat.pbx.starpoundtech.net &sip_from_user=1002 &sip_from_host=uat.pbx.starpoundtech.net &sip_request_host=uat.pbx.starpoundtech.net &sip_auth_qop=auth &sip_auth_cnonce=40021c0ae28de3ea588744019cd62c3d &sip_auth_nc=00000001 &sip_auth_response=c5b25b21b7e43684033231c259955993 &sip_auth_method=REGISTER &key=id&user=1002 &domain=uat.pbx.starpoundtech.net &ip=66.156.89.185 The response from the server can be: <document type="freeswitch/xml"> <section name="directory"> <domain name="uat.pbx.starpoundtech.net"> <user id="1002"> <params> <param name="password" value="1002"/> </params> <variables>

<variable name="toll_allow" value="domestic,international,local"/> </variables> </user> </domain> </section> </document>

Troubleshoot
You can use 'netcat' to troubleshoot the problem. Netcat can start up as a network listener on any port and output all request it received and accept input from stdin. For example, nc -v -l 127.0.0.1 8084 Copyright 2009, Starpound Technologies, INC. All rights reserved.

Вам также может понравиться