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


#1

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?


#2

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


#3

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


#4

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

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


#5

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


#6

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


#7

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

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


#8

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 )


#9

Too many underscores.


#10

i typed 2 underscores for it to be visible here


#11

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


#12

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


#13

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.

[outbound-dial-base64]
;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()


#14

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


#15

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


#16

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:
http://www.voip-info.org/wiki/view/Asterisk+Dialplan+Patterns


#17

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