Let's
assume the following scenario:
UA1 --> P1 --> P2 --> P1 --> UA2
Now, UA2 rejects the call, but P2 decides to reroute the call to an IVR
UA1 --> P1 --> P2 --> IVR
What will be the state of the dialog on P1?
I think this example of yours shows a potential problem of the
multiple-dialogs case while there is none in the single-dialog case.
First, the single-dialog case: When P1 receives the request from UA1, it
establishes a new, yet unconfirmed dialog. When it receives the request
from P2, it continues the dialog and does not create a new one.
When UA2's rejection is received by P1, the dialog will be terminated.
(This is what the dialog module already does now.) When P2 decides to send
out the request to another destination (like the IVR), P1 will establish a
new dialog (since there's none to continue anymore). I cannot see any
dialog handling problems in this approach.
I don't think that you got the right scenario here: when the call is
rerouted, it is rerouted by P2 directly to IVR and P1 is no longer
involved.
If P1 kills the dialog on the first rejection from UA2, there will be
no dialog left on P1.
Regards,
Ovidiu Sas