[Users] Error Handling with Parallel Forking

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri Feb 23 18:53:32 CET 2007


Hi Chris,

not sure if I got it right, but what you can do is to drop the branch 
(use drop()) if you decide in branch route not to fwd. it. If  at least 
one branch is fed, everything ok; if not, the t_relay will return with 
error back to script (use the flags to disable out reply in case of error).

regards,
bogdan


Chris Heiser wrote:
> Hello gurus,
>
> I'm attempting to do some rather crazy parallel forking and have found 
> a few issues I'm hoping to solve.  I thought I'd solicit some advice 
> from the experts.
>
> Some background:
>
> Each device registers with its own unique information.  No two devices 
> share the same credentials.  Since a random user might want their 
> number sent to multiple phones, and maybe even a cell phone, I've done 
> the following:
>
>         if(method=="INVITE" && !isflagset(5))
>         {
>                 if(avp_db_load("$ru/username","fork"))
>                 {
>                         t_on_branch("1");
>                         avp_pushto("$ru/username","$avp(s:fork)/g");
>                 };
>         };
>
> Then the branch route looks like:
>
> branch_route[1]
> {
>         setflag(5);
>         route(3);
> }
>
> The idea here is the fork avp contains one or more possible 
> destinations, but we don't store a complete URI here.  The branch 
> route sends us back through the normal routing logic to lookup local 
> users on the system, and maybe route something to an external PSTN 
> gateway, or another proxy.
>
> The problem:
>
> I haven't found a way to gracefully handle the event when one of the 
> possible destinations is a device that hasn't registered.  Say we 
> allow the user to have a soft client, so we add the username to the 
> list of fork avps.  If the device isn't registered, I have 2 options:
>
> 1)  Use a default route
> 2)  Detect that I should know who this is, and error out
>
> Either way, an error is produced, but I don't see a good way of 
> detecting if we should push the 404, or generate a 404 back to the 
> client.  The polite method would be:
>
> Are there other branches still going?
>   If yes, just exit this branch
>   If no, relay, or generate an error back to the client
>
> So my question is how to do this last part.  Am I crazy for even 
> thinking about doing this in OpenSER?  BTW, I'm using v1.1.1
>
> --Chris
>
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>





More information about the sr-users mailing list