Call between registered users

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Call between registered users

Gonzalo Gonzalez

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 doesn’t 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?



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Call between registered users

Zahid Mehmood

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: [hidden email] [mailto:[hidden email]] 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?

 


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Call between registered users

Gonzalo Gonzalez
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 <[hidden email]> wrote:
From: Zahid Mehmood <[hidden email]>
Subject: RE: [OpenSIPS-Users] Call between registered users
To: [hidden email], "Opensips" <[hidden email]>
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: [hidden email] [mailto:[hidden email]] 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?

 



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users