Can I hide the clients number from users when using asterisk?

I have an asterisk system which I use to make outgoing calls. I’ve been trying to hide the number from users so that they click to call but without knowing the number they are calling. I have tried to base64 encode the number, but I don’t know where to decode it in asterisk for the call to go through. Anyone has this problem?

What are they clicking? Is it an application outside of Asterisk? If so, how is it originating the dial? (AMI/Call files)

they are clicking a function sip:(phone number ) that simply launches eybeam to call the number they click ,now i want to base64 encode that phone number so they would click the encoded number eybeam would launch with the encoded text,but now how can asterisk decode that number for the call to come throug

If you’ve encoded the number, and passed that to Asterisk, you could do something like this…

exten => s,1,Set(number_to_dial=${BASE64_DECODE(${EXTEN})})

i did that in the 3,dial part but it dint work

thank u for replying i will paste what ive done tomorrow when i arrive at work first thing ,and if you kinddly have a look at it ,i would be so graytfull,im new to asterisk and it seems i have a stupid problem with the syntax

I ACCEESED work by remote ,here is what ive done but it doesnt seem to decode it

exten => _39.,1,AGI(agi://
exten => _39.,2,SET(CALLERID(num)=390694801842)
exten => _39.,3,Dial(${TRUNK1}/${BASE64__DECODE(${EXTEN})},tToR)
exten => _39,4,Hangup

when i try to make a call with encoded number asterisk respond that mxgdhfuwjdjsj is not found in context default.(the above being the encoded number )

Too many underscores.

1 Like

i typed 2 underscores for it to be visible here

Also, the value of ${EXTEN} is 39. You need to capture the “dialed extension”.

when i pass the number directly without encoding it works.can you show me an example of how can that be done .thank you

First of all, a word of caution. This will match everything, so use it very carefully. I’d even suggest pointing the dialing extensions to a separate context.

;Check to see if we’re dialing a regular number. If so, use that extension. If not, decode.
exten => _.,1,GotoIf($["${LEN(${EXTEN})}" <= “12”]?dial)
same => n,Set(EXTEN=${BASE64_DECODE(${EXTEN})})
;assuming you set TRUNK1 in the general section, otherwise, it will need defined first
same => n(dial),Dial(${TRUNK1}/${EXTEN},tToR)
same => n,Hangup()

thank u it works perfectly ,can u kindly explain what is the risk that this extension matches everything .again thank u

thank u it works perfectly ,can u kindly explain what is the risk that this extension matches everything .again thank u

Asterisk will try to pattern match in the order of most specific to least. If it can’t find an exact match, like 1234, then it will match a pattern like _1XXX, next it would match _XXXX. By using _., if someone dials something that isn’t matched elsewhere, it will use that. The problem with BASE64, is there is no guarantee that the first digit or character will be the same. If you pre-pended “CALL-” then the base64 variable, then you could use ‘CALL-.’ rather than '.’. They usually recommend using at least one character ‘_X.’ That means “any digit”, plus anything else.

Old, but still relevant:

1 Like

Man i cant thank you enough .To me you are an inspiration to this community.Keep up the teamwork .Again thank you!

1 Like