1, added SIP Provider, add the configuration file in Conf/sip_profiles/external
<!--Sipprovider.xml--
<include>
<gateway name= "Sipprovider" >
<param name= "username" value= "user"/>
<param name= "password" value= "pass"/>
<param name= "Realm" value= "*"/>
<param name= "proxy" value= "Sipprovider_ip_addr"/>
<param name= "Register" value= "true"/>
<param name= "expire-seconds" value= "/>"
<param name= "ping" value= "/>"
<param name= "Sip-trace" value= "true"/>
</gateway>
</include>
This SIP Provider requires REGISTER, and since FreeSWITCH is accessed through NAT, it is set to send pings for 30 seconds.
2, the did mapped by this SIP Provider to the corresponding extension
SIP Profile External.xml Sets the context default to public, so we need to edit conf/dialplan/public.xml
<extension name= "Sipprovider" > <!--your provider or any name "D-to-call it-
<condition field= "Destination_number" expression= "xxxxxxx" > <!--your did for this gateway-->
<action application= "Transfer" Data= "1001 XML Default"/>
</condition>
</extension>
Note:
You can also configure this gateway in your directory, the difference between the two configurations can be seen in this connection
Http://wiki.freeswitch.org/wiki/Clarification:gateways
<anthm> If you put them in a user tags in your directory you can and tell
#
Sofia to manage the whole domain And it'll iterate all the users
# in this
domain and reg the Gateways
#
<anthm> If you don ' t need That's can just put them in the Sofia Conf
What I gather from this is so if you are want certain extensions to being registered with your VoIP provider when a SPECIF IC User registers with FreeSWITCH-should define gateways in the directory sections rather than in the Sofia Configurati On. Conversely, if you are want an extension registered with a provider you would define the gateway as part of the SIP Pro File.
3, set extensions can dial PSTN phone through this SIP Provider
Conf/dialplan/default.xml
<extension name= "Long Distance" >
<condition field= "Destination_number" expression= "^00 (/d+) $" >
<action application= "Set" Data= "Effective_caller_id_number=xxxxxxxx"/>
<!--If your provider does not provide ringback (from or 183) may simulate
Ringback by uncommenting, the following line. -
<!--action application= "Ringback"/-->
<action application= "bridge" data= "sofia/gateway/sipprovider/1550$1"/>
</condition>
</extension>
Note: The new configuration should be placed before the following information
<!--
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
Anything you put below this line would usually get ignored due to the file in
Default/99999_enum.xml as it would transfer the call to the enum DialPlan.
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
-