I'm trying to call a cell phone number after i hangup on an internal fixed phone, but it doesn't work, i don't know what is going on... This is the code that i was trying with, but it doesn'work. The fixed phone is called like it should, but the cell phone isn't...
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);
I solved it. What needs to be done is to edit the extensions.conf on asterisk server and add a context. So just add to extensions.conf this->
and originateAction needs to look like this:
And that's all there is to it