1. SendImage - this application allows you to send an image file to the caller.
NOTE: This application is valid for Asterisk version 1.0.9 and above.
Syntax:
SendImage(filename)
If the channel does not support image transport the execution will continue with the extension with priority n+101. If such one does not exist it will continue at the next priority level.
Returns 0 on success or if the channel does not support image transport and -1 on failure or hang up.
Purpose and usage
This application is very similar to the application SendText.
You could use this application when you want to display a picture on the screen of the caller.
I will give you an idea what for you can use it. Its a good way for advertising. Every time, somebody attempts to call the numbers of your company he/she will see this picture.
I will show you how to configure your Asterisk PBX to use it with this application and for this purpose.
Unfortunately we did not find any softphone which to support this application. If you managed to find out such phone, please contact us at support@asteriskguru.com.
Asterisk PBX configurations
NOTE: This is only an example of what for you can use this application. Of course you can use it and for other things.
We need three registered users in 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 users anatoliy, user1 and user2.
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.
Now lets see how to make your advertisement with the help of SendImage application. On the picture above you could see a screenshot from our extensions.conf file.
First of all we dont want to write one and the same sentence ten or twenty times. For example if we have 10-15 phone lines and we want the callers of these lines to see our message we have to make separate extensions for each line. However there is a smarter way to achieve this. We need to make a macro. The macro is a special context in extensions.conf.
The first thing when you are going to create a macro is the name. In the brackets write macro, then dash and then the name you want to have for this macro. Now, in the body you have to write only one line. An extension which will contain the SendImage application.
Perhaps you have noticed that we have written the path to the image file and the name of the image file but without its extension.
Example
the name of the image file is: asterisk-intro.jpg but you have to write only: asterisk-intro
The supported formats for image files are: .jpeg and .png
Now you have to call out this macro in the main context where you write the extensions for your 10-15 numbers. The first extension for a certain number will be with priority 1 then the key word macro and then as argument in the brackets write the name of the macro(This has to be the name which you have written after the dash in the name of the macro). In our example this is sendimage.
The next extension with priority 2 will contain the application Dial which will dial the desired user through the chosen protocol(IAX, SIP, MGCP). Its a good idea to add an extension for a hanging up to be sure that when the conversation is over the Asterisk PBX will hang up the line.
So, in our example if somebody dials 111 or 112, he/she will see one and the same image - asterisk-intro.jpg.
2. Screenshots of what you can 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