Device & User mode: Device is able to make calls!

Hi,

In the device and user mode the device is able to make calls without having a user logged in to that device, how can i stop the ability of a device to make calls?

Thanks.

i guess i can add exten => *11,1,Goto(from-internal,${EXTEN},1) replacing *11 by the numbers i want to allow the device to make, right?

Yea you can do that and tq Philippe your insights are really important to us. Thanks again.

be careful when making dialplan that blocks devices that are not logged into.

you never want to block any device’s ability to dial 911 or the equivalent emergency dialing number for your country.

Hi,

The dialplans i had made myself for a customer.

As for sounds, you can record directly using FreePBX over the phone with the Systems Recordings module. If you want to upload that manually, the format has to be PCM Encoded, 16 Bits, at 8000Hz placed in /var/lib/asterisk/sounds

[devcheck]
exten => *11,1,Goto(from-internal,${EXTEN},1)
exten => *12,1,Goto(from-internal,${EXTEN},1)
exten => _.,1,Set(USEREXIST=$[${DB(DEVICE/${CALLERID(num)}/user)}])
exten => _.,n,GotoIf($[${USEREXIST}=none]?endit)
exten => _.,n,Goto(from-internal,${EXTEN},1)
exten => _.,n(endit),Playback(pbx-invalid)
exten => h,1,Hangup

This will kind of make the *11 and *12 always be the exception…

Hey sanjayws,

It works perfect, thanks a lot, where did you learn about dial plans?

if i want to make a custom announcement instead of pbx-invalid, what is the format and where should i put it, in which folder. Thanks.

Hey , thanks for your reply, i tried it but whatever i dial it says “i’m sorry that’s not a valid extension” , i still need to be able to dial *11 and *12 to log in and log out…can you help me more…I’m know knowledgeable in Dial plans.

Thanks.

Hi there

How i did it was to use a custom context (extension_customs.conf) and use that context in my extension config in FBX. Something like this perhaps? In this case, use the contextname like below devcheck for an extension and try it…

[devcheck]
exten => _.,1,Set(USEREXIST=$[${DB(DEVICE/${CALLERID(num)}/user)}])
exten => _.,n,GotoIf($[${USEREXIST}=none]?endit)
exten => _.,n,Goto(from-internal,${EXTEN},1)
exten => _.,n(endit),Playback(pbx-invalid)
exten => h,1,Hangup

Mine was more complex and had more things i check, but you can try this? At the end, the playback part you can use a custom sound recording for instance to tell users they’ve not logged in, up there i use a something default…