Are you actually trying to strip off the + or are you doing it as part of trying to check the callerid number to see if it is valid. If the later, then consider REGEX()... here is a snippet from my privacy manager script...<div>
<br></div><div><span class="Apple-style-span" style="font-family: 'Bitstream Vera Sans Mono', 'Lucida Console', 'Lucida Sans Typewriter', Monaco, 'Courier New', monospace; font-size: 12px; border-collapse: collapse; line-height: 15px; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">; First lookup number in asterisk DB for a Caller ID name.
exten = s,n,Set(CALLERID(name)=${IF(${DB_EXISTS(cidname/${CALLERID(num)})}?${DB_RESULT}:${CALLERID(name)})})
; Now check against whitelist.
exten = s,n,GotoIf(${DB_EXISTS(whitelist/${CALLERID(num)})}?onwhitelist)
; Not on whitelist, check it against blacklist
exten = s,n,GotoIf(${DB_EXISTS(blacklist/${CALLERID(num)})}?onblacklist)
; Not on blacklist either, check Caller ID number for anonymous conditions...
; If all zeros (with or without international dialing + sign) then caller is anonymous.
exten = s,n,GotoIf($[${REGEX("^[+]?0+$" ${CALLERID(num)})} = 1]?unknown)
; If Caller ID is not a number at least 4 digits long (with or without + sign)
; then caller is assumed to be anonymous. Alphabetic Caller ID "numbers"
; will therefore be considered anonymous. Common numbers for anonymous callers
; are: "asterisk, unknown, anonymous, private, unavailable" which may be upper, lower
; or mixed case. The regular expression catches everything non-numeric.
; If you want to permit a specific non-numeric Caller ID "number" add it to whitelist.
exten = s,n,GotoIf($[${REGEX("^[+]?[0-9]{4\,}$" ${CALLERID(num)})} != 1]?unknown)
; Caller ID looks good.</span></div><div><br></div><div><br><br><div class="gmail_quote">On Thu, Jan 14, 2010 at 9:11 AM, Danny Nicholas <span dir="ltr"><<a href="mailto:danny@debsinc.com">danny@debsinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">I saw something like this in another
answer, but here’s an example that should work (would on 1.4)</span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">exten => s/_+X.,1,Set(TMPNAME=${CALLERID(name)})</span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">exten => s/_+X.,n,Set(CLEANNAME=CUT(TMPNAME|\+|2))</span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">exten => s/_+X.,n,Set(CALLERID(name)=${CLEANNAME})</span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"> </span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">in my installations ${X:1} is a hit or miss proposition; CUT is a
Known quantity.</span></font><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">
<hr size="2" width="100%" align="center">
</span></font></div>
<p class="MsoNormal"><b><font size="2" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma;font-weight:bold">From:</span></font></b><font size="2" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma">
<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a> [mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>]
<b><span style="font-weight:bold">On Behalf Of </span></b>Szasz Szabolcs<br>
<b><span style="font-weight:bold">Sent:</span></b> Thursday, January 14, 2010
3:55 AM</span></font></p><font size="2" face="Tahoma"><div class="im"><br>
<b><span style="font-weight:bold">To:</span></b>
<a href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a><br>
</div><b><span style="font-weight:bold">Subject:</span></b> [asterisk-users] how to
strip + from the caller-ID</font><p></p>
</div><div><div></div><div class="h5">
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"> </span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">Hi,<br>
<br>
How can I strip + from the front of the caller ID?<br>
I have tried this:<br>
exten => s/_+X.,1,Set(CALLERID(name)=${CALLERID(name):1})<br>
<br>
But it is not working.<br>
<br>
<br>
Szasz Szabolcs</span></font></p>
</div></div></div>
</div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br></div>