When placing outbound calls there are a number of scenarios that you will want to apply business logic too. When your application reaches a BUSY number for example, you will need to make an appropriate decision as to how to process this result (should you redial, wait some amount of time and then redial, stop calling, etc). In order to handle these events you will first need to catch them using the Fault Handler page. From here you define the workflows for processing each fault type. The default project template for speech workflows includes two fault handlers. The first handles call disconnections (normally this happens when a caller hangs up) and a general fault handler for catching everything else. We’re going to add another one for trapping SIP results. This will fire off a code block where we will make decisions on how to handle the results we care about.
- From the toolbox, drag a new FaultHandler object into the fault handler's list.
- On the Properties tab for the FaultHandler, open the details dialog for the FaultType property.
- In the Type Name text box enter "Microsoft.SpeechServer.SipPeerException" and click ok.
- Drop a Code activity into the workflow area of the new FaultHandler instance
- Double-click the new Code activity to open the code view for the ExectuteCode event.
Now you can process the SipPeerException based on the ResponseCode you’ve received. For example: