[Home]

Summary:ASTERISK-23169: [patch] Support getting local SIP IP using CHANNEL() dial plan function
Reporter:Ben Smithurst (bensmithurst)Labels:patch
Date Opened:2014-01-21 08:50:03.000-0600Date Closed:
Priority:MinorRegression?No
Status:Open/NewComponents:Channels/chan_sip/General Functions/func_channel
Versions:SVN 11.7.0 13.18.4 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) ourip_v2.diff
( 1) ourip.diff
Description:It is useful for us in some dial plan code to be able to determine the local SIP IP.  I couldn't see a way of doing this, so I extended CHANNEL() to support it.  I'm submitting this because it's pretty simple and it may be useful for other people.
Comments:By: Rusty Newton (rnewton) 2014-01-28 15:36:56.608-0600

It does sound useful! Since this would be a new feature, it would likely go in Trunk. It appears to patch cleanly to Trunk.

A question about

bq. <para>R/O Get the IP address of the socket which received the call.</para>

I'm not a developer, so I don't know what is going on in the source always.

Would it always be the socket receiving the call? In the case of outbound calls, wouldn't it be the socket originating the call? Would it be more appropriate to say something like "R/O Get the IP address of the local socket regardless of it is source or destination" ?

By: Ben Smithurst (bensmithurst) 2014-01-30 05:30:55.997-0600

Good question, I must admit I haven't tested it in an outbound call scenario.

By: Rusty Newton (rnewton) 2014-02-18 20:16:29.783-0600

Do you mind testing and modifying the documentation as needed. I've got a million issues to work with, otherwise I'd be glad to. :)

By: Ben Smithurst (bensmithurst) 2014-02-20 03:07:20.600-0600

I'll try to find some time, but I'm pretty snowed under at work.  I'll see what I can do though.

By: Rusty Newton (rnewton) 2014-03-11 16:12:31.265-0500

Tested fine on 12 and trunk, though it would only go in trunk. Changed the help text to "R/O Get the IP address of the local socket." which makes more sense, since it doesn't matter whether we received the call or are originating the call.