summaryrefslogtreecommitdiff
path: root/src/pbx_api.erl
blob: 9d76ad4f1092784719c554b250b5aef5af50edce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-module(pbx_api).
-include("opcodes.hrl").

-export([ext/0, co/0, snapshot/1, monitor/1, button/1, dial/2, fco/1, type/0]).

ext() ->
	pbx_pdu:notify({invoke, ?ESCAPE,
			pbx_escape:lines(station)}).

co() ->
	pbx_pdu:notify({invoke, ?ESCAPE,
			pbx_escape:lines(networkInterface)}).

snapshot(Device) ->
	pbx_pdu:notify({invoke, ?SNAPSHOT,
			pbx_snapshot:encode({dialingNumber, Device})}).

button(Device) ->
	pbx_pdu:notify({invoke, ?BUTTON,
			pbx_button:encode({dialingNumber, Device})}).

monitor(Device) ->
	pbx_pdu:notify({invoke, ?MONITOR,
			pbx_monitor:encode({dialingNumber, Device})}).

dial(From, To) ->
	pbx_pdu:notify({invoke, ?MAKECALL,
			pbx_dial:encode({dialingNumber, From},
					{dialingNumber, To})}).

fco(Device) ->
	pbx_pdu:notify({invoke, ?ESCAPE,
			pbx_escape:deviceData({dialingNumber, Device})}).

type() ->
	pbx_pdu:notify({invoke, ?ESCAPE,
			pbx_escape:pbxType()}).