If you want remove in CALLERID.<br><br>you can remove it this way:<br><br>exten=> _X./_+1X.,1, Set()<br><br>ok?<br>good luck!<br>Thiago Maluf.<br><br><div><span class="gmail_quote">2007/8/14, Anselm Martin Hoffmeister <
<a href="mailto:anselm@hoffmeister-online.de">anselm@hoffmeister-online.de</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Am Sonntag, den
12.08.2007, 21:16 -0400 schrieb C F:<br>> you can do like this:<br>> exten => _X.,1,GoSubIf($[${LEN(${CALLERID(num)})}>10]?strip1);if it's<br>> longer than grab the last 10 digits of the CIDNUM<br>> exten => _X.,50(strip1),Set(CALLERID(num)=${CALLERID(num):$[${LEN(${CALLERID(num)})}-10]});this
<br>> grabs the last 10 digits of CALLERID(num) and sets it to CALLERID(num)<br>> exten => _X.,n,Return()<br><br>Argh! You do not ever get international calls, do you? (Well, Canada<br>does not count here for obvious reasons)
<br><br>The clean solution to the question<br><br>I get some calls with a leading "+1". If that is the case, how do I<br>strip that off?<br><br>is of course<br><br>If the CALLERID(num) starts "+1", re-set it to the same value, offset 2:
<br><br>...<br>exten => _X.,n,GoSubIf($["${CALLERID(num):0:2}" = "+1"]?strip1)<br>...<br><br>exten => _X.,n(strip1),Set(CALLERID(num)=${CALLERID(num):2})<br>exten => _X.,n,Return()<br><br>Which leaves international calls for themselves. Of course you still
<br>could replace the leading "+" for all other numbers by "011", if you<br>like.<br><br>Your code would probably handle<br>+12125551212<br>correctly, would work OK with<br>+495924236<br>(which might or might not be one of the old, short numbers still present
<br>in some places in Germany), leaving it intact, but not with<br>+4916177554224<br>which would be remapped to a Boston MA number (actually a Cingular cell<br>phone number) instead of mapping it to a german mobile phone.
<br><br>Variable handling (offset et al) is documented on<br><a href="http://www.voip-info.org/wiki/view/Asterisk+variables">http://www.voip-info.org/wiki/view/Asterisk+variables</a><br><br>BR<br>Anselm<br><br><br>_______________________________________________
<br>--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--">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">
http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>----------------------------------------------------------------<br>THIAGO MALUF RESENDE<br>Consultor Voip e Programador WEB (Voip Developer and Web Developer)
<br>Tel: +55 21 86042100<br>e-mail: <a href="mailto:malufrj@gmail.com">malufrj@gmail.com</a>