简体   繁体   English

更改星号来电中的主叫方号码

[英]Changing the caller number in an incoming call in asterisk

I am using asterisk.I have DID in which 4 numbers are mapped(stored in my database) so when user calls to that DID number the call is forwarded to the any one number mapped on that did. 我正在使用星号。我有DID,其中映射了4个数字(存储在我的数据库中),因此当用户呼叫该DID号码时,该呼叫将转发到映射到该数字的任何一个数字。 My problem is that when user calls to DID the one of the four executive receive calls from the DID number not with user number .This is my part of dialplan code the call is routed from another context(not given below) to the direct context 我的问题是,当用户呼叫DID时,四个执行人员之一从DID号码接收呼叫,但没有用户号码。这是我的拨号计划代码的一部分,呼叫从另一个上下文(以下未提供)路由到直接上下文。

[direct]
exten => start,1,noop(######START######)
same => n,mysql(Query resultid ${connid} SELECT number from database);;;DDDDDD
same => n,MYSQL(Fetch fetchid ${resultid} number )
same => n,mysql(clear ${resultid})
same => n,set(__NUMBER=${number})
same => n,dial(DAHDI/g0/0${NUMBER},20,mM(ANSWEREDED))


[macro-ANSWEREDED]
exten => s,1,noop(CALL_ANSWERED)
exten => s,n,Mixmonitor(/recordings/record.wav)

How can i change the number that flashes on executive number(number mapped on DID) to the caller number? 如何将执行号码上闪烁的号码(映射到DID上的号码)更改为呼叫方号码? Thanks in advance. 提前致谢。

1) Every asterisk book have example. 1)每本星号书都有示例。 Doing asterisk coding without reading book - not so nice idea 在不阅读书的情况下进行星号编码-并不是一个好主意

2) callerid can be set like this 2)可以这样设置callerid

same => n,set(__NUMBER=${number})
same => n,set(CALLERID(num)=123445678)
same => n,dial(DAHDI/g0/0${NUMBER},20,mM(ANSWEREDED))

3) If you use pstn dahdi connection(FXO card), that will not work. 3)如果使用pstn dahdi连接(FXO卡),则无法使用。 If you use digital connection, it can work if provider support that. 如果您使用数字连接,则在提供商支持的情况下可以使用。

4) Use of app_mysql is depricated. 4)描述了app_mysql的使用。 Use func_odbc or realtime. 使用func_odbc或实时。

5) Use of mixmonitor inside on-call macro is extremly bad practice. 5)在调用宏中使用mixmonitor绝对是一种不好的做法。 Use mixmonitor with 'b' option before call out. 呼出之前,请将mixmonitor与“ b”选项一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM