Skip to content

Commit 05281eb

Browse files
committed
Dialyzer updates
1 parent b351487 commit 05281eb

23 files changed

+159
-167
lines changed

include/nksip.hrl

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -204,33 +204,6 @@
204204
}).
205205

206206

207-
%% Meta current uses:
208-
%% - {nksip_min_se, MinSE}
209-
210-
-record(dialog, {
211-
id :: nksip_dialog_lib:id(),
212-
app_id :: nksip:app_id(),
213-
call_id :: nksip:call_id(),
214-
created :: nksip_lib:timestamp(),
215-
updated :: nksip_lib:timestamp(),
216-
local_seq :: 0 | nksip:cseq(),
217-
remote_seq :: 0 | nksip:cseq(),
218-
local_uri :: nksip:uri(),
219-
remote_uri :: nksip:uri(),
220-
local_target :: nksip:uri(), % Only for use in proxy
221-
remote_target :: nksip:uri(),
222-
route_set :: [nksip:uri()],
223-
blocked_route_set :: boolean(),
224-
early :: boolean(),
225-
secure :: boolean(),
226-
caller_tag :: nksip:tag(),
227-
invite :: nksip:invite(),
228-
subscriptions = [] :: [nksip:subscription()],
229-
supported = [] :: [nksip:token()],
230-
meta = [] :: nksip:optslist()
231-
}).
232-
233-
234207
-record(invite, {
235208
status :: nksip_dialog:invite_status(),
236209
answered :: nksip_lib:timestamp(),
@@ -263,6 +236,34 @@
263236
}).
264237

265238

239+
%% Meta current uses:
240+
%% - {nksip_min_se, MinSE}
241+
242+
-record(dialog, {
243+
id :: nksip_dialog_lib:id(),
244+
app_id :: nksip:app_id(),
245+
call_id :: nksip:call_id(),
246+
created :: nksip_lib:timestamp(),
247+
updated :: nksip_lib:timestamp(),
248+
local_seq :: 0 | nksip:cseq(),
249+
remote_seq :: 0 | nksip:cseq(),
250+
local_uri :: nksip:uri(),
251+
remote_uri :: nksip:uri(),
252+
local_target :: nksip:uri(), % Only for use in proxy
253+
remote_target :: nksip:uri(),
254+
route_set :: [nksip:uri()],
255+
blocked_route_set :: boolean(),
256+
early :: boolean(),
257+
secure :: boolean(),
258+
caller_tag :: nksip:tag(),
259+
invite :: nksip:invite(),
260+
subscriptions = [] :: [#subscription{}],
261+
supported = [] :: [nksip:token()],
262+
meta = [] :: nksip:optslist()
263+
}).
264+
265+
266+
266267
-record(sdp_m, {
267268
media :: binary(), % <<"audio">>, ...
268269
port = 0 :: inet:port_number(),

plugins/src/nksip_100rel_callbacks.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ nkcb_parse_uas_opt(Req, Resp, Opts) ->
122122

123123

124124
%% @doc Called when a new reponse is going to be sent
125-
-spec nkcb_uas_send_reply({nksip:response(), nksip:optlist()},
125+
-spec nkcb_uas_send_reply({nksip:response(), nksip:optslist()},
126126
nksip_call:trans(), nksip_call:call()) ->
127127
{continue, list()} | {error, term()}.
128128

plugins/src/nksip_event_compositor_callbacks.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
%% @private This plugin callback is called when a call to one of the method specific
3636
%% application-level SipApp callbacks is needed.
3737
-spec nkcb_sip_method(nksip_call:trans(), nksip_call:call()) ->
38-
{reply, nksip:sip_reply()} | noreply.
38+
{reply, nksip:sipreply()} | noreply.
3939

4040

4141
nkcb_sip_method(#trans{method='PUBLISH', request=Req}, #call{app_id=AppId}) ->

plugins/src/nksip_refer_callbacks.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ nkcb_parse_uac_opts(Req, Opts) ->
5050
%% @private This plugin callback is called when a call to one of the method specific
5151
%% application-level SipApp callbacks is needed.
5252
-spec nkcb_sip_method(nksip_call:trans(), nksip_call:call()) ->
53-
{reply, nksip:sip_reply()} | noreply.
53+
{reply, nksip:sipreply()} | noreply.
5454

5555
nkcb_sip_method(#trans{method='REFER', request=Req}, #call{app_id=AppId}=Call) ->
5656
Module = AppId:module(),

plugins/src/nksip_registrar_callbacks.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
%% @private This plugin callback is called when a call to one of the method specific
3838
%% application-level SipApp callbacks is needed.
3939
-spec nkcb_sip_method(nksip_call:trans(), nksip_call:call()) ->
40-
{reply, nksip:sip_reply()} | noreply.
40+
{reply, nksip:sipreply()} | noreply.
4141

4242

4343
nkcb_sip_method(#trans{method='REGISTER', request=Req}, #call{app_id=AppId}) ->

plugins/src/nksip_timers_callbacks.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ nkcb_make_uac_dialog(Method, Uri, Opts, #call{dialogs=[Dialog|_]}=Call) ->
140140

141141

142142
%% @doc Called when the UAC is preparing a request to be sent
143-
-spec nkcb_uac_pre_request(nksip:request(), nksip:optlist(),
143+
-spec nkcb_uac_pre_request(nksip:request(), nksip:optslist(),
144144
nksip_call_uac:uac_from(), nksip:call()) ->
145145
{continue, list()}.
146146

@@ -186,7 +186,7 @@ nkcb_uac_response(Req, Resp, UAC, Call) ->
186186

187187
%% @doc Called when preparing a UAS dialog response
188188
-spec nkcb_uas_dialog_response(nksip:request(), nksip:response(),
189-
nksip:optlist(), nksip:call()) ->
189+
nksip:optslist(), nksip:call()) ->
190190
{ok, nksip:response(), nksip:optslist()} | continue.
191191

192192
nkcb_uas_dialog_response(Req, Resp, Opts, Call) ->
@@ -202,7 +202,7 @@ nkcb_uas_dialog_response(Req, Resp, Opts, Call) ->
202202

203203

204204
%% @doc Called when the UAS is proceesing a request
205-
-spec nkcb_uas_process(nksip_trans:trans(), nksip_call:call()) ->
205+
-spec nkcb_uas_process(nksip_call:trans(), nksip_call:call()) ->
206206
{ok, nksip:call()} | {continue, list()}.
207207

208208
nkcb_uas_process(#trans{request=Req}=UAS, Call) ->

src/nksip_auth.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ realms(#sipmsg{headers=Headers}) ->
5050
get_realms(Headers, []);
5151

5252
realms(RespId) ->
53-
{ok, Hd1} = case nksip_response:header(RespId, ?RESP_WWW) of
54-
WWW when is_list(WWW) -> [{?RESP_WWW, Data} || Data <- WWW];
53+
Hd1 = case nksip_response:header(RespId, ?RESP_WWW) of
54+
{ok, WWW} when is_list(WWW) -> [{?RESP_WWW, Data} || Data <- WWW];
5555
_ -> []
5656
end,
57-
{ok, Hd2} = case nksip_response:header(RespId, ?RESP_PROXY) of
58-
Proxy when is_list(Proxy) -> [{?RESP_PROXY, Data} || Data <- Proxy];
57+
Hd2 = case nksip_response:header(RespId, ?RESP_PROXY) of
58+
{ok, Proxy} when is_list(Proxy) -> [{?RESP_PROXY, Data} || Data <- Proxy];
5959
_ -> []
6060
end,
6161
get_realms(Hd1++Hd2, []).

src/nksip_call.erl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
-type trans() :: #trans{}.
5353

54-
-type trans_id() :: binary().
54+
-type trans_id() :: integer().
5555

5656
-type fork() :: #fork{}.
5757

@@ -83,7 +83,7 @@ call_id(#call{call_id=CallId}) ->
8383

8484
%% @private Sends a new request.
8585
-spec send(nksip:request(), nksip:optslist()) ->
86-
nksip_uac:result() | nksip_uac:ack_result().
86+
nksip_uac:uac_result() | nksip_uac:uac_ack_result().
8787

8888
send(#sipmsg{app_id=AppId, call_id=CallId}=Req, Opts) ->
8989
nksip_router:send_work_sync(AppId, CallId, {send, Req, Opts}).
@@ -92,24 +92,24 @@ send(#sipmsg{app_id=AppId, call_id=CallId}=Req, Opts) ->
9292
%% @private Generates and sends a new request.
9393
-spec send(nksip:app_id(), nksip:call_id(), nksip:method(),
9494
nksip:user_uri(), nksip:optslist()) ->
95-
nksip_uac:result() | nksip_uac:ack_result().
95+
nksip_uac:uac_result() | nksip_uac:uac_ack_result().
9696

9797
send(AppId, CallId, Method, Uri, Opts) ->
9898
nksip_router:send_work_sync(AppId, CallId, {send, Method, Uri, Opts}).
9999

100100

101101
%% @private Generates and sends a new in-dialog request.
102102
-spec send_dialog(nksip:app_id(), nksip:call_id(), nksip:method(),
103-
nksip_dialog:id(), nksip:optslist()) ->
104-
nksip_uac:result() | nksip_uac:ack_result().
103+
nksip_dialog_lib:id(), nksip:optslist()) ->
104+
nksip_uac:uac_result() | nksip_uac:uac_ack_result().
105105

106106
send_dialog(AppId, CallId, Method, DialogId, Opts) ->
107107
nksip_router:send_work_sync(AppId, CallId, {send_dialog, DialogId, Method, Opts}).
108108

109109

110110
%% @private Cancels an ongoing INVITE request.
111111
-spec send_cancel(nksip:app_id(), nksip:call_id(), nksip_sipmsg:id(),
112-
nksip:optlist()) ->
112+
nksip:optslist()) ->
113113
nksip_uac:uac_cancel_result().
114114

115115
send_cancel(AppId, CallId, RequestId, Opts) ->
@@ -178,7 +178,7 @@ get_all_dialogs(AppId, CallId) ->
178178

179179

180180
%% @private Deletes a dialog
181-
-spec stop_dialog(nksip:app_id(), nksip:call_id(), nksip_dialog:id()) ->
181+
-spec stop_dialog(nksip:app_id(), nksip:call_id(), nksip_dialog_lib:id()) ->
182182
ok | {error, term()}.
183183

184184
stop_dialog(AppId, CallId, DialogId) ->

src/nksip_call_event.erl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ uac_response(_Req, _Resp, Dialog, _Call) ->
9898

9999
%% @private
100100
-spec uac_do_response(nksip:method(), nksip:sip_code(), nksip:request(),
101-
nksip:response(), nksip:subscription(), nksip:dialog(),
101+
nksip:response(), #subscription{}, nksip:dialog(),
102102
nksip_call:call()) ->
103103
nksip:dialog().
104104

@@ -212,7 +212,7 @@ uas_response(_Req, _Resp, Dialog, _Call) ->
212212

213213
%% @private
214214
-spec uas_do_response(nksip:method(), nksip:sip_code(), nksip:request(),
215-
nksip:response(), nksip:subscription(), nksip:dialog(),
215+
nksip:response(), #subscription{}, nksip:dialog(),
216216
nksip_call:call()) ->
217217
nksip:dialog().
218218

@@ -256,7 +256,7 @@ uas_do_response(_, _Code, _Req, _Resp, _Subs, Dialog, _Call) ->
256256

257257

258258
%% @private
259-
-spec update(term(), nksip:subscription(), nksip:dialog(), nksip_call:call()) ->
259+
-spec update(term(), #subscription{}, nksip:dialog(), nksip_call:call()) ->
260260
nksip:dialog().
261261

262262
update({subscribe, #sipmsg{class={req, Method}}=Req, Resp}, Subs, Dialog, Call) ->
@@ -409,7 +409,7 @@ stop(#subscription{id=Id}, Dialog, Call) ->
409409

410410
%% @private
411411
-spec request_uac_opts(nksip:method(), nksip:optslist(),
412-
nksip:dialog() | nksip:subscription()) ->
412+
nksip:dialog() | #subscription{}) ->
413413
{ok, nksip:optslist()} | {error, unknown_subscription}.
414414

415415
request_uac_opts(Method, Opts, #dialog{}=Dialog) ->
@@ -455,7 +455,8 @@ request_uac_opts('NOTIFY', Opts, #subscription{event=Event, timer_expire=Timer})
455455

456456

457457
%% @private Called when a dialog timer is fired
458-
-spec timer({middle|timeout, nksip_subscription:id()}, nksip:dialog(), nksip_call:call()) ->
458+
-spec timer({middle|timeout, nksip_subscription_lib:id()},
459+
nksip:dialog(), nksip_call:call()) ->
459460
nksip_call:call().
460461

461462
timer({Type, Id}, Dialog, Call) ->
@@ -479,7 +480,7 @@ timer({Type, Id}, Dialog, Call) ->
479480

480481
%% @private Creates a new event
481482
-spec create(uac|uas, nksip:request(), nksip:dialog(), nksip_call:call()) ->
482-
nksip:subscription().
483+
#subscription{}.
483484

484485
create(Class, #sipmsg{class={req, Method}}=Req, Dialog, Call) ->
485486
Event = case Method of
@@ -522,7 +523,7 @@ do_is_prov_event(Id, [_|Rest]) -> do_is_prov_event(Id, Rest).
522523

523524

524525
%% @private Updates an updated event into dialog
525-
-spec store(nksip:subscription(), nksip:dialog(), nksip_call:call()) ->
526+
-spec store(#subscription{}, nksip:dialog(), nksip_call:call()) ->
526527
nksip:dialog().
527528

528529
store(Subs, Dialog, _Call) ->
@@ -554,7 +555,7 @@ store(Subs, Dialog, _Call) ->
554555

555556

556557
%% @private
557-
-spec dialog_update(term(), nksip:subscription(), nksip:dialog(), nksip_call:call()) ->
558+
-spec dialog_update(term(), #subscription{}, nksip:dialog(), nksip_call:call()) ->
558559
ok.
559560

560561
dialog_update(Status, Subs, Dialog, #call{app_id=AppId}=Call) ->
@@ -572,7 +573,7 @@ cancel_timer(Ref) ->
572573

573574

574575
%% @private
575-
-spec start_timer(integer(), {atom(), nksip_subscription:id()}, nksip:dialog()) ->
576+
-spec start_timer(integer(), {atom(), nksip_subscription_lib:id()}, nksip:dialog()) ->
576577
reference().
577578

578579
start_timer(Time, Tag, #dialog{id=Id}) ->

src/nksip_call_uac_dialog.erl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@ pre_request(Req, Call) ->
9595
true ->
9696
ok
9797
end;
98-
false ->
98+
not_found ->
9999
{error, unknown_dialog}
100100
end.
101101

102102

103103
%% @private
104-
-spec request(nksip:request(), boolean(), nksip_call:call()) ->
104+
-spec request(nksip:request(), true|false|undefined, nksip_call:call()) ->
105105
nksip_call:call().
106106

107-
request(#sipmsg{class={req, 'ACK'}}=Req, _, Call) ->
107+
request(#sipmsg{class={req, 'ACK'}}=Req, undefined, Call) ->
108108
do_ack(Req, Call);
109109

110110
request(#sipmsg{class={req, Method}, dialog_id=DialogId}=Req, IsProxy, Call) ->
@@ -463,7 +463,7 @@ do_response(_, _Code, _Req, _Resp, Dialog, Call) ->
463463

464464

465465
%% @private
466-
-spec make(integer(), nksip:method(), nksip:optslist(), nksip_call:call()) ->
466+
-spec make(nksip_dialog_lib:id(), nksip:method(), nksip:optslist(), nksip_call:call()) ->
467467
{ok, RUri::nksip:uri(), nksip:optslist(), nksip_call:call()} | {error, Error}
468468
when Error :: invalid_dialog | unknown_dialog | unknown_subscription.
469469

@@ -564,7 +564,7 @@ get_sdp(#sipmsg{body=Body}, #invite{sdp_offer=Offer, sdp_answer=Answer}) ->
564564

565565
%% @private
566566
-spec generate(nksip:method(), nksip:optslist(), nksip:dialog(), nksip_call:call()) ->
567-
{{RUri, Opts}, nksip:dialog()}
567+
{RUri, Opts, nksip:dialog()}
568568
when RUri::nksip:uri(), Opts::nksip:optslist().
569569

570570
generate(Method, Opts, Dialog, _Call) ->

0 commit comments

Comments
 (0)