1. SetCIDName is a dial plan application that sets the Name of the user that calls (Name and Number are composite parts of CallerID). So this function can change the callerid name, while keeping the original callerid number.
NOTE: This application is valid for Asterisk version 1.0.9 and 1.0.10.
If you are using version 1.2 or newer, then you have to know that this application is deprecated. However, if you want to use its functionality, there is a new syntax, which require the usage of the Set application. For more information click on the link - The new syntax - the CALLERID(name) function.
Syntax:
SetCallerID(cname[|a]) : cname is the parameter that will be the new caller Name. The second parameter will set ANI flag if any are used (second argument is optional).
The application always returns 0.
NOTE: SetCIDName is being deprecated in favour of CALLERID(name). For more information loot at the tutorial concerning the function Set(). In future it will be more appropriate to use Set(CallerID(name)) then SetCIDName.
Purpose and usage
This dial plan application is used for changing the name of the caller without changing its number.
Have a look at the example below. There are some small tricky issues to be noted:
The caller ID (callerid name + callerid number) that is set in Asterisk PBX (iax.conf, sip.conf or mgcp.conf) overwrites the caller ID set on the softphone client.
When you use callerid name as variable ${CALLERID(name)} note that as this variable is Asterisk-defined it is case sensitive (must be in capital letters).
The asterisk defined variable ${CALLERIDNAME} is deprecated in favour of ${CALLERID(name)}.
Prerequisites
First of all you need to install Asterisk PBX. Afterwards you need to configure at least one user in iax.conf, sip.conf or mgcp.conf – the protocol you are going to use depends on you or of the phone you are using. After this you need to write some extensions in extensions.conf.
In this tutorial I will use Idefisk softphone that is an IAX client. You can download it by clicking here. Tutorial showing how it works and configuration support can be found here.
Asterisk PBX configurations
NOTE: This is just an example of what you can use this application for. Of course you can use it and for other purposes.
When you have installed and working Asterisk PBX you will need some user to test this application. If you do not have any registered in iax.conf you may add the following one. If you are not going to user Idefisk Softphone and iax.conf you have to register the user in the same way in sip.conf, h323.conf or mgcp.conf – depending on the protocol you are using.
Above I registered a user [ivan] with the properties:
type=friend (type might be user – just can call, peer – just can be called and friend – can call and can be called)
username=ivan – this is the user which must authenticate when connecting to the Asterisk PBX server
context=test is the context from extensions.conf which the user can access (including any other context which is/are included in this one)
secret=ivan is the password with which the user must authenticate when connecting to the Asterisk server
host=dynamic means that the host for this user is dynamic and he/she can connect to Asterisk PBX from different computers (host may be defined with static ip address)
Allow=all means that all audio codecs are allowed (You can allow certain codecs as well as disallow others)
Note that the settings in the softphone client are of greater importance here. I am using Idefisk in this tutorial. For better overview of Idefisk you can read the Idefisk configuration tutorial. Here is how the account I am using is set.
As you see in host I set the IP address of my Asterisk PBX. Username and password are the same as the username and secret that are defined in iax.conf on the asterisk. I set CallerID to ivan and number to 333.
We now have a user that can use the context test from extensions.conf. So now we need some dial plan application in [test] in extensions.conf.
Here is the application in extensions.conf:
exten => 2222,1,Answer()
the call is answered
exten => 2222,2,Playback(welcome)
welcome message is played on playback
exten => 2222,3,NoOp(${CALLERID(name)})
this shows the current value of the caller name
exten => 2222,4,SetCIDName(test)
Here caller name is set to test
exten => 2222,5,NoOp(${CALLERID(name)})
shows in CLI the current Caller ID Name that was changed. NOTE:${CALLERID(name)} is Asterisk defined variable and is case sensitive.
exten => 2222,6,Playback(vm-goodbye)
goodbye message is played
exten => 2222,7,Hangup()
hangup() closes the line
2. The application in CLI
Look above where asterisk gets the callerid name from the softphone client (callerid is ivan <333> so callerid name will be ivan). Then it is set to test and when dumped with NoOp it shows that the caller ID is really changed to test.
Now let us just add to iax.conf on Asterisk this line to the user properties: callerid=user <222>
Then redo the example and here is what happens in CLI.
As you see now Asterisk takes the ‘CallerID name’ value from the user properties in iax.conf not from the settings of the Idefisk (or any whatever softphone client) – user <222>. SetCIDName sets the CallerID name to test. Then we check the caller id name with NoOp to be sure that it is really changed.
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
buy hydroxychloroquine (sammythurmanccq02 at bracer dot ml) 30 August 2020 21:21:59 buy hydroxychloroquine https://chloroquine1st.com/
walmart prescription prices (antje dot snowden at ykoxevisulyk dot gq) 17 June 2020 08:18:33 walmart prescription prices https://amstyles.com/
andy (voiprate at netcabo dot pt) 18 December 2006 23:19:14 Good day to you again. This is andy from Portugal. I need a help on asterisk dail plan.I need to connect my asterisk box, to terminate some of my calls through a calling card gateway, via a gateway access number.
I need my asterisk to make international calls on the following way: First leg call from my asterisk, through one of my trunk to a gateway Acees number ie: (798)676 - 3333, When the gateway answers, enter 011 then the country code and number you want to reach. so asterisk will dial the number for the caller of my asterisk box, along with the destination number they have entered into my asterisk befor and the asterisk will complect the process, with out the need for the caller to know the process of the calls. I mean the second leg to the call, from my provider trunk, to the second gateway.