]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_iax2: Minor improvements to documentation and warning messages.
authorNaveen Albert <asterisk@phreaknet.org>
Fri, 18 Apr 2025 13:03:10 +0000 (09:03 -0400)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Mon, 21 Apr 2025 14:48:25 +0000 (14:48 +0000)
* Update Dial() documentation for IAX2 to include syntax for RSA
  public key names.
* Add additional details to a couple warnings to provide more context
  when an undecodable frame is received.

Resolves: #1206

channels/chan_iax2.c
channels/iax2/parser.c

index 118407f0919c9b5ff3c9a037b6c0a46a80306ce8..1ffcffce5a24dfe64dc9b2ff26c576278f18fbdd 100644 (file)
        </info>
        <info name="Dial_Resource" language="en_US" tech="IAX2">
                <para>The general syntax is:</para>
-               <para><literal>Dial(IAX2/[username[:password]@]peer[:port][/exten[@context]][/options]</literal></para>
+               <para><literal>Dial(IAX2/[username[:password[:pubkey]]@]peer[:port][/exten[@context]][/options]</literal></para>
+               <para>The IAX username is optionally followed by either the secret or name of the keypair to use for RSA
+               authentication (within square brakcets). If both need to be provided (such as for encrypted calls that
+               are RSA authenticated), both may be specified in either order.</para>
                <para>IAX2 optionally allows modifiers to be specified after the extension.</para>
                <enumlist>
                        <enum name="a">
@@ -10381,7 +10384,9 @@ static int socket_process_helper(struct iax2_thread *thread)
                if (f.datalen) {
                        if (f.frametype == AST_FRAME_IAX) {
                                if (iax_parse_ies(&ies, thread->buf + sizeof(struct ast_iax2_full_hdr), f.datalen)) {
-                                       ast_log(LOG_WARNING, "Undecodable frame received from '%s'\n", ast_sockaddr_stringify(&addr));
+                                       char subclass[40];
+                                       iax_frame_subclass2str(f.subclass.integer, subclass, sizeof(subclass));
+                                       ast_log(LOG_WARNING, "Undecodable %s frame received from '%s'\n", subclass, ast_sockaddr_stringify(&addr));
                                        ast_variables_destroy(ies.vars);
                                        return 1;
                                }
index ff025e1c18e8b1ce540175d8c61ee38ef0cddcb9..18d209d34bd7eaef420a5ec5d4d811f013beeddb 100644 (file)
@@ -812,7 +812,8 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen)
                ie = data[0];
                len = data[1];
                if (len > datalen - 2) {
-                       errorf("Information element length exceeds message size\n");
+                       snprintf(tmp, sizeof(tmp), "Information element length %d exceeds message size %d\n", len, datalen - 2);
+                       errorf(tmp);
                        return -1;
                }
                switch(ie) {