freeswitch: 如何指定主叫显示号码

一、origiante时指定主叫号码

正常情况下,如果在freeswitch控制台,输入类似下面 命令:

originate user/1000 &park

被叫收到振铃提示时,显示的号码类似下面这样

如果希望指定主叫的显示名称及号码,可以加参数:

1
originate {origination_caller_id_name=jimmy,origination_caller_id_number=139****666}user/1000 &echo

 

二、bridge时指定主叫号码

bridge时,同样可以指定类似参数,先来一个不加任何参数的示例:

1
originate user/1000 &bridge(user/1002)

 

可以看到,bridge后,被叫弹出的对话框中,直接显示了原始的主叫号,在bridge命令中加上参数后:

1
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

posted @   阿风小子  阅读(540)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示