Luca Bertoncello
2015-Jun-11 06:36 UTC
[asterisk-users] Allowing calls - maybe I'm just stupid...
Hi again! About my previous E-Mail... I though about it and I think, that maybe I'm just very stupid... Since I called an INTERNAL number, Asterisk tried to call it. I tried right now to call an EXTERNAL number (using my context [myproxy]) and the behavior is NOT the same... Not 100% correct, but it tries the right way... Now my problem is to check in my dialplan if the peer, that originate the call, is reachable, and if not, to give an error... Is there any function to know if the peer is reachable? Thanks Luca Bertoncello (lucabert at lucabert.de)
Luca Bertoncello
2015-Jun-11 07:39 UTC
[asterisk-users] Allowing calls - maybe I'm just stupid... [almost solved]
Zitat von Luca Bertoncello <lucabert at lucabert.de>:> Now my problem is to check in my dialplan if the peer, that > originate the call, is reachable, and if not, to give an error... > > Is there any function to know if the peer is reachable?I answer myself... I did that (in my [myproxy]-context): exten => _X.,n,Set(reachable=${SHELL(asterisk -rx "sip show peer ${CALLERID(num)}" | grep "Status" | grep "OK")}) exten => _X.,n,GotoIf($["${LEN(${reachable})}" = "0"]?notallowed) .... exten => _X.,n(notallowed),Set(ip=${SIPPEER(${CALLERID(num)},ip)}) exten => _X.,n,Log(WARNING,Refusing call from UNREACHABLE peer ${CALLERID(num)} to ${EXTEN}. Call from IP ${ip}) exten => _X.,n,Playback(privacy-incorrect) exten => _X.,n,Hangup and it works. But I'm not very happy to call the CLI for this test... Is there another possibility to do my check? Thanks Luca Bertoncello (lucabert at lucabert.de)
A J Stiles
2015-Jun-11 07:52 UTC
[asterisk-users] Allowing calls - maybe I'm just stupid...
On Thursday 11 Jun 2015, Luca Bertoncello wrote:> Now my problem is to check in my dialplan if the peer, that originate > the call, is reachable, and if not, to give an error... > > Is there any function to know if the peer is reachable?The peer that *originated* the call *must* be reachable, by definition ..... -- AJS Note: Originating address only accepts e-mail from list! If replying off- list, change address to asterisk1list at earthshod dot co dot uk .
Luca Bertoncello
2015-Jun-11 07:56 UTC
[asterisk-users] Allowing calls - maybe I'm just stupid...
Zitat von A J Stiles <asterisk_list at earthshod.co.uk>:> On Thursday 11 Jun 2015, Luca Bertoncello wrote: >> Now my problem is to check in my dialplan if the peer, that originate >> the call, is reachable, and if not, to give an error... >> >> Is there any function to know if the peer is reachable? > > The peer that *originated* the call *must* be reachable, by definition .....I can originate a call even if my peer is "UNREACHABLE" (sip show peers say UNREACHABLE)... But I solved using the function EXTENDED_STATE... Regards Luca Bertoncello (lucabert at lucabert.de)