0

I have the following code in freeswitch. We have decided to use asterisk instead.

I've setup so that if you dial 8XXXX you will dial the other server.

sip1:/usr/local/freeswitch/conf/autoload_configs/acl.conf.xml
   <node type="allow" cidr="192.168.0.2/32"/>
sip1:/usr/local/freeswitch/conf/dialplan/default.xml
redirect numbers 8XXXX to sip2
  <extension name="Dial to sip2">
    <condition field="destination_number" expression="^8(\d\d\d\d)$">
      <action application="bridge" data="sofia/internal/$1@192.168.0.2"/>
    </condition>
  </extension>
sip1:/usr/local/freeswitch/conf/dialplan/public.xml
route foreign calls to the the extension
   <extension name="Calls from sip2">
     <condition field="destination_number" expression="^(\d\d\d\d)$">
     <action application="transfer" data="$1 XML default"/>
     </condition>
   </extension>


sip2:/usr/local/freeswitch/conf/autoload_configs/acl.conf.xml
   <node type="allow" cidr="192.168.0.1/32"/>
sip2:/usr/local/freeswitch/conf/dialplan/default.xml
redirect numbers 8XXXX to sip1
  <extension name="Dial to sip1">
    <condition field="destination_number" expression="^8(\d\d\d\d)$">
      <action application="bridge" data="sofia/internal/$1@192.168.0.1"/>
    </condition>
  </extension>
sip2:/usr/local/freeswitch/conf/dialplan/public.xml
route foriegn calls to the extension
   <extension name="Calls from sip1">
     <condition field="destination_number" expression="^(\d\d\d\d)$">
     <action application="transfer" data="$1 XML default"/>
     </condition>
   </extension>

In the free switch code I see that the file acl.conf.xml was configured? what is the corresponding file in asterisk? and How do I implement the same configuration in that file?

I have created extensions.conf file below.Is this file alone enough?? Am I missing some glue logic that binds these together? I am new to SIP configuration.

[incoming]
exten => 123,1,Answer()
 same => n(menuprompt),Background(main-menu)

exten => 1,1,Playback(digits/1)
 same => n,Goto(incoming,menuprompt,123)

exten => 2,1,Playback(digits/2)
 same => n,Goto(incoming,menuprompt,123)

exten => 9,1,Hangup()

[main-menu]
exten => n(menuprompt),Background(main-menu)

exten => 3,1,Playback(digits/3)
 same => n,Goto(main-menu,menuprompt,n)

exten => 4,1,Playback(digits/4)
 same => n,Goto(main-menu,menuprompt,n)

exten => 9,1,Hangup()
liv2hak
  • 14,472
  • 53
  • 157
  • 270
  • 1
    For Asterisk, the corresponding file is `/etc/asterisk/extensions.conf`, you might want to checkout [Asterisk book](http://astbook.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/asterisk-DP-Basics.html) for how to rewrite the dialplan – number5 Oct 22 '12 at 01:18
  • I have created a dial plan which I have updated above.Do I need anything more for this? Am I missing some kind of glue logic.I am new to this system.thanks. – liv2hak Oct 22 '12 at 04:09
  • 1
    You need at least setup sip credentials in sip.conf and setting the default context to your incoming or main-menu, try to read the first 5 chapters of the book above and especially [this part](http://astbook.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/DeviceConfig_id216341.html) – number5 Oct 22 '12 at 04:39

1 Answers1

1

May I ask why you move away from FreeSWITCH? IMHO it's much easier and better to handle than Asterisk, and performance is great

Stanislav Sinyagin
  • 1,973
  • 10
  • 10