0

在我挂断内部固定电话后,我试图拨打一个手机号码,但它不起作用,我不知道发生了什么......这是我正在尝试使用的代码,但它不工作。固定电话正常调用,但手机不...

var host = "somehost";
Int32 port = someport;
var user = "someuser";
var password = "somepassword";
var manager = new ManagerConnection(host, port, user, password);
manager.Login();

var originateAction = new OriginateAction();
var originateResponse = new ManagerResponse();

originateAction.Channel = "SIP/1040";
originateAction.CallerId = "1040";
originateAction.Context = "from-pstn";
originateAction.Exten = "SIP/CH_CABLECOM_BSL_OUT/somephonenumber";
originateAction.Priority = "1";
originateAction.Timeout = 30000;
originateAction.Async = true;

originateResponse = manager.SendAction(originateAction);
4

1 回答 1

0

我解决了。需要做的是编辑星号服务器上的 extensions.conf 并添加上下文。所以只需将 this-> 添加到 extensions.conf

[outbound-context]
exten => _.,1,Dial(SIP/{NAME OF YOUR PROVIDER HERE}/${EXTEN})

并且originAction 需要看起来像这样:

originateAction.Channel = "SIP/1040";
originateAction.CallerId = "1040";
originateAction.Context = "outbound-context";
originateAction.Exten = "somephonenumber";
originateAction.Priority = "1";
originateAction.Timeout = 30000;
originateAction.Async = true;

originateResponse = manager.SendAction(originateAction);

这就是它的全部

于 2015-01-22T12:56:18.367 回答