Hello!
I have Kamailio setup with registrar configured to allow multiple registrations. *branch_route[MANAGE_BRANCH]* contains *t_on_reply("REPLY")* and *t_on_branch_failure("FAILURE")*.
*event_route[tm:branch-failure:FAILURE]* is used to do some logic, store information in htable and in the end it calls *t_relay* function. This creates new branch.
Replies for this branch go to* onreply_route[REPLY]*. The problem is that I can not find appropriate variable that would be available in both *event_route tm:branch-failure* and *onreply_route*. I need it to get saved data from htable. $T_reply_ruid is available in first one but not in second. $T_branch_idx obviously changes so it can not be used. Some registrations do not have *Received* value so source IP address and ports can not be used. *Address* value can be compared with *Contact* header from responce tacket but it is so long that it looks like it's not optimal way to do.
What interesting is that $T_reply_ruid is accessible in original replies for branches that have not failed.
Does anyone know what variable can be used in this case or how to make sure that $T_reply_ruid will be set?
Thanks a lot!
I found much better description of the problem here https://lists.kamailio.org/pipermail/users/2008-August/019070.html. Also I figured that calling *reg_fetch_contacts* and saving appropriate *$(ulc(callee=>addr)[$var(i)])* in *event_route[tm:branch-failure:FAILURE]* will allow to match *t_on_reply("REPLY")* by *$T(ruid)*.
пт, 15 бер. 2019 о 17:10 Володимир Іванець volodyaivanets@gmail.com пише:
Hello!
I have Kamailio setup with registrar configured to allow multiple registrations. *branch_route[MANAGE_BRANCH]* contains *t_on_reply("REPLY")* and *t_on_branch_failure("FAILURE")*.
*event_route[tm:branch-failure:FAILURE]* is used to do some logic, store information in htable and in the end it calls *t_relay* function. This creates new branch.
Replies for this branch go to* onreply_route[REPLY]*. The problem is that I can not find appropriate variable that would be available in both *event_route tm:branch-failure* and *onreply_route*. I need it to get saved data from htable. $T_reply_ruid is available in first one but not in second. $T_branch_idx obviously changes so it can not be used. Some registrations do not have *Received* value so source IP address and ports can not be used. *Address* value can be compared with *Contact* header from responce tacket but it is so long that it looks like it's not optimal way to do.
What interesting is that $T_reply_ruid is accessible in original replies for branches that have not failed.
Does anyone know what variable can be used in this case or how to make sure that $T_reply_ruid will be set?
Thanks a lot!
Hello,
I am not sure I understand what you are looking for? A variable that you can use as a key per branch? Or per call? Maybe you can give an example how you want to use it and expected behavior, then we may be able to give some hints about what can be used.
Cheers, Daniel
On 18.03.19 11:43, Володимир Іванець wrote:
I found much better description of the problem here https://lists.kamailio.org/pipermail/users/2008-August/019070.html. Also I figured that calling *reg_fetch_contacts* and saving appropriate *$(ulc(callee=>addr)[$var(i)])* in /event_route[tm:branch-failure:FAILURE]/ will allow to match /t_on_reply("REPLY")/ by *$T(ruid)*.
пт, 15 бер. 2019 о 17:10 Володимир Іванець <volodyaivanets@gmail.com mailto:volodyaivanets@gmail.com> пише:
Hello! I have Kamailio setup with registrar configured to allow multiple registrations. /branch_route[MANAGE_BRANCH]/ contains /t_on_reply("REPLY")/ and /t_on_branch_failure("FAILURE")/. /event_route[tm:branch-failure:FAILURE]/ is used to do some logic, store information in htable and in the end it calls *t_relay* function. This creates new branch. Replies for this branch go to/ onreply_route[REPLY]/. The problem is that I can not find appropriate variable that would be available in both *event_route tm:branch-failure* and *onreply_route*. I need it to get saved data from htable. $T_reply_ruid is available in first one but not in second. $T_branch_idx obviously changes so it can not be used. Some registrations do not have *Received* value so source IP address and ports can not be used. *Address* value can be compared with *Contact* header from responce tacket but it is so long that it looks like it's not optimal way to do. What interesting is that $T_reply_ruid is accessible in original replies for branches that have not failed. Does anyone know what variable can be used in this case or how to make sure that $T_reply_ruid will be set? Thanks a lot!
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Mon, Mar 18, 2019 at 12:43:25PM +0200, Володимир Іванець wrote:
I found much better description of the problem here https://lists.kamailio.org/pipermail/users/2008-August/019070.html.
Wow. That is some rather ancient history. And I think reflects a different place in the evolution of my own understanding of Kamailio/OpenSER; it was 11 years ago. I don't know if the question is very pertinent today as formulated there.
Hello,
I'll try to break down my scenario as detailed as I can :)
Following happens when Kamailio receives INVITE from Asterisk: 1. It decides if Asterisk reaches out to registered UAC. 2. *lookup("location")* is executed. AoR can have multiple Contacts. 3. Processing reaches branch_route[MANAGE_BRANCH]. String with rtpengine_offer parameters is being formed here. It can have different settings based on each Contact. *rtpengine_offer* is called. 4. Some phones will respond with 415 or 488. These responces are processed in event_route[tm:branch-failure:FAILURE]. 5. Alternative rtpengine_offer parameters are compiled. This time *call-id* is set to value from *Call-ID* plus a *suffix*. This information is stored in Htable. *rtpengine_offer* is called. 6. *$du* is set from apropriate Contact's data from *reg_fetch_contacts("location", "$ru", "callee")* and *t_relay()* is called. 7. Responce 200 for this branch will be processed in *onreply_route[REPLY]*. rtpengine_answer parameters are formed including *call-id* and *rtpengine_answer* is executed.
The problem is that that I was not able to rely responce on step 7 to new request from steps 4-6. I figured that *$(ulc(callee=>addr)[$var(i)])* in *event_route[tm:branch-failure:FAILURE]* will be the same as *$T(ruid)* in *t_on_reply("REPLY").* At this point I need to perform comparison of *$T(ruid)* to saved values from Htable.
These values have few dozens of characters and operation of comparison does not look to be efficient.
It also looks like *$T_branch(uri)* variable (which could be perfect to use on step 7) is not available in responce to new branch because how I set *$du* and called *t_relay()*. I was trying to call *lookup("location")* before *t_relay()* and *$T_branch(uri)* would be available but since each AoR can have multiple Contacts this will not work.
Please let me know if I need to provide any clarifications. I will really appreciate any suggestions on improvements that cam be made here.
Thanks a lot!
пн, 18 бер. 2019 о 22:51 Alex Balashov abalashov@evaristesys.com пише:
On Mon, Mar 18, 2019 at 12:43:25PM +0200, Володимир Іванець wrote:
I found much better description of the problem here https://lists.kamailio.org/pipermail/users/2008-August/019070.html.
Wow. That is some rather ancient history. And I think reflects a different place in the evolution of my own understanding of Kamailio/OpenSER; it was 11 years ago. I don't know if the question is very pertinent today as formulated there.
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
I just realized that *$T_branch(uri)* variable in *onreply_route[REPLY]* is always set to first Contact's Address from AoR list.
вт, 19 бер. 2019 о 12:05 Володимир Іванець volodyaivanets@gmail.com пише:
Hello,
I'll try to break down my scenario as detailed as I can :)
Following happens when Kamailio receives INVITE from Asterisk:
- It decides if Asterisk reaches out to registered UAC.
- *lookup("location")* is executed. AoR can have multiple Contacts.
- Processing reaches branch_route[MANAGE_BRANCH]. String with
rtpengine_offer parameters is being formed here. It can have different settings based on each Contact. *rtpengine_offer* is called. 4. Some phones will respond with 415 or 488. These responces are processed in event_route[tm:branch-failure:FAILURE]. 5. Alternative rtpengine_offer parameters are compiled. This time *call-id* is set to value from *Call-ID* plus a *suffix*. This information is stored in Htable. *rtpengine_offer* is called. 6. *$du* is set from apropriate Contact's data from *reg_fetch_contacts("location", "$ru", "callee")* and *t_relay()* is called. 7. Responce 200 for this branch will be processed in *onreply_route[REPLY]*. rtpengine_answer parameters are formed including *call-id* and *rtpengine_answer* is executed.
The problem is that that I was not able to rely responce on step 7 to new request from steps 4-6. I figured that *$(ulc(callee=>addr)[$var(i)])* in *event_route[tm:branch-failure:FAILURE]* will be the same as *$T(ruid)* in *t_on_reply("REPLY").* At this point I need to perform comparison of *$T(ruid)* to saved values from Htable.
These values have few dozens of characters and operation of comparison does not look to be efficient.
It also looks like *$T_branch(uri)* variable (which could be perfect to use on step 7) is not available in responce to new branch because how I set *$du* and called *t_relay()*. I was trying to call *lookup("location")* before *t_relay()* and *$T_branch(uri)* would be available but since each AoR can have multiple Contacts this will not work.
Please let me know if I need to provide any clarifications. I will really appreciate any suggestions on improvements that cam be made here.
Thanks a lot!
пн, 18 бер. 2019 о 22:51 Alex Balashov abalashov@evaristesys.com пише:
On Mon, Mar 18, 2019 at 12:43:25PM +0200, Володимир Іванець wrote:
I found much better description of the problem here https://lists.kamailio.org/pipermail/users/2008-August/019070.html.
Wow. That is some rather ancient history. And I think reflects a different place in the evolution of my own understanding of Kamailio/OpenSER; it was 11 years ago. I don't know if the question is very pertinent today as formulated there.
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hello again!
My problem was solved by using *t_reuse_branch()* in *event_route[tm:branch-failure:FAILURE]*.
Thanks a lot!
вт, 19 бер. 2019 о 19:42 Володимир Іванець volodyaivanets@gmail.com пише:
I just realized that *$T_branch(uri)* variable in *onreply_route[REPLY]* is always set to first Contact's Address from AoR list.
вт, 19 бер. 2019 о 12:05 Володимир Іванець volodyaivanets@gmail.com пише:
Hello,
I'll try to break down my scenario as detailed as I can :)
Following happens when Kamailio receives INVITE from Asterisk:
- It decides if Asterisk reaches out to registered UAC.
- *lookup("location")* is executed. AoR can have multiple Contacts.
- Processing reaches branch_route[MANAGE_BRANCH]. String with
rtpengine_offer parameters is being formed here. It can have different settings based on each Contact. *rtpengine_offer* is called. 4. Some phones will respond with 415 or 488. These responces are processed in event_route[tm:branch-failure:FAILURE]. 5. Alternative rtpengine_offer parameters are compiled. This time *call-id* is set to value from *Call-ID* plus a *suffix*. This information is stored in Htable. *rtpengine_offer* is called. 6. *$du* is set from apropriate Contact's data from *reg_fetch_contacts("location", "$ru", "callee")* and *t_relay()* is called. 7. Responce 200 for this branch will be processed in *onreply_route[REPLY]*. rtpengine_answer parameters are formed including *call-id* and *rtpengine_answer* is executed.
The problem is that that I was not able to rely responce on step 7 to new request from steps 4-6. I figured that *$(ulc(callee=>addr)[$var(i)])* in *event_route[tm:branch-failure:FAILURE]* will be the same as *$T(ruid)* in *t_on_reply("REPLY").* At this point I need to perform comparison of *$T(ruid)* to saved values from Htable.
These values have few dozens of characters and operation of comparison does not look to be efficient.
It also looks like *$T_branch(uri)* variable (which could be perfect to use on step 7) is not available in responce to new branch because how I set *$du* and called *t_relay()*. I was trying to call *lookup("location")* before *t_relay()* and *$T_branch(uri)* would be available but since each AoR can have multiple Contacts this will not work.
Please let me know if I need to provide any clarifications. I will really appreciate any suggestions on improvements that cam be made here.
Thanks a lot!
пн, 18 бер. 2019 о 22:51 Alex Balashov abalashov@evaristesys.com пише:
On Mon, Mar 18, 2019 at 12:43:25PM +0200, Володимир Іванець wrote:
I found much better description of the problem here https://lists.kamailio.org/pipermail/users/2008-August/019070.html.
Wow. That is some rather ancient history. And I think reflects a different place in the evolution of my own understanding of Kamailio/OpenSER; it was 11 years ago. I don't know if the question is very pertinent today as formulated there.
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users