吴伟贤のBlog

Feed Rss

freeswitch conf/directory/default/brian.xml 备注

07.22.2013, freeswitch conf/directory/default/brian.xml 备注已关闭评论, freeswitch, by .

freeswitch conf/directory/default/brian.xml 备注

简单GG翻译下,仅用于自己学习用。

 

<include>
<!–
user属性内cidr=表示,用于IP登陆验证, 如 cidr=”1.2.3.4/32″
你可以查看 acl.conf.xml 内的<node type=”allow” domain=”$${domain}”/>
–>
<user id=”brian” cidr=”192.0.2.0/24″> <!–ID 为SIP注册用户名. CIDR可选– 如果指定的话,这些IP地址与该用户自动认证–>
<!– 用户相关的出局信息 –>
<gateways>
<!–<gateway name=”asterlink.com”>–>
<!–/// 账号用户名 *必需* ///–>
<!–<param name=”username” value=”cluecon”/>–>
<!–/// 验证 realm: *选填* 如果为空,跟gateway name同值 ///–>
<!–<param name=”realm” value=”asterlink.com”/>–>
<!–/// SIP From用户名: *选填* 如果为空,跟username同值///–>
<!–<param name=”from-user” value=”cluecon”/>–>
<!–/// SIP From域名domain: *选填* 如果为空,跟realm同值 ///–>
<!–<param name=”from-domain” value=”asterlink.com”/>–>
<!–/// 账户密码 *必需* ///–>
<!–<param name=”password” value=”2007″/>–>
<!–/// 使用信道的caller-id 替换INVITE的 from user ///–>
<!–<param name=”caller-id-in-from” value=”false”/>–>
<!–/// inbound呼入电话分机号: *选填* ,为空,跟username同值 ///–>
<!–<param name=”extension” value=”cluecon”/>–>
<!–/// 代理主机proxy host: *选填* 为空,跟realm同值 ///–>
<!–<param name=”proxy” value=”asterlink.com”/>–>
<!–/// 发送注册代理: *选填* 为空,跟 proxy同值 ///–>
<!–<param name=”register-proxy” value=”mysbc.com”/>–>
<!–/// 超时时长expire in seconds: *选填* 为空.默认3600秒 ///–>
<!–<param name=”expire-seconds” value=”60″/>–>
<!–/// 不注册 ///–>
<!–<param name=”register” value=”false”/>–>
<!– 注册使用什么传输协议tcp/udp –>
<!–<param name=”register-transport” value=”udp”/>–>
<!–失败或超时后 多少秒后重试 –>
<!–<param name=”retry-seconds” value=”30″/>–>
<!–Use the callerid of an inbound call in the from field on outbound calls via this gateway –>
<!–<param name=”caller-id-in-from” value=”false”/>–>
<!–在SIP contact内,发送额外的sip params–>
<!–<param name=”contact-params” value=”tport=tcp”/>–>
<!–每X秒发送一个可选的ping, 失败后将不注册或者做标记 –>
<!–<param name=”ping” value=”25″/>–>
<!–</gateway>–>
</gateways>
<params>
<!– 省略免认证注册的密码omit password for authless registration –>
<param name=”password” value=”$${default_password}”/><!–SIP 密码–>
<param name=”vm-password” value=”9999″/><!–为空,使用password的值–>
<!–<param name=”email-addr” value=”me@mydomain.com”/>–>
<!–<param name=”vm-delete-file” value=”true”/>–>
<!–<param name=”vm-attach-file” value=”true”/>–>
<!–<param name=”vm-mailto” value=”me@mydomain.com”/>–>
<!–<param name=”vm-email-all-messages” value=”true”/>–>
<!–选填 user:domain:pass的a1-hash–>
<!–<param name=”a1-hash” value=”c6440e5de50b403206989679159de89a”/>–>
<!– 允许用户访问What this user is allowed to acces –>
<!–<param name=”http-allowed-api” value=”jsapi,voicemail,status”/> –>
</params>
<variables><!–这些变量是在信道访问–>
<!–这里所有的变量将被设置对所有入站该用户发起的呼叫all variables here will be set on all inbound calls that originate from this user –>
<variable name=”user_context” value=”default”/><!–魔术变量: 指定context–>
<variable name=”effective_caller_id_name” value=”Brian West”/><!–魔术变量: 用户出局主叫ID–>
<variable name=”effective_caller_id_number” value=”1000″/><!–魔术变量: 用户出局主叫名或者主叫号码–>
<!– 为 false不记录CDR  有效值: true, false, a_leg and b_leg –>
<variable name=”process_cdr” value=”true”/>
<!– sip_secure_media will offer mandatory SRTP on invite AES_CM_128_HMAC_SHA1_32, AES_CM_128_HMAC_SHA1_80 or true–>
<variable name=”sip_secure_media” value=”true”/>
<!– 用户最大呼叫数limit the max number of outgoing calls for this user –>
<!–<variable name=”max_calls” value=”2″/>–>

<!– send presence information if FS is configured to do so –>
<!–<variable name=”presence_id” value=”1000@$${domain}”/>–>

<!– set these to take advantage of a dialplan localized to this user –>
<!–<variable name=”numbering_plan” value=”US”/>–>
<!–<variable name=”default_area_code” value=”434″/>–>
<!–<variable name=”default_gateway” value=”asterlink.com”/>–>
<!–
NDLB-connectile-dysfunction – Rewrite contact ip and port
NDLB-tls-connectile-dysfunction – Rewrite contact port only.
–>
<!–<variable name=”sip-force-contact” value=”NDLB-connectile-dysfunction”/>–>
<!–<variable name=”sip-force-expires” value=”10″/>–>
<!–<variable name=”sip-register-gateway” value=”cluecon.com”/>–>
<!– 为特定用户设置的文件格式–>
<!–<variable name=”vm_message_ext” value=”mp3″/> –>
</variables>

<vcard>
<!– 这里插入可选兼容XML的电子名片–>
</vcard>
</user>
</include>

freeswitch XML用户目录指南 XML User Directory Guide

07.22.2013, freeswitch XML用户目录指南 XML User Directory Guide已关闭评论, freeswitch, by .

来源:https://wiki.freeswitch.org/wiki/FreeSwitch_XML_User_Directory_Guide
简单GG翻译下,仅用于自己学习用。 

概述Overview

FreeSWITCH的目录下 $FS_ROOT/conf/directory/ 包含账户信息 (即XML文件) ,用于用户(即SIP电话分机)注册到freeswitch.

注意: 这里的语法跟在 Dialplan 内的不一样

用户设置 User settings

<include>
<!--定义用户 包含在<user></user>内-->
  <user id="1000" cidr="12.34.56.78/32,20.0.0.0/8"> <!--ID 为SIP注册用户名. CIDR可选-- 如果指定的话,这些IP地址与该用户自动认证-->
    <params><!--参数集-->
      <param name="password" value="correcthorsebatterystaple"/> <!--SIP 密码-->
      <param name="vm-password" value="8761"/> <!--虚拟密码 用于语音信箱-->
    </params>
    <variables><!--这些变量是在信道访问-->
      <variable name="accountcode" value="1000"/> <!--在你的拨号方案内使用,授权和限制。此外,cdr_csv可以在各自的CDR文件内使用-->
      <variable name="user_context" value="default"/> <!--魔术变量: 指定context-->
      <variable name="effective_caller_id_name" value="Extension 1000"/><!--魔术变量: 用户出局主叫ID-->
      <variable name="effective_caller_id_number" value="1000"/><!--魔术变量: 用户出局主叫名或者主叫号码-->
    </variables>
  </user>
</include>

基本用户 Basic User

基本配置是相当简单的,你只需要添加用户名和密码。

如:添加文件 $FS_ROOT/conf/directory/mike_x2239.xml

<domain name="$${sip_profile}">
  <user id="mike">
    <params>
      <param name="password" value="micke"/>
    </params>
  </user>
</domain>

domain标签告诉FS该用户所属的domain. 注意所有用户都应该在同一个域domain中标签, 除非你正在使用多域名multiple domains. 用户名在SIP地址@的左部分 (如上面定义的用户”mike” 在 “mike@sub.mydomain.com”). $${sip_profile} 将domain替换为在freeswitch.xml中定义的.

加密 a1-hash

明文密码可以替换为 “a1-hash”加密密码. a1-hash 是通过MD5函数对”username用户名:domain域:password密码”(不含引号)加密生成的 MD5 digest function . Linux下, 加密可以通过以下方式生成: openssl dgst -md5 < filename, 或者 echo -n "username:domain:password" | openssl dgst -md5.

<domain name="$${sip_profile}">
  <user id="mike">
    <params>
      <param name="a1-hash" value="c6440e5de50b403206989679159de89a"/>
    </params>
  </user>
</domain>

反向认证 reverse authentication

有些端点需要验证某些类型的请求 (如. SIP NOTIFY同步). 你可以设置这些认证数据

<domain name="$${sip_profile}">
  <user id="jim">
    <params>
       <param name="reverse-auth-user" value="jim" /> <!--反向认证用户-->
       <param name="reverse-auth-pass" value="foo123" /> <!--反向认证密码-->
    </params>
  </user>
</domain>

电子名片 VCards

你可以添加电子名片VCards支持,需要添加mod_dingaling支持. 添加如下格式的信息

<domain name="$${sip_profile}">
  <user id="peter">
    <params>
      <param name="password" value="thepassword"/>
    </params>

    <!-- This is only for mod_dingaling so it can deliver vcards in component mode-->
    <vcard xmlns='vcard-temp'>
      <FN>Peter Saint-Andre</FN>
      <N>
	<FAMILY>Saint-Andre</FAMILY>
	<GIVEN>Peter</GIVEN>
	<MIDDLE/>
      </N>
      <NICKNAME>stpeter</NICKNAME>
      <URL>http://www.jabber.org/people/stpeter.php</URL>
      <BDAY>1966-08-06</BDAY>
      <ORG>
	<ORGNAME>Jabber Software Foundation</ORGNAME>
	<ORGUNIT>Jabber Software Foundation</ORGUNIT>
      </ORG>
      <TITLE>Executive Director</TITLE>
      <ROLE>Patron Saint</ROLE>
      <TEL><WORK/><VOICE/><NUMBER>303-308-3282</NUMBER></TEL>
      <TEL><WORK/><FAX/><NUMBER/></TEL>
      <TEL><WORK/><MSG/><NUMBER/></TEL>
      <ADR>
	<WORK/>
	<EXTADD>Suite 600</EXTADD>
	<STREET>1899 Wynkoop Street</STREET>
	<LOCALITY>Denver</LOCALITY>
	<REGION>CO</REGION>
	<PCODE>80202</PCODE>
	<CTRY>USA</CTRY>
      </ADR>
      <TEL><HOME/><VOICE/><NUMBER>303-555-1212</NUMBER></TEL>
      <TEL><HOME/><FAX/><NUMBER/></TEL>
      <TEL><HOME/><MSG/><NUMBER/></TEL>
      <ADR>
	<HOME/>
	<EXTADD/>
	<STREET/>
	<LOCALITY>Denver</LOCALITY>
	<REGION>CO</REGION>
	<PCODE>80209</PCODE>
	<CTRY>USA</CTRY>
      </ADR>
      <EMAIL><INTERNET/><PREF/><USERID>stpeter@jabber.org</USERID></EMAIL>
      <JABBERID>stpeter@jabber.org</JABBERID>
      <DESC>
	More information about me is located on my
	personal website: http://www.saint-andre.com/
      </DESC>
    </vcard>

  </user>
</domain>

组Groups

组是用户逻辑合集,FS可以使用并行,串行的方式桥接呼叫.根据group_call application 参数的不同 . 使用组是可选的– 如果你想使用,你可以直接将用户信息放在domain节点内.

这是特别有用,如果你使用mod_xml_curl的向用户提供目录FreeSWITCH的和逻辑结构,希望一些用户分组。This is specially useful if you use mod_xml_curl to provide the user directory to FreeSWITCH and want to group some users in a logical structure. 以下组”200″ 将4个用户设置为一个组. It’s interesting to notice the “dial-string” param, which is used to bridge the calls to those users. Users 1000 and 1001 will use the default “dial-string” while user 2014 uses a loopback channel so FreeSWITCH can actually query the dialplan to figure out how to reach that user (this also works for external numbers through OpenZAP and gateways):

type=”pointer” is a pointer so you can have the same user in multiple groups. It basically means to keep searching for the user in the directory.

<document type="freeswitch/xml">
 <section name="directory">
   <domain name="sip.example.com">
     <users>
       <user id="1000">
         <params>
           <param name="dial-string" value="{presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}"/>
         </params>
         <variables>
           <variable name="user_context" value="default"/>
         </variables>
       </user>
       <user id="1001">
         <params>
           <param name="dial-string" value="{presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}"/>
         </params>
         <variables>
           <variable name="user_context" value="default"/>
         </variables>
       </user>
     </users>
     <groups>
       <group name="200">
         <users>
           <user id="2014">
             <params>
               <param name="dial-string" value="loopback/2014/default/XML"/>
             </params>
             <variables>
               <variable name="user_context" value="default"/>
             </variables>
           </user>
           <user id="1000" type="pointer"/>
           <user id="1001" type="pointer"/>
         </users>
       </group>
     </groups>
   </domain>
 </section>
</document>

The dialplan for the above group can be defined like this:

     <extension name="Group 200">
       <condition field="destination_number" expression="200">
         <action application="set" data="hangup_after_bridge=true"/>
         <action application="set" data="continue_on_fail=true"/>
         <action application="set" data="originate_continue_on_timeout=true"/>
         <action application="set" data="call_timeout=15"/>
         <action application="bridge" data="${group_call(200@${domain_name}+F)}"/>
         <action application="transfer" data="200 XML default"/>
         <action application="hangup"/>
       </condition>
     </extension>

The extension 200 will ring all the users defined in the user directory for group 200 in a serial fashion (specified by the +F argument, if you want to ring all the users at once use the +A argument) for 15 seconds, then it will transfer the call to the same group again so the call will ring the group infinitely.

To explain the variables set prior to the bridge:

The hangup_after_bridge is set to true for this effect: if the bridge is successfully answered and the B-leg later hangs up, the A-leg will also be hung up.

The continue_on_fail is set to true for this: if the bridge fails, dialplan execution will continue and the transfer will be executed.

The originate_continue_on_timeout is set to true for this: if the bridge’s dial string specifies several destinations separated by the “|” (this is for failover), the bridge will time out on an unanswered destination and will attempt the next specified destination. Without originate_continue_on_timeout set to true, the bridge will time out on the first destination it tries and the bridge itself will fail. (In the example above, the bridge string is generated by group_call with the +F option; this specifies a dial string with all the group’s destinations separated by “|”. So originate_continue_on_timeout needs to be set to true for serial calling behavior.)

The call_timeout is set so that the bridge attempt to a destination that goes unanswered will time out. NOTE: If the destination sends early media, the bridge will be answered (pre-answered) and will NOT time out! To time out a bridge attempt to a destination sending early media, set ignore_early_media to true.

The dialplan for user 2014, which in this example happens to be terminated through a gateway defined via mod_lcr, can be defined like this:

     <extension name="Extension 2014">
       <condition field="destination_number" expression="2014">
         <action application="lcr" data="2014"/>
         <action application="set" data="dialed_ext=${lcr_auto_route}"/>
         <action application="export" data="dialed_ext=${lcr_auto_route}"/>
         <action application="set" data="hangup_after_bridge=true"/>
         <action application="set" data="call_timeout=120"/>
         <action application="bridge" data="${lcr_auto_route}"/>
         <action application="hangup"/>
       </condition>
     </extension>

Alphanumeric to numeric user mapping

Say you want a user’s id to be alphanumeric (like an email username), such as johnsmith@pbx.example.com. These users have alphanumeric usernames in their sip phone config, but you want to map them from their sip username to a numeric extension, and vice versa.

As of version 1.0.4, FreeSWITCH makes this trivial to accomplish. A user’s ID can be any alphanumeric string, and this can be simply tied to an extension number using the ‘number-alias’ property. This property creates an aliased directory entry that points to the alphanumeric user entry.

NOTE: When using this attribute, you must be careful not to create a directory collision by having another user whose ID is the same as another user’s alias

Here is an example from the user directory:

  <user id="johnsmith" number-alias="1001">
    <!-- Insert the usual user configuration variables and params here,
         including user password, voicemail password, caller ID info, etc -->
     <variables>
       <variable name="mailbox" value="1001"/>
       <variable name="effective_caller_id_name" value="1001"/>
       <variable name="effective_caller_id_number" value="1001"/>
       <variable name="voicemail_alternate_greet_id" value="1001"/>
     </variables>
  </user>

So when a user dials extension number 1001, your dialplan can use the ‘user_data’ function to look up the ID attribute associated with that number alias. In the default dialplan, the ‘Local Extension’ section can be made to work with a small change to the ‘bridge’ line:

  <action application="bridge" data="user/${user_data(${destination_number}@${domain_name} attr id)}"/>

NOTE: Using this user_data function in combination with mod_xml_curl will generate an additional request each time the user_data function is called. Note that it is already called once in the Local Extension section to determine the callgroup. Beware of performance implications of this with high-volume systems.

More Complex Examples

Each <user> can also have it’s own variables and gateways with their own [semi-]complex configurations.

User-Specific Gateways

<user id="user1">
  <params>
    <param name="password" value="1"/>
  </params>
  <variables>
    <variable name="register-gateway" value="user1out"/>
  </variables>
  <gateways>
    <gateway name="user1out">
      <param name="username" value="4347382173"/>
      <param name="password" value="1"/>
      <param name="proxy" value="sip.example.com"/>
      <param name="register" value="false"/>
    </gateway>
  </gateways>
</user>

The <register-gateway> variable can be set to the name of a specific gateway, a comma delimited list of multiple gateways, or “all”. Setting it to one or more gateways will register the named gateway(s) when the <user> registers with FreeSWITCH.(whether they’re in the <user>’s <gateways> or some other <user>’s <gateways> or anywhere). Setting the variable to “all” will register all of the particular <user>’s gateways.

Group call with answer confirmation

The following example makes the user reachable at multiple phone numbers in SIP and PSTN networks. A call to a mobile phone may usually be answered with a message that a mobile user is unreachable, or end up in a voicemail. In order to avoid such situations, group_confirm_key is used to request the user to press “1” for call confirmation.

Loopback endpoint duplicates all channel variables, so if group_confirm_key is set globally, the confirmation key would be asked twice. So it needs to be applied with [] to limit to one leg only. The loopback endpoint is used to route the call to a PSTN number, assuming that users in the default context are allowed to dial international numbers and they are routed to an appropriate gateway.

 <!-- dialplan/default.xml -->
   <extension name="global" continue="true">
     <condition>
       <action application="set" data="group_confirm_file=phrase:press_one_to_answer"/>
       <action application="set" data="group_confirm_read_timeout=1000"/>
     </condition>
   </extension>
   <extension name="dvop_groupcall">
     <condition field="destination_number" expression="^(71[1-9]0)$">
       <action application="answer"/>
       <action application="set" data="ringback=$${hold_music}"/> 
       <action application="set" data="call_timeout=60"/>
       <action application="set" data="hangup_after_bridge=true"/>
       <action application="bridge" data="${group_call(hunt_$1@${domain_name}+A)}"/>
     </condition>
   </extension>

 <!-- directory/default.xml -->
    <users>
      <user id="7012">
        <params>
          <param name="a1-hash" value="538db5a1dcf95cd9df62bf2ff0466c4b"/>
        </params>
        <variables>
          <variable name="user_context" value="default"/>
        </variables>
      </user>
      <user id="7017">
        <params>
          <param name="dial-string" value="[group_confirm_key=1]loopback/00491637743380/default"/>
        </params>
      </user>
    </users>
    <groups>
      <group name="hunt_7190">
        <users>
          <user id="7012" type="pointer"/>
          <user id="7017" type="pointer"/>
        </users>
      </group>
    </groups>

Domains & Users Parameters

<params> and <variables> tags are valid inside <user>, <group> and <domain> tags.

Parameters and variables set on the domain will apply to all users in the domain, and parameters and variables set in a group will apply to all users in the group.

Priority will be given to identical parameters and variables in the following order: users, groups, domain.

Password

<param name="password" value="123456"/>

Do Not Allow Empty Passwords

If you do not include the above ‘password’ parameter, anybody can register as the user without using a password. It is always wise to include this parameter in the directory section in case a user does not set their password.

<param name="allow-empty-password" value="false"/>

Dial String

The dial string MUST be defined and will control the behavior of the call when a user is dialed. The dial-string parameter is used by the user/ endpoint.

Default value goes as follows:

<param name="dial-string" value="${sofia_contact(${dialed_user}@${dialed_domain})}"/>

Channel variables useful for the dial-string

  • transfer_fallback_extension
  • presence_id
<param name="dial-string" value="{transfer_fallback_extension=${dialed_user}}${sofia_contact(${dialed_user}@${dialed_domain})}"/>

Include Pickup Endpoints

<param name="dial-string" value="${sofia_contact(${dialed_user}@${dialed_domain})},pickup/${dialed_user}@${dialed_domain}"/>

Advanced dial-string

  • Sets presence and creates pickup endpoint
<param name="dial-string" value="{sip_invite_domain=${dialed_domain},presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})},pickup/${dialed_user}@${dialed_domain}"/>

Variables

Any variables defined in the domain or user will be defined as channel variables when there is a call to user or when there is an inbound calls from that user.

Forcing a particular user to a particular extension

In a PABX environment, an authenticated user can specify that they are at an arbitrary extension. This behavior can be restricted in two ways.

To force a user to use a specified extension, add

  <variable name="sip-force-user" value="<extension>"/>

to that user’s directory entry.

Alternatively, to check that users authenticate with the same username as that in their contact field for an entire profile, add

  <variable name="inbound-reg-force-matching-username" value="true"/>

to that profile’s definition.

Additionally look at [1] – easy way of registration user with different SIP ID (Contact header) and username (Authorization header).

Force Registrations to Expire

To help prevent stale registrations you are able to override the client specified registration expiry. You do this in the clients directory profile, by simply adding the variable

<variable name="sip-force-expires" value="180"/>

freeswitch 默认拨号方案Default Dialplan

07.21.2013, freeswitch 默认拨号方案Default Dialplan已关闭评论, freeswitch, by .

简单GG翻译下,仅用于自己学习用。

freeswitch默认拨号方案中(conf/dialplan/default.xml)设置了一些基本的测试功能和PBX电话系统功能

包含了分机互拨及简单IVR功能

抢接 Intercept (Ringing Call Pickup)

global-intercept

^886$

抢接组group-intercept

^\*8$

抢接分机号intercept-ext

^\*\*(\d+)$

抢接其他分机 输入 **分号  如1001正响铃,1002想要抢接过来.直接输入**1001

更多抢接内容请查看https://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_intercept

 

转接-盲转

将来电转接到某一分机,当分机忙。直接挂断

接通状态下拨打:*1 分机号

<action application=”bind_meta_app” data=”1 b s execute_extension::dx XML features”/>

转接-协商转

将来电转接到某一分机,当分机忙。回到原转接方

接通状态下拨打:*4 分机号

<action application=”bind_meta_app” data=”4 b s execute_extension::att_xfer XML features”/>

重拨 最近拨打出去的被叫号码

每个分机号都会记住最近一次拨打出去被叫号码,你可以直接输入870进行重拨

拨打: 870

snom-demo-2

^9001$

snom-demo-1

^9000$

侦听分机

Eavesdrop 侦听一个特定的分机

拨打: 881001 (侦听分机 1001)
或者
拨打: *01001 (侦听分机 1001)

侦听,循环通道  Eavesdrop, cycle through channels

Allows you to cycle through active channels listening in on the calls.

侦听使用说明: Misc._Dialplan_Tools_eavesdrop

拨打: 779

回拨Call Return

回拨 最近一次拨打给你的分机

拨打: *69 或者 869 或者 lcr

删除组 del-group

^80(\d{2})$

添加组 add-group

^81(\d{2})$

call-group-simo

^82(\d{2})$

call-group-order

^83(\d{2})$

分机对讲extension-intercom

^8(1[0-9]{3})$

拨打本地分机 Dial local extensions

默认拨号方案内,1000-1019  20个分机号可直接拨打

拨打: 1000 – 1019

拨打销售组 Call the sales group

默认创建了一个销售组,转接或者呼叫这个组,组内分机都会响铃,呼叫分机2000直接呼叫销售组.

拨打: 2000

拨打支持组 Call the support group

同上

拨打: 2001

拨打财务组 Call the billing group

同上

拨打: 2002

拨打人工台 Dial the operator

默认拨号方案为每个domain定义一个人工台,多个domain多个人工台

拨打: 0 (零)

或者

拨打: operator(字母)

语音信箱 Voicemail

拨打语音信箱 voicemail

拨打: vmain 或者 4000 或者 *98

通过SIP URI 拨打 Dial by SIP URI

通过URI拨打SIP设备

拨打: sip:user@domain.tld

开始一个动态会议(窄带音频)  Start a dynamic conference (narrowband audio)

8k 会议可以通过拨打3000-3099创建

拨打: 3000 – 3099

开始一个动态会议(宽带音频) Start a dynamic conference (wideband audio)

宽带(16k) 会议可以通过拨打3100-3199创建

拨打: 3100 to 3199

开始一个动态会议(超宽带音频) Start a dynamic conference (ultrawideband audio)

超宽带(32k) 会议可以通过拨打3200-3299创建

拨打: 3200 to 3299

开始一个动态会议(CD品质的单声道音频) Start a dynamic conference (cd quality mono audio)

CD品质的单声道音频(48k) 会议可以通过拨打3300-3399创建

拨打: 3300 to 3399

freeswitch公开会议 FreeSWITCH public conference

通过SIP拨打freeswitch公开会议

拨打: 9888

你也可以拨打91616和93232呼叫freeswitch公开的16k 32k会议

Note: I don’t believe the different extensions dump into the same conference.

mad_boss_intercom

这个分机将开始会议,并邀请一个组。在任何时候,参与者可以拨打* 2 ,直接向老板桥接。所有其他来电就会挂断电话。

This extension will start a conference and invite a group. At anytime the participant can dial *2 to bridge directly to the boss. All other callers are then hung up on.

拨打: 0911

mad_boss_intercom

这个分机将开始会议,并邀请一部分人。在任何时候,参与者可以拨打* 2 ,直接向老板桥接。所有其他来电就会挂断电话。

This extension will start a conference and invite a few of people. At anytime the participant can dial *2 to bridge directly to the boss. All other callers are then hung up on.

拨打: 0912

mad_boss

这个分机将开始会议时邀请几个人进来

This extension will start a conference and invite several people upon entering.

拨打: 0913

拨打演示IVR Call the demo IVR

呼叫 Included Demo IVR.

拨打: 5000

动态会议 dynamic_conference

^5001$

rtp_multicast_page

^pagegroup$|^7243$

队列内暂停一个呼叫 Park a call in queue 5900

查看 Mod_fifo

拨打: 5900

队列内接一个呼叫Pick up a call from queue 5900

Mod_fifo

拨打: 5901

Pick up from valet parking

Valet park retrieval, works with valet_park extension below. Retrieve a valet parked call by dialing 6000 + park number + # See:Misc._Dialplan_Tools_valet_park

Dial: 6000 1 #

Park a call with valet parking

Valet park 6001-6099. Blind x-fer to 6001, 6002, etc. to valet park the call. Dial 6001, 6002, etc. to retrieve a call that is already valet parked. After call is retrieved, park extension is free for another call. See: Misc._Dialplan_Tools_valet_park

Dial: 6001

park

park\+(\d+)

unpark

parking

park

callpark

unpark

pickup

等待 wait

^wait$

接收传真 Receive a fax

接收传真到 /tm/rxfax.tif ,需要 mod_spandsp

拨打: 9178

发送传真 Transmit a fax

使用文档 /tmp/txfax.tif 发送传真,需要 mod_spandsp

拨打: 9179

180回铃声 ringback_180

^9180$

183回铃声 ringback_183_uk_ring

^9181$

183音乐回铃声 ringback_183_music_ring

^9182$

ringback_post_answer_uk_ring

^9183$

ringback_post_answer_music

^9184$

ClueCon information

介绍 ClueCon

拨打: 9191

显示info信息 show_info

执行 info app 并挂断. 在控制台查看输出.

拨打: 9192

记录视频 video_record

^9193$

播放视频 video_playback

^9194$

回声测试,5秒延迟 Echo test, five second delay

呼叫 echo test application. Audio sent from the caller is rerouted(echo’ed) back to the caller after a five second delay.

拨打: 9195

回声测试 Echo test

Calls the echo test application. Audio sent from the caller is imediately rerouted(echo’ed) back to the caller.

拨打: 9196

tone_stream demo (milliwatt)

Uses tone_stream to play a continuous 1004hz tone.

Dial: 9197

tone_stream demo (tetris)

Uses tone_stream to play the tetris theme.

Dial: 9198

zrtp_enrollement

^9787$

听保持音乐 Listen to music on hold

拨打: 9664


The next three extensions are after the multiline WARNING in default.xml.

refer

${sip_refer_to}

ruri

^ruri$

7004

^7004$

来源:https://wiki.freeswitch.org/wiki/Default_Dialplan_QRF

freeswitch mod_curl http请求API

07.21.2013, freeswitch mod_curl http请求API已关闭评论, freeswitch, by .

需求:用户呼叫某号码如1000,执行指定http地址的一个请求

如:1001呼叫1000后执行http://www.baidu.com

 

在dialplan只添加

<extension name=”test”>
<condition field=”destination_number” expression=”^1000$”>
<action application=”curl” data=”http://www.baidu.com”/>
<action application=”hangup” data=”USER_BUSY”/>
</condition>
</extension>

 

具体参考:https://wiki.freeswitch.org/wiki/Mod_curl

FreeSwitch传真测试

07.21.2013, FreeSwitch传真测试已关闭评论, freeswitch, by .

转自:http://zdm2008.blog.163.com/blog/static/20491545201321945256119/

最近在测试FreeSwitch下的接收和发送传真,客户端之前用Zoiper,一直没有测试成功,最后才发现原来,是Zoiper免费版的不直接传真,商业版的才直接。最后客户端用Kapanga。

而且接收传真必须加上面的配置才行。

<extension name=”fax_receive”>
<condition field=”destination_number” expression=”^9178$”>
<action application=”set” data=”proxy_media=true”/>
<action application=”set” data=”bypass_media=false”/>
<action application=”set” data=”fax_enable_t38=true”/>
<action application=”set” data=”fax_enable_t38_request=true”/>
<action application=”answer” />
<action application=”playback” data=”silence_stream://2000″/>
<action application=”rxfax” data=”tmp/rxfax.tif”/>
<action application=”hangup”/>
</condition>
</extension>

FreeSWITCH在呼叫失败的情况下播放语音提示

07.21.2013, FreeSWITCH在呼叫失败的情况下播放语音提示已关闭评论, freeswitch, by .

转自:http://zdm2008.blog.163.com/blog/static/20491545201321945439885/

 

看到好多网友问到这个问题。一般我们在打电话时会听到“您拨的电话正在通话中,请稍后再拨….”,或“电话无应答…”之类的提示,我们在 freeswitch 里也可以这样做。
其实很简单,默认的配置在呼叫失败时会转到 voicemail (语音信箱),我们只需要在这里修改,让他播放一个语音提示,然后再进入语音信箱(或直接挂 断也行)。
找到 <extension name=”Local_Extension”>部分的最后几行
<action application=”bridge” data=”user/${dialed_extension}@${domain_name}”/>
<action application=”answer”/>
<action application=”sleep” data=”1000″/>
<action application=”bridge” data=”loopback/app=voicemail:default ${domain_name} ${dialed_extension}”/>
其中,第一个 bridge 是说明去呼叫被叫号码,如果呼叫失败,则 dialplan 继续往下走,依次是
应答
睡一会
进入 voicemail
OK, 我们只需要把最后一个bridge那行改成
<action application=”playback” data=”${originate_disposition}.wav”/>
重新打电话试一下吧,如果被叫忙,则 originate_disposition 变量就是 USER_BUSY ,用户没注册就是 USER_NOT_REGISTERED 之类的,你只需要保证相关目录下有相对应的声音文件即可(如果LOG中提示找不到声音文件的话试试自己录一个)。
当然,呼不通的原因可能有很多,你总不可能录上所有的声音文件是吧,有两种方法:
1) 使用一个 lua (或其它语言) 的脚本
<action appliction=”lua” data=”/tmp/xxx.lua”/>
在 lua 脚本中可以拿到这个 originate_disposition 变量,从而可以使用 if then else 之类的逻辑播放各种声音文件。
2) 当然,如果你脚本也不想编辑的话,实现上 FreeSWITCH 的 dialplan 功能是非常强大的,你只需要将呼叫转到播放不同声音文件的 dialplan:
<action application=”transfer” data=”play-cause-${originate_disposition}”/>
然后创建如下 dialplan extension:
<condition field=”destination_number” expression=”^play-cause-USER_BUSY$”> <action application=”playback” “/tmp/sounds/user-busy.wav”/> </condition>
<condition field=”destination_number” expression=”^play-cause-USER_NOT_REGISTERED$”> <action application=”playback” “/tmp/sounds/user-not-registered.wav”/> </condition>
<condition field=”destination_number” expression=”^play-cause0(.*)$”> <!– for all other reasons, play this file –> <action application=”log” data=”WARNING hangup cause: $1″/> <action application=”playback” “/tmp/sounds/unknown-error.wav”/> </condition>
小结:
当然,能播放上面的声音文件还有一个前提,就是在第一个 bridge 前面要有以下两行:
<action application=”set” data=”hangup_after_bridge=true”/> <action application=”set” data=”continue_on_fail=true”/>
第一行的作用是,如果第一个 bridge 成功了,被叫挂断电话后我们就没有必要再播放该声音了,因此直接挂机。当然这一行可以没有,那么你在后面的 originate_disposition 里如果发现值是 “NORMAL_CLEARING” (正常挂机)的情况再决定是否播放相关语音。
第二行的作用是,如果呼叫失败(空号,拒接等),继续往下走,否则(值为 false 的情况)到这里就挂机了。该变量的值还可以有以下几种,表示只有遇到这几种情况才播放语音,其它的就直接挂机。
<action application=”set” data=”continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION”/>

freeswitch的system命令容易造成安全问题

07.21.2013, freeswitch的system命令容易造成安全问题已关闭评论, freeswitch, by .

转自:http://zdm2008.blog.163.com/blog/static/2049154520135844410517/

 

freeswitch 内置了直接执行系统级命令的api, “bg_system”,”system”如果你为mod_event_socket 或者 mod_erlang_event 开启了远程访问。一定要设置一个强壮的密码,并用防火墙做好限制,不要用root账户运行freeswitch,不要给freeswitch的运行账户修改权限最好是修改下源码关闭这2个api

FreeSWITCH uuid_transfer both转移失败(三方通话),如何解决?

07.21.2013, FreeSWITCH uuid_transfer both转移失败(三方通话),如何解决?已关闭评论, freeswitch, by .

转自:http://www.cnblogs.com/jizha/archive/2013/06/07/uuid_transfer_both.html

 

FreeSWITCH uuid_transfer both转移失败,如何解决?
问题描述:
需要做三方通话,同时将两条腿转移的时候,使用命令uuid_transfer xxxxx -both 总是有一条腿会挂断,为啥?
————————-
正常情况下uuid_transfer xxxxx -both是可以转移成功,但有种情况是例外,就是如果freeswitch采用媒体绕过的话,就是<param name=”inbound-bypass-media” value=”true”/>这个被设置的话,就会导致转移出现异常,应该两条腿一起转的变成只能转一条腿。

解决方法:
取消媒体绕过。
将conf/sip_profiles/internal.xml里面的inbound-bypass-media属性改成false,如下:

<param name=”inbound-bypass-media” value=”true”/>

FreeSWITCH命令:uuid_dual_transfer

07.21.2013, FreeSWITCH命令:uuid_dual_transfer已关闭评论, freeswitch, by .

转自:http://www.cnblogs.com/jizha/p/freeswitch_uuid_dual_transfer.html

 

该篇文章主要介绍FreeSWITCH的API命令uuid_dual_transfer的用法。

命令介绍

该命令用于同时将两条腿进行转移,并且是可以转移到不同的方向。
-USAGE: <A-dest-exten>[/<A-dialplan>][/<A-context>] <B-dest-exten>[/<B-dialplan>][/<B-context>] 如:
uuid_dual_transfer xxxx dial1/XML/default dial2/XML/default
或者,使用默认拨号方案的话,
uuid_dual_transfer xxxx dial1 dial2

应用背景

1、A拨打B,B接听后,A与B正常通话。A为主叫,B为被叫
2、FreeSWITCH的dialpalan/default.xml存在两个拨号方案:dial1和dial2

命令应用

使用下面的命令实现将A转到dial1,将B转到dial2
>uuid_dual_transfer A的uuid dial1 dial2

使用下面的命令实现将B转到dial1,将A转到dial2
uuid_dual_transfer B的uuid dial1 dial2

小结

从上面可以看出,uuid_dual_transfer会先将参数uuid所代表的那条腿转到拨号方案1(dial1)上,再将另一条腿转到拨号方案2(dial2)上。不管uuid所在的那条腿是主叫还是被叫。

国内外VoIP方面的网站收集

07.21.2013, 国内外VoIP方面的网站收集已关闭评论, voip, by .

转自http://www.voip123.cn

  1. http://www.smithonvoip.com/
  2. http://www.asteriskvoipnews.com/
  3. http://www.voip-weblog.com/
  4. http://www.advancedvoip.com/
  5. http://www.voipproviderslist.com/
  6. http://www.voiplowdown.com/
  7. http://www.voipservice.com/
  8. http://www.hackingvoip.com/
  9. http://www.mobilevoipreview.com/
  10. http://www.cliconnect.com/
  11. http://www.snom.com/
  12. http://www.voipplanet.com/
  13. http://www.voipservicedirectory.com/
  14. http://www.voipresource.net/
  15. http://www.c21communications.com/
  16. http://www.voiplogic.com/
  17. http://www.bandcalc.com/
  18. http://www.packetizer.com/
  19. http://www.voip-calculator.com/
  20. http://www.voiplobby.com/
  21. http://voipguides.blogspot.com/
  22. http://www.yealink.com/en/index.asp
  23. http://www.voiptalk.org/products/index.html
  24. http://www.voipcheap.com/en/index.html
  25. http://www.justvoip.com/en/index.html
  26. http://www.voipsupply.com/
  27. http://www.tmcnet.com/voip/
  28. http://www.voipwx.net/
  29. http://www.sipfoundry.org/
  30. http://www.antisip.com/as/
  31. http://www.kamailio.org
  32. http://yate.null.ro/pmwiki/
  33. http://www.iptel.org/ser/
  34. http://research.edm.uhasselt.be/~jori/page/index.php?n=CS.Jrtplib
  35. http://www.iptel.org/~sipsc/ SIP协议场景生成器
  36. http://www.cs.columbia.edu/sip/
  37. http://www.packetizer.com/ipmc/sip/
  38. http://phoenix.labri.fr/documentation/sip/
  39. http://www.sipstone.org/
  40. http://www.sipcenter.com/
  41. http://www.toyz.org/cgi-bin/sipwiki.cgi
  42. http://www.juphoon.com/
  43. http://www.networkworld.com/
  44. http://www.infoworld.com/
  45. http://www.cio.com/
  46. http://www.voipjet.com/
  47. http://www.chayden.net/
  48. http://www.pbxinfo.com/
  49. http://www.3cx.com/
  50. http://www.protocols.com/
  51. http://www.thinkbroadband.com/
  52. http://www.packetizer.com/
  53. http://freshmeat.net/
  54. http://www.voip365.org/
  55.  
  56. http://www.microvoip.com/ 全球IP通信联盟
  57. http://www.chinacie.com.cn/ 中国通信器材网
  58. http://www.tele.com.cn/ 通讯世界
  59. http://www.voip86.net/ VOIP商情网
  60.  
  61. http://www.vlan9.com/ Cisco及华为网络技术
  62. http://www.openvoip.cn/ 网络通信服务网
  63. http://www.ip1688.com/ 天源VOIP信息网
  64. http://www.elecfans.com/ 电子发烧友
  65. http://www.chinavoipnet.com/ 中国VOIP网
  66. http://www.voipyeah.com/ 网话易
  67. http://www.21ctn.com/ 通信机世界
  68. http://www.tele.com.cn/ 通讯世界
  69. http://www.tongxin123.com/ 通信网址大全
  70.  
  71.  
  72. http://www.ctm.com.cn/ 通信市场
  73. http://www.226e.net/ 企业信息化联盟
  74. http://www.soidc.net IDC信息专家
  75. http://hi.baidu.com/wanhongnan/blog/item/519ca001589efe01738da54b.html