Ok, let me see if I've got this right.
I'm running SER and Asterisk on the same box. SER listens on the external IP of the box on port 5060, Asterisk on localhost (127.0.0.1) on port 5061. My starting point to get calls from SER able to use the real world is the SER PSTN gateway in the Getting Started document, with route[5] changed to:
route[5] { rewritehostport("127.0.0.1:5061"); avp_write("i:45", "inv_timeout"); route(1); }
I start SER and add accounts 306, 307 and 499. So far so good, and when I get it all up and running, SIP phones can call other SIP phones via SER. Now, if I read right, I then need to tell SER that 127.0.0.1 is a trusted account by doing
INSERT INTO trusted VALUES('127.0.0.1', 'any', '^sip:.*$');
in mysql, and restarting SER. I can still dial between internal phones and that is all OK, but I cannot dial via asterisk. I don't even see calls getting there.
If I then add into the trusted table the IP addresses of SIP clients, I can dial from them via asterisk. But I have to do this for every client. This is fine if there are only a limited number of IP addresses that can use the asterisk gateway, but I have users with laptops in the real world whose IP addresses change so it's obviously not an ideal solution.
What am I missing? Is the Call Forwarding setup the answer? I need to use SER as a front end to asterisk because of NAT issues, but I don't want to have to add EVERY user to the trusted table individually.
Regards
John Breen
John Breen wrote:
in mysql, and restarting SER. I can still dial between internal phones and that is all OK, but I cannot dial via asterisk. I don't even see
What does "I cannot dial" mean? What happens? What are your tring to achieve (calling from a SIP phones to a PSTN number which will be forwarded to Asterisk as the PSTN gateway? Other direction?)
calls getting there.
use ngrep with "-d any" to sniff on loopback interface too and post your sipdump.
Further, do you use the correct functions from the permissions module to authenticate Asterisk? If you only have a limited number of gateways you can easily authenticate them with if (src_ip == 127.0.0.1) { # routing from GW to clients ... } else { # routing from clients to clients/GW ... }
Further, even if signaling works - as others already said - you need a RTP proxy on the same machine clients can't send RTP to 127.0.0.1
regards klaus