How to Create Custom Config Files in Yeastar S-Series VoIP PBX

Overview

Some tech skilled clients want to do some custom configuration for the Asterisk config files to meet their need when the features are not  supported by Yeastar.

If the clients modify the config file in /etc/asterisk/, the changes will be lost when you save and apply any changes on WEB GUI. PBX reboot would also make the changes lost.

  • Solution
  • Which Config Files Can be Customized
  • Content format
  • Examples

Solution

First you would learn how to login the SSH: How to Log in SSH of Yeastar S-Series VoIP PBX

As the solution all done in the SSH session. 

The solution is to create *_custom.conf” config file in the path of  /ysdisk/support/customcfg/. For example,  the changes of pjsip.conf must be saved in pjsip_custom.conf.

Note:

  • The extensions.conf is exception for the naming rule which also has the other file called extensions_support.conf. You would see how it is going in the following part of the article.
  • The operation in this article requires some basic Linux knowledge like how to use vi command etc... If you are not good at it, it could be a little difficult for you.

Which Config Files Can be Customized

The following config files can be customized in Yeastar S-Series VoIP PBX.

Modify Files

You can write only the modified context in the custom config file.

[modifyfile]
/etc/asterisk/extensions.conf
/etc/asterisk/pjsip.conf
/etc/asterisk/users.conf
/etc/asterisk/iax.conf
/etc/asterisk/queues.conf
/etc/asterisk/features.conf
/etc/asterisk/voicemail.conf
/etc/asterisk/meetme.conf
/etc/asterisk/rtp.conf
/etc/asterisk/http.conf
/etc/asterisk/musiconhold.conf
/etc/asterisk/followme.conf
/etc/asterisk/logger.conf
/etc/asterisk/manager.conf
/etc/asterisk/chan_dahdi.conf
/etc/asterisk/udptl.conf

Replace Files

You need copy and paste all the contents including the modified contents in the custom config file.

/etc/asterisk/dahdi-channels.conf
/etc/asterisk/digital-channel.conf

Content format

The content in the custom config file consists of 2 major parts.

  • Context name
  • Configuration parameter

It can have several contexts with its respective configuration parameters.

[Context Name 1]

Configuration parameter 1

Configuration parameter 2

...

[Context Name 2]

Configuration parameter 1

Configuration parameter 2

...

Examples

First you would need to know every time when you save and apply any changes on WEB GUI or PBX reboot specific, PBX would read and update the data fromthe custom config files.

While if you would like to update the change instantly for test purpose in the SSH session. You could execute the command astconfig.

__1.png

Then let's see the examples:

1. Modify Files

To modify or delete a specified field in the context of voicemail.conf

Just pick the the configuration you need to customize and add it followed by the context.

The format of configuration files as below:

/ysdisk/support/customcfg/voicemail_custom.conf

[general]  // this the context name

maxmsg = 100  //  It means the default value of masmsg is 100, you could change it other value according to Asterisk config file instructions.

;maxmin = 200  //  The ; means comment the configuration.

Also here is article for reference: Expand the Time of Customized Voicemail Greeting

 

2. Replaces Files

The common config file we customize is the extensions.conf. 

Specifically here, you need to edit the /ysdisk/support/customcfg/extensions_support.conf. If you meet the permission to edit extensions_support.conf. You can try to execute the following commands to gain the permission.

rm /ysdisk/support/customcfg/extensions_support.conf
touch /ysdisk/support/customcfg/extensions_support.conf

After you have the edit permission, Copy the all the content of [macro-stdPrivacyexten]  from /etc/asterisk/extensions.conf to the /ysdisk/support/customcfg/extensions_support.conf.

Such as:

[macro-stdPrivacyexten]

exten => s,1,Dial(${ARG2},20,p)

exten => s,2,Goto(s-${DIALSTATUS},1)

exten => s-NOANSWER,1,Voicemail(u${ARG1})

exten => s-NOANSWER,2,Goto(default,s,1)

… (Other lines are ignore here)

In practical case, please replace the context in extensions.conf with user-defined context.

Also you can refer the example in this article: Block dialing to specific extensions in IVR

 

Have more questions? Submit a request

5 Comments

  • 0
    Avatar

    Do you know if in the newer firmware version (using pjsip module instead of chan_sip), we can create pjsip_custom.conf?

  • 1
    Avatar

    Hi. One question about S20:

    This is a part of /etc/asterisk/extensions.conf, which i added from web-gui:
    [ivr_6501]
    exten = 6501,1,NoOp(without_operator)
    exten = 6501,n,Set(TIMEOUT(digit)=3)
    exten = 6501,n,Background(record/hi-pcm2)
    exten = 6501,n,WaitExten(3)
    exten = 6501,n,Goto(t,1)
    exten = 1,1,Goto(ivrs,6500,1)
    exten = 2,1,Goto(from-outside,1000,1)
    exten = 3,1,Goto(always-Hangup,h,1)
    exten = t,1,Goto(always-Hangup,h,1)
    exten = i,1,Goto(ivrs,6501,1)
    exten = unknown,1,NoOp(No Action)
    exten = fax,1,Goto(inrouter_${INROUTERNAME}_fax_detect,fax,1)

     

    and this is /ysdisk/support/customcfg/extensions_custom.conf

    [ivr_6501]
    exten = 6501,1,NoOp(without_operator)
    exten = 6501,n,Set(TIMEOUT(digit)=3)
    exten = 6501,n,Background(record/hi-pcm2)
    exten = 6501,n,WaitExten(3)
    exten = 6501,n,Goto(t,1)
    exten = 1,1,System(wget "https://example.com/aster?phone=${CALLERIDNUM}")
    exten = 1,2,Hangup()
    exten = 2,1,Goto(from-outside,1000,1)
    exten = t,1,Goto(always-Hangup,h,1)
    exten = i,1,Goto(ivrs,6501,1)
    exten = unknown,1,NoOp(No Action)
    exten = fax,1,Goto(inrouter_${INROUTERNAME}_fax_detect,fax,1)

    I do "astconfig" from customcfg dir, reload, restart asterisk, device in different orders, but extensions_custom.cfg do not applies to extensions.conf, and works rules only from /etc/asterisk/extensions.conf

    What i do wrong?

    Thx.

  • 1
    Avatar

    I support the question, only for the S100. Why is not activated extensions_custom.cfg?
    (I used the commands "astconfig" and then asterisk -rx 'module reload')

    And I also drew attention to strange mistakes after the command:
    asterisk -rx "dialplan show 272700@callin_trunk_272700"
    Could not open the specified codec configuration file '/ysdisk/ysapps/pbxcenter/etc/codec.conf' using the default built-in values
    Can not disable kernel resource limit: operation not allowed

    Is this message the reason?

    Edited by Starkomt
  • 0
    Avatar

    Hi,

    i created an iax_custom.conf and a extensions_custom.conf. The IAX ist working, but they do not jump in the from-intercom context

    iax_custom.conf 
    [DSP-IAX01]
    auth=md5
    type=friend
    secret=DSP-IAXPW
    context=from-intercom01
    requirecalltoken=auto
    disallow=all
    allow=g722
    allow=alaw
    host=dynamic
    qualify=yes
    qualifyfreqok=60000
    qualifyfreqnotok=8000
    qualifysmoothing=yes
    language=en
     
    and a extensions_custom.conf
    [from-intercom01]
    exten = 600,1,Playback(demo-echotest)
     
     
    but when i call the through the IAX they dont jump to the [from-intercom01] context
     
     
    I reload it from asterisk and restart the S20
     
    astconfig tells me Permission denied
    Edited by Michael Mitch Marciniak
  • 0
    Avatar

    Hi Michael, could you share the Asterisk logs when you test?

    Also you type command to return the result: dialplan show from-intercom01

Please sign in to leave a comment.