Asterisk catch a Incoming call and transfer it to a specific exten -
i have been building window form desktop application using c# interfaces asterisk using asterisk.net. first problem catch incoming call , transfer specific exten. first idea using originateaction, when call come, use dial event , catch , use originateaction call specific exten.
redirectaction originateaction = new redirectaction(); originateaction.channel = e.channel; originateaction.context = "default"; originateaction.exten = "203"; originateaction.priority = 1; managerresponse originateresponse = manager.sendaction(originateaction); console.writeline(originateresponse);
but not work wish. second idea using redirectaction:
redirectaction originateaction = new redirectaction(); originateaction.channel = e.channel; originateaction.context = "default"; originateaction.exten = "203"; originateaction.priority = 1; managerresponse originateresponse = manager.sendaction(originateaction); console.writeline(originateresponse);
and not work.
i have find on many websites documents little.
how can solve issue?
thanks!
i suggest using kind of dynamic dialplan instead of "catching" calls reactively. why not use agi script?
essentially, application tells database or other central system when calls matching criteria come in. asterisk runs script setup when calls reach context (such incoming calls), , script routes call dynamically based on inputs given application.
since seem .net, here's .net agi project started: asternet. looks library mentioned, asterisk.net, capable of fast cgi (what agi uses), last release in 2009, whereas asternet active 3 months ago.
i use phpagi kinds of neat acd , call routing stuff in our call center.
for more info on agi, see official docs.
edit: should explain basic call flow terminology (from docs):
- originate: generates outgoing call extension/context/priority or application/data. example: user clicks button, originate call desk phone, when answer call, executes dialplan, or dialplan application.
- redirect: redirect (transfer) call. example: agent , customer talking, manager wants take on call. use redirect "take" call agent , ring manager.
- dial: (in dialplan only, not ami) dial technology/channel specified. note can originate .net application, not dial.
can show event handler code? looks library manager.newchannel += new managereventhandler(new_channel);
Comments
Post a Comment