How To Launch A URl When Dialing A Number

Home » Asterisk Users » How To Launch A URl When Dialing A Number
Asterisk Users 6 Comments


i want to luanch an URL in my PC when i call a number like below

exten => 066104xxxx,1,Set(CALLERID(number)Rxxxxxxx)
exten => 066104xxxx,n,MixMonitor(zap_g1_${EXTEN}_${UNIQUEID}.wav|av(0}V(0))
=> 066104xxxx,n,Dial(Zap/g1/${EXTEN},30,A(this-call-may-be-monitored-or-recorded))
exten => 066104xxxx,n, ( here i want to launch this url in my pc )
exten => 066104xxxx,n,Hangup()

thanks and regards

6 thoughts on - How To Launch A URl When Dialing A Number

  • If you just want the url to be opened (perhaps to update a counter via a web service or cgi script), you can do this:

    system(“wget http://“)
    or system(“fetch http://…”)


  • thanks justin i try to do this but the issue still the same.this link is stored in my server .but what i want to receive this link when i call this number in my pc

    ip adresse of my pc
    ip adresse of server when the page php is stored

    thanks and regards

    2013/5/30 Justin Killen

  • hello ,

    thanks alex for your help and support the scenario is correct.

    i will try to follow your suggestion and i will update you asap

    thank you again for your explication i really appreciate it

    2013/5/31 Alex Villac

  • Actually, that *is* doable, because I have done it!

    I wrote a little daemon, which runs on each agent’s workstation, listening for UDP messages and delivering system notifications. The daemon is started through a symlink in /home/*/.kde/Autostart, so it runs under the logged-in user’s ID; and one of the supported message types instructs the daemon to open a URL in iceweasel. Since iceweasel probably is already running, it just opens a new tab in the existing browser process.

    This isn’t quite as insecure as it sounds, because I made sure to bake in the following security measures:

    * You can’t actually execute arbitrary commands just by sending UDP messages.
    The daemon is doing some sanity-checking — the worst you can do is display an arbitrary web page.

    * All this is happening on the inside of a firewall, which blocks access from agents’ workstations to most outside IP addresses. Any web page you can display is safe-for-work.

    * The firewall also doesn’t let anything in on the UDP port which is used for notification messaging.

    When an agent receives an incoming call on their DDI number, an AGI script is started. It looks up the calling number in the database; and if it is found, a notification message is sent with the details of the caller, followed by another one to fetch up the user’s details in our web app.

    There is no reason why an AGI script should not fire off a request to open a browser page as an external number is dialled. But instead of dialling the number manually, we use a callfile-generating CGI script (linked from within the main telesales application) to call external numbers when the agent follows a link.

    It probably also helps greatly that all the software we use to run our call centre (besides whatever is usually found in a standard Linux distribution)
    was written in-house …..

  • Have you tried maybe setting up the entire call in an AGI that will execute the desired script as you make the dial command? Or, you could look at running the M or U options in your Dial() command to execute a macro or gosub routine when the call is connected?