Here the context:
I want to make calls on demand. I could use a call file or Action : Originate. I’ll choose the action, because I want to create a web base application to make call. I want to keep trace of the calls, answered or not. I’ll use Mysql, could be any database.
Here the use cases that I tough. (I don’t know which one is better, I need your advices please)
case 1 :
in java
Insert in mysql with status = 0
do a Action : Originate
if OriginateResponse == SUCCESS status=1, else status=2
update mysql with status for this phone number.
case 2 :
Action : Originate
call a AGI script (I only did the hello world example, I have no idea how I could do that here)
do the sql in the agi script ?
case 3 : took the example : viewtopic.php?t=23834
OriginateAction dial = new OriginateAction();
dial.setChannel(“Local/DIAL@my_context”);
dial.setContext(“my_context”);
dial.setExten(“ANSWERED”);
dial.setPriority(1);
dial.setAsync(true);
dial.setCallerId(“5555551212”);
dial.setVariable(“dial_string”,“SIP/+15555551213@myprovider.com”);
[my_context]
exten => DIAL,1,Verbose(1,About to perform outdial)
exten => DIAL,n,Dial(${dial_string},30)
exten => DIAL,n,Agi(agi://127.0.0.1/MyAGI.agi?dial_result=${DIALSTATUS})
exten => DIAL,n,Hangup()
exten => ANSWERED,1,Answer()
exten => ANSWERED,n,Agi(agi://127.0.0.1/MyAGI.agi?dial_result=ANSWER)
exten => ANSWERED,n,Hangup()
I think I could replace the call AGI, by sql insert in mysql ?
What do you think ?