how to execute code if a call came. help me please

Discussion in 'General' started by khalid, Aug 13, 2010.

  1. khalid

    Joined:
    Aug 13, 2010
    Messages:
    3
    Likes Received:
    0
    Hi. I am new to asterisk and elastix, thought I have a little complicated problem.

    I have setup two internal extensions in elastix, one with number 111 and the other is 222

    I need asterisk to execute specific php code passing the calling number and the called number to the script, without affecting the call performance. I don't want the call to be affected while the script is executing, as if it used threading.

    I am new but I found in other asterisk forum that there is a function that called system. and I wrote the following

    [from-internal]
    exten => 111,1,Answer()
    exten => 111,n,system(php /var/lib/asterisk/agi-bin/test.php)
    exten => 111,n,hangup()

    the code execute, but it prevent calls to the number 111, and second, I don't know how to pass the calling number to the script so that the code to execute is as follow

    test.php?calling=xxxx&called=yyyy

    please help me
     

Share This Page