On Tue, Mar 27, 2012 at 3:13 PM, Uri Shacked uri.shacked@gmail.com wrote:
Hi,
Following the advice I got on the subject “remove_hf" and "append_hf" one after the other , twice, issue”, I tried to work with the “append_branch()” function.
What I need to do is, after I received the invite from the original user, I use SIP methods to work with the NP server. I subst() the user part, send the call to the NP server, get the reply, parse it and then subst() back to the destination and send the call out.
Doing it with “append_branch” seems logical.
I do “append_branch()” before changing the user, get the reply (301), goes on to failure route after the branch route was called, and from there I have a problem.
I need to continue my flow without the branch I added. How do I return to the original on?
I read about the t_drop_replies but didn’t quit understand…..
BR,
Uri
Hi,
try the following:
route { # Whatever you do in your main-route.... t_on_branch("modify_contact"); # Whatever you do in your main-route, the branch route is automatically triggered for each branch. t_relay(); }
branch_route[modify_contact] { remove_hf("Contact"); append_hf("Contact: sip:whatever@something\r\n"); }
failure_route[failure_from_np] { # You need to modify the triggered branch_route again, otherwise the same branch_route will triggered again... }
Just calling "append_branch" does not help.
Carsten
2012/3/27 Uri Shacked ushacked@gmail.com:
On Tue, Mar 27, 2012 at 3:13 PM, Uri Shacked uri.shacked@gmail.com wrote:
Hi,
Following the advice I got on the subject “remove_hf" and "append_hf" one after the other , twice, issue”, I tried to work with the “append_branch()” function.
What I need to do is, after I received the invite from the original user, I use SIP methods to work with the NP server. I subst() the user part, send the call to the NP server, get the reply, parse it and then subst() back to the destination and send the call out.
Doing it with “append_branch” seems logical.
I do “append_branch()” before changing the user, get the reply (301), goes on to failure route after the branch route was called, and from there I have a problem.
I need to continue my flow without the branch I added. How do I return to the original on?
I read about the t_drop_replies but didn’t quit understand…..
BR,
Uri
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
In my case i need to change the header and then send it.
Here the case works if i make the changes after i sent the invite and got the reply. As i know the t_on_branch will work after the invite is sent... am i wrong?
There are many questions to ask about the branches... when do they work in a serial manner, when parallel... where can i find it documented best?
Hi,
try the following:
route { # Whatever you do in your main-route.... t_on_branch("modify_contact"); # Whatever you do in your main-route, the branch route is automatically triggered for each branch. t_relay(); }
branch_route[modify_contact] { remove_hf("Contact"); append_hf("Contact: sip:whatever at somethinghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users \r\n"); }
failure_route[failure_from_np] { # You need to modify the triggered branch_route again, otherwise the same branch_route will triggered again... }
Just calling "append_branch" does not help.
Carsten
On Tue, Mar 27, 2012 at 3:14 PM, Uri Shacked ushacked@gmail.com wrote:
On Tue, Mar 27, 2012 at 3:13 PM, Uri Shacked uri.shacked@gmail.comwrote:
Hi,
Following the advice I got on the subject “remove_hf" and "append_hf" one after the other , twice, issue”, I tried to work with the “append_branch()” function.
What I need to do is, after I received the invite from the original user, I use SIP methods to work with the NP server. I subst() the user part, send the call to the NP server, get the reply, parse it and then subst() back to the destination and send the call out.
Doing it with “append_branch” seems logical.
I do “append_branch()” before changing the user, get the reply (301), goes on to failure route after the branch route was called, and from there I have a problem.
I need to continue my flow without the branch I added. How do I return to the original on?
I read about the t_drop_replies but didn’t quit understand…..
BR,
Uri
Hi Uri,
you're wrong. "t_on_branch" works before the request is sent out.... The branches work in the manner, you program them in your logic (e.g. set the timeout for a request, then use failure route for serial branches). There is no general switch (and i'm not aware of any good docs regarding this) in order to do serial or parallel branches.
Carsten
2012/3/27 Uri Shacked ushacked@gmail.com:
In my case i need to change the header and then send it.
Here the case works if i make the changes after i sent the invite and got the reply. As i know the t_on_branch will work after the invite is sent... am i wrong?
There are many questions to ask about the branches... when do they work in a serial manner, when parallel... where can i find it documented best?
Hi,
try the following:
route { # Whatever you do in your main-route.... t_on_branch("modify_contact"); # Whatever you do in your main-route, the branch route is automatically triggered for each branch. t_relay(); }
branch_route[modify_contact] { remove_hf("Contact"); append_hf("Contact: sip:whatever at something\r\n"); }
failure_route[failure_from_np] { # You need to modify the triggered branch_route again, otherwise the same branch_route will triggered again... }
Just calling "append_branch" does not help.
Carsten
On Tue, Mar 27, 2012 at 3:14 PM, Uri Shacked ushacked@gmail.com wrote:
On Tue, Mar 27, 2012 at 3:13 PM, Uri Shacked uri.shacked@gmail.com wrote:
Hi,
Following the advice I got on the subject “remove_hf" and "append_hf" one after the other , twice, issue”, I tried to work with the “append_branch()” function.
What I need to do is, after I received the invite from the original user, I use SIP methods to work with the NP server. I subst() the user part, send the call to the NP server, get the reply, parse it and then subst() back to the destination and send the call out.
Doing it with “append_branch” seems logical.
I do “append_branch()” before changing the user, get the reply (301), goes on to failure route after the branch route was called, and from there I have a problem.
I need to continue my flow without the branch I added. How do I return to the original on?
I read about the t_drop_replies but didn’t quit understand…..
BR,
Uri
Are you searching for examples of serial / parallel forking config found in the TM module documentation ?
Reda
On Tue, Mar 27, 2012 at 16:55, Carsten Bock carsten@ng-voice.com wrote:
Hi Uri,
you're wrong. "t_on_branch" works before the request is sent out.... The branches work in the manner, you program them in your logic (e.g. set the timeout for a request, then use failure route for serial branches). There is no general switch (and i'm not aware of any good docs regarding this) in order to do serial or parallel branches.
Carsten
2012/3/27 Uri Shacked ushacked@gmail.com:
In my case i need to change the header and then send it.
Here the case works if i make the changes after i sent the invite and got the reply. As i know the t_on_branch will work after the invite is
sent...
am i wrong?
There are many questions to ask about the branches... when do they work
in a
serial manner, when parallel... where can i find it documented best?
Hi,
try the following:
route { # Whatever you do in your main-route.... t_on_branch("modify_contact"); # Whatever you do in your main-route, the branch route is automatically triggered for each branch. t_relay(); }
branch_route[modify_contact] { remove_hf("Contact"); append_hf("Contact: sip:whatever at something\r\n"); }
failure_route[failure_from_np] { # You need to modify the triggered branch_route again, otherwise the same branch_route will triggered again... }
Just calling "append_branch" does not help.
Carsten
On Tue, Mar 27, 2012 at 3:14 PM, Uri Shacked ushacked@gmail.com wrote:
On Tue, Mar 27, 2012 at 3:13 PM, Uri Shacked uri.shacked@gmail.com wrote:
Hi,
Following the advice I got on the subject “remove_hf" and "append_hf"
one
after the other , twice, issue”, I tried to work with the
“append_branch()”
function.
What I need to do is, after I received the invite from the original
user,
I use SIP methods to work with the NP server. I subst() the user part,
send
the call to the NP server, get the reply, parse it and then subst()
back to
the destination and send the call out.
Doing it with “append_branch” seems logical.
I do “append_branch()” before changing the user, get the reply (301), goes on to failure route after the branch route was called, and from
there I
have a problem.
I need to continue my flow without the branch I added. How do I return
to
the original on?
I read about the t_drop_replies but didn’t quit understand…..
BR,
Uri
-- Carsten Bock CEO (Geschäftsführer)
ng-voice GmbH Schomburgstr. 80 D-22767 Hamburg / Germany
http://www.ng-voice.com mailto:carsten@ng-voice.com
Mobile +49 179 2021244 Office +49 40 34927219 Fax +49 40 34927220
Sitz der Gesellschaft: Hamburg Registergericht: Amtsgericht Hamburg, HRB 120189 Geschäftsführer: Carsten Bock Ust-ID: DE279344284
Hier finden Sie unsere handelsrechtlichen Pflichtangaben: http://www.ng-voice.com/imprint/
-- Meet ng-voice at LinuxTag 2012 in Berlin - May 23rd - 26th, 2012. Save the date!
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
Hi,
On 03/27/2012 04:46 PM, Uri Shacked wrote:
In my case i need to change the header and then send it.
Here the case works if i make the changes after i sent the invite and got the reply. As i know the t_on_branch will work after the invite is sent... am i wrong?
There are many questions to ask about the branches... when do they work in a serial manner, when parallel... where can i find it documented best?
Actually it's quite simple. If a request comes in and you modify it in a normal route (e.g. calling rtpproxy_offer(), uac_replace_from(), adding additional headers and stuff like that) and you send it out using e.g. t_relay(), then in a serial scenario when you re-enter via a failure-route, these changes will still be there (which is not always what you want).
On the other hand, if you register a branch route via t_on_branch() and do your changes there instead of prior to calling t_relay(), then these changes from branch route will be rolled back, and you can do your changes easily again in the same or another branch route starting with your original message. This is important for example in serial call forward scenarios, where the first destination might require an rtpproxy, but the second doesn't, or when the first destination requires different custom headers compare to the second.
Basically the same applies to parallel scenarios. If you modify your message before calling lookup() and you've multiple contacts registered for your destination, then your changes will apply for all branches which are created by that. However if you move your modifications to a branch route, then you can work on your messages individually, depending on the branch.
Hope this clarifies it a bit.
Andreas