Kingsley Tart
2021-Nov-03 18:30 UTC
[asterisk-users] Dial(PJSIP/xx) - finding the IP address it connected to
Hi, When dialling a remote SIP host with PJSIP, is it possible either within the dialplan or via the AMI to find out the IP address of the remote host? If for example a remote host has multiple A records, I would like to know which one Asterisk has connected to. We have an issue with some remote hosts that send INVITE messages back periodically mid-call, but because of our firewall the messages aren't being received by Asterisk, therefore not being answered, and the remote host is dropping the call. We can't open those hosts up by default in the firewall because customers could choose any SIP destination, but if I could allow the specific remote address for the duration of the call, it would solve some issues. I could use AGI scripts to add/remove firewall rules as needed. Unless, that is, there's a better way? I'm using Asterisk 18.7.1 FWIW. Cheers, Kingsley.
Joshua C. Colp
2021-Nov-03 19:25 UTC
[asterisk-users] Dial(PJSIP/xx) - finding the IP address it connected to
On Wed, Nov 3, 2021 at 3:31 PM Kingsley Tart <kingsley at dns99.co.uk> wrote:> Hi, > > When dialling a remote SIP host with PJSIP, is it possible either > within the dialplan or via the AMI to find out the IP address of the > remote host? >The CHANNEL dialplan function[1] provides functionality for pjsip to get the remote address. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+19+Function_CHANNEL -- Joshua C. Colp Asterisk Technical Lead Sangoma Technologies Check us out at www.sangoma.com and www.asterisk.org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20211103/775d047f/attachment.html>