已
挂断内部固定电话后,我试图拨打手机号码,但它不起作用,我不知道发生了什么......这是我正在尝试的代码,但它不起作用。固定电话按原样调用,但手机不是...
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);
我解决了。需要做的是在星号服务器上编辑扩展名.conf并添加上下文。所以只需添加到扩展.conf this->
[outbound-context]
exten => _.,1,Dial(SIP/{NAME OF YOUR PROVIDER HERE}/${EXTEN})
和发起操作需要如下所示:
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);
仅此而