• Idefisk
  • Tools
  • Tutorials
  • Reviews
  • VoIP Providers
  • Archives
ZOIPER softphone
Back to Tutorials

6.1.2.82. SetCallerID (dialplan application)

1. SetCallerID is a dialplan application that sets the ID of the user that calls (ID is composed of name and 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(all) function.

 

Syntax:
SetCallerID(clid[|a]) : clid is the parameter that will be the new caller ID. The second parameter will set ANI flag if any are used. It is optional.

The application always returns 0.

 

Purpose and usage
This dial plan application is used for changing the caller ID.

Have a look at the example below. There are some small tricky issues to be noted:

The caller ID 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 caller ID as variable ${CALLERID} note that as this variable is Asterisk-defined it is case sensitive (must be in capital letters).

 

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.

setCallerID01.png

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 the settings in the softphone client – here they are important. 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.

SetCallerID02.png

As you see in host I set the IP address of my Asterisk PBX. Username and password are the same as the ones defined in the iax.conf file 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.

SetCallerID03.png

Here is the application in extensions.conf:

exten => 1111,1,Answer()
the call is answered

exten => 1111,2,Playback(welcome)

welcome message is played on playback

exten => 1111,3,NoOp(${CALLERID})
this shows the current value of the caller ID

exten => 1111,4,SetCallerID(test)
Caller ID is set to test here

exten => 1111,5,NoOp(${CALLERID})
shows in CLI the current Caller ID that must was changed.
NOTE: the ${CALLERID} above is Asterisk-set variable and is case sensitive.

exten => 1111,6,Playback(vm-goodbye)
goodbye message is played

exten => 1111,7,Hangup()
hangup() closes the line

 

2. The application in CLI


SetCallerID04.png
SetCallerID05.png

Look above asterisk gets the caller id from the softphone client – user + number (ivan <333>). Then it is set to test and when dumped with NoOp it shows that the caller ID is changed to test.

Now let us just add to iax.conf on Asterisk this line to the user properties: callerid=user <222>

setCallerID06.png

Then redo the example and here is what happens in CLI.

SetCallerID07.png

As you see now Asterisk takes the Caller ID value from the user properties in iax.conf not from the settings of the Idefisk (or any whoever softphone client) – user <222>. SetCallerID sets the caller ID to test. Then we check the caller id with NoOp to be sure that it is 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

 


4. Similar dialplan applications

Set()
SetCIDName()
SetCIDNum()

 

 
User Comments
EllElulky (ellColi at daff dot pw)
16 August 2019 14:21:36
Buy Cipro Xr Online <a href=http://genericcial.com>online cialis</a> Cialis Mieux Que Le Viagra
DamonTrorp (damongeobek at mail dot ru)
26 May 2017 20:29:03

<a href=http://apotheke-online-24.com/drugs/kamagra-soft>kamagra soft tabs </a>
<a href=http://apotheke-online-24.com/drugs/lovegra>wie wirkt lovegra </a>
<a href=http://apotheke-online-24.com/drugs/kamagra-jelly>kamagra oral jelly shop </a>
<a href=" http://apotheke-online-24.com/drugs/cialis-generic ">cialis generika kaufen tschechien </a>
<a href=" http://apotheke-online-24.com/drugs/lovegra ">wo kann ich lovegra bestellen </a>
<a href=" http://apotheke-online-24.com/drugs/kamagra ">kamagra jelly 100mg </a>
Blue (m96urtn6ic at mail dot com)
18 November 2016 02:44:40
Ho ho, who <a href="http://mpzsstf.com">woldua</a> thunk it, right?
Kayden (9cy19webb at yahoo dot com)
15 November 2016 18:03:40
I hate my life but at least this makes it beearbla. http://nxebbuw.com [url=http://echagdesq.com]echagdesq[/url] [link=http://qdnlzdqacc.com]qdnlzdqacc[/link]
Ireland (v4bz5yk1o at yahoo dot com)
09 November 2016 09:36:04
If you want to get read, this is how you <a href="http://giuvtofh.com">shulod</a> write.
Leif Madsen (leif at leifmadsen dot com)
24 February 2006 07:20:09
No, you would use it like so using the dialplan function:

exten => s,1,Set(CALLERID(ani)=8675551212)

For prior to 1.2, you can use the SetCIDNum() application:

exten => s,1,SetCIDNum(8675551212,a)
Joe Spear (obitusis at gmail dot com)
01 February 2006 07:20:17
How exactly would the ANI flag be used? Would you just type: SetCallerID("Joe Spear" <0000000000> a) ?
 
Add Comment
Name:
Email:
Comment:
In order to prevent automatic posting on our website, we kindly request you to type in the number you see in the picture below.
Image Verification:
 

Latest Headlines:

  • T.38 faxing with Zoiper 2.15 is now easier than ever
    section: voip software
  • Asterisk 1.4.21 Released
    section: Asterisk
  • Asterisk 1.4.20 Released
    section: Asterisk
  • Asterisk 1.4.20-rc2 Released
    section: Asterisk
  • Asterisk 1.4.20-rc1 Now Available
    section: Asterisk
  • News Archives (older news)

Latest Tutorials:

  • Sending Fax from Zoiper to Zoiper using T.38
    added 08/Dec/2008 18:16
  • VMAuthenticate (dialplan application)
    added 01/Mar/2008 15:57
  • Siptronic ST-530
    added 06/Nov/2007 17:57
  • Siemens C455 IP hardphone
    added 05/Nov/2007 10:24
  • Zoiper
    added 22/Oct/2007 17:53

Latest Comments:

  • https://donde-ver-ant-man-y-la-avispa-qu...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-scream-6-tyt.statuspag...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-guardianes-de-la-noche...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-demon-slayer-villa-de-...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://www.reddit.com/r/BenavidezvPlant...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
 
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™