[asterisk-biz] Bad routign or hack attempt ?

asterisk_help at iwishi.nu asterisk_help at iwishi.nu
Thu May 14 13:37:42 CDT 2009


On Thu, 14 May 2009, James A. Shigley wrote:
> Yeah it would be great to have it log a cdr style DB for sip calls with all the usual CDR information along with SIP specific information like IP of the user, codec being used, login, ect ,ect for tracking these type things and also for other reporting I can see doing if I had that data.

So why not add this to your dialplan?  You could then stuff the value into 
the userfield of the cdr record.


Example from: http://www.voip-info.org/wiki/view/Asterisk+func+sip_header
=========================================================================
To get Ip address of From (takes into account no caller id info i.e. no 
555 at 192.168.1.1 in the header):


exten => 1,1,Set(TESTAT=${CUT(SIP_HEADER(From),@,2)})
exten => 1,n,GotoIf($["${TESTAT}" != ""]?hasat)
exten => 1,n,Set(FROM_IP=${CUT(CUT(SIP_HEADER(From),>,1),:,2)})
exten => 1,n,Goto(gotip)
exten => 1,20(hasat),Set(FROM_IP=${CUT(CUT(CUT(SIP_HEADER(From),@,2),>,1),:,1)})
exten => 1,n(gotip),NoOp(Gateway IP is ${FROM_IP})
=========================================================================




More information about the asterisk-biz mailing list