Hi all,
sippipe/cancel_transaction/3 must check if state field clienttransaction_pid is actually pid() but not atom none, this could happen when, for example there are no more reachable destination available. If server transaction happened to be canceled at this moment, we'll get function clause error in transactionlayer:cancel_client_transaction/3.


Suggested patch attached.

--- src/sippipe.erl.orig        2007-10-17 10:41:21.000000000 -0400
+++ src/sippipe.erl     2008-06-05 11:46:28.672427959 -0400
@@ -547,7 +547,8 @@
 %%          client transaction.
 %% @end
 %%--------------------------------------------------------------------
-cancel_transaction(#state{cancelled = false} = State, Reason, ExtraHeaders) 
when is_list(Reason) ->
+cancel_transaction(#state{clienttransaction_pid = Pid, cancelled = false} = 
State, Reason, ExtraHeaders)
+when is_pid(Pid), is_list(Reason) ->
     logger:log(debug, "sippipe: Original request has been cancelled, asking 
current "
               "client transaction handler (~p) to cancel, and answering "
               "'487 Request Cancelled' to original request",
@@ -555,7 +556,11 @@
     
transactionlayer:cancel_client_transaction(State#state.clienttransaction_pid, 
Reason, ExtraHeaders),
     transactionlayer:send_response_handler(State#state.serverhandler, 487, 
"Request Cancelled"),
     State#state{cancelled = true};
-cancel_transaction(#state{cancelled = true} = State, Reason, _ExtraHeaders) 
when is_list(Reason) ->
+cancel_transaction(#state{cancelled = false} = State, _Reason, _ExtraHeaders) 
->
+    logger:log(debug, "sippipe: Original request has been cancelled, but no 
current "
+               "client transaction found, answering '487 Request Cancelled' to 
original request", []),
+    transactionlayer:send_response_handler(State#state.serverhandler, 487, 
"Request Cancelled"),
+cancel_transaction(#state{cancelled = true} = State, _Reason, _ExtraHeaders) ->
     %% already cancelled
     State.
 
_______________________________________________
Yxa-devel mailing list
Yxa-devel@lists.su.se
https://lists.su.se/mailman/listinfo/yxa-devel

Reply via email to