Freeswitch:如何指定来电显示号码
首先,指定始发时的主叫号码
在正常情况下,如果您在freeswitch控制台中,请输入以下命令:
当呼叫始发用户/1000 &park时,如果 ......
一、origiante时指定主叫号码
正常情况下,如果在freeswitch控制台,输入类似下面命令:
originate user/1000 &park被叫收到振铃提示时,显示的号码类似下面这样

如果希望指定主叫的显示名称及号码,可以加参数:
originate {origination_caller_id_name=jimmy,origination_caller_id_number=139****666}user/1000 &echo
二、bridge时指定主叫号码
bridge时,同样可以指定类似参数,先来一个不加任何参数的示例:
originate user/1000 &bridge(user/1002)
可以看到,bridge后,被叫弹出的对话框中,直接显示了原始的主叫号,在bridge命令中加上参数后:
originate user/1000 &bridge({origination_caller_id_name=jimmy,origination_caller_id_number=139****666}user/1002)
注:根据官方文档的说法,effective_caller_id_name/effective_caller_id_number这2个参数,也是类似的效果,但是好象并非对所有版本都生效,参考下图,1.6.18版上并未生效


三、ESL outbound外联模式下指定
public void onConnect(Context context, EslEvent eslEvent) { try { Execute exe = new Execute(context, ''); exe.answer(); // exe.export('effective_caller_id_name', 'jimmy', true); // exe.export('effective_caller_id_number', '111111', true); exe.export('origination_caller_id_name', 'yjmyzz', true); exe.export('origination_caller_id_number', '139****7777', true); exe.bridge('user/1000'); } catch (ExecuteException e) { e.printStackTrace(); } finally { context.closeChannel(); } }
参考:
https://freeswitch.org/confluence/display/FREESWITCH/effective_caller_id_name
https://freeswitch.org/confluence/display/FREESWITCH/effective_caller_id_number
作者:菩提树下的杨过
出处:http://yjmyzz.cnblogs.com
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。