Hi I want to run rpc commands like permissions.addressReload from a go
application but with no luck please help me my code is:


cmd:="permissions.addressReload"
conn, err := net.Dial("unix", "/run/kamailio/kamailio_ctl")
if err != nil {
return "", fmt.Errorf("connect error: %w", err)
}
defer conn.Close()

// _, err = fmt.Fprintf(conn, "%s\n", cmd)
 _, err = conn.Write([]byte(cmd))
 if err != nil {
     return "", fmt.Errorf("write error: %w", err)
 }

 scanner := bufio.NewScanner(conn)
 var output string
 for scanner.Scan() {
     output += scanner.Text() + "\n"
 }
 if err := scanner.Err(); err != nil {
     return "", fmt.Errorf("read error: %w", err)
 }

`
the only thing i get is:
ยก0#^@ ^A<90><91>^^bad request: corrupted packet^@
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- 
[email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to