Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 122799) +++ channels/chan_sip.c (working copy) @@ -18524,7 +18524,25 @@ memset(buf, 0, buflen); - if (!strcasecmp(args.param, "rtpdest")) { + if (!strcasecmp(args.param, "peerip")) + ast_copy_string(buf, p->sa.sin_addr.s_addr ? ast_inet_ntoa(p->sa.sin_addr) : "", buflen); + else if (!strcasecmp(args.param, "recvip")) + ast_copy_string(buf, p->recv.sin_addr.s_addr ? ast_inet_ntoa(p->recv.sin_addr) : "", buflen); + else if (!strcasecmp(args.param, "from")) + ast_copy_string(buf, p->from, buflen); + else if (!strcasecmp(args.param, "uri")) + ast_copy_string(buf, p->uri, buflen); + else if (!strcasecmp(args.param, "useragent")) + ast_copy_string(buf, p->useragent, buflen); + else if (!strcasecmp(args.param, "peername")) + ast_copy_string(buf, p->peername, buflen); + else if (!strcasecmp(args.param, "t38passthrough")) { + if (p->t38.state == T38_DISABLED) + ast_copy_string(buf, "0", sizeof("0")); + else /* T38 is offered or enabled in this call */ + ast_copy_string(buf, "1", sizeof("1")); + } + else if (!strcasecmp(args.param, "rtpdest")) { struct sockaddr_in sin; if (ast_strlen_zero(args.type)) Index: channels/chan_iax2.c =================================================================== --- channels/chan_iax2.c (revision 122799) +++ channels/chan_iax2.c (working copy) @@ -11751,6 +11751,10 @@ if (!strcasecmp(args, "osptoken")) ast_copy_string(buf, pvt->osptoken, buflen); + else if (!strcasecmp(args, "peerip")) + ast_copy_string(buf, pvt->addr.sin_addr.s_addr ? ast_inet_ntoa(pvt->addr.sin_addr) : "", buflen); + else if (!strcasecmp(args, "peername")) + ast_copy_string(buf, pvt->username, buflen); else res = -1; Index: funcs/func_channel.c =================================================================== --- funcs/func_channel.c (revision 122799) +++ funcs/func_channel.c (working copy) @@ -190,6 +190,13 @@ #endif "\n" "chan_sip provides the following additional options:\n" + "R/O peerip Get the IP address of the peer\n" + "R/O recvip Get the source IP address of the peer\n" + "R/O from Get the URI from the From: header\n" + "R/O uri Get the URI from the Contact: header\n" + "R/O useragent Get the useragent\n" + "R/O peername Get the name of the peer\n" + "R/O t38passthrough 1 if T38 is offered or enabled in this channel, otherwise 0\n" "R/O rtpqos Get QOS information about the RTP stream\n" " This option takes two additional arguments:\n" " Argument 1:\n" @@ -227,6 +234,8 @@ "\n" "chan_iax2 provides the following additional options:\n" "R/W osptoken Get or set the OSP token information for a call\n" + "R/O peerip Get the peer's ip address\n" + "R/O peername Get the peer's username\n" "\n" "Additional items may be available from the channel driver providing\n" "the channel; see its documentation for details.\n"