Search code examples
asteriskraspberry-pi3freepbx

Asterisk won't does as extension_custom.conf says


I'm currently working on a project where I need to do some specific tasks using asterisk.

WHAT I DID

I run the asterisk through a raspberry pi and convert PSTN call to VoIP using Obi110 device. However it routes incoming calls to my FreePBX. As extension file says it comes as"from trunk" context name. So to be able to answer the incoming call and play a sound file, I followed online tutorial and as an example I used provided code to check whether it actually works. So in extension_custom.conf I wrote following code,

[from-trunk]
exten => s,1,Answer ; 
exten => s,2,Playback(tt-weasels) ; 
exten => s,3,Hangup ; 

exten => ste,1,Set(VOLUME(RX)=10) ; set the RX volume
exten => ste,2,Set(VOLUME(TX)=10) ; set the RX volume
exten => ste,hint,SIP/ste; hint  'ste' used for presence notification
exten => ste,3,Dial(SIP/ste) ; call the user ste'


exten => steand,1,Set(VOLUME(RX)=10) ; set the RX volume
exten => steand,2,Set(VOLUME(TX)=10) ; set the RX volume
exten => steand,hint,SIP/ste; hint  'steand' used for presence notification
exten => steand,3,Dial(SIP/steand) call the user 'steand' used for presence 
notification

My Problem

After saving that and restarting asterisk and make a call to the PSTN line phone, it still rings rather than following the commands. Am I doing something wrong? I'm new to this. Thanks.


Solution

  • Extension s mean "no extension". More then likly, that you have no any goto to that extension in your dialplan.

    Use

    asterisk -rvvv 
    

    Check output of asterisk when call come in, you will see context and extension used.

    Also you SHOULD not use SAME context in custom. You should use from-trunk-custom.