On 1/16/06, Bob Cai <[EMAIL PROTECTED]> wrote:
folks,
can I get Asterisk server IP address in externsion.conf ? thanks!
bob
Hmmm, you didn't actually say if you want the local address or the remote address.

Realistically, only Asterisk itself can tell you what IP it accepted a given connection on (any server machine might have multiple locat interfaces, each with a different IP),
and what address a given connection is coming from.
This is something to suggest as an enhancement on their bugs/support forum.

You ca not just grab some random interface that is up and assume that that is the one
you were connected on. The C code down inside Asterisk already does a
getpeername() system call (or equivalent) on the incoming socket to get the other end's IP; you can prove this by doing e.g., "sip show peers" and see that it has the IP addrs of
all your registered peers.

It's up to the C to reliably provide this.

Reply via email to