diff options
author | Peter Maatman <blackwolf12333@gmail.com> | 2013-11-01 11:52:31 +0100 |
---|---|---|
committer | Peter Maatman <blackwolf12333@gmail.com> | 2013-11-01 11:52:31 +0100 |
commit | 9ff287569ea35cce4d6d0cd37634aec97cbee90c (patch) | |
tree | b5c329e7da4c59bdd6b9723bed0e0b4f32284b62 /docs/av_api.md | |
parent | 6c0cfd08e6aca43c2e7b4a381a60d73d1b2065f1 (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.md | 19 |
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. | |||
16 | Phone requires one msi session and two rtp sessions ( one for audio and one for | 16 | Phone requires one msi session and two rtp sessions ( one for audio and one for |
17 | video ). | 17 | video ). |
18 | 18 | ||
19 | ``` | ||
19 | msi_session_t* msi_init_session( void* _core_handler, const uint8_t* _user_agent ); | 20 | msi_session_t* msi_init_session( void* _core_handler, const uint8_t* _user_agent ); |
21 | ``` | ||
20 | 22 | ||
21 | initializes msi session. | 23 | initializes msi session. |
22 | Params: | 24 | Params: |
25 | |||
26 | ``` | ||
23 | void* _core_handler - pointer to an object handling networking, | 27 | void* _core_handler - pointer to an object handling networking, |
24 | const uint8_t* _user_agent - string describing phone client version. | 28 | const uint8_t* _user_agent - string describing phone client version. |
29 | ``` | ||
25 | 30 | ||
26 | Return value: | 31 | Return value: |
27 | msi_session_t* - pointer to a newly created msi session handler. | 32 | msi_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 | |||
35 | directly from event loop. You can find examples in phone.c. | 40 | directly from event loop. You can find examples in phone.c. |
36 | 41 | ||
37 | Register callbacks: | 42 | Register callbacks: |
43 | ``` | ||
38 | void msi_register_callback_call_started ( MCALLBACK ); | 44 | void msi_register_callback_call_started ( MCALLBACK ); |
39 | void msi_register_callback_call_canceled ( MCALLBACK ); | 45 | void msi_register_callback_call_canceled ( MCALLBACK ); |
40 | void msi_register_callback_call_rejected ( MCALLBACK ); | 46 | void msi_register_callback_call_rejected ( MCALLBACK ); |
@@ -47,6 +53,7 @@ void msi_register_callback_recv_ending ( MCALLBACK ); | |||
47 | void msi_register_callback_recv_error ( MCALLBACK ); | 53 | void msi_register_callback_recv_error ( MCALLBACK ); |
48 | 54 | ||
49 | void msi_register_callback_requ_timeout ( MCALLBACK ); | 55 | void msi_register_callback_requ_timeout ( MCALLBACK ); |
56 | ``` | ||
50 | 57 | ||
51 | MCALLBACK is defined as: void (*callback) (void* _arg) | 58 | MCALLBACK is defined as: void (*callback) (void* _arg) |
52 | msi_session_t* handler is being thrown as _arg so you can use that and _agent_handler to get to your own phone handler | 59 | msi_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 | ||
56 | Actions: | 63 | Actions: |
64 | |||
65 | ``` | ||
57 | int msi_invite ( msi_session_t* _session, call_type _call_type, uint32_t _timeoutms ); | 66 | int msi_invite ( msi_session_t* _session, call_type _call_type, uint32_t _timeoutms ); |
67 | ``` | ||
68 | |||
58 | Sends call invite. Before calling/sending invite msi_session_t::_friend_id is needed to be set or else | 69 | Sends call invite. Before calling/sending invite msi_session_t::_friend_id is needed to be set or else |
59 | it will not work. _call_type is type of the call ( Audio/Video ) and _timeoutms is how long | 70 | it will not work. _call_type is type of the call ( Audio/Video ) and _timeoutms is how long |
60 | will poll wait until request is terminated. | 71 | will poll wait until request is terminated. |
61 | 72 | ||
73 | ``` | ||
62 | int msi_hangup ( msi_session_t* _session ); | 74 | int msi_hangup ( msi_session_t* _session ); |
75 | ``` | ||
63 | Hangs up active call | 76 | Hangs up active call |
64 | 77 | ||
78 | ``` | ||
65 | int msi_answer ( msi_session_t* _session, call_type _call_type ); | 79 | int msi_answer ( msi_session_t* _session, call_type _call_type ); |
80 | ``` | ||
66 | Answer incomming call. _call_type set's callee call type. | 81 | Answer incomming call. _call_type set's callee call type. |
67 | 82 | ||
83 | ``` | ||
68 | int msi_cancel ( msi_session_t* _session ); | 84 | int msi_cancel ( msi_session_t* _session ); |
85 | ``` | ||
69 | Cancel current request. | 86 | Cancel current request. |
70 | 87 | ||
88 | ``` | ||
71 | int msi_reject ( msi_session_t* _session ); | 89 | int msi_reject ( msi_session_t* _session ); |
90 | ``` | ||
72 | Reject incomming call. | 91 | Reject incomming call. |
73 | 92 | ||
74 | 93 | ||