The data in Asterisk-Last-Data is something like SIP/7874338439@SIPprovider.
I would like to save only the 7874338439 data in Called-Station-Id.
If the string is fairly constant in format, i.e. it's always 'SIP/<numbers>@SIPProvider', then I'd try: if (&request:Asterisk-Last-Data =~ /\/([0-9]+)\@/) { # a series of digits preceded by a / and followed by an @ update reply { Called-Station-Id := "%{1}" } } Does that work for you? :-) Stefan Paetow Moonshot Industry & Research Liaison Coordinator t: +44 (0)1235 822 125 gpg: 0x3FCE5142 xmpp: stefanp@jabber.dev.ja.net skype: stefan.paetow.janet jisc.ac.uk Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800.