Outbound calls

Dear all

i have this code in my extension.conf
[service]
exten => 222333444,1,Answer()
exten => 222333444,2,GotoIftime(9:00-21:00,,,*?outcallchristian,s,1)

[outcallchristian]
exten => s,1,Set(new=${CURL(localhost/bulk/newcall.php)})
exten => s,n,Set(MSI=${new})
exten => s,n,Dial(SIP/${MSI}@10.10.1.12,G(callstart,s,1))
exten => s,n,Goto(${DIALSTATUS},1)

exten => BUSY,1,Goto(busy,h,1)
exten => NOANSWER,1,Goto(busy,h,1)
exten => CANCEL,1,Goto(busy,h,1)
exten => CONGESTION,1,Goto(busy,h,1)
exten => CHANUNAVAIL,1,Goto(busy,h,1)

exten => h,1,goto(busy,h,1)
exten => h,n,Hangup()

[callstart]
exten => s,1,noop(“CallStart”})
exten => s,n,Read(insert,/var/lib/asterisk/sounds/christian,1)
exten => s,n,noop(${insert})
exten => h,1,Set(STS=${CURL(localhost/bulk/christian.php?CALLERID=${MSI}&SELECTION=${insert})})
exten => h,n,Set(callstatus=${CURL(localhost/bulk/callstatus.php?CALLSTATUS=${DIALSTATUS}&CALLERID=${MSI}&SELECTION=${insert})})
exten => h,n,Set(outcall=${CURL(localhost/bulk/outcall.php)})
exten => h,n,Hangup()

[busy]
exten => h,1,noop(“Call End”)
exten => h,n,Set(callstatus=${CURL(localhost/bulk/callstatus.php?CALLSTATUS=${DIALSTATUS}&CALLERID=${MSI}&SELECTION=0)})
exten => h,n,Set(outcall=${CURL(localhost/bulk/outcall.php)})
exten => h,n,Hangup()

and this code as my call file

Channel: Local/222333444@service
Application: wait
Data: 15
Archive: No

and this as my CLI output
– Attempting call on Local/222333444@service for application wait(15) (Retry 1)
– Executing [222333444@service:1] Answer(“Local/222333444@service-00000016;2”, “”) in new stack
– Executing [222333444@service:2] GotoIfTime(“Local/222333444@service-00000016;2”, “9:00-21:00,,,*?outcallchristian,s,1”) in new stack
– Goto (outcallchristian,s,1)
– Executing [s@outcallchristian:1] Set(“Local/222333444@service-00000016;2”, “new=2347085599911”) in new stack
– Executing [s@outcallchristian:2] Set(“Local/222333444@service-00000016;2”, “MSI=2347085599911”) in new stack
– Executing [s@outcallchristian:3] Dial(“Local/222333444@service-00000016;2”, “SIP/2347085599911@10.10.1.12,G(callstart,s,1)”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/2347085599911@10.10.1.12
– SIP/10.10.1.12-00000142 is making progress passing it to Local/222333444@service-00000016;2
– SIP/10.10.1.12-00000142 answered Local/222333444@service-00000016;2
– Executing [s@callstart:1] NoOp(“Local/222333444@service-00000016;2”, ““CallStart”}”) in new stack
– Executing [s@callstart:2] Read(“Local/222333444@service-00000016;2”, “insert,/var/lib/asterisk/sounds/christian,1”) in new stack
– Accepting a maximum of 1 digits.
– <Local/222333444@service-00000016;2> Playing ‘/var/lib/asterisk/sounds/christian.slin’ (language ‘en’)
– Executing [s@callstart:2] Read(“SIP/10.10.1.12-00000142”, “insert,/var/lib/asterisk/sounds/christian,1”) in new stack
– Accepting a maximum of 1 digits.
– <SIP/10.10.1.12-00000142> Playing ‘/var/lib/asterisk/sounds/christian.slin’ (language ‘en’)
– User entered ‘2’
– Executing [s@callstart:3] NoOp(“SIP/10.10.1.12-00000142”, “2”) in new stack
– Auto fallthrough, channel ‘SIP/10.10.1.12-00000142’ status is ‘UNKNOWN’
– Executing [h@callstart:1] Set(“SIP/10.10.1.12-00000142”, “STS=”) in new stack
– Executing [h@callstart:2] Set(“SIP/10.10.1.12-00000142”, “callstatus= updated”) in new stack
– Executing [h@callstart:3] Set(“SIP/10.10.1.12-00000142”, “outcall=Call files generated”) in new stack
– Executing [h@callstart:4] Hangup(“SIP/10.10.1.12-00000142”, “”) in new stack
== Spawn extension (callstart, h, 4) exited non-zero on ‘SIP/10.10.1.12-00000142’
[Nov 21 12:01:45] NOTICE[6986]: pbx_spool.c:385 attempt_thread: Call completed to Local/222333444@service
– User disconnected
– Executing [h@callstart:1] Set(“Local/222333444@service-00000016;2”, “STS=failed”) in new stack
– Executing [h@callstart:2] Set(“Local/222333444@service-00000016;2”, “callstatus=Updated Not Subscribed”) in new stack
– Executing [h@callstart:3] Set(“Local/222333444@service-00000016;2”, “outcall=Call files generated”) in new stack
– Executing [h@callstart:4] Hangup(“Local/222333444@service-00000016;2”, “”) in new stack
== Spawn extension (callstart, h, 4) exited non-zero on ‘Local/222333444@service-00000016;2’

i dont know what is happening but seems the file loops in the cli why am i having this please any help ?

G runs code on both channels.

hey man i removed the G and added a goto function
but it’s always going to the hangup is there anyway to make a dial and let the user go to another context where i can make a READ() without using the G ?

Please see: catb.org/esr/faqs/smart-questions.html#goal

well i don’t know where i am not being specific i am very new to asterisk but still i think i have been very clear in my question maybe it’s a dumb question but i have been stuck with this a week now i am trying to search online i cannot find any answers maybe i am searching the wrong places…

again i am trying to make an outbound call and when the call is answered i want the user to hear a small voice and then take his input with the read function and then use the CURL function to store the input with the dialed number to my database when doing so with the G now i am loosing the variables between the 2 channels and cannot successfully insert the data to my database so how can i do so …
any suggestion will be helpful thx

[service]
exten => 222333444,1,Answer()
exten => 222333444,2,GotoIftime(9:00-21:00,,,*?outcallchristian,s,1)

[outcallchristian]
exten => s,1,Set(__MSI=${CURL(localhost/bulk/newcall.php)})
exten => s,n,Dial(SIP/${MSI}@10.10.1.12,G(startcall,s,1))
exten => s,n,goto(${DIALSTATUS},1)

exten => BUSY,1,Goto(busy,s,1)
exten => NOANSWER,1,Goto(busy,s,1)
exten => CANCEL,1,Goto(busy,s,1)
exten => CONGESTION,1,Goto(busy,s,1)
exten => CHANUNAVAIL,1,Goto(busy,s,1)

[startcall]
exten => s,1,goto(waitcall,s,1)
exten => s,n,Read(SELECTION,/var/lib/asterisk/sounds/christian,1)
exten => s,n,noop(${SELECTION})
exten => s,n,noop(${MSI})
exten => s,n,Set(__RETURN=${CURL(localhost/bulk/christian.php?CALLERID=${MSI}&SELECTION=${SELECTION})})
exten => s,n,set(CALLSTATUS=ANSWER)
exten => s,n,noop(${SELECTION})
exten => s,n,noop(${MSI})
exten => s,n,Set(__STATUS=${CURL(localhost/bulk/callstatus.php?CALLSTATUS=${CALLSTATUS}&CALLERID=${MSI}&SELECTION=${SELECTION})})
exten => s,n,Set(__CALL=${CURL(localhost/bulk/outcall.php)})
exten => h,1,Hangup()

[waitcall]
exten => s,1,wait(30)
exten => s,n,Answer()

[busy]
exten => s,1,noop(“Call End”)
exten => s,n,noop(${MSI})
exten => s,n,Set(__STATUS=${CURL(localhost/bulk/callstatus.php?CA … CALLERID=${MSI}&SELECTION=0)})
exten => s,n,Set(__CALL=${CURL(localhost/bulk/outcall.php)})
exten => h,1,Hangup()

i changed the code to this no the call status is a php code that updates my table with the call status
the christian.php is irrelevant here the outcall generates a new call file the problem is when i send 30 to 50 call file at a time i get only 12 or 13 working and the others are not even updated in the database it seems they jst cut off at the DIAL … and i get this warning

[Nov 25 15:40:00] WARNING[24942]: app_dial.c:1473 wait_for_answer: Unable to write frametype: 2
== Spawn extension (outcallchristian, s, 2) exited non-zero on 'Local/222333444@service-00000187;2’
anyone can help plz ??