Asterisk noop callers IP required

Say, Using this on hangup
http://www.voip-info.org/wiki/view/Asterisk+variables
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
shaunwinginAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

grbladesCommented:
You will need to use the sip_header function to read the address directly out of the sip header. See http://www.voip-info.org/wiki/view/Asterisk+func+sip_header
The example given on that page looks like it will do what you want.
0
feptiasCommented:
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:
http://www.voip-info.org/wiki/view/Asterisk+func+channel
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
grbladesCommented:
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.
0
shaunwinginAuthor Commented:
Look fwd to testing it...tx
0
shaunwinginAuthor Commented:
Still to test
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IP Telephony

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.