<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hello Steve,<div class=""><br class=""></div><div class="">I also couldn’t find a way to pass CRLF with Kamcmd. However if it it an alternative for you, you can use jsonrpc instead (<a href="https://kamailio.org/docs/modules/5.5.x/modules/jsonrpcs.html" class="">https://kamailio.org/docs/modules/5.5.x/modules/jsonrpcs.html</a>). Then you can use e.g. curl to trigger a registration like</div><div class=""><br class=""></div><div class=""> curl --header 'Content-Type: application/json' --data-binary '{"jsonrpc":"2.0", "method": "tm.t_uac_start", "params":["REGISTER","<a href="sip:test.net" class="">sip:test.net</a>","sip:<YOUR_IP>:5060","udp:<YOUR_IP>:5060","From: <a href="sip:test2@test.net\r\nTo:" class="">sip:test2@test.net\r\nTo:</a> <a href="sip:test@.test.net\r\n" class="">sip:test@.test.net\r\n</a>"], "id": 1}' http://<YOUR_IP>:8080/<YOUR_ENPOINT></div><div class=""><br class=""></div><div class="">Regards,</div><div class=""><br class=""></div><div class="">Markus<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 16.12.2021 um 22:04 schrieb Steve Sether <<a href="mailto:ssether@usinternet.com" class="">ssether@usinternet.com</a>>:</div><br class="Apple-interchange-newline"><div class="">
  

    <meta http-equiv="content-type" content="text/html; charset=UTF-8" class="">
  
  <div class=""><p class="">I'm trying to use the kamcmd tml.tc_uac_start command to send raw
      SIP messages in Kamailio 5.5, but I always get a error: 400 -
      Invalid headers.  I've also tried sending OPTIONS messages with
      the same result.  I've looked for examples of sending SIP messages
      via kamcmd, but can't find any.<br class="">
    </p><p class="">kamcmd help tm.t_uac_start specifies the following:</p><p class="">kamcmd> help tm.t_uac_start <br class="">
      starts a tm uac using  a list of string parameters: method, ruri,
      dst_uri, send_sock, headers (CRLF separated) and body (optional)</p><p class="">Essentially my problem is I don't really know how to properly
      encode these headers.  How do I send special characters? Do I need
      to use double quotes, single quotes, etc around the whole header?
      Which characters are special?  How do I encode the CRLF?  I tried
      \r\n, but I still get this error.  It says only From: and To: are
      required.  It's a bit hard trying to make progress when all I ever
      get is one error message.  The kamailio logs are a little more
      helpful, and largely point me down the road that it doesn't
      understand the CRLF encoding, and says my From: header includes
      the To: line, so it's not separating them.<br class="">
    </p><p class="">For example, I'm trying things like this:</p><p class="">kamcmd -v tm.t_uac_start OPTIONS <a class="moz-txt-link-abbreviated" href="mailto:sip:200@exampleserver.com:5060">sip:200@exampleserver.com:5060</a> .
      . "From:
<a class="moz-txt-link-rfc2396E" href="mailto:sip:example@192.168.0.1"><sip:example@192.168.0.1></a>;tag=d27ca05e-1789-4774-a698-dcfe91dec9b4\r\nTo:
      <a class="moz-txt-link-rfc2396E" href="mailto:sip:example@192.168.0.2"><sip:example@192.168.0.2></a>"\r\nExpires:
      1200\r\nContent-Length: 0"</p><p class="">Nothing seems to work, so whatever the syntax I'm using must be
      wrong.<br class="">
    </p><p class="">Just providing an example of sending SIP via  kamcmd
      tm.t_uac_start would likely help a huge amount. </p><p class="">Thanks!<br class="">
    </p>
    <div class="moz-signature">-- <br class=""><p class="MsoNormal"><o:p class=""> </o:p></p>
    </div>
  </div>

__________________________________________________________<br class="">Kamailio - Users Mailing List - Non Commercial Discussions<br class="">  * <a href="mailto:sr-users@lists.kamailio.org" class="">sr-users@lists.kamailio.org</a><br class="">Important: keep the mailing list in the recipients, do not reply only to the sender!<br class="">Edit mailing list options or unsubscribe:<br class="">  * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" class="">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br class=""></div></blockquote></div><br class=""></div></body></html>