Freeswitch phone Softswitch configuration note

Source: Internet
Author: User
Tags perl script freeswitch

I recently bought a new office building and the telephone system of the new Office, including Softswitch, digital relay gateway, E1 and VoIP, which should be configured by me. Multi-function programmer :)

The following are some records during freeswitch configuration. I will share them with you here. For more details, see the official FS and Chinese official website.

1. freeswitch SRC contains a Perl script. add_user adds users in batches.

2. view User Registration Information Sofia status profile internal Reg

3. Simulate originate user/5004 & Echo () for 5004 users ()

4. Configure CONF/dialplan/Default. XML to set the SIP outbound call (add 0 outbound calls, add 00 external calls, remove the local area code, and send the caller ID)
<Extension name = "local_extension2">
<Condition field = "destination_number" expression = "^ 0 (551) * ([0-9] \ D {5,}) $">
<Action application = "Export" Data = "dialed_extension = $1"/>
<Action application = "Answer"/>
<Action application = "set" Data = "call_timeout = 30"/>
<Action application = "set" Data = "record_sample_rate = 8000"/>
<Action application = "Export" Data = "record_stereo = false"/>
<Action application = "set" Data = "hangup_after_bridge = true"/>
<Action application = "set" Data = "continue_on_fail = true"/>
<Condition field = "caller_id_number" expression = "^ (50) ([0-4] [0-9]) $">
<Action application = "set" Data = "inclutive_caller_id_number = 123456 $2"/>
</Condition>
<! -- <Action application = "bridge" Data = "User/$ {dialed_extension }@$ {domain_name}"/> -->
<! -- <Action application = "bridge" Data = "$ {rtmp_contact (default/$ {dialed_extension }@$ $ {domain})}"/> -->
<Action application = "bridge" Data = "Sofia/gateway/gw1/$1"/>
</Condition>
</Extension>

5. Configure the incoming call number for the external line, and change the internal call number of the company to the internal extension short number of the company (to help the company save money, the company's new deal should give me a bonus of 0.0)
<Extension name = "public_extensions">
<Condition field = "destination_number" expression = "^ 123456 ([0-4] \ D) $">
<Action application = "pre_answer"/>
<Action application = "transfer" Data = "50 $1 XML default"/>
</Condition>
</Extension>
<Extension name = "public_extensions">
<Condition field = "destination_number" expression = "^ ([0-9] \ D +) $">
<Action application = "pre_answer"/>
<Action application = "transfer" Data = "$1 XML default"/>
</Condition>
</Extension>

6. View All Channel variable in the dial-up plan. You can view all channel VAR by using the info app. Modify dialplan first.
<Extension name = "Show Channel variable">
<Condition field = "destination_number" expression = "^ 1235 $">
<Action application = "info" Data = ""/>
</Condition>
</Extension>

Variable table
Http://wiki.freeswitch.org/wiki/Channel_Variables#Info_Application_Variable_Names_.28variable_xxxx.29

7. Differences between set and export
<Action application = "set" Data = "dialed_extension = $1"/>
<Action application = "Export" Data = "dialed_extension = $1"/>
Set is to set the variable to the current channel, that is, a-leg. The export also sets the variable to B-leg. Of course, here B-leg does not exist. So here it has the same effect on the channel as set. Therefore, using set is completely redundant. In addition, export also sets a special variable called export_vars. Its value is dialed_extension.

8. Channel variables in the dialing string
The syntax of braces {} and [] is described as follows:
{Foo = bar} can only start with a dial-up string. It sets the same value for each channel.
[Foo = bar] It is set before a specified dial-up string. The variable value of this channel is only valid for the current channel.
In the following example, the variable Foo = bar is set to all channels, Chan = 1 to bLH is set, and Chan = 2 to blh2 is set at the same time.
If you want to overwrite the variable values set in braces {} with the same name, you can set 'local _ var_clobber = true' in braces {}. For example: {local_var_clobber = true, sip_secure_media = true} Sofia/default/[email protected] | Sofia/default/[email protected] | [sip_secure_media = false] Sofia/default/[email protected]

9. Configure FS to call external Gateway
Create gw1.xml content under CONF/sip_profiles/external
<Gateway name = "gw1">
<Param name = "Realm" value = "192.168.1.2: 5060"/>
<Param name = "username" value = "5678"/>
<Param name = "password" value = "1234"/>
<Param name = "register" value = "false"/>
<Param name = "caller-ID-in-from" value = "true"/>
</Gateway>

10. Implement the IVR language menu www.freeswitch.org.cn/2010/03/21/yong-freeswitchshi-xian-ivr.html
First, modify CONF/dialplan/public. xml if you want to implement the language menu named welcome.
<Extension name = "incoming_call">
<Condition field = "destination_number" expression = "^ your did number $">
<Action application = "Answer" Data = ""/>
<Action application = "Sleep" Data = "1000"/>
<Action application = "start_dtmf"/>
<Action application = "IVR" Data = "welcome"/>
</Condition>
</Extension>
Next, modify CONF/autoload_configs/IVR. conf in the language menu configuration of welcome.
<Configuration name = "IVR. conf" Description = "IVR Menus">
<Menus>
<! -- <Menu name = "demo_ivr"> -->
<Menu name = "welcome"
Greet-long = "Custom/welcome.wav"
Greet-short = "Custom/welcom_assist.wav"
Invalid-sound = "IVR/ivr-that_was_an_invalid_entry.wav"
Exit-sound = "voicemail/vm-goodbye.wav"
Timeout = "15000"
Max-failures = "3"
Max-timeouts = "3"
Inter-digit-Timeout = "2000"
Digit-len = "4">
<Entry action = "menu-Exec-app" Digits = "0" Param = "transfer 1000 XML default"/>
<Entry action = "menu-Exec-app" Digits = "/^ (10 [01] [0-9]) $/"Param =" transfer $1 XML default "/>
</Menu>
</Menus>
</Configuration>


11. Determine whether a telephone voice file exists
<Extension name = "Play-news-announcements">
<Condition expression = "$ {file_exists ($ {sounds_dir}/news.wav)}" expression = "true"/>
<Action application = "playback" Data = "$ {sounds_dir}/news.wav"/>
<Anti-action application = "playback" Data = "$ {soufnds_dir }/ no-news-is-good-news.wav"/>
</Condition>
</Extension>

12. do not record the pre-media when you enable the recording.
<Action application = "set" Data = "media_bug_answer_req = true"/>

13. generate random UUID in FS
<Action application = "set" Data = "newuuid =$ {create_uuid ()}"/>

14. freeswitch play the voice prompt http://zdm2008.blog.163.com/blog/static/20491545201321945439885/ when the call fails
<Action application = "bridge" Data = "loopback/APP = VOICEMAIL: Default $ {domain_name }$ {dialed_extension}"/>
Change
<Action application = "playback" Data = "${inate_disposition).wav"/>

15. fs_cli command line bridging Lega, legb phone

Originate {effective_caller_id_number = xxxxxx} Sofia/Internal/[email protected] & Bridge (Sofia/gateway/gw1/xxxxxxxxxx)

 

Freeswitch phone Softswitch configuration note

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.