[Serusers] call fwd all with avp_ops question

Steve Blair blairs at isc.upenn.edu
Tue Apr 12 02:37:48 CEST 2005


  I'm trying to use avp_ops to implement call forward all but it is not
working. I'm hoping this list can offer some suggestions.

  The idea is that a use turns call forward all on or off via the web
page. This sets the flag callfwdall to y or n.

  If flag=y then the user must enter a phone number to which all calls
will be forwarded.

   When a calls arrives for the users phone number callfwdall is checked,
if = y then fwdaddr is written to r-uri and the call proceeds through the
rest of the route blocks.  This is so that any ACL checks can be done
on the newly written r-uri so that user cannot forward to an otherwise
inaccessible number.

    Well this isn't working. Here is a snippet from my config. All other 
calling
is working fine.


    if (method=="INVITE")
  {
        if (lookup("location") | lookup("aliases") )
        {
           xlog("L_INFO", "\n[SER]: AVP LOAD: Checking callfwdall flag 
\n\n");
           if (avp_db_load("$ruri/username", "s:callfwdall")) {
             if (avp_check("s:callfwdall","eq/y/i")) {
               if (avp_db_load("$ruri/username", "s:fwdaaddr")) {
                  avp_write("$ruri/username", "s:ocn");
                  avp_pushto("$ruri/username", "s:fwdaaddr");
                  rewritehostport("net.isc.upenn.edu:5060");
                 xlog("L_INFO", "\n[SER]: AVP LOAD new ruri: Time: [%Tf]
                    From uri <%fu> To < %tu> Method: <%rm>  R-uri: <%ru>
                   Contact Header: <%ct> \n\n");
                  setflag(3);
               }  else {
                  xlog("L_INFO", "\n[SER]: AVP LOAD: no fwdaaddr \n\n");
              };


Thanks,Steve




More information about the sr-users mailing list