[OpenSIPS-Users] How to delay a branch

ryan embgrets rembgrets at gmail.com
Fri Jul 24 12:15:27 EST 2020


Hi,

Thanks for coming back to me on this query. I did not want to do serial
forking.  Let me try to explain my query in better detail.

So, i have desktop phones and mobile phones registered to same AOR, what i
wanted to do was,

If we have mobile phone devices registered we send invites to them
instantly but desktop devices need to be rung after some delay from phone
devices.
But if no phone device was registered, we simply do parallel forking to
desktop devices.

Ryan.

On Fri, 24 Jul 2020 at 15:14, Liviu Chircu <liviu at opensips.org> wrote:

> On 13.07.2020 16:02, ryan embgrets wrote:
> >
> > So, I set a branch flag on those registrations before calling the save
> > function, and then try to use async sleep in the branch route after
> > lookup.
> >
> > But I see sleep applies on the whole call(all branches are sent with
> > delay) no matter if it was called on a single branch.
>
> Hey, Ryan!
>
> Did you solve your problem in the meantime?  I think you are confusing
> parallel forking with serial forking.  Implicitly, the OpenSIPS request
> branching engine performs **parallel** forking.  In other words, no
> matter how you prepare your branches (be it using append_branch(),
> lookup(), mid_registrar_lookup(), etc.), they will all be sent out
> concurrently, hence the effect you are noticing ("the sleep applies on
> the whole call").
>
> To change the behavior to a **serial** forking one, try calling
> serialize_branches() [1] after building your branch set.  IIRC, there's
> a caveat in there, which also requires you to call next_branches()
> afterwards.  Just read the docs carefully and you should be fine.
>
> Best regards,
>
> [1]: https://opensips.org/Documentation/Script-CoreFunctions-3-2#toc44
>
> --
> Liviu Chircu
> www.twitter.com/liviuchircu | www.opensips-solutions.com
> OpenSIPS Summit 2020 Distributed
>    www.opensips.org/events
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200724/7134cb24/attachment.html>


More information about the Users mailing list