Remove area code on mail script

hello friend ,
how can i remove area code and add 0 number before the incoming call number , when sending mail for this script?

example : 0XXXXXXXXX

exten => _.,1,TrySystem(echo "Incoming call from : ${CALLERID(number)} Call on ${STRFTIME(${EPOCH},,%k:%M:%S %A %B %e Date )}" | mail -s "Incoming call alert" -a "From: Incoming Phone Call <[email protected]>" [email protected])
exten => _.,n(ivrsel-0),Goto(ivr-6,s,1)

thanks

Depends on where the are code is in the number, what country are you in?

my country code 972
first 3 numbers on number
example : 972XXXXXXXXX
i want to replace 972 with 0
and get email with 0XXXXXXXXX

https://docs.asterisk.org/Configuration/Dialplan/Variables/Manipulating-Variables-Basics/

so

0${CALLERID(number):3}

or

0${CALLERID(number):-9}

0${CALLERID(num):3}

:slight_smile: now its work thanks you

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.