Re: [OpenSIPS-Users] Asteriak load balance

2009-01-25 Thread Gonzalo Gonzalez
()) {
    sl_send_reply(403, Forbidden);
    exit;
    };

    save(location);
    exit;
    } else if
 {
    sl_send_reply(403, Forbidden);
    };
}

route[3] {
   ## INVITE request handler 
    if (is_from_local()){
    # From an internal domain - check the credentials and the FROM
    if(!allow_trusted()){
    if (!proxy_authorize(,subscriber)) {
    proxy_challenge(,1);
    exit;
    } else if (!check_from()) {
    sl_send_reply(403,
 Forbidden, use From=ID);
    exit;
    };
    } else { 
    log(Request bypassed the auth.using allow_trusted);
    };
    
    consume_credentials();
    
    #Verify aliases, if found replace R-URI. 
    lookup(aliases);
    
    if (is_uri_host_local()) {
    # -- Inbound to
 Inbound
    route(10);
    } else {
    # -- Inbound to outbound
    route(11);
    };

    } else {
    #From an external domain -do not check credentials
    #Verify aliases, if found replace R-URI. 
    lookup(aliases);
    if (is_uri_host_local()) {
    #-- Outbound to inbound
    route(12);
    } else
 {
    # -- Outbound to outbound
    route(13);
    };
    };
}

route[4] {
    # routing to the public network
    ds_select_dst(1, 0);
     record_route();
     t_relay();
}

route[10] {
    #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]{6}@) {
    if
 (is_user_in(credentials,local)) {
    route(4);
    exit;
    } else {
    sl_send_reply(403, No permissions for local calls);
    exit;
    };
    };

    if (uri=~^sip:1[2-9][1-9]{9}@) {
    if (is_user_in(credentials,ld)) {
    route(4);
    exit;
    } else {
   
 sl_send_reply(403, No permissions for long distance);
    exit;
    };
    };
    
    if (uri=~^sip:011[0-9]*@) {
    if (is_user_in(credentials,int)) {
    route(4);
    exit;
    } else {
    sl_send_reply(403, No permissions for international calls);
    };
    };

    if (!lookup(location)) {
    sl_send_reply(404, Not Found);
   
 exit;
    };
    route(1);
}

route[11] {
    # from an internal domain - outbound
    # Simply route the call outbound using DNS search
    append_hf(P-hint: inbound-outbound \r\n);
    route(1);
}

route[12] {
    # From an external domain - inbound
    # Verify aliases, if found replace R-URI.
    lookup(aliases);
    if (!lookup(location)) {
    sl_send_reply(404, Not Found);
    exit;
    };
    route(1);
}

route[13] {
    #From an external domain outbound
    #we are not accepting these calls
    append_hf(P-hint: outbound-inbound
 \r\n);
    sl_send_reply(403, Forbidden);
    exit;
}

Any Idea why calls are getting rejected?


--- On Fri, 1/23/09, Robin Rodriguez rrodrig...@ifbyphone.com wrote:
From: Robin Rodriguez rrodrig...@ifbyphone.com
Subject: Re: [OpenSIPS-Users] Asteriak load balance
To: gonzov...@yahoo.com
Cc: users@lists.opensips.org
Date: Friday, January 23, 2009, 4:05 PM




  
Gonzalo Gonzalez wrote:

  

  
Thanks.



Could somebody share a simple config file using dispatcher module.



Thanks



Gonzo









  

  

http://www.dialogic.com/products/docs/appnotes/10833_HMP_OpenSER_SIP_an.pdf
is the most concise example i've ever seen on using dispatcher, should
be enough to get you going. A zip file is linked in the pdf that with a
sample config



-- 


Robin D. Rodriguez

Systems Engineer

Ifbyphone, Inc.

Phone: (866) 250-1663

Fax: (847) 676-6553

rrodrig...@ifbyphone.com

http://www.ifbyphone.com



   
   



 



  ___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Asteriak load balance

2009-01-23 Thread Robin Rodriguez

Gonzalo Gonzalez wrote:

Thanks.

Could somebody share a simple config file using dispatcher module.

Thanks

Gonzo



http://www.dialogic.com/products/docs/appnotes/10833_HMP_OpenSER_SIP_an.pdf 
is the most concise example i've ever seen on using dispatcher, should 
be enough to get you going. A zip file is linked in the pdf that with a 
sample config


--
Robin D. Rodriguez
Systems Engineer
Ifbyphone, Inc.
Phone: (866) 250-1663
Fax: (847) 676-6553
rrodrig...@ifbyphone.com
http://www.ifbyphone.com





___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Asteriak load balance

2009-01-22 Thread Gonzalo Gonzalez
What is the best module to use for load balance with 5 asterisk servers?

user  Opensips --- Asterisk --- PSTN



  ___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Asteriak load balance

2009-01-22 Thread Alex Balashov
Dispatcher.

Gonzalo Gonzalez wrote:

 What is the best module to use for load balance with 5 asterisk servers?
 
 user  Opensips --- Asterisk --- PSTN
 
 
 
 
 
 ___
 Users mailing list
 Users@lists.opensips.org
 http://lists.opensips.org/cgi-bin/mailman/listinfo/users


-- 
Alex Balashov
Evariste Systems
Web: http://www.evaristesys.com/
Tel: (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (678) 237-1775

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users