[RESOLVED] Identify international calls for CID manipulation

Hi All,

Here in the UK the telcos send max-10-digit caller ID. This has the effect of stripping the leading zero from inbound numbers.

I have added some caller ID manipulation to the from-pstn context to add it back in:

For reasons unknown to me, ‘Unknown’ CID has LEN()=2, hence the ‘> 4’. This is effective to keep unknowns as ‘Unknown’ and add the leading ‘0’ back into actual numbers.Unfortunately this also adds a single leading ‘0’ to international numbers where I really want ‘00’.

Apart from, say, assuming numbers >10 char are international is there a way of determining international or not in the dialplan? I can’t find anything appropriate in the documentation.

Many thanks in advance for any help.

I suspect you need to look at the Type of Number (ton).

Many thanks for the suggestion.

I looked at ToN and after working out that outgoing ToN and incoming ToN did not have the same values (!) I have:

[from-pstn-custom] exten => _X!,1,ExecIf($[${CALLINGTON}=17]?Set(CIDPREFIX=00):Set(CIDPREFIX=0)) exten => _X!,n,ExecIf($[LEN("${CALLERID(num)}") > 4]?Set(CALLERID(num)=${CIDPREFIX}${CALLERID(num)}))

So far this has worked well; ‘unknown’ stays as such, local, national or unknown ToN prefixes with ‘0’, international gets ‘00’