On Wed, 2021-11-03 at 16:25 -0300, Joshua C. Colp wrote:
> On Wed, Nov 3, 2021 at 3:31 PM Kingsley Tart <[email protected]>
> 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:
exten => s,n,Set(tmp=CHANNEL(PJSIP,remote_addr))exten =>
s,n,Set(tmp=CHANNEL(PJSIP/remote_addr))exten =>
s,n,Set(tmp=${CHANNEL(PJSIP,remote_addr)})exten =>
s,n,Set(tmp=${CHANNEL(PJSIP/remote_addr)})exten =>
s,n,Set(tmp=CHANNEL(pjsip,remote_addr))exten =>
s,n,Set(tmp=CHANNEL(pjsip/remote_addr))exten =>
s,n,Set(tmp=${CHANNEL(pjsip,remote_addr)})exten =>
s,n,Set(tmp=${CHANNEL(pjsip/remote_addr)})exten =>
s,n,Set(tmp=CHANNEL(remote_addr))exten =>
s,n,Set(tmp=CHANNEL(remote_addr))exten =>
s,n,Set(tmp=${CHANNELremote_addr)})exten =>
s,n,Set(tmp=${CHANNEL(remote_addr)})
-- Executing [s@register-answer:5] Set("PJSIP/btipx-00000005",
"tmp=CHANNEL(PJSIP,remote_addr)") in new stack -- Executing [
s@register-answer:6] Set("PJSIP/btipx-00000005",
"tmp=CHANNEL(PJSIP/remote_addr)") in new stack[Nov 4 11:41:20]
WARNING[11722][C-00000003]: func_channel.c:463 func_channel_read:
Unknown or unavailable item requested: 'PJSIP,remote_addr' --
Executing [s@register-answer:7] Set("PJSIP/btipx-00000005", "tmp=") in
new stack[Nov 4 11:41:20] WARNING[11722][C-00000003]:
func_channel.c:463 func_channel_read: Unknown or unavailable item
requested: 'PJSIP/remote_addr' -- Executing [s@register-answer:8]
Set("PJSIP/btipx-00000005", "tmp=") in new stack -- Executing [
s@register-answer:9] Set("PJSIP/btipx-00000005",
"tmp=CHANNEL(pjsip,remote_addr)") in new stack -- Executing [
s@register-answer:10] Set("PJSIP/btipx-00000005",
"tmp=CHANNEL(pjsip/remote_addr)") in new stack[Nov 4 11:41:20]
WARNING[974]: pjsip/dialplan_functions.c:834 channel_read_pjsip: No
transport information for channel PJSIP/btipx-00000005[Nov 4 11:41:20]
WARNING[11722][C-00000003]: func_channel.c:463 func_channel_read:
Unknown or unavailable item requested: 'pjsip,remote_addr' --
Executing [s@register-answer:11] Set("PJSIP/btipx-00000005", "tmp=") in
new stack[Nov 4 11:41:20] WARNING[11722][C-00000003]:
func_channel.c:463 func_channel_read: Unknown or unavailable item
requested: 'pjsip/remote_addr' -- Executing [s@register-answer:12]
Set("PJSIP/btipx-00000005", "tmp=") in new stack -- Executing [
s@register-answer:13] Set("PJSIP/btipx-00000005",
"tmp=CHANNEL(remote_addr)") in new stack -- Executing [
s@register-answer:14] Set("PJSIP/btipx-00000005",
"tmp=CHANNEL(remote_addr)") in new stack -- Executing [
s@register-answer:15] Set("PJSIP/btipx-00000005", "tmp=") in new
stack[Nov 4 11:41:20] WARNING[11722][C-00000003]: func_channel.c:463
func_channel_read: Unknown or unavailable item requested:
'remote_addr' -- Executing [s@register-answer:16] Set("PJSIP/btipx-
00000005", "tmp=") in new stack
--
Cheers,
Kingsley.
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
Check out the new Asterisk community forum at: https://community.asterisk.org/
New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users