diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-04-03 07:35:14 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-04-03 07:35:14 +0000 |
commit | 55126ae685c0c7110a6db49380c55f7d308e3b6a (patch) | |
tree | 49d5e1a620332ed0e3dad359dca22b9c51d235b3 /pbx.c | |
parent | a767222eaa41d28592bf8d39c770b7dcba29d4a9 (diff) |
State change patch
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@740 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-x | pbx.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1245,18 +1245,21 @@ int ast_extension_state_add(char *context, char *exten, struct ast_notify_cb *cblist; struct ast_exten *e; + e = ast_hint_extension(NULL, context, exten); + if (!e) { + return -1; + } + pthread_mutex_lock(¬ifylock); list = notifys; while (list) { - if (!strcmp(list->exten->parent->name, context) && - !strcmp(list->exten->exten, exten)) + if (list->exten == e) break; list = list->next; } if (!list) { - e = ast_hint_extension(NULL, context, exten); if (!e) { pthread_mutex_unlock(¬ifylock); return -1; @@ -1267,9 +1270,9 @@ int ast_extension_state_add(char *context, char *exten, return -1; } /* Initialize and insert new item */ - memset(list, 0, sizeof(struct ast_notify)); + memset(list, 0, sizeof(struct ast_notify)); list->exten = e; - list->laststate = -1; + list->laststate = ast_extension_state2(e); list->next = notifys; notifys = list; } |