[Users] Server call forwarding

Steve Blair blairs at isc.upenn.edu
Mon Mar 19 13:26:39 CET 2007


Sam:

   You can try something like the following. The flag callfwdall 
indicates whether call forwarding is on or off and is set by the user 
via a provisioning interface. fwdaaddr is another DB flag that contains 
the user portion of the "new" r-uri after the re-write is performed. 
$ocn is original called number and is saved so that it may be used 
elsewhere, such as in the voicemail handling routing. route[8] just 
types the call so I know which type of call is being processed. I also 
use a route block for checking class of service (call permissions) when 
needed. I use flags to indicate what feature has been enabled and 
finally route[2] just relays this particular type of call.

   I hope this helps.

-Steve

    # call forward always
      if (avp_db_load("$ruri/username", "s:callfwdall")) {
        if (avp_check("s:callfwdall","eq/y/i")) {
           xlog("L_INFO", "\n[SER]: [%Tf] [%ci] User <%ru> has enabled 
Call Forward Always\n");
           setflag(3);
           avp_write("$ruri", "$ocn");
           if (avp_db_load("$ruri/username", "s:fwdaaddr")) {
              avp_pushto("$ruri/username", "s:fwdaaddr");
              rewritehostport("voip.upenn.edu");
              xlog("L_INFO", "\n[SER]: [%Tf] [%ci] Calls for user <%ru> 
FORWARDING to <%ru>\n");
              route(8);
              if (avp_check("$calltype","eq/oncampus/i")) {
                if (avp_db_load("$to/username", "s:allow_oncampus")) {
                  if (avp_check("s:allow_oncampus","eq/y/i")) {
                        setflag(13);
                  } else {
                    resetflag(13);
                    return;
                  };
                  avp_delete("s:allow_oncampus");
                };
                route(2);

         ........

>
> On 3/19/07, Sam Lee <sam.lee at super.net.sg> wrote:
>>
>>
>> Hey guys,
>>
>> I'm thinking of try out a server side forwarding where forwarded 
>> number is
>> stored in a database.
>> I just want to ask if anyone has done it before and how was the call 
>> routing
>> done .
>>
>> Been thinking alot but couldn't figure out a way to do it.
>>
>> Any pointers ?
>>
>> Regards,
>> Sam
>> _______________________________________________
>> Users mailing list
>> Users at openser.org
>> http://openser.org/cgi-bin/mailman/listinfo/users
>>
>>
>
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>




More information about the sr-users mailing list