1. CDR() - this function allows you to change the Account Code of the caller
NOTE:Information about the Asterisk functions could be obtained by typing the show functions command.
Information about a particular function could be obtained by typing the show function <function name> on the Asterisk CLI command.
NOTE: In Asterisk versions 1.2 and up there are several applications which are mark as deprecated and which are no longer supported.
These applications will now become functions and these functions will be used in combination with the Set application.
You have to know that their functionality will be the same, but with a different syntax.
The CDR() function is one of those new functions which will replace the old applications. In this tutorial we will show you its syntax and possible usage.
The function is very useful, because now it gives you the possibility to change any of the CDR fields
value - The new account code, which you would like to be set for the call.
Purpose and usage
]The purpose of this function is to give you the possibility to change different CDR parameters of the caller. In this way the call from this caller will have for example an accountcode which will be selected by you and this call will be written in the CDR with the accountcode that you have been chosen.
To see how the application works we recommend you to use our IAX softphone Idefisk. You could download it from here. Please also read our tutorial to learn how to configure it to work with Asterisk PBX.
Asterisk PBX configurations
iax.conf Configurations
We need to create one user in the iax.conf file. This is because we are going to use the IAX2 protocol. If you want to use other protocol, such as SIP or MGCP, you have to do the configurations below respectively in sip.conf or mgcp.conf.
So, we have registered the user user1
Type=friend means that this user can make and receive calls. Host=dynamic means that the IP is not static but dynamic through a DHCP server. Allow=all means that the line which this user will use, could support all audio codecs. Context=test - this shows that this user is working with the extensions in this context of the configuration file extensions.conf.
On the picture above you could see our extensions.conf file.
In this example, when somebody dials 100, the call will be answered by the Answer application.
The next executed extension will be the one which contains the NoOp application. We will use it to check the content of the ${ACCOUNTCODE} variable. In our case it shows 20202020 because this is the accountcode we have set in our iax.conf file for the user user1
Then it is time for the CDR(accountcode) function. Use the Set application and type the following as argument in its brackets - CDR(accountcode)=10101010. This will cause the change of the caller's accountcode from 20202020to 10101010.
We will use another extension with the NoOp application - to verify that the change is successful.
NOTE: The function CDR() is case sensitive. You always have to write it in your dialplans as you see it in our tutorial.
In order to be sure that the Asterisk PBX will hang up the line, when the conversation is over, it is a good idea to use the Hangup application.
NOTE: This is only an example. The CDR() function could be used to change the following CDR parameters:
CDR(accountcode)
CDR(userfield)
2. Screenshots of what you could see on the CLI of the Asterisk PBX
3. Additional information
For more information about extensions.conf you can check here.
For more information about iax.conf you can check here.
This application is tested with our IAX softphone Idefisk. You can download it from here. For more information about this softphone please read our tutorial.
If you would like to test this application with the SIP channel you can read our tutorials about the SIP Softphones to learn how to configure them to work with Asterisk PBX
walmart pharmacy keflex (alfredopethardyod at lobumisan dot gq) 19 August 2020 12:36:22 walmart pharmacy keflex https://keflex.webbfenix.com/
StevUnsumS (stevNalk at belan dot space) 10 March 2020 10:46:08 Cialis 40 Mg Online http://apcialisle.com/# - Buy Cialis Cialis 5 Mg Diario <a href=http://apcialisle.com/#>Cialis</a> Ou Est Priligy Vendu
Champ (o8kxlxx3yo at outlook dot com) 18 November 2016 02:44:51 Kick the tires and light the fires, problem <a href="http://tgbqdsczfu.com">offlcialiy</a> solved!
Kailan (wabjrri9 at mail dot com) 15 November 2016 18:03:54 The abiltiy to think like that is always a joy to behold http://yojndpmjbgv.com [url=http://jrecyjz.com]jrecyjz[/url] [link=http://fxyxkgn.com]fxyxkgn[/link]