Je vais te donner l'exemple d'une bonne action pour asterisk 1.6



Exemple en ruby:

testcall.rb

require 'socket'

STDOUT.flush
s = TCPsocket.open('localhost', 5038)

seq = [
"Action: Login",
"Username: contactlist",
"Secret: contactSdjgsD6",
"",
"Action: Originate",
"Channel: SIP/SOFTPHONE001", #DEVICE de l'appelant
"Context: trunktollfree", #Contexte avec le bon plan de numérotation
"Exten: 33557023597", #DESTINATION
"Priority: 1",
"Callerid: Dupond <3355706456>", #PRESENTATION DE NUMERO
"",
"Action: Logoff"
""
""
]

seq.each{ |c| s.puts "#{c}\r\n" }

while line = s.gets # Read lines from the socket
puts line.chop # And print with platform line terminator
end