summaryrefslogtreecommitdiff
path: root/docs/av_api.md
diff options
context:
space:
mode:
authorPeter Maatman <blackwolf12333@gmail.com>2013-11-01 11:52:31 +0100
committerPeter Maatman <blackwolf12333@gmail.com>2013-11-01 11:52:31 +0100
commit9ff287569ea35cce4d6d0cd37634aec97cbee90c (patch)
treeb5c329e7da4c59bdd6b9723bed0e0b4f32284b62 /docs/av_api.md
parent6c0cfd08e6aca43c2e7b4a381a60d73d1b2065f1 (diff)
Update av_api.md
add some code blocks in the markup
Diffstat (limited to 'docs/av_api.md')
-rw-r--r--docs/av_api.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/av_api.md b/docs/av_api.md
index a1a8b4c4..bd67b078 100644
--- a/docs/av_api.md
+++ b/docs/av_api.md
@@ -16,12 +16,17 @@ everything will be started within a mesenger.
16Phone requires one msi session and two rtp sessions ( one for audio and one for 16Phone requires one msi session and two rtp sessions ( one for audio and one for
17video ). 17video ).
18 18
19```
19msi_session_t* msi_init_session( void* _core_handler, const uint8_t* _user_agent ); 20msi_session_t* msi_init_session( void* _core_handler, const uint8_t* _user_agent );
21```
20 22
21initializes msi session. 23initializes msi session.
22Params: 24Params:
25
26```
23void* _core_handler - pointer to an object handling networking, 27void* _core_handler - pointer to an object handling networking,
24const uint8_t* _user_agent - string describing phone client version. 28const uint8_t* _user_agent - string describing phone client version.
29```
25 30
26Return value: 31Return value:
27msi_session_t* - pointer to a newly created msi session handler. 32msi_session_t* - pointer to a newly created msi session handler.
@@ -35,6 +40,7 @@ NOT TO PLACE SOMETHING LIKE LOOPS THAT TAKES A LOT OF TIME TO EXECUTE; every cal
35directly from event loop. You can find examples in phone.c. 40directly from event loop. You can find examples in phone.c.
36 41
37Register callbacks: 42Register callbacks:
43```
38void msi_register_callback_call_started ( MCALLBACK ); 44void msi_register_callback_call_started ( MCALLBACK );
39void msi_register_callback_call_canceled ( MCALLBACK ); 45void msi_register_callback_call_canceled ( MCALLBACK );
40void msi_register_callback_call_rejected ( MCALLBACK ); 46void msi_register_callback_call_rejected ( MCALLBACK );
@@ -47,6 +53,7 @@ void msi_register_callback_recv_ending ( MCALLBACK );
47void msi_register_callback_recv_error ( MCALLBACK ); 53void msi_register_callback_recv_error ( MCALLBACK );
48 54
49void msi_register_callback_requ_timeout ( MCALLBACK ); 55void msi_register_callback_requ_timeout ( MCALLBACK );
56```
50 57
51MCALLBACK is defined as: void (*callback) (void* _arg) 58MCALLBACK is defined as: void (*callback) (void* _arg)
52msi_session_t* handler is being thrown as _arg so you can use that and _agent_handler to get to your own phone handler 59msi_session_t* handler is being thrown as _arg so you can use that and _agent_handler to get to your own phone handler
@@ -54,21 +61,33 @@ directly from callback.
54 61
55 62
56Actions: 63Actions:
64
65```
57int msi_invite ( msi_session_t* _session, call_type _call_type, uint32_t _timeoutms ); 66int msi_invite ( msi_session_t* _session, call_type _call_type, uint32_t _timeoutms );
67```
68
58Sends call invite. Before calling/sending invite msi_session_t::_friend_id is needed to be set or else 69Sends call invite. Before calling/sending invite msi_session_t::_friend_id is needed to be set or else
59it will not work. _call_type is type of the call ( Audio/Video ) and _timeoutms is how long 70it will not work. _call_type is type of the call ( Audio/Video ) and _timeoutms is how long
60will poll wait until request is terminated. 71will poll wait until request is terminated.
61 72
73```
62int msi_hangup ( msi_session_t* _session ); 74int msi_hangup ( msi_session_t* _session );
75```
63Hangs up active call 76Hangs up active call
64 77
78```
65int msi_answer ( msi_session_t* _session, call_type _call_type ); 79int msi_answer ( msi_session_t* _session, call_type _call_type );
80```
66Answer incomming call. _call_type set's callee call type. 81Answer incomming call. _call_type set's callee call type.
67 82
83```
68int msi_cancel ( msi_session_t* _session ); 84int msi_cancel ( msi_session_t* _session );
85```
69Cancel current request. 86Cancel current request.
70 87
88```
71int msi_reject ( msi_session_t* _session ); 89int msi_reject ( msi_session_t* _session );
90```
72Reject incomming call. 91Reject incomming call.
73 92
74 93