Asterisk noop callers IP required

Posted on 2011-10-08
Last Modified: 2013-12-21
Say, Using this on hangup
Below is my output.
How do I get the callers IP?

 Executing [h@OutboundWS:1] NoOp("SIP/41.x.x.x-03bfd750", "EXTEN : h") in new stack
[2011-10-08 23:55:15] VERBOSE[14670] logger.c:     -- Executing [h@OutboundWS:2] NoOp("SIP/41.x.x.x-03bfd750", "SIPDOMAIN : 41.x.x.x") in new stack
[2011-10-08 23:55:15] VERBOSE[14670] logger.c:     -- Executing [h@OutboundWS:3] NoOp("SIP/41.x.x.x-03bfd750", "SIPCALLID : b212484d2e3ca45d") in new stack
Question by:shaunwingin
    LVL 36

    Expert Comment

    You will need to use the sip_header function to read the address directly out of the sip header. See
    The example given on that page looks like it will do what you want.
    LVL 19

    Accepted Solution

    I don't like to contradict another expert, especially one as wise as grblades. However, on this occasion there is a strong case for saying that the IP address in the From header is quite likely not to be the same as the source IP address of the request. It may not even be an IP address, but a host name/sip domain.

    Since there is actually a channel variable that returns the source IP address it would seem a much better choice becuause (a) it does nto require text manipulation with CUT and (b) it will always contain the actual source IP address.

    exten => _X.,n,noop(SOURCEIP: ${CHANNEL(recvip)})

    Details here:
    LVL 36

    Assisted Solution

    Good find feptias.
    I use opensips sitting infront of asterisk and use it to add custom headers for the received IP etc... so I know exactly what information I am getting and dont run into issues with formatting.

    Author Comment

    Look fwd to testing it...tx

    Author Closing Comment

    Still to test

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    I recently purchased a Bluetooth headset called the Music Jogger (model BSH10). The control buttons on it look like this: One of my goals is to use it as the microphone and speakers for Skype calls. In that respect, it works well. However, I …
    Moving your enterprise fax infrastructure from in-house fax machines and servers to the cloud makes sense — from both an efficiency and productivity standpoint. But does migrating to a cloud fax solution mean you will no longer be able to send or re…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now