From c1729e937b897815bde63e8a03bc33bfbb3302e5 Mon Sep 17 00:00:00 2001 From: totoro Date: Fri, 17 May 2019 19:23:42 +0900 Subject: [PATCH] [~] add some print in case of error --- asterisk/ami.anubis | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/asterisk/ami.anubis b/asterisk/ami.anubis index f6c100a..503baf2 100644 --- a/asterisk/ami.anubis +++ b/asterisk/ami.anubis @@ -24,11 +24,11 @@ define Maybe(List(String)) //TODO find the header and content-lenght to get full length of answer //if read(conn, 16384, 5) is - if read_line(conn, 80, 10) is + if read_line(conn, 80, 60) is { - error then failure, - timeout then failure, - eof then failure, + error then println("readline error");failure, + timeout then println("readline timeout");failure, + eof then println("readline eof");failure, ok(str) then if str = crlf then (if print_dump then @@ -103,7 +103,7 @@ public define Maybe(List(String)) if write(conn, to_byte_array(action_str)) is { - failure then failure, + failure then println("send_action write failure");failure, success(_) then ami_receive(true, conn) } }. @@ -161,20 +161,3 @@ public define Maybe(Asterisk_client) )= asterisk_new_client(server_name, auth, false) . - - -global define One - ami_test - ( - List(String) args - )= - if asterisk_new_client("192.168.3.118:5038", auth("anubix","anubix")) is - { - failure then println(" asterisk new client failure"), - success(ami_client) then - forget(send_action(ami_client, ami_originate_call("1000", "1001"))) - //forget(xml_rpc_client_execute(true, rpc_client, "/Settings", "list_domains", empty_param)) - //forget(xml_rpc_client_execute(true, rpc_client, "/Settings", "delete_domain", parameters([parameter[string("amisdefontainebleau.org")]]))) - //forget(xml_rpc_client_execute(true, rpc_client, "/Settings", "create_domain", empty_param)) - }. - -- libgit2 0.21.4