From abalashov@evaristesys.com Tue Nov 28 18:39:00 2023 From: Alex Balashov To: sr-users@lists.kamailio.org Subject: [SR-Users] tsilo dependency on usrloc Date: Tue, 28 Nov 2023 13:38:36 -0500 Message-ID: <1AC48029-930E-43D0-BDEF-8B0DB7714EA4@evaristesys.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1633829215==" --===============1633829215== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, I wanted to revisit the topic of tsilo dependence on the location service. Al= l three ts_append*() functions have the following quality: - ts_append(): "performing a contact lookup on the table specified by the dom= ain parameter." - ts_append_by_contact(): "the contact lookup is performed" - ts_append_to(): "performing a contacts lookup on the table specified by the= domain parameter" Why is this extensive coupling to usrloc necessary? This makes it impossible = to use `tsilo` in case of providing a push-notification add-on that front-end= s an upstream registrar, requiring a kind of local shadow registrar or mid-re= gistrar. What would make more sense is a generic mechanism that allows one to= "drip" new contacts into an existing transaction, whether suspended or activ= e.=20 Kamailio has a mechanism to add more branches to an existing transaction, but= the scope of that mechanism is only from *inside* the vantage point of the t= ransaction in question. The key parlour trick of `tsilo` is that it permits d= ripping new branches into a *different* transaction. ts_append_to() almost does the trick, providing a target index and label, but= it just insists on doing a registrar lookup to source the contacts.=20 What is really wanted and needed for the downstream PN gateway use-case is a = means of extracting contacts from incoming registrations (or other sources, p= otentially) without storing them in any fashion locally, without using or eve= n loading usrloc, and just throwing them over the fence into a different tran= saction. Is this somehow possible by means other than tsilo? Am I overlooking somethin= g? Cheers, -- Alex --=20 Alex Balashov Principal Consultant Evariste Systems LLC Web: https://evaristesys.com Tel: +1-706-510-6800 --===============1633829215==-- From abalashov@evaristesys.com Tue Nov 28 19:10:08 2023 From: Alex Balashov To: sr-users@lists.kamailio.org Subject: [SR-Users] Re: tsilo dependency on usrloc Date: Tue, 28 Nov 2023 14:09:40 -0500 Message-ID: In-Reply-To: <1AC48029-930E-43D0-BDEF-8B0DB7714EA4@evaristesys.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0560386310==" --===============0560386310== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable PS. It seems to me there are some kludgy options to work around this limitati= on, i.e. to basically reinvent tsilo.=20 They all boil down to suspending the transaction and using some sort of IPC m= echanism to queue new branch destinations, then, after some defined interval,= using some dequeueing mechanism as a semaphore to kick-start the forking pro= cess.=20 For instance, one could do this by hashing the RURI destination, transaction = index and label in htable, then suspending the transaction, then piling some = branches into it and then setting the expiration value of the RURI key to imm= ediate, causing event_route[htable:expired:] to kick off. Depending on= where exactly that executes, this could resume the transaction, add the bran= ches and manage the forking. Or one could try some tricks with config locks, = or mqueue's unique key mode. But none of these solutions allow the continuous drip of new serial forking d= estinations into an active transaction. They all require suspending and waiti= ng a sufficient amount of time to believe oneself to have collected all the p= otential destinations, then to reanimate. This is not necessarily how the rea= l world works. These mechanisms are also quite complicated, and complexity br= eeds fragility. -- Alex > On 28 Nov 2023, at 13:38, Alex Balashov wrote: >=20 > Hi, >=20 > I wanted to revisit the topic of tsilo dependence on the location service. = All three ts_append*() functions have the following quality: >=20 > - ts_append(): "performing a contact lookup on the table specified by the d= omain parameter." > - ts_append_by_contact(): "the contact lookup is performed" > - ts_append_to(): "performing a contacts lookup on the table specified by t= he domain parameter" >=20 > Why is this extensive coupling to usrloc necessary? This makes it impossibl= e to use `tsilo` in case of providing a push-notification add-on that front-e= nds an upstream registrar, requiring a kind of local shadow registrar or mid-= registrar. What would make more sense is a generic mechanism that allows one = to "drip" new contacts into an existing transaction, whether suspended or act= ive.=20 >=20 > Kamailio has a mechanism to add more branches to an existing transaction, b= ut the scope of that mechanism is only from *inside* the vantage point of the= transaction in question. The key parlour trick of `tsilo` is that it permits= dripping new branches into a *different* transaction. >=20 > ts_append_to() almost does the trick, providing a target index and label, b= ut it just insists on doing a registrar lookup to source the contacts.=20 >=20 > What is really wanted and needed for the downstream PN gateway use-case is = a means of extracting contacts from incoming registrations (or other sources,= potentially) without storing them in any fashion locally, without using or e= ven loading usrloc, and just throwing them over the fence into a different tr= ansaction. >=20 > Is this somehow possible by means other than tsilo? Am I overlooking someth= ing? >=20 > Cheers, >=20 > -- Alex >=20 > --=20 > Alex Balashov > Principal Consultant > Evariste Systems LLC > Web: https://evaristesys.com > Tel: +1-706-510-6800 >=20 --=20 Alex Balashov Principal Consultant Evariste Systems LLC Web: https://evaristesys.com Tel: +1-706-510-6800 --===============0560386310==-- From federico.cabiddu@gmail.com Sat Dec 2 06:14:50 2023 From: Federico Cabiddu To: sr-users@lists.kamailio.org Subject: [SR-Users] Re: tsilo dependency on usrloc Date: Sat, 02 Dec 2023 07:13:55 +0100 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0579342902==" --===============0579342902== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Hi Alex, sorry for the late reply. I had to revisit the tsilo code, long time without looking at it :) When I designed the module I had in mind what I considered a "natural" scenario for the push notifications: the entity acting as a registrar being the one responsible for a call forking. Of course other scenarios have arisen which are not covered by the current implementation, one of which is to be able to add branches without the usrloc/registrar mechanism. We could add two new functions that do the same as ts_append and ts_append_to but without performing the look: - ts_append_no_lookup(ruri, [contact]): add to all the transactions stored for ruri a new branch for (if not specified extracted from the current SIP message) - ts_append_to_no_lookup(tindex, tlabel, [contact]): add to the transaction specified by tindex and tlabel a new branch for Maybe names are a bit long but is to give the idea. Do you think that a solution like this would cover your (and others') scenarios? I can try to find the time to work on it :) Cheers, Federico On Tue, Nov 28, 2023 at 8:39 PM Alex Balashov via sr-users < sr-users(a)lists.kamailio.org> wrote: > PS. It seems to me there are some kludgy options to work around this > limitation, i.e. to basically reinvent tsilo. > > They all boil down to suspending the transaction and using some sort of > IPC mechanism to queue new branch destinations, then, after some defined > interval, using some dequeueing mechanism as a semaphore to kick-start the > forking process. > > For instance, one could do this by hashing the RURI destination, > transaction index and label in htable, then suspending the transaction, > then piling some branches into it and then setting the expiration value of > the RURI key to immediate, causing event_route[htable:expired:
] to > kick off. Depending on where exactly that executes, this could resume the > transaction, add the branches and manage the forking. Or one could try some > tricks with config locks, or mqueue's unique key mode. > > But none of these solutions allow the continuous drip of new serial > forking destinations into an active transaction. They all require > suspending and waiting a sufficient amount of time to believe oneself to > have collected all the potential destinations, then to reanimate. This is > not necessarily how the real world works. These mechanisms are also quite > complicated, and complexity breeds fragility. > > -- Alex > > > On 28 Nov 2023, at 13:38, Alex Balashov > wrote: > > > > Hi, > > > > I wanted to revisit the topic of tsilo dependence on the location > service. All three ts_append*() functions have the following quality: > > > > - ts_append(): "performing a contact lookup on the table specified by > the domain parameter." > > - ts_append_by_contact(): "the contact lookup is performed" > > - ts_append_to(): "performing a contacts lookup on the table specified > by the domain parameter" > > > > Why is this extensive coupling to usrloc necessary? This makes it > impossible to use `tsilo` in case of providing a push-notification add-on > that front-ends an upstream registrar, requiring a kind of local shadow > registrar or mid-registrar. What would make more sense is a generic > mechanism that allows one to "drip" new contacts into an existing > transaction, whether suspended or active. > > > > Kamailio has a mechanism to add more branches to an existing > transaction, but the scope of that mechanism is only from *inside* the > vantage point of the transaction in question. The key parlour trick of > `tsilo` is that it permits dripping new branches into a *different* > transaction. > > > > ts_append_to() almost does the trick, providing a target index and > label, but it just insists on doing a registrar lookup to source the > contacts. > > > > What is really wanted and needed for the downstream PN gateway use-case > is a means of extracting contacts from incoming registrations (or other > sources, potentially) without storing them in any fashion locally, without > using or even loading usrloc, and just throwing them over the fence into a > different transaction. > > > > Is this somehow possible by means other than tsilo? Am I overlooking > something? > > > > Cheers, > > > > -- Alex > > > > -- > > Alex Balashov > > Principal Consultant > > Evariste Systems LLC > > Web: https://evaristesys.com > > Tel: +1-706-510-6800 > > > > -- > Alex Balashov > Principal Consultant > Evariste Systems LLC > Web: https://evaristesys.com > Tel: +1-706-510-6800 > > __________________________________________________________ > Kamailio - Users Mailing List - Non Commercial Discussions > To unsubscribe send an email to sr-users-leave(a)lists.kamailio.org > Important: keep the mailing list in the recipients, do not reply only to > the sender! > Edit mailing list options or unsubscribe: > --===============0579342902== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+SGkgQWxleCw8ZGl2PnNvcnJ5IGZvciB0aGXCoGxhdGXCoHJlcGx5LiBJ IGhhZCB0byByZXZpc2l0IHRoZSB0c2lsbyBjb2RlLCBsb25nIHRpbWUgd2l0aG91dCBsb29raW5n IGF0IGl0IDopPC9kaXY+PGRpdj5XaGVuIEkgZGVzaWduZWQgdGhlIG1vZHVsZSBJIGhhZCBpbiBt aW5kIHdoYXQgSSBjb25zaWRlcmVkIGEgJnF1b3Q7bmF0dXJhbCZxdW90OyBzY2VuYXJpbyBmb3Ig dGhlIHB1c2ggbm90aWZpY2F0aW9uczogdGhlIGVudGl0eSBhY3RpbmcgYXMgYSByZWdpc3RyYXLC oGJlaW5nIHRoZSBvbmUgcmVzcG9uc2libGUgZm9yIGEgY2FsbCBmb3JraW5nLjwvZGl2PjxkaXY+ T2YgY291cnNlIG90aGVyIHNjZW5hcmlvcyBoYXZlIGFyaXNlbiB3aGljaCBhcmUgbm90IGNvdmVy ZWQgYnkgdGhlIGN1cnJlbnQgaW1wbGVtZW50YXRpb24sIG9uZSBvZiB3aGljaCBpcyB0byBiZSBh YmxlIHRvIGFkZCBicmFuY2hlcyB3aXRob3V0IHRoZSB1c3Jsb2MvcmVnaXN0cmFyIG1lY2hhbmlz bS48L2Rpdj48ZGl2PldlIGNvdWxkIGFkZCB0d28gbmV3IGZ1bmN0aW9ucyB0aGF0IGRvIHRoZSBz YW1lIGFzIHRzX2FwcGVuZCBhbmQgdHNfYXBwZW5kX3RvIGJ1dCB3aXRob3V0IHBlcmZvcm1pbmcg dGhlIGxvb2s6PC9kaXY+PGRpdj4tIHRzX2FwcGVuZF9ub19sb29rdXAocnVyaSwgW2NvbnRhY3Rd KTogYWRkIHRvIGFsbCB0aGUgdHJhbnNhY3Rpb25zIHN0b3JlZCBmb3Igc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gwMDxicj4KPGJyPgpfX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fPGJyPgpLYW1haWxp byAtIFVzZXJzIE1haWxpbmcgTGlzdCAtIE5vbiBDb21tZXJjaWFsIERpc2N1c3Npb25zPGJyPgpU byB1bnN1YnNjcmliZSBzZW5kIGFuIGVtYWlsIHRvIDxhIGhyZWY9Im1haWx0bzpzci11c2Vycy1s ZWF2ZUBsaXN0cy5rYW1haWxpby5vcmciIHRhcmdldD0iX2JsYW5rIj5zci11c2Vycy1sZWF2ZUBs aXN0cy5rYW1haWxpby5vcmc8L2E+PGJyPgpJbXBvcnRhbnQ6IGtlZXAgdGhlIG1haWxpbmcgbGlz dCBpbiB0aGUgcmVjaXBpZW50cywgZG8gbm90IHJlcGx5IG9ubHkgdG8gdGhlIHNlbmRlciE8YnI+ CkVkaXQgbWFpbGluZyBsaXN0IG9wdGlvbnMgb3IgdW5zdWJzY3JpYmU6PGJyPgo8L2Jsb2NrcXVv dGU+PC9kaXY+Cg== --===============0579342902==-- From abalashov@evaristesys.com Sun Dec 3 02:16:46 2023 From: Alex Balashov To: sr-users@lists.kamailio.org Subject: [SR-Users] Re: tsilo dependency on usrloc Date: Sat, 02 Dec 2023 21:15:59 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0148439153==" --===============0148439153== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Federico, I certainly don't mean to presume upon your free time. :-)=20 But of course, either of those options would be wonderful! Of the two, I thin= k the second function, addressing the transaction by index and label, would b= e the most useful. -- Alex > On 2 Dec 2023, at 01:13, Federico Cabiddu wr= ote: >=20 > Hi Alex, > sorry for the late reply. I had to revisit the tsilo code, long time withou= t looking at it :) > When I designed the module I had in mind what I considered a "natural" scen= ario for the push notifications: the entity acting as a registrar being the o= ne responsible for a call forking. > Of course other scenarios have arisen which are not covered by the current = implementation, one of which is to be able to add branches without the usrloc= /registrar mechanism. > We could add two new functions that do the same as ts_append and ts_append_= to but without performing the look: > - ts_append_no_lookup(ruri, [contact]): add to all the transactions stored = for ruri a new branch for (if not specified extracted from the curr= ent SIP message) > - ts_append_to_no_lookup(tindex, tlabel, [contact]): add to the transaction= specified by tindex and tlabel a new branch for =20 > Maybe names are a bit long but is to give the idea. > Do you think that a solution like this would cover your (and others') scena= rios? > I can try to find the time to work on it :) >=20 > Cheers, >=20 > Federico >=20 >=20 >=20 > On Tue, Nov 28, 2023 at 8:39=E2=80=AFPM Alex Balashov via sr-users wrote: > PS. It seems to me there are some kludgy options to work around this limita= tion, i.e. to basically reinvent tsilo.=20 >=20 > They all boil down to suspending the transaction and using some sort of IPC= mechanism to queue new branch destinations, then, after some defined interva= l, using some dequeueing mechanism as a semaphore to kick-start the forking p= rocess.=20 >=20 > For instance, one could do this by hashing the RURI destination, transactio= n index and label in htable, then suspending the transaction, then piling som= e branches into it and then setting the expiration value of the RURI key to i= mmediate, causing event_route[htable:expired:
] to kick off. Depending = on where exactly that executes, this could resume the transaction, add the br= anches and manage the forking. Or one could try some tricks with config locks= , or mqueue's unique key mode. >=20 > But none of these solutions allow the continuous drip of new serial forking= destinations into an active transaction. They all require suspending and wai= ting a sufficient amount of time to believe oneself to have collected all the= potential destinations, then to reanimate. This is not necessarily how the r= eal world works. These mechanisms are also quite complicated, and complexity = breeds fragility. >=20 > -- Alex >=20 > > On 28 Nov 2023, at 13:38, Alex Balashov wro= te: > >=20 > > Hi, > >=20 > > I wanted to revisit the topic of tsilo dependence on the location service= . All three ts_append*() functions have the following quality: > >=20 > > - ts_append(): "performing a contact lookup on the table specified by the= domain parameter." > > - ts_append_by_contact(): "the contact lookup is performed" > > - ts_append_to(): "performing a contacts lookup on the table specified by= the domain parameter" > >=20 > > Why is this extensive coupling to usrloc necessary? This makes it impossi= ble to use `tsilo` in case of providing a push-notification add-on that front= -ends an upstream registrar, requiring a kind of local shadow registrar or mi= d-registrar. What would make more sense is a generic mechanism that allows on= e to "drip" new contacts into an existing transaction, whether suspended or a= ctive.=20 > >=20 > > Kamailio has a mechanism to add more branches to an existing transaction,= but the scope of that mechanism is only from *inside* the vantage point of t= he transaction in question. The key parlour trick of `tsilo` is that it permi= ts dripping new branches into a *different* transaction. > >=20 > > ts_append_to() almost does the trick, providing a target index and label,= but it just insists on doing a registrar lookup to source the contacts.=20 > >=20 > > What is really wanted and needed for the downstream PN gateway use-case i= s a means of extracting contacts from incoming registrations (or other source= s, potentially) without storing them in any fashion locally, without using or= even loading usrloc, and just throwing them over the fence into a different = transaction. > >=20 > > Is this somehow possible by means other than tsilo? Am I overlooking some= thing? > >=20 > > Cheers, > >=20 > > -- Alex > >=20 > > --=20 > > Alex Balashov > > Principal Consultant > > Evariste Systems LLC > > Web: https://evaristesys.com > > Tel: +1-706-510-6800 > >=20 >=20 > --=20 > Alex Balashov > Principal Consultant > Evariste Systems LLC > Web: https://evaristesys.com > Tel: +1-706-510-6800 >=20 > __________________________________________________________ > Kamailio - Users Mailing List - Non Commercial Discussions > To unsubscribe send an email to sr-users-leave(a)lists.kamailio.org > Important: keep the mailing list in the recipients, do not reply only to th= e sender! > Edit mailing list options or unsubscribe: --=20 Alex Balashov Principal Consultant Evariste Systems LLC Web: https://evaristesys.com Tel: +1-706-510-6800 --===============0148439153==--