diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index a41f173b9b7ccce184108108b63bbcf3fab25942..1f37904d073cf793f58267c778a7c46e10beb900 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -5036,7 +5036,7 @@ reject: * password field will be set to NULL. * * \note The dial string format is: - * [username[:password]@]peer[:port][/exten[@@context]][/options] + * [username[:password]@]peer[:port][/exten[@context]][/options] */ static void parse_dial_string(char *data, struct parsed_dial_string *pds) { @@ -5069,9 +5069,10 @@ static void parse_dial_string(char *data, struct parsed_dial_string *pds) pds->peer = strsep(&data, ":"); pds->port = data; - /* check for a key name wrapped in [] in the secret position, if found, - move it to the key field instead - */ + /* + * Check for a key name wrapped in [] in the password position. + * If found, move it to the key field instead. + */ if (pds->password && (pds->password[0] == '[')) { pds->key = ast_strip_quoted(pds->password, "[", "]"); pds->password = NULL; diff --git a/main/devicestate.c b/main/devicestate.c index 7f9136da39a63ca4d0cc1e48e5ce1131a4fc9791..7eb9e3057de764fb1fd11d28c9c2493f8d24aa07 100644 --- a/main/devicestate.c +++ b/main/devicestate.c @@ -169,7 +169,7 @@ static const char * const devstatestring[][2] = { { /* 5 AST_DEVICE_UNAVAILABLE */ "Unavailable", "UNAVAILABLE" }, /*!< Unavailable (not registered) */ { /* 6 AST_DEVICE_RINGING */ "Ringing", "RINGING" }, /*!< Ring, ring, ring */ { /* 7 AST_DEVICE_RINGINUSE */ "Ring+Inuse", "RINGINUSE" }, /*!< Ring and in use */ - { /* 8 AST_DEVICE_ONHOLD */ "On Hold", "ONHOLD" }, /*!< On Hold */ + { /* 8 AST_DEVICE_ONHOLD */ "On Hold", "ONHOLD" }, /*!< On Hold */ }; /*!\brief Mapping for channel states to device states */ @@ -187,7 +187,6 @@ static const struct chan2dev { { AST_STATE_BUSY, AST_DEVICE_BUSY }, { AST_STATE_DIALING_OFFHOOK, AST_DEVICE_INUSE }, { AST_STATE_PRERING, AST_DEVICE_RINGING }, - { -100, -100 }, }; /*! \brief A device state provider (not a channel) */ @@ -251,7 +250,7 @@ enum ast_device_state ast_state_chan2dev(enum ast_channel_state chanstate) { int i; chanstate &= 0xFFFF; - for (i = 0; chan2dev[i].chan != -100; i++) { + for (i = 0; i < ARRAY_LEN(chan2dev); i++) { if (chan2dev[i].chan == chanstate) { return chan2dev[i].dev; }