1. CALLERID(num) - this function allows you to set the Number 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 CALLERID(num) 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.
value - The new number, you want to set to the caller.
Purpose and usage
The purpose of this function is to allow you to change the Number of the caller. (Name and Number are composite parts of CallerID). So this function could change the callerid number, while keeping the original callerid name.
NOTE: The caller ID (callerid name + callerid number) that is set in the Asterisk PBX (iax.conf, sip.conf or mgcp.conf) overwrites the caller ID set on the softphone client.
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 Playback application. As arguments in its brackets we have set welcome. This is a standard welcome message, which comes with the Asterisk and which will be played thanks to the application. We have one extension with the NoOp application - just to verify the content of the CALLERID(num) variable. In our case it will show 111, because this is the caller number set in our Idefisk softphone. You could also set the caller's number in the iax.conf file by using the callerid=name <number> option.
Now let's change the caller's number with the CALLERID(num) function.
Use the Set application. As argument in the brackets write the following - CALLERID(num)=1010. This will cause the change of the caller number form 111 to 1010.
We will use an extension with the NoOp application - to verify that the change is successful. Then, by using the Playback application we will play another sound file - vm-goodbye.
NOTE: The function CALLERID(num) 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.
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
Davidnut (thincariper1989ytavip at yandex dot ru) 02 February 2019 18:46:23 cialis on line spedizione italia
pharmacy cialis meningitis net
<a href="http://kaivanrosendaal.com">tadalafil</a>
cialis usage
cialis 20mg side effects
<a href=http://kaivanrosendaal.com>Cheap Cialis</a>
purchase cialis online cheap
pharmacy cadia cialis
http://kaivanrosendaal.com/#Buy-Cheap-Cialis
mahfuz (rh dot mahfuz at yahoo dot com) 14 September 2018 07:02:34 Hi,
I need some help.
I am running asterisk 11.4.0 with dahdi 2.11.1 in RHEL server.
Everything working fine (both inbound and outbound)
The only problem is I cannot see the inbound caller ID on any SIP phone. it always shows "Anonymous" on SIP phone. I can see the incoming number inside asterisk log / console but never on SIP phone. Caller ID between SIP phones are visible only Inbound caller ID shows "Anonymous".
Please help to resolve the issue.
Thanks
Mahfuz
David Gawler (david dot gawler at skybridgedomains dot com) 24 October 2017 07:15:51 how to set asterisk caller ID to blocked calls on the default outbound trunk, please? email david.gawler@phoneonline.com.au
giuseppe (giuseppe dot montanarella at manet dot it) 31 May 2016 17:38:21 Hello, is possible check the callerID and put this number in a file?
Thankyou
Giuseppe
souvik (souvik_sadhu at yahoo dot com) 13 March 2007 05:56:02 how can i make call from asterisk FXS phone to other PSTN or mobile no?
Jonathan Cardinez (jonathan dot cardinez at transact dot com dot au) 16 May 2006 07:38:20 Hi,
How do I block CallingPartyNumber when the call scenario is:
IP PHone --> Gateway --> PSTN
In an Asterisk PBX extension, if I want to call a PSTN number, I don't want the A-number delivered to PSTN. How can I do this in Asterisk PBX.