Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Allowing calls - maybe I'm just stupid... [almost solved]


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
lucabert at lucabert.de
Guest





PostPosted: Thu Jun 11, 2015 2:40 am    Post subject: [asterisk-users] Allowing calls - maybe I'm just stupid... [ Reply with quote

Zitat von Luca Bertoncello <lucabert@lucabert.de>:

Quote:
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@lucabert.de)


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services