Controlling calls with mod_event_socket
I have a simple Asterisk AGI based to translate to Freeswitch and want to use mod_event_socket to implement. The first part is whether the extension making the call is active. In the AGI it checks the database whether the extension is supposed to be on, and skips to the end of the dial plan if it is not. The second part is to check the destination, select the gateway to call, and dial through with an API command or whatever is best suited. If I use an outbound event socket which events should I filter for?
From reading the docs it looks once the call is parked and the event shows up, I either hangup the call, or unpark it and bridge via a gateway.
The wiki page http://wiki.freeswitch.org/wiki/Event_Socket_Outbound gives an example like this. sendmsg call-command: execute execute-app-name: bridge execute-app-arg: {ignore_early_media=true}sofia/gateway/myGW/177808 event-lock: true The api command list produced by api show does not contain a bridge command, but has a uuid_bridge command. Is that the command to use? Another wiiki example uses this: api originate sofia/mydomain.com/ext@yourvsp.com 1000 , which appears to be another method. I just need some info about the options available and how to implement them. -- Frank Church ======================= http://devblog.brahmancreations.com
All the uuid_xxx api are from mod_commands and execute *OUT* of a channel. What you are looking for called app (v.s. api) which execute "IN" a channel(think about, the b-leg) http://wiki.freeswitch.org/wiki/Mod_dptools 2010/4/25 Frank Church <vfclists@googlemail.com>:
I have a simple Asterisk AGI based to translate to Freeswitch and want to use mod_event_socket to implement.
The first part is whether the extension making the call is active. In the AGI it checks the database whether the extension is supposed to be on, and skips to the end of the dial plan if it is not.
The second part is to check the destination, select the gateway to call, and dial through with an API command or whatever is best suited.
If I use an outbound event socket which events should I filter for?
From reading the docs it looks once the call is parked and the event shows up, I either hangup the call, or unpark it and bridge via a gateway.
The wiki page http://wiki.freeswitch.org/wiki/Event_Socket_Outbound gives an example like this.
sendmsg call-command: execute execute-app-name: bridge execute-app-arg: {ignore_early_media=true}sofia/gateway/myGW/177808 event-lock: true
The api command list produced by api show does not contain a bridge command, but has a uuid_bridge command. Is that the command to use?
Another wiiki example uses this: api originate sofia/mydomain.com/ext@yourvsp.com 1000 , which appears to be another method.
I just need some info about the options available and how to implement them.
-- Frank Church
======================= http://devblog.brahmancreations.com
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Blog: http://www.dujinfang.com Proj: http://www.freeswitch.org.cn
Throw a copy of that AGI script up on pastebin and let us take a look at it. We should be able to assist you in finding the right event_socket stuff to get you going. -MC On Sat, Apr 24, 2010 at 12:37 PM, Frank Church <vfclists@googlemail.com>wrote:
I have a simple Asterisk AGI based to translate to Freeswitch and want to use mod_event_socket to implement.
The first part is whether the extension making the call is active. In the AGI it checks the database whether the extension is supposed to be on, and skips to the end of the dial plan if it is not.
The second part is to check the destination, select the gateway to call, and dial through with an API command or whatever is best suited.
If I use an outbound event socket which events should I filter for?
From reading the docs it looks once the call is parked and the event shows up, I either hangup the call, or unpark it and bridge via a gateway.
The wiki page http://wiki.freeswitch.org/wiki/Event_Socket_Outbound gives an example like this.
sendmsg call-command: execute execute-app-name: bridge execute-app-arg: {ignore_early_media=true}sofia/gateway/myGW/177808 event-lock: true
The api command list produced by api show does not contain a bridge command, but has a uuid_bridge command. Is that the command to use?
Another wiiki example uses this: api originate sofia/mydomain.com/ext@yourvsp.com 1000 , which appears to be another method.
I just need some info about the options available and how to implement them.
-- Frank Church
======================= http://devblog.brahmancreations.com
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
http://pastebin.freeswitch.org/12801 The AGI first tests if the management system is running checking the uptime table, then it checks whether the extension making the call is permitted, then allows the call to proceed into the dial plan. This version is setup for a single outbound provider. I want to extend the freeswitch version dial multiple providers in case of failure. Thanks Frank. On 25 April 2010 07:02, Michael Collins <msc@freeswitch.org> wrote:
Throw a copy of that AGI script up on pastebin and let us take a look at it. We should be able to assist you in finding the right event_socket stuff to get you going. -MC
On Sat, Apr 24, 2010 at 12:37 PM, Frank Church <vfclists@googlemail.com> wrote:
I have a simple Asterisk AGI based to translate to Freeswitch and want to use mod_event_socket to implement.
The first part is whether the extension making the call is active. In the AGI it checks the database whether the extension is supposed to be on, and skips to the end of the dial plan if it is not.
The second part is to check the destination, select the gateway to call, and dial through with an API command or whatever is best suited.
If I use an outbound event socket which events should I filter for?
From reading the docs it looks once the call is parked and the event shows up, I either hangup the call, or unpark it and bridge via a gateway.
The wiki page http://wiki.freeswitch.org/wiki/Event_Socket_Outbound gives an example like this.
sendmsg call-command: execute execute-app-name: bridge execute-app-arg: {ignore_early_media=true}sofia/gateway/myGW/177808 event-lock: true
The api command list produced by api show does not contain a bridge command, but has a uuid_bridge command. Is that the command to use?
Another wiiki example uses this: api originate sofia/mydomain.com/ext@yourvsp.com 1000 , which appears to be another method.
I just need some info about the options available and how to implement them.
-- Frank Church
======================= http://devblog.brahmancreations.com
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Frank Church ======================= http://devblog.brahmancreations.com
Looks pretty straight forward. The biggest hurtle is design. From the posted code it's invoked on a per call basis. Quicker to write but not ideal if you want to scale it up. You could do similar in FS too by embed scripting or a daemon that catches any call to a certain extension regex and applies your logic. outbound event socket would work too if you wanted to stick with PHP and reuse most of what you have. http://wiki.freeswitch.org/wiki/PHP_ESL (I wrote that page so any questions/suggestions are welcome.) -- W PS: sorry for any typos but it's getting a bit late (3:38am)
On 25 April 2010 08:39, William Suffill <william.suffill@gmail.com> wrote:
Looks pretty straight forward. The biggest hurtle is design. From the posted code it's invoked on a per call basis. Quicker to write but not ideal if you want to scale it up. You could do similar in FS too by embed scripting or a daemon that catches any call to a certain extension regex and applies your logic.
After some reading outbound sockets seem to be the way to go. Can an outbound socket return to the dial plan after setting some variables during its execution, so that the dialplan can work as normal? It is what I prefer. The call volumes are not that high and the controlling program is written in ObjectPascal, making performance even less of a problem The original deployment run on an Asterisk VM but switching to Freeswitch means having the VoIP engine a Windows one as well.
outbound event socket would work too if you wanted to stick with PHP and reuse most of what you have. http://wiki.freeswitch.org/wiki/PHP_ESL (I wrote that page so any questions/suggestions are welcome.)
-- W
PS: sorry for any typos but it's getting a bit late (3:38am)
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Frank Church ======================= http://devblog.brahmancreations.com
2010/4/25 Frank Church <vfclists@googlemail.com>:
On 25 April 2010 08:39, William Suffill <william.suffill@gmail.com> wrote:
Looks pretty straight forward. The biggest hurtle is design. From the posted code it's invoked on a per call basis. Quicker to write but not ideal if you want to scale it up. You could do similar in FS too by embed scripting or a daemon that catches any call to a certain extension regex and applies your logic.
After some reading outbound sockets seem to be the way to go.
Can an outbound socket return to the dial plan after setting some variables during its execution, so that the dialplan can work as normal? It is what I prefer.
Yes, you can transfer to a dialplan extension
The call volumes are not that high and the controlling program is written in ObjectPascal, making performance even less of a problem
The original deployment run on an Asterisk VM but switching to Freeswitch means having the VoIP engine a Windows one as well.
outbound event socket would work too if you wanted to stick with PHP and reuse most of what you have. http://wiki.freeswitch.org/wiki/PHP_ESL (I wrote that page so any questions/suggestions are welcome.)
-- W
PS: sorry for any typos but it's getting a bit late (3:38am)
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Frank Church
======================= http://devblog.brahmancreations.com
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Blog: http://www.dujinfang.com Proj: http://www.freeswitch.org.cn
participants (4)
-
Frank Church
-
Michael Collins
-
Seven Du
-
William Suffill