Joshua C. Colp
2021-Nov-04 11:52 UTC
[asterisk-users] Dial(PJSIP/xx) - finding the IP address it connected to
On Thu, Nov 4, 2021 at 8:43 AM Kingsley Tart <kingsley at dns99.co.uk> wrote:> On Wed, 2021-11-03 at 16:25 -0300, Joshua C. Colp wrote: > > 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 > > > Thanks, that looks perfect. What is the syntax? I have tried a few things > but none work: >${CHANNEL(pjsip,remote_addr)} -- 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/20211104/dadcb0d8/attachment.html>
Kingsley Tart - Barritel Ltd
2021-Nov-04 12:39 UTC
[asterisk-users] Dial(PJSIP/xx) - finding the IP address it connected to
On Thu, 2021-11-04 at 08:52 -0300, Joshua C. Colp wrote:> > Thanks, that looks perfect. What is the syntax? I have tried a few > > things but none work: > > > > ${CHANNEL(pjsip,remote_addr)}Hmm, I can't get this to work. This dialplan code: exten => s,n,NoOp(### state=${CHANNEL(state)} ##) exten => s,n,NoOp(### remote_addr=${CHANNEL(pjsip,remote_addr)} ##) logged this: -- Executing [s at register-answer:5] NoOp("PJSIP/btipx-0000000b", "### state=Up ##") in new stack [Nov 4 12:31:00] WARNING[974]: pjsip/dialplan_functions.c:834 channel_read_pjsip: No transport information for channel PJSIP/btipx-0000000b [Nov 4 12:31:00] WARNING[12206][C-00000006]: func_channel.c:463 func_channel_read: Unknown or unavailable item requested: 'pjsip,remote_addr' -- Executing [s at register-answer:6] NoOp("PJSIP/btipx-0000000b", "### remote_addr= ##") in new stack That sub was called from this context: Dial("Local/2.1.01162687107-btipx at dial_pstn_carrier-00000011;2", "PJSIP/btipx/sip:01162687107 at 88.151.41.45:5060,,r(ring)b(dial_pstn_carrier^set_handler^1(btipx,2,1,1))U(register-answer^2^1)") Am I doing something silly? Cheers, Kingskey, -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20211104/35af8255/attachment.html>