Commit c1729e937b897815bde63e8a03bc33bfbb3302e5

Authored by David RENÉ
1 parent 0bc9bea2

[~] add some print in case of error

Showing 1 changed file with 5 additions and 22 deletions   Show diff stats
asterisk/ami.anubis
@@ -24,11 +24,11 @@ define Maybe(List(String)) @@ -24,11 +24,11 @@ define Maybe(List(String))
24 //TODO find the header and content-lenght to get full length of answer 24 //TODO find the header and content-lenght to get full length of answer
25 25
26 //if read(conn, 16384, 5) is 26 //if read(conn, 16384, 5) is
27 - if read_line(conn, 80, 10) is 27 + if read_line(conn, 80, 60) is
28 { 28 {
29 - error then failure,  
30 - timeout then failure,  
31 - eof then failure, 29 + error then println("readline error");failure,
  30 + timeout then println("readline timeout");failure,
  31 + eof then println("readline eof");failure,
32 ok(str) then 32 ok(str) then
33 if str = crlf then 33 if str = crlf then
34 (if print_dump then 34 (if print_dump then
@@ -103,7 +103,7 @@ public define Maybe(List(String)) @@ -103,7 +103,7 @@ public define Maybe(List(String))
103 103
104 if write(conn, to_byte_array(action_str)) is 104 if write(conn, to_byte_array(action_str)) is
105 { 105 {
106 - failure then failure, 106 + failure then println("send_action write failure");failure,
107 success(_) then ami_receive(true, conn) 107 success(_) then ami_receive(true, conn)
108 } 108 }
109 }. 109 }.
@@ -161,20 +161,3 @@ public define Maybe(Asterisk_client) @@ -161,20 +161,3 @@ public define Maybe(Asterisk_client)
161 )= 161 )=
162 asterisk_new_client(server_name, auth, false) 162 asterisk_new_client(server_name, auth, false)
163 . 163 .
164 -  
165 -  
166 -global define One  
167 - ami_test  
168 - (  
169 - List(String) args  
170 - )=  
171 - if asterisk_new_client("192.168.3.118:5038", auth("anubix","anubix")) is  
172 - {  
173 - failure then println(" asterisk new client failure"),  
174 - success(ami_client) then  
175 - forget(send_action(ami_client, ami_originate_call("1000", "1001")))  
176 - //forget(xml_rpc_client_execute(true, rpc_client, "/Settings", "list_domains", empty_param))  
177 - //forget(xml_rpc_client_execute(true, rpc_client, "/Settings", "delete_domain", parameters([parameter[string("amisdefontainebleau.org")]])))  
178 - //forget(xml_rpc_client_execute(true, rpc_client, "/Settings", "create_domain", empty_param))  
179 - }.  
180 -