Call Forwarding From Phones And Getting The Referrer IP

Home » Asterisk Users » Call Forwarding From Phones And Getting The Referrer IP
Asterisk Users 2 Comments

Hi

I’m using asterisk 1.8 but I’m sure this applies to other versions.

If someone puts a call divert on a handset such as a Snom phone I get this type of SIP message on receipt of an inbound call:

Got SIP response 302 “Moved Temporarily” back from xxx.xxx.xxx.xxx:xxxxx

Which then triggers a local channel to make the call.

Is there any way I can access that IP address inside my dialplan? I’ve done a ChanDump and there’s no sign of it.

Regards

Ish

2 thoughts on - Call Forwarding From Phones And Getting The Referrer IP

  • Bumping this as I originally sent it late on Friday. If anyone has any idea, please let me know.

    Thanks in Advance

    Ish

  • After a quick perusal of the chan_sip.c code (from svn trunk), I’m not seeing where the address (p->sa) logged in that message is passed to the redirecting functions handling the 302, thus it is unlikely there is a way to obtain it other than reading the log.

    It wouldn’t be hard to set a channel variable with that value however, should you want to patch the code, possibly even submit that.