OpenACD Restful Call Control

90 views
Skip to first unread message

vexe...@aol.com

unread,
May 1, 2012, 9:48:19 AM5/1/12
to OpenACD
Hi. My name is Ian Wesson. I am working on a plugin for OpenACD that
allows for third-party softphone integration via a Restful API. For
example, a softphone could call the URI:

http://localhost:8383/transfer?from=201&to=200

to transfer the call agent 201 is on to agent 200. This should also
(inside of OpenACD) update the agent states for agents 200 and 201 so
that an OACD_Hop plugin would send out updated state changes to
RabbitMQ

The problems I've been running into seem to be that the code in
OpenACD is incomplete for (1) initiating/executing an outbound call,
(2) spying, and (3) transferring.

(Although preferable) I do not find it necessary to always do (1),
(2), and (3) completely through OpenACD, as long as the agent states
are updated in such a way that, say, OACD_Hop recieves the update that
(1), and/or (2), and/or (3) have occured.

Any help on accomplishing this would be greatly appreciated. If it
makes any difference, I plan contributing my code for this back to the
community (if I can get it to work). Here is the bulk of what I have
so far. It is started as a plugin to OpenACD:

http://pastebin.com/KTDTQuPS

Please take a close look at the functions
handle_request("/transfer", Req),
handle_request("/spy" ++ _Rest, Req), and
handle_request("/dial" ++ _Rest, Req)
as those are the functions I need the most help with.

vexe...@aol.com

unread,
May 8, 2012, 12:45:15 PM5/8/12
to OpenACD
We've made some progress in the REST Call Controls. Now we can do the
following API calls from a browser to control the OpenACD agent state.
Note that <username> is the agent username, <password> is the agent
password, <server> is the server the OpenRCC plugin is running on, and
<domain> is the domain the agent's phone is registered to:

Log in: http://<server>:8383/login?username=<username>&password=<password>&domain=<domain>
Go available: http://<server>:8383/set_avail?username=<username>
End wrap-up: http://<server>:8383/end_wrapup?username=<username>
Go released: http://<server>:8383/set_released?username=<username>
Log out: http://<server>:8383/logout?username=<username>

We are now interested in doing the following actions with a logged in
agent(s). They are ordered by priority:

1) Dial an outbound call
2) Transfer the call from one agent to another
3) Spy on an agent (supervisor function)

If you even PARTIALLY know how to do any of the above using OpenACD
and a few logged in agents, please share!

If it makes a difference to anyone, this project will be contributed
back to the community as a open source software.

Here is the source code for the gen_server implementing all the
functions we've created so far. You'll notice the gen_server call
backs go unused. That is because they interfere with the mochiweb
process. This will be updated/removed at a later time:

http://pastebin.com/H4RBNyYk

Micah

unread,
May 14, 2012, 12:32:54 PM5/14/12
to ope...@googlegroups.com
I'm not sure if you are developing against version 1 or 2.  My answers below reflect version 1.

Spy is baked into the agent module (agent:spy/2).  Easiest way to do this is from one agent to another.  There is also a way to set up a supervisor in a non-agent role, which also has a spy/2 function.  That is in the supervisor_web_connection module.

Transfering a media from one agent to another is done via agent:agent_transfer/2.

I notice you're using a similar strategy for the code as what the original agent web connection/agent web listener used.  For a fully restful interface, you may find it more manageable to use webmachine (http://webmachine.basho.com).

MIcah
Reply all
Reply to author
Forward
0 new messages