So, I've been playing around with the permissions module. It's working ok, except...
I am sending calls from Asterisk to OpenSER, and then onto an ITSP. Calls only flow in this outbound direction. There are NO inbound calls.
I put the IP addresses of the Asterisk servers into the address table and used allow_source_address() to confirm the calls where allowed. However, I found that I also had to put the IP's of the ITSP's in the address table or otherwise when the remote end hangs up and sends a BYE message the call to allow_source_address() returns false.
This isn't that big a deal, but it seems messy. It also means that the ITSP, being in the address list, could send calls to us, and we don't want that.
How do I work around this? Do I do:
if ( allow_source_address("1") || method=="BYE" ) { .... }
What about CANCEL? I haven't tried that.
The same thing goes for putting IP's in the trusted table and using if_trusted().
Douglas.
____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
El Miércoles, 14 de Noviembre de 2007, Douglas Garstang escribió:
So, I've been playing around with the permissions module. It's working ok, except...
I am sending calls from Asterisk to OpenSER, and then onto an ITSP. Calls only flow in this outbound direction. There are NO inbound calls.
I put the IP addresses of the Asterisk servers into the address table and used allow_source_address() to confirm the calls where allowed. However, I found that I also had to put the IP's of the ITSP's in the address table or otherwise when the remote end hangs up and sends a BYE message the call to allow_source_address() returns false.
This isn't that big a deal, but it seems messy. It also means that the ITSP, being in the address list, could send calls to us, and we don't want that.
How do I work around this? Do I do:
if ( allow_source_address("1") || method=="BYE" ) { .... }
What about CANCEL? I haven't tried that.
The same thing goes for putting IP's in the trusted table and using if_trusted().
Maybe you should have different behaviour for initial requests and sequential requests (in-dialog messages).
You say that the calls are just: Asterisk -> OpenSer -> ITSP
In this way you can receive from ITSP the following **in-dialog** messages: - OPTIONS, UPDATE or re-INVITE to test the dialog. - BYE - re-INVITE (on hold)
All of them are in-dialog, so maybe you could do:
if( ($si == ITSP_IP && has_totag() && loose_route()) || ($si == Asterisk_IP) )
or
if( ($si == ITSP_IP && has_totag() && loose_route()) || (allow_source_address("1"))