Hi List,
I want to implement serial forking with avpops module and I have this problem. The set of destinations for each user is stored in a database and I use apv_db_load to load it. However, I couldn't find a way to sort them in the right order. For example, I cant tell SER to try destination A before B, then C because there is no way to specify this in the database. Another feature I want to implement is to allow a client to specify a timeout for a destination. Eg. Try A for x seconds, then try B for y seconds, then try C. I wonder if there are ways to implement the services above using actual ser modules or it's not yet possible.
Best regards,
Minh
PHAN, Quang-Minh (Docteur Ordinateur) writes:
I want to implement serial forking with avpops module and I have this
problem. The set of destinations for each user is stored in a database and I use apv_db_load to load it. However, I couldn't find a way to sort them in the right order. For example, I cant tell SER to try destination A before B, then C because there is no way to specify this in the database.
if you use location table to store the destinations, then you can use lcr module to implement serial forking according to q value.
Another feature I want to implement is to allow a client to specify a timeout for a destination. Eg. Try A for x seconds, then try B for y seconds, then try C.
lcr module has a timer variable that is used to timeout all but the last destination.
-- juha
Hi Minh,
After loading the AVPs via apv_db_load() function you will have in memory the AVP list exactly in the revert order than in database. Ex: if you had for avp "test" values A, B, C and D, after loading you will have the order D, C, B and A.
Regarding the timeout value, to set different values for each step, just do : avp_write("i:10", "fr_inv_timer_avp"); before each call of t_relay() - instead of 10, put whatever value you want;
If you are using the development branch, you can set the value for timeout directly from another AVP (perhaps loaded also from DB): avp_copy("my_avp", "fr_inv_timer_avp");
Best regards, Marian
PHAN, Quang-Minh (Docteur Ordinateur) wrote:
Hi List,
I want to implement serial forking with avpops module and I have
this problem. The set of destinations for each user is stored in a database and I use apv_db_load to load it. However, I couldn't find a way to sort them in the right order. For example, I cant tell SER to try destination A before B, then C because there is no way to specify this in the database. Another feature I want to implement is to allow a client to specify a timeout for a destination. Eg. Try A for x seconds, then try B for y seconds, then try C.
I wonder if there are ways to implement the services above using
actual ser modules or it's not yet possible.
Best regards,
Minh
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi Minh,
After loading the AVPs via apv_db_load() function you will have in memory the AVP list exactly in the revert order than in database. Ex: if you had for avp "test" values A, B, C and D, after loading you will have the order D, C, B and A.
Can anyone think of a way to set the order in the database? I think that it is probably impractical, if not impossible.
Is this reverse order by design or by implementation? My ser logic heavily relies on the behavior. I wonder if any future upgrade might break it if it is just how the code is implemented.
Richard
Richard wrote:
Hi Minh,
After loading the AVPs via apv_db_load() function you will have in memory the AVP list exactly in the revert order than in database. Ex: if you had for avp "test" values A, B, C and D, after loading you will have the order D, C, B and A.
Can anyone think of a way to set the order in the database? I think that it is probably impractical, if not impossible.
If you want to have ordering for AVP of same name/ID at load_db time you need to relay on some information/order already existing in the DB. At the moment, the only available criteria is the DB order itself.
Is this reverse order by design or by implementation? My ser logic heavily relies on the behavior. I wonder if any future upgrade might break it if it is just how the code is implemented.
The revert order is a effect of how the AVP core is implemented - the AVPs are kept in singled-linked list and any new APV is added at the beginning of the list.
Best regards, Marian
Richard writes:
Can anyone think of a way to set the order in the database? I think that it is probably impractical, if not impossible.
you would need some field(s) in the database for ordering and then use ORDER BY in SELECT.
Is this reverse order by design or by implementation? My ser logic heavily relies on the behavior. I wonder if any future upgrade might break it if it is just how the code is implemented.
there are modules that would break if reverse order is changed to something else.
-- juha