@@ -96,7 +96,7 @@ next(#fork{pending=[]}=Fork, Call) ->
9696 [] when Method =:= 'ACK' ->
9797 delete (Fork , Call );
9898 [] ->
99- # sipmsg {response = Code } = Resp = best_response (Fork ),
99+ # sipmsg {class = { resp , Code } } = Resp = best_response (Fork ),
100100 ? call_debug (" Fork ~p ~p selected ~p response" ,
101101 [Id , Method , Code ], Call ),
102102 Call1 = send_reply (Resp , Fork , Call ),
@@ -157,11 +157,11 @@ launch([Uri|Rest], Fork, Call) ->
157157-spec response (id (), integer (), nksip :response (),call ()) ->
158158 call ().
159159
160- response (_ , _ , # sipmsg {response = Code }, Call ) when Code < 101 ->
160+ response (_ , _ , # sipmsg {class = { resp , Code } }, Call ) when Code < 101 ->
161161 Call ;
162162
163163response (Id , Pos , # sipmsg {vias = [_ |Vias ]}= Resp , # call {forks = Forks }= Call ) ->
164- # sipmsg {to_tag = ToTag , response = Code } = Resp ,
164+ # sipmsg {class = { resp , Code }, to_tag = ToTag } = Resp ,
165165 case lists :keyfind (Id , # fork .id , Forks ) of
166166 # fork {pending = Pending , uacs = UACs , method = Method }= Fork ->
167167 ? call_debug (" Fork ~p ~p received ~p (~s )" ,
@@ -271,7 +271,7 @@ waiting(Code, Resp, Pos, Fork, Call) when Code >= 600 ->
271271 call ().
272272
273273send_reply (Resp , Fork , Call ) ->
274- # sipmsg {response = Code } = Resp ,
274+ # sipmsg {class = { resp , Code } } = Resp ,
275275 # fork {id = TransId , method = Method } = Fork ,
276276 # call {trans = Trans } = Call ,
277277 case lists :keyfind (TransId , # trans .id , Trans ) of
@@ -296,11 +296,11 @@ best_response(#fork{request=Req, responses=Resps}) ->
296296 if
297297 Code =:= 401 ; Code =:= 407 -> {3999 , Resp };
298298 Code =:= 415 ; Code =:= 420 ; Code =:= 484 -> {4000 , Resp };
299- Code =:= 503 -> {5000 , Resp # sipmsg {response = 500 }};
299+ Code =:= 503 -> {5000 , Resp # sipmsg {class = { resp , 500 } }};
300300 Code >= 600 -> {Code , Resp };
301301 true -> {10 * Code , Resp }
302302 end
303- || # sipmsg {response = Code }= Resp <- Resps
303+ || # sipmsg {class = { resp , Code } }= Resp <- Resps
304304 ]),
305305 case Sorted of
306306 [{3999 , Best }|_ ] ->
@@ -309,7 +309,7 @@ best_response(#fork{request=Req, responses=Resps}) ->
309309 nksip_lib :delete (Best # sipmsg .headers , Names ) |
310310 [
311311 nksip_lib :extract (Headers , Names ) ||
312- # sipmsg {response = Code , headers = Headers }
312+ # sipmsg {class = { resp , Code } , headers = Headers }
313313 <- Resps , Code =:= 401 orelse Code =:= 407
314314 ]
315315 ],
0 commit comments