string manipulation

Willy Offermans FreeWilly at Offermans.Rompen.nl
Tue Sep 6 13:26:59 CEST 2016


Dear freeradius friends,

I have the following in the accounting section of my sites-enabled/default 
file:

<snip>

	if ( request:Asterisk-Unique-ID ) {
		update request {
			Acct-Session-Time := &Asterisk-Bill-Sec
			Called-Station-Id := &Asterisk-Last-Data
			Calling-Station-Id := &Asterisk-Src
			Connect-Info := &Asterisk-Disposition
		#       NAS-Port-Type := "Asterisk CDR"
		}
	}
</snip>

The data in Asterisk-Last-Data is something like 
SIP/7874338439 at SIPprovider.

I would like to save only the 7874338439 data in Called-Station-Id.

So I need something like a sed or awk command to strip out the right data.
Something equivalent as

`echo 'SIP/7874338439 at SIPProv' | sed 's/[a-Z/@]//g'`

How can this be achieved within freeradius?


-- 
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,
De jrus wah,

Will

*************************************
 W.K. Offermans

                                       Powered by ....

                                            (__)
                                         \\\'',)
                                           \/  \ ^
                                           .\._/_)

                                       www.FreeBSD.org


More information about the Freeradius-Users mailing list