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