4

my current setup - i use bunch of sip hard-phones around few offices. all devices have two sip accounts configured - one on internal sip proxy [for calls between the branches], another - at 3rd party voip providers [ since it's in different countries - those are different providers, but that's irrelevant ].

i was thinking about terminating sip calls on something like asterisk/freeswitch server and having all sip-devices log on just once to such server[s] - mostly to provide things like voicemail, groupcalls, redirections etc. it seems perfectly doable but there is one problem - i cannot find examples how to prepare for nat/no nat. for calls routed to from/to 3rd party voip operator - i'll need handling for nat/stun etc, but for handling of internal calls - i do not want any nat, all traffic should go via vpns to different branches.

can you provide me some hints how to configure it? any tutorials?

thanks!

pQd
  • 29,561
  • 5
  • 64
  • 106

1 Answers1

3

For FreeSWITCH, I believe this functionality can be handled by the internal/external sip profiles. You can find more info on wiki.freeswitch.org

The NAT configuration to your external VoIP provider(s) can be setup in the external profile (example /usr/local/freeswitch/conf/sip_profiles/external/voipprovider.xml). You can set these two parameters to match your public ip address:

<include>
        <gateway name="voipprovider">
        <param name="ext-rtp-ip" value="x.x.x.x"/>
        <param name="ext-sip-ip" value="x.x.x.x"/>
        <param name="username" value="user"/>
        <param name="password" value="password"/>
        <param name="realm" value="sip.voipprovider.com"/>
        </gateway>
</include>

To use your external voip providers, you would setup your dialplan (/usr/local/freeswitch/conf/dialplan/default.xml) something like this. To use different voip providers depending on destination, you can adjust the regex:

<include>
 <extension name="Dial Out VoIP Provider">
   <condition field="destination_number" expression="^9(1\d{10})$">
     <action application="bridge" data="sofia/gateway/voipprovider/$1"/>
   </condition>
 </extension>
</include>

I hope this helps. I don't have any experience w/ Asterisk, so I am not sure how you would set it up with that switch.

okonomiyaki
  • 101
  • 1
  • thanks a lot for your response! can you suggest any freeswitch tutorials? [yes.. i've heard about google ;-] – pQd Jun 07 '10 at 14:44
  • 1
    theres a lot of good sample configs on the freeswitch wiki. wiki.freeswitch.org. They have sample sip profiles for service providers and sample dialplans. – okonomiyaki Jun 11 '10 at 01:00
  • Its also not really needed to use an internal proxy for internal calls, and external one for other scenarios. Freeswitch can serve both with the same results –  Aug 09 '15 at 06:15