Obtain IP address through dialplan?

dghundt

Guru
Joined
Nov 15, 2007
Messages
647
Reaction score
86
Is there a way to obtain the ip address of pbxiaf system by calling into a custom dialplan which could playback the ip address to the caller? Would use an fxs extension to dial in.

would set variable to the ip address (how?)
then playback the numbers.
 
I would like the internal ip address (the one I would use via my LAN to log on).

Thanks!
 
I didnt put it all together and test it, but you could put something like this in a script that sets a variable:

ifconfig eth0 | awk '{print $2}' | grep -o "[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*" | awk '{print $1}'

and then use something like:

exten => s,1,sayalpha($variable)

It should work. :biggrin5:
 
Just out of curiosity, if you have people calling into this system, wont the admin already know the IP address? If so cant he just setup an extension with something like this in it?:

exten => s,1,answer
exten => s,2,sayalpha(192.168.1.100)
sxten => s,3,hangup
 
thanks.
have not worked much with scripts, but will play with this.

I am experimenting with the ip04 box which does not have samba, so I would like to be able to dial in to find the ip address kind of like what one does with the sipura ata's(instead of connecting with the serial cable).
thanks again.
 

Members online

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top