Hello:
I would like to implement sequential hunting. Hunting is when a call arrives for a given subscriber, no one answers the original number so the proxy populates the username portion of the r-uri with another number (from the database) and tries again. This process continues until all numbers in the database are exhausted. I have the "failover" working but the r-uri field is not updated on any interation though the failure_route. Does anyone have any ideas how to make the following work?
Thanks,Steve
# hunting (serial forking) if (avp_db_load("$ruri/username", "s:allow_hunt")) { if (avp_check("s:allow_hunt", "eq/y/i")) { avp_delete("s:allow_hunt"); xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Call Hunting Enabled for <%ru>\n"); avp_db_load("$ruri/username", "s:huntlist/sam"); xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Call Hunting Started to <%ru>\n"); t_on_failure("6"); t_relay(); break; }; };
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Failure Block #6: HUNTING for <%ru> from <%fu> at <%is>\n"); if (avp_pushto("$ruri/username", "s:huntlist/g")) { append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
I'm not familiar with the avp_pushto, but on the first look I'd say you should first append_branch and then change the request-uri.
I appologize in advance if it shows as false hint. ;-)
Michal
On Wed, 2007-01-31 at 13:45 -0500, Steve Blair wrote:
Hello:
I would like to implement sequential hunting. Hunting is when a call arrives for a given subscriber, no one answers the original number so the proxy populates the username portion of the r-uri with another number (from the database) and tries again. This process continues until all numbers in the database are exhausted. I have the "failover" working but the r-uri field is not updated on any interation though the failure_route. Does anyone have any ideas how to make the following work?
Thanks,Steve
# hunting (serial forking) if (avp_db_load("$ruri/username", "s:allow_hunt")) { if (avp_check("s:allow_hunt", "eq/y/i")) { avp_delete("s:allow_hunt"); xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Call Hunting Enabled for <%ru>\n"); avp_db_load("$ruri/username", "s:huntlist/sam"); xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Call Hunting Started to <%ru>\n"); t_on_failure("6"); t_relay(); break; }; };
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Failure Block #6: HUNTING for <%ru> from <%fu> at <%is>\n"); if (avp_pushto("$ruri/username", "s:huntlist/g")) { append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Thanks Michal. It turns out I needed to set the invite timer on each iteration
-Steve
Michal Matyska wrote:
I'm not familiar with the avp_pushto, but on the first look I'd say you should first append_branch and then change the request-uri.
I appologize in advance if it shows as false hint. ;-)
Michal
On Wed, 2007-01-31 at 13:45 -0500, Steve Blair wrote:
Hello:
I would like to implement sequential hunting. Hunting is when a call arrives for a given subscriber, no one answers the original number so the proxy populates the username portion of the r-uri with another number (from the database) and tries again. This process continues until all numbers in the database are exhausted. I have the "failover" working but the r-uri field is not updated on any interation though the failure_route. Does anyone have any ideas how to make the following work?
Thanks,Steve
# hunting (serial forking) if (avp_db_load("$ruri/username", "s:allow_hunt")) { if (avp_check("s:allow_hunt", "eq/y/i")) { avp_delete("s:allow_hunt"); xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Call Hunting Enabled for <%ru>\n"); avp_db_load("$ruri/username", "s:huntlist/sam"); xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Call Hunting Started to <%ru>\n"); t_on_failure("6"); t_relay(); break; }; };
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Failure Block #6: HUNTING for <%ru> from <%fu> at <%is>\n"); if (avp_pushto("$ruri/username", "s:huntlist/g")) { append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
OK. So this isn't working quite so well after all. What should I expect after execution of the statement "avp_db_load("$ruri/username", "s:huntlist/sam"); "? I would think huntlist would be a list of usernames (from the DB) and that each username would be pushed into the r-uri one per-failure_route iteration. That isn't happening.
When a call which arrives for the "first number" that phone rings until the invite timer expires. That phone then stops ringing. Shortly thereafter the next phone in the "huntlist" rings but before it stops ringing the next phone in the list begins ringing.
It seems that the code below doesn't know how to detect when the 2nd through Nth number in the huntlist is unavailable so it tries them all simultaneously.
Any thoughts?
Thanks,Steve
Steve Blair wrote:
Thanks Michal. It turns out I needed to set the invite timer on each iteration
-Steve
Michal Matyska wrote:
I'm not familiar with the avp_pushto, but on the first look I'd say you should first append_branch and then change the request-uri.
I appologize in advance if it shows as false hint. ;-)
Michal
On Wed, 2007-01-31 at 13:45 -0500, Steve Blair wrote:
Hello:
I would like to implement sequential hunting. Hunting is when a call arrives for a given subscriber, no one answers the original number so the proxy populates the username portion of the r-uri with another number (from the database) and tries again. This process continues until all numbers in the database are exhausted. I have the "failover" working but the r-uri field is not updated on any interation though the failure_route. Does anyone have any ideas how to make the following work?
Thanks,Steve
# hunting (serial forking) if (avp_db_load("$ruri/username", "s:allow_hunt")) { if (avp_check("s:allow_hunt", "eq/y/i")) { avp_delete("s:allow_hunt"); xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Call Hunting Enabled for <%ru>\n"); avp_db_load("$ruri/username", "s:huntlist/sam"); xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Call Hunting Started to <%ru>\n"); t_on_failure("6"); t_relay(); break; }; };
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Failure Block #6: HUNTING for <%ru> from <%fu> at <%is>\n"); if (avp_pushto("$ruri/username", "s:huntlist/g")) { append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Don't use the g flag in avp_pushto, with it you push all values. Then use avp_delete on the list so that you use the next for the next hunt. g-)
------- Original message ------- From: Steve Blair blairs@isc.upenn.edu Sent: 31.1.'07, 15:16
OK. So this isn't working quite so well after all. What should I expect after execution of the statement "avp_db_load("$ruri/username", "s:huntlist/sam"); "? I would think huntlist would be a list of usernames (from the DB) and that each username would be pushed into the r-uri one per-failure_route iteration. That isn't happening.
When a call which arrives for the "first number" that phone rings until the invite timer expires. That phone then stops ringing. Shortly thereafter the next phone in the "huntlist" rings but before it stops ringing the next phone in the list begins ringing.
It seems that the code below doesn't know how to detect when the 2nd through Nth number in the huntlist is unavailable so it tries them all simultaneously.
Any thoughts?
Thanks,Steve
Steve Blair wrote:
Thanks Michal. It turns out I needed to set the invite timer on each iteration
-Steve
Michal Matyska wrote:
I'm not familiar with the avp_pushto, but on the first look I'd say you should first append_branch and then change the request-uri.
I appologize in advance if it shows as false hint. ;-)
Michal
On Wed, 2007-01-31 at 13:45 -0500, Steve Blair wrote:
Hello:
I would like to implement sequential hunting. Hunting is when a call arrives for a given subscriber, no one answers the original number so the proxy populates the username portion of the r-uri with another number (from the database) and tries again. This process continues until all numbers in the database are exhausted. I have the "failover" working but the r-uri field is not updated on any interation though the failure_route. Does anyone have any ideas how to make the following work?
Thanks,Steve
# hunting (serial forking) if (avp_db_load("$ruri/username", "s:allow_hunt")) { if (avp_check("s:allow_hunt", "eq/y/i")) { avp_delete("s:allow_hunt"); xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Call Hunting Enabled for <%ru>\n"); avp_db_load("$ruri/username", "s:huntlist/sam"); xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Call Hunting Started to <%ru>\n"); t_on_failure("6"); t_relay(); break; }; };
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Failure Block #6: HUNTING for <%ru> from <%fu> at <%is>\n"); if (avp_pushto("$ruri/username", "s:huntlist/g")) { append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Greger:
So something like the following:
# hunting (serial forking) if (avp_db_load("$ruri/username", "s:allow_hunt")) { if (avp_check("s:allow_hunt", "eq/y/i")) { avp_delete("s:allow_hunt"); avp_db_load("$ruri/username", "s:huntlist/sam"); t_on_failure("6"); t_relay(); break; }; };
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { if (avp_pushto("$ruri/username", "s:huntlist")) { append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Greger Viken Teigre wrote:
Don't use the g flag in avp_pushto, with it you push all values. Then use avp_delete on the list so that you use the next for the next hunt. g-)
------- Original message ------- From: Steve Blair blairs@isc.upenn.edu Sent: 31.1.'07, 15:16
yes.
Steve Blair wrote:
Greger:
So something like the following:
# hunting (serial forking) if (avp_db_load("$ruri/username", "s:allow_hunt")) { if (avp_check("s:allow_hunt", "eq/y/i")) { avp_delete("s:allow_hunt"); avp_db_load("$ruri/username", "s:huntlist/sam"); t_on_failure("6"); t_relay(); break; }; };
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { if (avp_pushto("$ruri/username", "s:huntlist")) { append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Greger Viken Teigre wrote:
Don't use the g flag in avp_pushto, with it you push all values. Then use avp_delete on the list so that you use the next for the next hunt. g-)
------- Original message ------- From: Steve Blair blairs@isc.upenn.edu Sent: 31.1.'07, 15:16
Greger:
This technique almost works. Two things are happening which I cannot fully explain. Perhaps you can help. First, does the avp_db_load load the values in a specific, predictable order? Second, I cannot seem to hunt to a third number. I believe this is because the call to the second number causes SER to exit failure_route[6] effectively stopping the hunt. Do you or anyone else on this list have any thoughts on why I can only hunt trough the second number?
Thanks,Steve
Steve Blair wrote:
Greger:
So something like the following:
# hunting (serial forking) if (avp_db_load("$ruri/username", "s:allow_hunt")) { if (avp_check("s:allow_hunt", "eq/y/i")) { avp_delete("s:allow_hunt"); avp_db_load("$ruri/username", "s:huntlist/sam"); t_on_failure("6"); t_relay(); break; }; };
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { if (avp_pushto("$ruri/username", "s:huntlist")) { append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
OK. A little trial and error and I think I found the problem. I changed the failure_route to include the command lookup("location"). I'm not clear why this makes a difference but it does. The new failure route is:
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { if (avp_pushto("$ruri/username", "s:huntlist")) { lookup("location"); append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Thanks,Steve
Steve Blair wrote:
Greger:
This technique almost works. Two things are happening which I cannot fully explain. Perhaps you can help. First, does the avp_db_load load the values in a specific, predictable order? Second, I cannot seem to hunt to a third number. I believe this is because the call to the second number causes SER to exit failure_route[6] effectively stopping the hunt. Do you or anyone else on this list have any thoughts on why I can only hunt trough the second number?
Thanks,Steve
Steve Blair wrote:
Greger:
So something like the following:
# hunting (serial forking) if (avp_db_load("$ruri/username", "s:allow_hunt")) { if (avp_check("s:allow_hunt", "eq/y/i")) { avp_delete("s:allow_hunt"); avp_db_load("$ruri/username", "s:huntlist/sam"); t_on_failure("6"); t_relay(); break; }; };
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { if (avp_pushto("$ruri/username", "s:huntlist")) { append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Yes, if you in the db store aors (which I presume), replacing the ruri with a new aor requires you to do a "recursion" on your INVITE logic. I use a true recursion inside the script, i.e. the same INVITE logic is called for the new ruri (handling forwarding etc), but for hunts you need to decide whether you want to also follow forwarding or just continue on your huntlist... g-)
Steve Blair wrote:
OK. A little trial and error and I think I found the problem. I changed the failure_route to include the command lookup("location"). I'm not clear why this makes a difference but it does. The new failure route is:
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { if (avp_pushto("$ruri/username", "s:huntlist")) { lookup("location"); append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Thanks,Steve
Steve Blair wrote:
Greger:
This technique almost works. Two things are happening which I cannot fully explain. Perhaps you can help. First, does the avp_db_load load the values in a specific, predictable order? Second, I cannot seem to hunt to a third number. I believe this is because the call to the second number causes SER to exit failure_route[6] effectively stopping the hunt. Do you or anyone else on this list have any thoughts on why I can only hunt trough the second number?
Thanks,Steve
Steve Blair wrote:
Greger:
So something like the following:
# hunting (serial forking) if (avp_db_load("$ruri/username", "s:allow_hunt")) { if (avp_check("s:allow_hunt", "eq/y/i")) { avp_delete("s:allow_hunt"); avp_db_load("$ruri/username", "s:huntlist/sam"); t_on_failure("6"); t_relay(); break; }; };
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { if (avp_pushto("$ruri/username", "s:huntlist")) { append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Greger V. Teigre wrote:
Yes, if you in the db store aors (which I presume), replacing the ruri with a new aor requires you to do a "recursion" on your INVITE logic. I use a true recursion inside the script, i.e. the same INVITE logic is called for the new ruri (handling forwarding etc), but for hunts you need to decide whether you want to also follow forwarding or just continue on your huntlist... g-)
Thanks Greger. Hunting is working perfectly now.
Steve
Steve Blair wrote:
OK. A little trial and error and I think I found the problem. I changed the failure_route to include the command lookup("location"). I'm not clear why this makes a difference but it does. The new failure route is:
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { if (avp_pushto("$ruri/username", "s:huntlist")) { lookup("location"); append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Thanks,Steve
Steve Blair wrote:
Greger:
This technique almost works. Two things are happening which I cannot fully explain. Perhaps you can help. First, does the avp_db_load load the values in a specific, predictable order? Second, I cannot seem to hunt to a third number. I believe this is because the call to the second number causes SER to exit failure_route[6] effectively stopping the hunt. Do you or anyone else on this list have any thoughts on why I can only hunt trough the second number?
Thanks,Steve
Steve Blair wrote:
Greger:
So something like the following:
# hunting (serial forking) if (avp_db_load("$ruri/username", "s:allow_hunt")) { if (avp_check("s:allow_hunt", "eq/y/i")) { avp_delete("s:allow_hunt"); avp_db_load("$ruri/username", "s:huntlist/sam"); t_on_failure("6"); t_relay(); break; }; };
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { if (avp_pushto("$ruri/username", "s:huntlist")) { append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Great! Could you possibly share the final result in an how-to?! http://www.iptel.org/node/add/flexinode-4 g-)
Steve Blair wrote:
Greger V. Teigre wrote:
Yes, if you in the db store aors (which I presume), replacing the ruri with a new aor requires you to do a "recursion" on your INVITE logic. I use a true recursion inside the script, i.e. the same INVITE logic is called for the new ruri (handling forwarding etc), but for hunts you need to decide whether you want to also follow forwarding or just continue on your huntlist... g-)
Thanks Greger. Hunting is working perfectly now.
Steve
Steve Blair wrote:
OK. A little trial and error and I think I found the problem. I changed the failure_route to include the command lookup("location"). I'm not clear why this makes a difference but it does. The new failure route is:
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { if (avp_pushto("$ruri/username", "s:huntlist")) { lookup("location"); append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Thanks,Steve
Steve Blair wrote:
Greger:
This technique almost works. Two things are happening which I cannot fully explain. Perhaps you can help. First, does the avp_db_load load the values in a specific, predictable order? Second, I cannot seem to hunt to a third number. I believe this is because the call to the second number causes SER to exit failure_route[6] effectively stopping the hunt. Do you or anyone else on this list have any thoughts on why I can only hunt trough the second number?
Thanks,Steve
Steve Blair wrote:
Greger:
So something like the following:
# hunting (serial forking) if (avp_db_load("$ruri/username", "s:allow_hunt")) { if (avp_check("s:allow_hunt", "eq/y/i")) { avp_delete("s:allow_hunt"); avp_db_load("$ruri/username", "s:huntlist/sam"); t_on_failure("6"); t_relay(); break; }; };
# Iterate through extension list for subscribers with call hunting enabled failure_route[6] { if (avp_pushto("$ruri/username", "s:huntlist")) { append_branch(); avp_delete("s:huntlist"); t_on_failure("6"); t_relay(); }; }
Hi !
I am working on the simple blind forward functionality. My procedure looks like this:
if inbound user then check if user have blindfwd parameter if yes rewrite ruri (rewriteuri("sip:tzl@voip.touk.pl");) and forward with t_relay()
Everything works fine, I see the message being routed again to ser with different ruri but at the end of the message processing when I invoke the lookup_contacts("location") message is forwarded to the location which corresponds to the first ruri which was changed by rewriteuri() function. Please point me what do I miss.
Thanks in advance!! -Tomasz