[OpenSIPS-Users] Call between registered users

Gonzalo Gonzalez gonzovoip at yahoo.com
Thu Feb 12 20:40:03 CET 2009


Zahid,


Thank you for your reply. 

I tried if (!lookup("location"))  before the uri matching, but no change. Unfortunately don't know how to setup xlog.


    #from an internal domain -> inbound
    #Native SIP destinations are handled using the location table
    #Gateway destinations are handled by regular expressions
    append_hf("P-hint: inbound->inbound \r\n");

    if (!lookup("location")) {
    route(1);

    }

        
    if (uri=~"^sip:[2-9][0-9]{9}@") {
        if (is_user_in("credentials","local")) {
            #prefix("+1");
            route(4);
            exit;
        } else {
            sl_send_reply("403", "No permissions for local calls");
            exit;
        };
    };



Thanks,

Gonzalo


--- On Thu, 2/12/09, Zahid Mehmood <zm23 at columbia.edu> wrote:
From: Zahid Mehmood <zm23 at columbia.edu>
Subject: RE: [OpenSIPS-Users] Call between registered users
To: gonzovoip at yahoo.com, "Opensips" <users at lists.opensips.org>
Date: Thursday, February 12, 2009, 6:45 PM




 
 







Hi Gonzalo, 

   

Is  lookup(“location”) being
called before the uri matching or after?    

   

Looking at the code snippet, If local
callers are dialing a pattern that matches one of the  “if (uri=….”
Then it is sent to route(4) and lookup part of the code is not touched. 

   

You may want to add “xlog”
messages in your config  to see how the call is processed.   

   

Hope this helps. 

   

--  

Zahid 

   

   









From:
users-bounces at lists.opensips.org [mailto:users-bounces at lists.opensips.org] On Behalf Of Gonzalo Gonzalez

Sent: Thursday, February 12, 2009
1:35 PM

To: Opensips

Subject: [OpenSIPS-Users] Call
between registered users 



   


 
  
  Each user has a DID number and the user name match
  the DID umber, so on incoming calls to a DID if the user is online it ring
  that ext. and if is offline it go to voice mail. Mt issue is when a user call
  another user that is online it doesnt go to that user directly even though
  shows in the location table.  
     

  

   
  
  #from an internal domain -> inbound 
      #Native SIP destinations
  are handled using the location table 
      #Gateway destinations are
  handled by regular expressions 
      append_hf("P-hint:
  inbound->inbound \r\n"); 
     
        
       
      if
  (uri=~"^sip:[2-9][0-9]{9}@") { 
         
  if (is_user_in("credentials","local")) { 
             
  route(4); 
             
  exit; 
         
    }; 
      }; 
     
      if
  (uri=~"^sip:1[2-9][0-9]{9}@") { 
         
  if (is_user_in("credentials","ld")) { 
             
  route(4); 
             
  exit; 
          }; 
      }; 
     
      if
  (uri=~"^sip:011[0-9]*@") { 
         
  if (is_user_in("credentials","int")) { 
             
  route(4); 
             
  exit; 
         
   }; 
      }; 
       
       
     
         if
  (!lookup("location")) { 
         
  if (does_uri_exist()) { 
             
  ## User not registered at this time. 
             
  ## Use the IP Address of your e-mail server 
             
  revert_uri(); 
    
           prefix("u"); 
             
  rewritehostport("192.168.1.104"); #Use the voicemail IP 
             
  route(1); 
          }
  else { 
             
  sl_send_reply("404", "Not Found"); 
             
  exit; 
           
  }       
           
  sl_send_reply("404", "Not Found"); 
           
  exit; 
       }; 
       route(1); 
  } 
    
    
  Any idea or suggestion how to accomplish this? 
  
 


   



 




      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090212/38290f36/attachment-0001.htm 


More information about the Users mailing list