- strncpy(info, (char *)data, strlen((char *)data) + AST_MAX_EXTENSION-1);
- queuename = info;
- if (queuename) {
- options = strchr(queuename, '|');
- if (options) {
- *options = '\0';
- options++;
- url = strchr(options, '|');
- if (url) {
- *url = '\0';
- url++;
- announceoverride = strchr(url, '|');
- if (announceoverride) {
- *announceoverride = '\0';
- announceoverride++;
- queuetimeoutstr = strchr(announceoverride, '|');
- if (queuetimeoutstr) {
- *queuetimeoutstr = '\0';
- queuetimeoutstr++;
- qe.queuetimeout = atoi(queuetimeoutstr);
- } else {
- qe.queuetimeout = 0;
- }
- }
- }
- }
- }
+ strncpy(info, (char *) data, sizeof(info) - 1);
+ queuename = strsep(&info_ptr, "|");
+ options = strsep(&info_ptr, "|");
+ url = strsep(&info_ptr, "|");
+ announceoverride = strsep(&info_ptr, "|");
+ queuetimeoutstr = info_ptr;
+
+ /* set the expire time based on the supplied timeout; */
+ if (queuetimeoutstr)
+ qe.expire = qe.start + atoi(queuetimeoutstr);
+ else
+ qe.expire = 0;