/* If this is a subscription we actually just need to see if a hint exists for the extension */
if (req->method == SIP_SUBSCRIBE) {
- char hint[AST_MAX_EXTENSION];
int which = 0;
- if (ast_get_hint(hint, sizeof(hint), NULL, 0, NULL, p->context, uri) ||
- (ast_get_hint(hint, sizeof(hint), NULL, 0, NULL, p->context, decoded_uri) && (which = 1))) {
+
+ if (ast_get_hint(NULL, 0, NULL, 0, NULL, p->context, uri)
+ || (ast_get_hint(NULL, 0, NULL, 0, NULL, p->context, decoded_uri)
+ && (which = 1))) {
if (!oreq) {
ast_string_field_set(p, exten, which ? decoded_uri : uri);
}
{
const char *exten = astman_get_header(m, "Exten");
const char *context = astman_get_header(m, "Context");
- char hint[256] = "";
+ char hint[256];
int status;
+
if (ast_strlen_zero(exten)) {
astman_send_error(s, m, "Extension not specified");
return 0;
context = "default";
}
status = ast_extension_state(NULL, context, exten);
- ast_get_hint(hint, sizeof(hint) - 1, NULL, 0, NULL, context, exten);
+ hint[0] = '\0';
+ ast_get_hint(hint, sizeof(hint), NULL, 0, NULL, context, exten);
astman_start_ack(s, m);
- astman_append(s, "Message: Extension Status\r\n"
- "Exten: %s\r\n"
- "Context: %s\r\n"
- "Hint: %s\r\n"
- "Status: %d\r\n"
- "StatusText: %s\r\n\r\n",
- exten, context, hint, status,
- ast_extension_state2str(status));
+ astman_append(s, "Message: Extension Status\r\n"
+ "Exten: %s\r\n"
+ "Context: %s\r\n"
+ "Hint: %s\r\n"
+ "Status: %d\r\n"
+ "StatusText: %s\r\n"
+ "\r\n",
+ exten, context, hint, status,
+ ast_extension_state2str(status));
return 0;
}
/* Notify managers of change */
char hint[512];
+ hint[0] = '\0';
ast_get_hint(hint, sizeof(hint), NULL, 0, NULL, context, exten);
switch(info->reason) {