summaryrefslogtreecommitdiff
path: root/src/pbx_api.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/pbx_api.erl')
-rw-r--r--src/pbx_api.erl33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/pbx_api.erl b/src/pbx_api.erl
index e5fa5fd..9d76ad4 100644
--- a/src/pbx_api.erl
+++ b/src/pbx_api.erl
@@ -4,32 +4,35 @@
-export([ext/0, co/0, snapshot/1, monitor/1, button/1, dial/2, fco/1, type/0]).
ext() ->
- pbx_conn:send(pbx_rose:invoke(?ESCAPE,
- pbx_escape:lines(station))).
+ pbx_pdu:notify({invoke, ?ESCAPE,
+ pbx_escape:lines(station)}).
co() ->
- pbx_conn:send(pbx_rose:invoke(?ESCAPE,
- pbx_escape:lines(networkInterface))).
+ pbx_pdu:notify({invoke, ?ESCAPE,
+ pbx_escape:lines(networkInterface)}).
snapshot(Device) ->
- pbx_conn:send(pbx_rose:invoke(?SNAPSHOT,
- pbx_snapshot:encode({dialingNumber, Device}))).
+ pbx_pdu:notify({invoke, ?SNAPSHOT,
+ pbx_snapshot:encode({dialingNumber, Device})}).
button(Device) ->
- pbx_conn:send(pbx_rose:invoke(?BUTTON,
- pbx_button:encode({dialingNumber, Device}))).
+ pbx_pdu:notify({invoke, ?BUTTON,
+ pbx_button:encode({dialingNumber, Device})}).
monitor(Device) ->
- pbx_conn:send(pbx_rose:invoke(?MONITOR,
- pbx_monitor:encode({dialingNumber, Device}))).
+ pbx_pdu:notify({invoke, ?MONITOR,
+ pbx_monitor:encode({dialingNumber, Device})}).
dial(From, To) ->
- pbx_conn:send(pbx_rose:invoke(?MAKECALL,
- pbx_dial:encode({dialingNumber, From}, {dialingNumber, To}))).
+ pbx_pdu:notify({invoke, ?MAKECALL,
+ pbx_dial:encode({dialingNumber, From},
+ {dialingNumber, To})}).
fco(Device) ->
- pbx_conn:send(pbx_rose:invoke(?ESCAPE,
- pbx_escape:deviceData({dialingNumber, Device}))).
+ pbx_pdu:notify({invoke, ?ESCAPE,
+ pbx_escape:deviceData({dialingNumber, Device})}).
type() ->
- pbx_conn:send(pbx_rose:invoke(?ESCAPE, pbx_escape:pbxType())).
+ pbx_pdu:notify({invoke, ?ESCAPE,
+ pbx_escape:pbxType()}).
+