此种方法能实现,其中默认转移后按0,可进入三方通话。

用transfer只能实现代接转移。

Misc. Dialplan Tools att xfer

From FreeSWITCH Wiki

Jump to: navigation, search

Contents

[hide]

* 1 Attended Transfer

o 1.1 Example1

o 1.2 Example2

* 2 See Also

Attended Transfer

Make an attended transfer.

Usage:

att_xfer <channel_url>

Example1

Make a dialplan feature which read the number to make an attended transfer.

<extension name="att_xfer">

<condition field="destination_number" expression="^att_xfer$">

<action application="read" data="3 4 sounds/getdigits.wav attxfer_callthis 30000 #"/>

<action application="att_xfer" data="sofia/default/${attxfer_callthis}"/>

</condition> </extension>

Then bind this feature to DTMF 3.

<action application="bind_meta_app" data="3 a a execute_extension::att_xfer XML features"/>

During call press *3 to activate the feature. Feed it the number then it will make the call.

If you hang up (after the other leg answered and you decided what to do), then it will transfer the call and bridge them together.

If the other leg hang up thus indicating it doesn't want the transfer then you get it back.

If the other leg is a voicemail or doesn't answered you can hangup that leg by pressing DTMF # (fixed in r14438)

If you press DTMF 0 then it will convert it to a three-way, hangup and complete the transfer.

See also bind_meta_app and read

Example2

In your dialplan add bind_meta_app key that will transfer the call to the extensions that will execute the att_xfer application.

Example:

<extension name="local_number">

<condition field="destination_number" expression="^(\d{3})$">

<action application="set" data="dialed_extension=$1"/>

<action application="export" data="dialed_extension=$1"/>

<action application="bind_meta_app" data="1 b s execute_extension::attented_xfer XML features"/>

<action application="set" data="transfer_ringback=$${hold_music}"/>

<action application="set" data="call_timeout=10"/>

<action application="set" data="hangup_after_bridge=true"/>

<action application="bridge" data="user/${dialed_extension}@${domain_name}"/>

</condition>

</extension>

In the features.xml add the extensions attended_xfer. The extensions below first waits for input from the user (30sec) and then makes attended transfer to the entered extension.

Example:

<extension name="attented_xfer">

<condition field="destination_number" expression="^attented_xfer$">

<action application="set" data="continue_on_fail=true"/>

<action application="read" data="3 4 ivr/ivr-enter_ext.wav attxfer_callthis 30000 #"/>

<action application="set" data="origination_cancel_key=#"/>

<action application="att_xfer" data="user/${attxfer_callthis}@${domain_name}"/>

</condition>

</extension>

From revision 14650, there is new parameter that can be set - origination_cancel_key. This feature is used when you want to cancel a transfer and to return to the first caller.

Feature code  Purpose  When to use

0  it will convert the call to three-way conference  After the last party answers the call

#  to hangup the call and to initiate the transfer  After the last party answers the call

*  it will hangup the B leg and bridge A to C (fixed in r15013)  After the last party answers the call

#  it will cancel the call and will return you the the caller  Before the answer of the call by the last party See Also

*********************我们先看execute_extension的用法

You can execute an extension from within another extension with this dialplan application.

execute_extension executes an extension like a macro then returns where transfer actually goes to the new extension instantly. When you don't need to do anything else use transfer and exit what you are doing and the channel goes back to the dialplan

execute_extension will keep the current scope and build a one time extension, execute it, and return right back to where it was called from.

The transfer actually alters the channels state, so if you are in a script you should exit the script as soon as you call transfer.

Usage

<action application="execute_extension" data="extension [dialplan] [context]"/>

If you do not specify the dialplan and context, it defaults to the current one. Please note that the extension parameter indicates a value that will be matched by dialplan_hunt() as a destination_number. It will not match on the extension's name= value. See the is_transfer example below on how to match on a name.

Examples

<extension name="hold_music">

<condition field="destination_number" expression="^9999$"/>

<condition field="${sip_has_crypto}" expression="^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$">

<action application="answer"/>

<action application="execute_extension" data="is_secure XML features"/>

<action application="playback" data="$${moh_uri}"/>

<anti-action application="answer"/>

<anti-action application="playback" data="$${moh_uri}"/>

</condition>

</extension>

Another example is in features.xml:

<extension name="dx">

<condition field="destination_number" expression="^dx$">

<action application="answer"/>

<action application="read" data="11 11 'tone_stream://%(10000,0,350,440)' digits 5000 #"/>

<action application="execute_extension" data="is_transfer XML features"/>

</condition>

</extension>

<extension name="is_transfer">

<condition field="destination_number" expression="^is_transfer$"/>

<condition field="${digits}" expression="^(\d+)$">

<action application="transfer" data="-bleg ${digits} XML default"/>

<anti-action application="eval" data="w00t"/>

</condition>

</extension>

************************************第二read的用法

Read DTMF (touch-tone) digits.

Usage

read <min> <max> <sound file> <variable name> <timeout> <terminators>

Parameters

min = Minimum number of digits to fetch.

max = Maximum number of digits to fetch.

sound file = Sound file to play before digits are fetched.

variable name = Channel variable that digits should be placed in.

timeout = Number of milliseconds to wait on each digit

terminators = Digits used to end input if less than <min> digits have been pressed. (Typically '#')

Examples

Read and playback digits. In this example 400 is the destination number min digits 0 max 10 with # as a terminator. The timeout argument is an inter-digit timeout

<extension name="Read Example">

<condition field="destination_number" expression="^400$">

<action application="answer"/>

<action application="sleep" data="1"/>

<action application="read" data="0 10 $${base_dir}/sounds/en/us/callie/conference/8000/conf-pin.wav res 10000 #"/>

<action application="phrase" data="spell,${res}"/>

<action application="hangup"/>

</condition>

</extension>

You can also have multiple terminators just comma separate them.

<extension name="Read Example">

<condition field="destination_number" expression="^400$">

<action application="answer"/>

<action application="sleep" data="1"/>

<action application="read" data="0 10 $${base_dir}/sounds/en/us/callie/conference/8000/conf-pin.wav res 10000 #,*"/>

<action application="phrase" data="spell,${res}"/>

<action application="hangup"/>

</condition>

</extension>

**************************************************第三bind meta app按键转移的用法

Misc. Dialplan Tools bind meta app

From FreeSWITCH Wiki

Jump to: navigation, search

Contents [hide]

1 Description

2 Usage

3 Examples

4 Feature update

5 See Also

Description

bind_meta_app binds an application to the specified call leg(s). During a bridged call, the DTMF sequence on the bound call leg will trigger the execution of the application. The call leg that is not bound will not hear the DTMF sequence being dialed. Once bound to a call leg, the application binding will survive for the lifetime of the call leg.

Important: This feature will not work when bypass_media=true, because the endpoints will be communicating directly with each other, and the key presses will not be sent to FreeSWITCH.

Key can also only be 0-9 ... * or # will revert to 0

Usage

<action application="bind_meta_app" data="KEY LISTEN_TO RESPOND_ON APPLICATION[::PARAMETERS]"/>

Explanation of parameters

KEY is the button you want to respond to after the * button is pressed. If you wanted to respond to *1, you would put 1 in place of KEY. You are limited to a single digit.

LISTEN_TO is which call leg(s) to listen on. Acceptable parameters are a, b or ab.

RESPOND_ON is which call leg(s) to perform the action on. Acceptable parameters are s or o. s means same and o means opposite in cases where you use both a and b

APPLICATION is which application you want to execute.

PARAMETERS are the arguments you want or need to provide to the

APPLICATION. You must put :: after the APPLICATION for these arguments to be handled properly.

Examples

<action application="bind_meta_app" data="1 a s execute_extension::dx XML features"/>

When *1 is pressed on the A call leg, the execute_extension application is executed upon the A call leg.

The extension that is executed is the dx extension in the XML dialplan under the features context.

<action application="bind_meta_app" data="2 a s

record_session::$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>

When *2 is pressed on the A call leg, the session audio starts recording on the A call leg. It saves the audio to the $$(base_dir)/recordings/${caller_id_number}.$(strftime(%Y-%m-%d-%H-%M-%S)}.wav file. (i.e. /usr/local/freeswitch/recordings/1234.2008-04-09-10-11-12.wav). Important note: In default diaplan example record_session is listening for DMTF on the B leg, so callee can only activate the recording.

Feature update

As of July 31st you may now customize the meta key. It will default to '*' but you can use the bind_meta_key channel variable to select a different meta key:

<action application="set" data="bind_meta_key=#"/> <action application="bind_meta_app" data="2 a s foo"/>

See Also

**************************************************第四att xfer的用法

Misc. Dialplan Tools att xfer

From FreeSWITCH Wiki

Jump to: navigation, search

Contents [hide]

1 Attended Transfer

1.1 Example1

1.2 Example2

2 See Also

Attended Transfer

Make an attended transfer.

Usage:

att_xfer <channel_url>

Example1

Make a dialplan feature which read the number to make an attended transfer.

<extension name="att_xfer">

<condition field="destination_number" expression="^att_xfer$">

<action application="read" data="3 4 sounds/getdigits.wav attxfer_callthis 30000 #"/>

<action application="att_xfer" data="sofia/default/${attxfer_callthis}"/>

</condition>

</extension>

Then bind this feature to DTMF 3.

<action application="bind_meta_app" data="3 a a execute_extension::att_xfer XML features"/>

During call press *3 to activate the feature. Feed it the number then it will make the call.

If you hang up (after the other leg answered and you decided what to do), then it will transfer the call and bridge them together.

If the other leg hang up thus indicating it doesn't want the transfer then you get it back.

If the other leg is a voicemail or doesn't answered you can hangup that leg by pressing DTMF # (fixed in r14438)

If you press DTMF 0 then it will convert it to a three-way, hangup and complete the transfer.

See also bind_meta_app and read

Example2

In your dialplan add bind_meta_app key that will transfer the call to the extensions that will execute the att_xfer application.

Example:

<extension name="local_number">

<condition field="destination_number" expression="^(\d{3})$">

<action application="set" data="dialed_extension=$1"/>

<action application="export" data="dialed_extension=$1"/>

<action application="bind_meta_app" data="1 b s execute_extension::attented_xfer XML features"/>

<action application="set" data="transfer_ringback=$${hold_music}"/>

<action application="set" data="call_timeout=10"/>

<action application="set" data="hangup_after_bridge=true"/>

<action application="bridge" data="user/${dialed_extension}@${domain_name}"/>

</condition>

</extension>

In the features.xml add the extensions attended_xfer. The extensions below first waits for input from the user (30sec) and then makes attended transfer to the entered extension.

Example:

<extension name="attented_xfer">

<condition field="destination_number" expression="^attented_xfer$">

<action application="set" data="continue_on_fail=true"/>

<action application="read" data="3 4 ivr/ivr-enter_ext.wav attxfer_callthis 30000 #"/>

<action application="set" data="origination_cancel_key=#"/>

<action application="att_xfer" data="user/${attxfer_callthis}@${domain_name}"/>

</condition>

</extension>

From revision 14650, there is new parameter that can be set - origination_cancel_key. This feature is used when you want to cancel a transfer and to return to the first caller.

Feature code   Purpose                                                            when to use

0           it will convert the call to three-way conference                After the last party answers the call

#           to hangup the call and to initiate the transfer                 After the last party answers the call

*           it will hangup the B leg and bridge A to C (fixed in r15013)    After the last party answers the call

#           it will cancel the call and will return you the the caller      Before the answer of the call

by the last party

See Also

freeswitch三方通话配置的更多相关文章

  1. FreeSwitch安装和配置记录

    安装FreeSwitch 主要示例,下面的命令: git clone -b v1.2.stable git://git.freeswitch.org/freeswitch.git cd freeswi ...

  2. freeswitch的网关配置

    vim  /usr/local/freeswitch/conf/sip_profiles/external/weihu1.xml 1 <!-- 点对点式 --> 2 <!-- 3 & ...

  3. FreeSWITCH部署与功能配置

    一.FreeSWITCH服务部署 1.wget http://www.freeswitch.org.cn/Makefile && make install 2.cd freeswitc ...

  4. Freeswitch配置之sofia

    SIP模块 - mod_sofia SIP 模块是 FreeSWITCH的主要模块. 在 FreeSWITCH中,实现一些互联协议接口的模块称为 Endpoint.FreeSWITH支持很多的 End ...

  5. 手把手教你部署验证freeswitch(避免踩坑)

    前言:请各大网友尊重本人原创知识分享,谨记本人博客:南国以南i 介绍:freeswitch可集成ASR(语音识别)和TTS(文本转语音)创建智能电话机器人和用户通话,可用于问卷调查,自动催缴等业务,电 ...

  6. 《FreeSWITCH: VoIP实战》:SIP 模块 - mod_sofia

    SIP 模块是 FreeSWITCH 的主要模块,所以,值得拿出专门一章来讲解. 在前几章时里,你肯定见过几次 sofia 这个词,只是或许还不知道是什么意思.是这样的,Sofia-SIP 是由诺基亚 ...

  7. freeswitch对话机320信令在专有网络情况下不生效的处理

    昨天处理客户提出的话机设置呼叫转移不生效的问题, 经过多次测试发现这个问题与freeswitch版本和配置没有关系, 后来分析freeswitch正常转移日志与不转移日志发现不转移的日志少了一行 Re ...

  8. freeswitch与外部网关链接

    我建了一个 Freeswitch 内核研究 交流群, 45211986, 欢迎加入, 另外,提供基于SIP的通信服务器及客户端解决方案, 承接 sip/ims 视频客户端开发,支持接入sip软交换,i ...

  9. IT战略规划咨询

    目录 1IT战略规划微咨询简介 2IT战略的意义 3服务模式 4IT战略规划焦点问题 5IT战略规划步骤 6服务提供方微咨询网 7微咨询价值 8微咨询服务方式 9IT工作规划与IT战略规... IT战 ...

随机推荐

  1. Cognos报表验证(添加字段)

    1.打开后台Cognos 链接远程后台Cognos 2.打开要验证的报表 3.给右边的sql语句加个空格或者换行点击验证 4.查看业务视图中是否已经添加该字段 双击维度或者度量(添加字段所在的分类) ...

  2. 几个windows使用小技巧

    windows使用技巧 保存网页上图片时,可以按住左键把图片拖到右下角(win+D,双屏幕直接拖动)然后就可以放在桌面啦 放大镜-->Win+加号或者减号(放大或缩小).Win + Esc(退出 ...

  3. 51nod 1031 骨牌覆盖

    基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题  收藏  关注 在2*N的一个长方形方格中,用一个1*2的骨牌排满方格.   问有多少种不同的排列方法.   例如: ...

  4. tac命令

    tac——显示文件内容(反列显示) 命令所在路径:/usr/bin/tac 示例1: # tac /etc/hosts 反列显示/etc/目录下hosts文件内容 ☛适合查看内容较短的文件

  5. 数据库连接池proxool的两种使用方式

    数据库连接池可以通过两种方式来应用,针对web应用和非web应用而来. 非web应用的数据库连接池配置 第一种方式:工厂类 非web应用可以使用工厂模式将数据库连接创建封装在一个工具类中,工具类中又使 ...

  6. Convert Sorted List to Balanced Binary Search Tree leetcode

    题目:将非递减有序的链表转化为平衡二叉查找树! 参考的博客:http://blog.csdn.net/worldwindjp/article/details/39722643 利用递归思想:首先找到链 ...

  7. PHP13 会话控制

    学习要点 会话控制使用的意义 用户跟踪方式 Cookie的设置.读取以及删除 Session的设置.读取以及删除 自定义session处理方式 会话控制 什么是会话控制 实现服务器跟踪同一个客户端的连 ...

  8. IOI2008 Island 岛屿

    题目描述: bz luogu 题解: 裸的基环树直径. 代码: #include<queue> #include<cstdio> #include<cstring> ...

  9. Centos 7 编译php 7.2.10

    步骤一:安装依赖 yum install -y wget gcc gcc-c++ gd-devel zlib-devel libjpeg-devel libpng-devel libiconv-dev ...

  10. 测试linux服务器带宽

    测试准备 1. 计划考量参数 TCP上传数据带宽 TCP下载数据带宽 UDP上传带宽 UDP下载带宽 多并发支持 稳定性 Tcp通讯网络延迟(小包:32.中包1k.大包1M) UDP通讯网络延迟(小包 ...