Hi all
I'm trying to do a "followme" from the proxy side, so I receive a request to some SIP URI and that URI have configured it's followme function that in this case means ... progress a call to the original URI + a call to a new URI, just a parallel branching, but I'm no luck ... :-(
if(is_avp_set($avp(s:followme)) { append_branch($avp(s:followme)); }
That doesn't run, because append_branch does not accept a PV as param, so ...
... $var(s:tmp_ru) = $ru; append_branch(); $ru = $avp(s:followme); ...
But now ... only one of the branches progress ..., the new created branch (after the append_branch call) ... must go to a PSTN number ... but no way, because I must "mark" the branch in some way that I could send it directly to the go_to_pstn route block ...
any clue or example about how to work with the new branch ONLY ? ... because branch 1 works ok, I need to do changes only on branch 2
Best regards
El día 26 de julio de 2010 01:07, Raúl Alexis Betancor Santana rabs@dimension-virtual.com escribió:
any clue or example about how to work with the new branch ONLY ? ... because branch 1 works ok, I need to do changes only on branch 2
You must inspect the $ru (or $du depending the case) in onbranch_route, and take the desired action when $ru is $avp(s:followme).
Yep, what I meant is what Iñaki said.
-- Alex Balashov - Principal Evariste Systems LLC 1170 Peachtree Street 12th Floor, Suite 1200 Atlanta, GA 30309 Tel: +1-678-954-0670 Fax: +1-404-961-1892 Web: http://www.evaristesys.com/
On Jul 25, 2010, at 11:32 PM, Iñaki Baz Castillo ibc@aliax.net wrote:
El día 26 de julio de 2010 01:07, Raúl Alexis Betancor Santana rabs@dimension-virtual.com escribió:
any clue or example about how to work with the new branch ONLY ? ... because branch 1 works ok, I need to do changes only on branch 2
You must inspect the $ru (or $du depending the case) in onbranch_route, and take the desired action when $ru is $avp(s:followme).
-- Iñaki Baz Castillo ibc@aliax.net
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
On Monday 26 July 2010 04:32:13 Iñaki Baz Castillo wrote:
El día 26 de julio de 2010 01:07, Raúl Alexis Betancor Santana
rabs@dimension-virtual.com escribió:
any clue or example about how to work with the new branch ONLY ? ... because branch 1 works ok, I need to do changes only on branch 2
You must inspect the $ru (or $du depending the case) in onbranch_route, and take the desired action when $ru is $avp(s:followme).
Umm ... again confused ... does the execution of the cfg continues AFTER the append_branch call,just on the next line ... or it "begins" on "t_on_branch()"?
On 07/26/2010 01:20 AM, Raúl Alexis Betancor Santana wrote:
On Monday 26 July 2010 04:32:13 Iñaki Baz Castillo wrote:
El día 26 de julio de 2010 01:07, Raúl Alexis Betancor Santana
rabs@dimension-virtual.com escribió:
any clue or example about how to work with the new branch ONLY ? ... because branch 1 works ok, I need to do changes only on branch 2
You must inspect the $ru (or $du depending the case) in onbranch_route, and take the desired action when $ru is $avp(s:followme).
Umm ... again confused ... does the execution of the cfg continues AFTER the append_branch call,just on the next line ... or it "begins" on "t_on_branch()"?
The first one.
On Monday 26 July 2010 06:21:56 Alex Balashov wrote:
On 07/26/2010 01:20 AM, Raúl Alexis Betancor Santana wrote:
On Monday 26 July 2010 04:32:13 Iñaki Baz Castillo wrote:
El día 26 de julio de 2010 01:07, Raúl Alexis Betancor Santana
rabs@dimension-virtual.com escribió:
any clue or example about how to work with the new branch ONLY ? ... because branch 1 works ok, I need to do changes only on branch 2
You must inspect the $ru (or $du depending the case) in onbranch_route, and take the desired action when $ru is $avp(s:followme).
Umm ... again confused ... does the execution of the cfg continues AFTER the append_branch call,just on the next line ... or it "begins" on "t_on_branch()"?
The first one.
So ... both branches continues at the same point, with the only difference that one have $ru = $avp(s:followme) ... uff ... I'll have to elavorate a little more because that point of the .cfg it's also reached with a "normal" call to $avp(s:followme) ... :-\
thanks
On 07/26/2010 01:59 AM, Raúl Alexis Betancor Santana wrote:
On Monday 26 July 2010 06:21:56 Alex Balashov wrote:
On 07/26/2010 01:20 AM, Raúl Alexis Betancor Santana wrote:
On Monday 26 July 2010 04:32:13 Iñaki Baz Castillo wrote:
El día 26 de julio de 2010 01:07, Raúl Alexis Betancor Santana
rabs@dimension-virtual.com escribió:
any clue or example about how to work with the new branch ONLY ? ... because branch 1 works ok, I need to do changes only on branch 2
You must inspect the $ru (or $du depending the case) in onbranch_route, and take the desired action when $ru is $avp(s:followme).
Umm ... again confused ... does the execution of the cfg continues AFTER the append_branch call,just on the next line ... or it "begins" on "t_on_branch()"?
The first one.
So ... both branches continues at the same point, with the only difference that one have $ru = $avp(s:followme) ... uff ... I'll have to elavorate a little more because that point of the .cfg it's also reached with a "normal" call to $avp(s:followme) ... :-\
It might be more helpful to think of it as: execution continues right where it was in the request route, but a branch route is also later called right before the message is forwarded on the given branch, not in parallel, where certain branch-specific parameters can be tweaked at the last moment, or certain branch-specific actions taken.
On Monday 26 July 2010 07:02:03 Alex Balashov wrote:
On 07/26/2010 01:59 AM, Raúl Alexis Betancor Santana wrote:
On Monday 26 July 2010 06:21:56 Alex Balashov wrote:
On 07/26/2010 01:20 AM, Raúl Alexis Betancor Santana wrote:
On Monday 26 July 2010 04:32:13 Iñaki Baz Castillo wrote:
El día 26 de julio de 2010 01:07, Raúl Alexis Betancor Santana
rabs@dimension-virtual.com escribió:
any clue or example about how to work with the new branch ONLY ? ... because branch 1 works ok, I need to do changes only on branch 2
You must inspect the $ru (or $du depending the case) in onbranch_route, and take the desired action when $ru is $avp(s:followme).
Umm ... again confused ... does the execution of the cfg continues AFTER the append_branch call,just on the next line ... or it "begins" on "t_on_branch()"?
The first one.
So ... both branches continues at the same point, with the only difference that one have $ru = $avp(s:followme) ... uff ... I'll have to elavorate a little more because that point of the .cfg it's also reached with a "normal" call to $avp(s:followme) ... :-\
It might be more helpful to think of it as: execution continues right where it was in the request route, but a branch route is also later called right before the message is forwarded on the given branch, not in parallel, where certain branch-specific parameters can be tweaked at the last moment, or certain branch-specific actions taken.
I don't undestand ... so ... execution continues in the next line, just after append_branch for BOTH branches, but wenever I call t_relay ... BOTH branches will pass through on_branch_route BEFORE been forwarded?
On 07/26/2010 02:14 AM, Raúl Alexis Betancor Santana wrote:
I don't undestand ... so ... execution continues in the next line, just after append_branch for BOTH branches, but wenever I call t_relay ... BOTH branches will pass through on_branch_route BEFORE been forwarded?
That's exactly correct.
On Monday 26 July 2010 07:22:42 Alex Balashov wrote:
On 07/26/2010 02:14 AM, Raúl Alexis Betancor Santana wrote:
I don't undestand ... so ... execution continues in the next line, just after append_branch for BOTH branches, but wenever I call t_relay ... BOTH branches will pass through on_branch_route BEFORE been forwarded?
That's exactly correct.
But when branches are generated after a call to lookup (multiple AOR for example), on_branch_route is called after lookup and before t_relay? or JUST after lookup, so for the new branches execution BEGINS on on_branch_route ?
On 07/26/2010 03:19 AM, Raúl Alexis Betancor Santana wrote:
On Monday 26 July 2010 07:22:42 Alex Balashov wrote:
On 07/26/2010 02:14 AM, Raúl Alexis Betancor Santana wrote:
I don't undestand ... so ... execution continues in the next line, just after append_branch for BOTH branches, but wenever I call t_relay ... BOTH branches will pass through on_branch_route BEFORE been forwarded?
That's exactly correct.
But when branches are generated after a call to lookup (multiple AOR for example), on_branch_route is called after lookup and before t_relay? or JUST after lookup, so for the new branches execution BEGINS on on_branch_route ?
I would say it is called as part of t_relay(), prior to actually forwarding the request on the socket level, because it's anchored to TM callbacks (e.g. t_on_branch()).
El día 26 de julio de 2010 08:14, Raúl Alexis Betancor Santana rabs@dimension-virtual.com escribió:
It might be more helpful to think of it as: execution continues right where it was in the request route, but a branch route is also later called right before the message is forwarded on the given branch, not in parallel, where certain branch-specific parameters can be tweaked at the last moment, or certain branch-specific actions taken.
I don't undestand ... so ... execution continues in the next line, just after append_branch for BOTH branches, but wenever I call t_relay ... BOTH branches will pass through on_branch_route BEFORE been forwarded?
When you call append_branch() or loockup() (and various contacts are retrieved) the cfg script continues normally. At this point its not a good idea to inspect the $ru neither $du or bflags as you would find values for just *one* of the loaded contacts/destinations. Which one? maybe the last element retrieved from the DB, no idea...
So the cfg script continues. Then at some point you call t_relay (and you set on_branch_route("N") before). So you get into branch_route[N] block in which you process each generated destination in an independent way, so into this block you can inspect $ru, %du, bflags per destination.
On Monday 26 July 2010 10:15:47 Iñaki Baz Castillo wrote:
El día 26 de julio de 2010 08:14, Raúl Alexis Betancor Santana
rabs@dimension-virtual.com escribió:
It might be more helpful to think of it as: execution continues right where it was in the request route, but a branch route is also later called right before the message is forwarded on the given branch, not in parallel, where certain branch-specific parameters can be tweaked at the last moment, or certain branch-specific actions taken.
I don't undestand ... so ... execution continues in the next line, just after append_branch for BOTH branches, but wenever I call t_relay ... BOTH branches will pass through on_branch_route BEFORE been forwarded?
When you call append_branch() or loockup() (and various contacts are retrieved) the cfg script continues normally. At this point its not a good idea to inspect the $ru neither $du or bflags as you would find values for just *one* of the loaded contacts/destinations. Which one? maybe the last element retrieved from the DB, no idea...
So the cfg script continues. Then at some point you call t_relay (and you set on_branch_route("N") before). So you get into branch_route[N] block in which you process each generated destination in an independent way, so into this block you can inspect $ru, %du, bflags per destination.
Thanks for the explanation Iñaki, that give me a clue about some "strange" things I have .. XDD
Well .. time to review all .. :-\
El día 26 de julio de 2010 07:20, Raúl Alexis Betancor Santana rabs@dimension-virtual.com escribió:
Umm ... again confused ... does the execution of the cfg continues AFTER the append_branch call,just on the next line ... or it "begins" on "t_on_branch()"?
To clarify: when you call t_on_branch("N") it means that *after* calling t_relay() the block branch_route[N] will be executed for *each* branch. So the position of t_on_branch() is not important (it must be before t_relay however).
On Monday 26 July 2010 11:21:02 Iñaki Baz Castillo wrote:
El día 26 de julio de 2010 07:20, Raúl Alexis Betancor Santana
rabs@dimension-virtual.com escribió:
Umm ... again confused ... does the execution of the cfg continues AFTER the append_branch call,just on the next line ... or it "begins" on "t_on_branch()"?
To clarify: when you call t_on_branch("N") it means that *after* calling t_relay() the block branch_route[N] will be executed for *each* branch. So the position of t_on_branch() is not important (it must be before t_relay however).
I know, I know ... the real problem to me is that I made lot of changes to the request BEFORE calling t_relay or lookup, so ... those changes (add_hf, flags, etc.) be applied to ALL branches when I call t_relay or lookup? ... only to the first branch? ... not sure ... :-(
On 07/26/2010 06:48 AM, Raúl Alexis Betancor Santana wrote:
On Monday 26 July 2010 11:21:02 Iñaki Baz Castillo wrote:
El día 26 de julio de 2010 07:20, Raúl Alexis Betancor Santana
rabs@dimension-virtual.com escribió:
Umm ... again confused ... does the execution of the cfg continues AFTER the append_branch call,just on the next line ... or it "begins" on "t_on_branch()"?
To clarify: when you call t_on_branch("N") it means that *after* calling t_relay() the block branch_route[N] will be executed for *each* branch. So the position of t_on_branch() is not important (it must be before t_relay however).
I know, I know ... the real problem to me is that I made lot of changes to the request BEFORE calling t_relay or lookup, so ... those changes (add_hf, flags, etc.) be applied to ALL branches when I call t_relay or lookup? ... only to the first branch? ... not sure ... :-(
All.
El día 26 de julio de 2010 12:48, Raúl Alexis Betancor Santana rabs@dimension-virtual.com escribió:
To clarify: when you call t_on_branch("N") it means that *after* calling t_relay() the block branch_route[N] will be executed for *each* branch. So the position of t_on_branch() is not important (it must be before t_relay however).
I know, I know ... the real problem to me is that I made lot of changes to the request BEFORE calling t_relay or lookup, so ... those changes (add_hf, flags, etc.) be applied to ALL branches when I call t_relay or lookup? ... only to the first branch? ... not sure ... :-(
Changes done before the branch_route block are changes shared by all the branches that will be generated. However in branch_route you can add/remove headers and set bflags for each branch (by inspecting the $ru or $du).