<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>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>
</p>
<p>kamcmd help tm.t_uac_start specifies the following:</p>
<p>kamcmd> help tm.t_uac_start <br>
starts a tm uac using a list of string parameters: method, ruri,
dst_uri, send_sock, headers (CRLF separated) and body (optional)</p>
<p>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>
</p>
<p>For example, I'm trying things like this:</p>
<p>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>Nothing seems to work, so whatever the syntax I'm using must be
wrong.<br>
</p>
<p>Just providing an example of sending SIP via kamcmd
tm.t_uac_start would likely help a huge amount. </p>
<p>Thanks!<br>
</p>
<div class="moz-signature">-- <br>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>