Hi Greger

 

Thank you for the information I have found it just what I needed.

 

Calls To SER from Asterisk:

 

To add to trusted in MYSQL I would use this right:

 
INSERT INTO trusted SET src_ip='***.***.***.***',proto='any',from_pattern='sip:[0-9]*@***.***.***.***'; #replace *** with the asterisk ip address

 

With this in my ser.cfg:

 

modparam("permissions", "db_url", "mysql://ser:heslo@localhost/ser")
modparam("permissions", "db_mode", 1)

modparam("permissions", "trusted_table", "trusted")

 

 

and for routing to Asterisk From SER:

 

if (method == "INVITE" && (uri=~"^sip:0")){
rewritehostport ("***
.***.***.***:5060");
t_relay();
break();
};

 

 

 

Or do I just add:

Asterisk to the trusted table and the following near the

 

 

if(!allow_trusted)

if (!proxy_authorize("","subscriber")) {
proxy_challenge("","0");
break;
} else if (!check_from()) {
sl_send_reply("403", "Use From=ID");
break;

 

 

Thank you very much for your help

 

Cheers

Greg

 

 


From: Greger V. Teigre [mailto:greger@teigre.com]
Sent: Wednesday, 11 May 2005 6:20 PM
To: Mr Greg Plater; serusers@lists.iptel.org
Subject: Re: [Serusers] Ser Accepting Calls From Asterisk

 

Greg,

Basically, you can do four things (first two for dialing asterisk-ser, the next two for dialing ser-asterisk):

1. Accept INVITEs from a specific src ip (asterisk) and add if(src_ip != asterisk_ip) around the INVITE authentication to avoid that part being triggered

2. Or you accomplish the same thing be adding asterisk to the trusted table and us if(!allow_trusted) instead. This will give you more control as you can filter on ruri as well.

3. You can create an account in asterisk and have asterisk register with SER like a regular user (who will be available in location for dialling into asterisk). This only makes sense if you have one main number for all users registered on asterisk (you don't need 1 or 2 if you do this)

4. Use some kind of routing, either through manual configuration (uri=~"some pattern", then forward to asterisk) or use the LCR (least cost routing) module to look up the ruris and forward to asterisk. This must be done in combination with 1 or 2.

 

Hope this helps.

g-)

 

---- Original Message ----
From: Mr Greg Plater
To: serusers@lists.iptel.org
Sent: Wednesday, May 11, 2005 06:10 AM
Subject: [Serusers] Ser Accepting Calls From Asterisk

> Hi
>
> I am using the onsip getting started doc with mediaproxy.
>
> Calls for registered users on SER work great but when I try to call a
> registered ser user from my asterisk box.
> I get a response in Asterisk Debug. Says  “failed to auth on INVITE”
>
> If I wish to allow calls from my asterisk box to registered users on
> SER what do I change.
>
>
> IN SER.cfg I note these 2 snippets
>
>
> if (!www_authorize("","subscriber")) {
> www_challenge("","0");
> break;
> };
>
>
>
> if (!proxy_authorize("","subscriber")) {
> proxy_challenge("","0");
> break;
> } else if (!check_from()) {
> sl_send_reply("403", "Use From=ID");
> break;
> };
>
>
>
> _______________________________________________
> Serusers mailing list
> serusers@lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers