Re: [SR-Users] serial forking calls using TSILO
Hi, could you please provide the LOCATION route and the Kamailio's log at level 3? Thank you. Regards, Federico On Fri, Jan 20, 2017 at 11:05 AM, Tomas Zanetwrote: > Hello, > I’m using Kamailio 4.4.4 with TSILO module in order to support Push > Notifications used by our voip app on Apple ios10. > So far, everything works fine: Kamailio can get an incoming call, suspend > it, then send push notification with an external script, receive a new app > registration and then call it after resuming the invite. > To do so, thanks to Mr, Cabiddu, I used all the functions described here > http://www.kamailio.org/events/2015-KamailioWorld/ > Day2/20-Federico.Cabiddu-Kamailio-In-A-Mobile-World.pdf > > > Right now, I would like to support serial forking calls using push > notification because it was already supported with legacy voip. > To do so, I used failure_route function where, after getting the call > destinations and setting them into an avp, I set the new SIP request uri > $ru. > Here is my failure_route: > failure_route[MANAGE_FAILURE] > route(NATMANAGE); > if (t_is_canceled()) > exit; > > > #!ifdef WITH_BLOCK3XX > # block call redirect based on 3xx replies. > if (t_check_status("3[0-9][0-9]")) > t_reply("404","Not found"); > exit; > > #!endif > >if (is_avp_set("$avp(group_members_db)")) > $ru ="sip:"+$avp(group_members_db)+"@"+$fd; > $avp(group_members_db) = $null; > route(LOCATION); > exit; > > > > I am troubleshooting this scenario and this is what I see: > 1) Kamailio receives incoming call > 2) Suspend it > 3) Send Push notification to account1 > 4) Kamailio receives account1 registration -> INVRESUME route is now called > 5) Then call account1 > 6) Nobody answers the call > 7) failure_route[MANAGE_FAILURE] is now called -> set $ru with next > sipaccount: account2 > 8) suspend invite > 9) send push notification to account2 > 10) account2 sends its sip registration -> INVRESUME route is now called > 11) Kamailio calls account1 instead of account2 -> this is my issue > > On step 10: despite account2 is registered, I checked it using “kamctl ul > show”, the second call is forwarded all'account1 and not to account2. > I also checked the TSILO logs and everything seems ok. Here is the logs: > First call: > suspended transaction [53945:1648394094] asterisk => account1 > htable key value [53945:1648394094] > resuming trasaction [53945:1648394094] account1 53945:1648394094) > second call: > suspended transaction [53945:1648394094] asterisk => account2 > htable key value [53945:1648394094] > resuming trasaction [53945:1648394094] account2 53945:1648394094) > > In order to find out the issue I put some xlogs, printing $ru value: what > I see is the $ru value is set correctly on failure_route but as soon as the > t_continue is called, the ru overwritten back to account1 > > Can anyone address me to find out the solution? > Thanks in advance > > T. > > > > > *Tomas Zanet *Software Design Department > tza...@came.com > > > > ___ > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list > sr-users@lists.sip-router.org > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users > > ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] serial forking calls using TSILO
Hello, have you stored the transaction for the second account? Cheers, Daniel On 20/01/2017 11:05, Tomas Zanet wrote: > Hello, > I’m using Kamailio 4.4.4 with TSILO module in order to support Push > Notifications used by our voip app on Apple ios10. > So far, everything works fine: Kamailio can get an incoming call, > suspend it, then send push notification with an external script, > receive a new app registration and then call it after resuming the invite. > To do so, thanks to Mr, Cabiddu, I used all the functions described here > http://www.kamailio.org/events/2015-KamailioWorld/Day2/20-Federico.Cabiddu-Kamailio-In-A-Mobile-World.pdf > > > Right now, I would like to support serial forking calls using push > notification because it was already supported with legacy voip. > To do so, I used failure_route function where, after getting the call > destinations and setting them into an avp, I set the new SIP request > uri $ru. > Here is my failure_route: > failure_route[MANAGE_FAILURE] > route(NATMANAGE); > if (t_is_canceled()) > exit; > > > #!ifdef WITH_BLOCK3XX > # block call redirect based on 3xx replies. > if (t_check_status("3[0-9][0-9]")) > t_reply("404","Not found"); > exit; > > #!endif > >if (is_avp_set("$avp(group_members_db)")) > $ru ="sip:"+$avp(group_members_db)+"@"+$fd; > $avp(group_members_db) = $null; > route(LOCATION); > exit; > > > > I am troubleshooting this scenario and this is what I see: > 1) Kamailio receives incoming call > 2) Suspend it > 3) Send Push notification to account1 > 4) Kamailio receives account1 registration -> INVRESUME route is now > called > 5) Then call account1 > 6) Nobody answers the call > 7) failure_route[MANAGE_FAILURE] is now called -> set $ru with next > sipaccount: account2 > 8) suspend invite > 9) send push notification to account2 > 10) account2 sends its sip registration -> INVRESUME route is now called > 11) Kamailio calls account1 instead of account2 -> this is my issue > > On step 10: despite account2 is registered, I checked it using “kamctl > ul show”, the second call is forwarded all'account1 and not to account2. > I also checked the TSILO logs and everything seems ok. Here is the logs: > First call: > suspended transaction [53945:1648394094] asterisk => account1 > htable key value [53945:1648394094] > resuming trasaction [53945:1648394094] account1 53945:1648394094) > second call: > suspended transaction [53945:1648394094] asterisk => account2 > htable key value [53945:1648394094] > resuming trasaction [53945:1648394094] account2 53945:1648394094) > > In order to find out the issue I put some xlogs, printing $ru value: > what I see is the $ru value is set correctly on failure_route but as > soon as the t_continue is called, the ru overwritten back to account1 > > Can anyone address me to find out the solution? > Thanks in advance > > T. > > > > *Tomas Zanet > *Software Design Department > tza...@came.com > > > > > ___ > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list > sr-users@lists.sip-router.org > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - www.asipto.com Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] serial forking calls using TSILO
Hello, I'm using Kamailio 4.4.4 with TSILO module in order to support Push Notifications used by our voip app on Apple ios10. So far, everything works fine: Kamailio can get an incoming call, suspend it, then send push notification with an external script, receive a new app registration and then call it after resuming the invite. To do so, thanks to Mr, Cabiddu, I used all the functions described here http://www.kamailio.org/events/2015-KamailioWorld/Day2/20-Federico.Cabiddu-Kamailio-In-A-Mobile-World.pdf Right now, I would like to support serial forking calls using push notification because it was already supported with legacy voip. To do so, I used failure_route function where, after getting the call destinations and setting them into an avp, I set the new SIP request uri $ru. Here is my failure_route: failure_route[MANAGE_FAILURE] route(NATMANAGE); if (t_is_canceled()) exit; #!ifdef WITH_BLOCK3XX # block call redirect based on 3xx replies. if (t_check_status("3[0-9][0-9]")) t_reply("404","Not found"); exit; #!endif if (is_avp_set("$avp(group_members_db)")) $ru ="sip:"+$avp(group_members_db)+"@"+$fd; $avp(group_members_db) = $null; route(LOCATION); exit; I am troubleshooting this scenario and this is what I see: 1) Kamailio receives incoming call 2) Suspend it 3) Send Push notification to account1 4) Kamailio receives account1 registration -> INVRESUME route is now called 5) Then call account1 6) Nobody answers the call 7) failure_route[MANAGE_FAILURE] is now called -> set $ru with next sipaccount: account2 8) suspend invite 9) send push notification to account2 10) account2 sends its sip registration -> INVRESUME route is now called 11) Kamailio calls account1 instead of account2 -> this is my issue On step 10: despite account2 is registered, I checked it using "kamctl ul show", the second call is forwarded all'account1 and not to account2. I also checked the TSILO logs and everything seems ok. Here is the logs: First call: suspended transaction [53945:1648394094] asterisk => account1 htable key value [53945:1648394094] resuming trasaction [53945:1648394094] account1 53945:1648394094) second call: suspended transaction [53945:1648394094] asterisk => account2 htable key value [53945:1648394094] resuming trasaction [53945:1648394094] account2 53945:1648394094) In order to find out the issue I put some xlogs, printing $ru value: what I see is the $ru value is set correctly on failure_route but as soon as the t_continue is called, the ru overwritten back to account1 Can anyone address me to find out the solution? Thanks in advance T. Tomas Zanet Software Design Department tza...@came.com ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Serial Forking and t_suspend
Hello, On 28/09/16 07:11, Kelvin Chua wrote: > we have serial forking already setup properly but need to t_suspend(). > found out that it completely breaks the destination set. > other than manually rebuilding the destination set after t_continue(), > are > there any other solution out there? are you using t_load_contacts()/t_next_contacts()? Or how you keep the list of addresses for serial forking? The internal destination set array is static and moved in a transaction context as branches (for parallel forking) or xavps via the above functions. Cheers, Daniel -- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Oct 24-26, 2016 - http://www.asipto.com ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Serial Forking and t_suspend
we have serial forking already setup properly but need to t_suspend(). found out that it completely breaks the destination set. other than manually rebuilding the destination set after t_continue(), are there any other solution out there? Kelvin Chua ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Serial Forking and Lookup Function
Thanks for the clarification! -dan From: sr-users [mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of Daniel-Constantin Mierla Sent: Tuesday, November 3, 2015 2:23 AM To: Kamailio (SER) - Users Mailing List <sr-users@lists.sip-router.org> Subject: Re: [SR-Users] Serial Forking and Lookup Function Hello, On 03/11/15 05:31, Daniel W. Graham wrote: Looking for some clarification / direction on setting up forking. I have configured clients to use q-value and is stored in location table. I see several examples as described in TM module documentation but does not mention use of lookup() function. Per registrar documentation- lookup() The functions extracts username from Request-URI and tries to find all contacts for the username in usrloc. If there are no such contacts, -1 will be returned. If there are such contacts, Request-URI will be overwritten with the contact that has the highest q value and optionally the rest will be appended to the message (depending on append_branches parameter value). Append_branch parameter The parameter controls how lookup function processes multiple contacts. If there are multiple contacts for the given username in usrloc and this parameter is set to 1, Request-URI will be overwritten with the highest-q rated contact and the rest will be appended to sip_msg structure and can be later used by tm for forking. Does lookup() build the destination set and then I can proceed by doing t_load_contacts(), t_next_contacts() and setup failure route? Any direction is appreciated! Yes, lookup location builds the destination set with all available contacts in location table. A t_relay() at that moment will do parallel forking, ingnoring the q values. To do serial forking, use t_load_contacts(), t_next_contacts() and failure_route. Cheers, Daniel -- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Book: SIP Routing With Kamailio - http://www.asipto.com Kamailio Advanced Training, Nov 30-Dec 2, Berlin - http://asipto.com/kat ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Serial Forking and Lookup Function
Hello, On 03/11/15 05:31, Daniel W. Graham wrote: > > Looking for some clarification / direction on setting up forking. > > > > I have configured clients to use q-value and is stored in location > table. I see several examples as described in TM module documentation > but does not mention use of lookup() function. > > > > Per registrar documentation- > > > > lookup() > > The functions extracts username from Request-URI and tries to find all > contacts for the username in usrloc. If there are no such contacts, -1 > will be returned. If there are such contacts, Request-URI will be > overwritten with the contact that has the highest q value and > optionally the rest will be appended to the message (depending on > append_branches parameter value). > > > > Append_branch parameter > > The parameter controls how lookup function processes multiple > contacts. If there are multiple contacts for the given username in > usrloc and this parameter is set to 1, Request-URI will be overwritten > with the highest-q rated contact and the rest will be appended to > sip_msg structure and can be later used by tm for forking. > > > > Does lookup() build the destination set and then I can proceed by > doing t_load_contacts(), t_next_contacts() and setup failure route? > Any direction is appreciated! > Yes, lookup location builds the destination set with all available contacts in location table. A t_relay() at that moment will do parallel forking, ingnoring the q values. To do serial forking, use t_load_contacts(), t_next_contacts() and failure_route. Cheers, Daniel -- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Book: SIP Routing With Kamailio - http://www.asipto.com Kamailio Advanced Training, Nov 30-Dec 2, Berlin - http://asipto.com/kat ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Serial Forking and Lookup Function
Looking for some clarification / direction on setting up forking. I have configured clients to use q-value and is stored in location table. I see several examples as described in TM module documentation but does not mention use of lookup() function. Per registrar documentation- lookup() The functions extracts username from Request-URI and tries to find all contacts for the username in usrloc. If there are no such contacts, -1 will be returned. If there are such contacts, Request-URI will be overwritten with the contact that has the highest q value and optionally the rest will be appended to the message (depending on append_branches parameter value). Append_branch parameter The parameter controls how lookup function processes multiple contacts. If there are multiple contacts for the given username in usrloc and this parameter is set to 1, Request-URI will be overwritten with the highest-q rated contact and the rest will be appended to sip_msg structure and can be later used by tm for forking. Does lookup() build the destination set and then I can proceed by doing t_load_contacts(), t_next_contacts() and setup failure route? Any direction is appreciated! Thanks, -dan ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Serial forking q value
Hello, you can use sqlops to retrieve data from any database table, with the structure you want. Then with append_branch() function and $branch(...) variable, you have the options to add branches and update their specific attributes with the values retrieved from database. Cheers, Daniel On 03/10/14 16:43, Marino Mileti wrote: Hi guys, I've tried with success to implement serial forking based on q value (i've followed documentation) with the istruction: append_branch(sip:b...@example.com, 0.5); Now my questions are: is it possible to import URI from db? is it possible to import q value from db too? I would like to change the q value based, for example, on night day; so it would be nice if I can store it on DB and then load it dinamically when i need. For the first question I think that it's possible with dbaliases for example...but I don't know how get a q value for each contact :) Marino ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Serial forking q value
Hi guys, I've tried with success to implement serial forking based on q value (i've followed documentation) with the istruction: append_branch(sip:b...@example.com, 0.5); Now my questions are: is it possible to import URI from db? is it possible to import q value from db too? I would like to change the q value based, for example, on night amp; day; so it would be nice if I can store it on DB and then load it dinamically when i need.For the first question I think that it's possible with dbaliases for example...but I don't know how get a q value for each contact :) Marino___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Serial forking with equal q-value
Good morning, I have serveral servers who are registered with the same AOR in Kamailio. Every server registers with a Q-value indicating its availability. When a user sends an INVITE request through Kamailio to that AOR, Kamailio should send the request to the server with the best Q-value. Using t_load_contacts I obtain a q-ordered destination set but the t_next_contacts uses parallel forking when there are two servers with the same q-value. Is there any way to tell t_next_contacts to use only ONE destination? Thank you in advance, Regards, -- *Jan **Gaida* Ingeniero Desarrollo Software C/ Marconi 3 (PTM) 28760 Tres Cantos Spain jan.ga...@grupoamper.com | www.grupoamper.com -- This message and any attachments are intended only for the use of the individual to whom they are addressed and it may contain information that is privileged or confidential. If you have received this communication by mistake, please notify us immediately by e-mail or telephone.The storage, recording, use or disclosure of this e-mail and its attachments by anyone other than the intended recipient is strictly prohibited. This message has been verified using antivirus software; however, the sender is not responsible for any damage to hardware or software resulting from the presence of any virus. Este mensaje y cualquier anexo son exclusivamente para la persona a quien van dirigidos y pueden contener información privilegiada o confidencial. Si usted ha recibido esta comunicación por error, le agradecemos notificarlo de inmediato por esta misma vía o por teléfono. Está prohibida su retención, grabación, utilización o divulgación con cualquier propósito. Este mensaje ha sido verificado con software antivirus; sin embargo, el remitente no se hace responsable en caso de que en éste o en los archivos adjuntos haya presencia de algún virus que pueda generar daños en los equipos o programas del destinatario. ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Serial forking with equal q-value
Jan Gaida writes: I have serveral servers who are registered with the same AOR in Kamailio. Every server registers with a Q-value indicating its availability. When a user sends an INVITE request through Kamailio to that AOR, Kamailio should send the request to the server with the best Q-value. Using t_load_contacts I obtain a q-ordered destination set but the t_next_contacts uses parallel forking when there are two servers with the same q-value. Is there any way to tell t_next_contacts to use only ONE destination? no, unless you do some hacks of your own. same q value means parallel forking. -- juha ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Serial forking
Hello, On 5/9/13 3:14 PM, Vitaliy Aleksandrov wrote: Hello. As I understand t_load_contacts() / t_next_contacts() can help only in case when branches have different q values. The only way I see is to get all contacts via reg_fetch_contacts(), save the list to an AVP and then iterate through the list in the way described in tm module docs. Does anybody know a better way of how serial forking can be implemented if all contacts have equal q values ? maybe you can try a solution by modifying the q value via $branch(...) variable Cheers, Daniel -- Daniel-Constantin Mierla - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013 * http://asipto.com/u/katu * ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Serial forking
I missed that $branch(..) variable is r/w. I like this way more than playing with AVPs. According to documentation $branch(..) variable gives access to additional branches. Is it possible to change Q value for the first branch ? ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Serial forking
Hello. As I understand t_load_contacts() / t_next_contacts() can help only in case when branches have different q values. The only way I see is to get all contacts via reg_fetch_contacts(), save the list to an AVP and then iterate through the list in the way described in tm module docs. Does anybody know a better way of how serial forking can be implemented if all contacts have equal q values ? ___ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users