~ubuntu-branches/ubuntu/karmic/asterisk/karmic

« back to all changes in this revision

Viewing changes to apps/app_meetme.c

  • Committer: Bazaar Package Importer
  • Author(s): Faidon Liambotis, Tzafrir Cohen, Faidon Liambotis
  • Date: 2007-12-06 17:20:21 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20071206172021-pd0wrjirz3os7hia
Tags: 1:1.4.15~dfsg-1
* New upstream release (Closes: #452054)
  - Fix a potential corrupt of voicemail.conf on simultaneous PIN updates
    (Closes: #353227)

[ Tzafrir Cohen ]
* Add some sample/reference config files as documentation.
* Provide asterisk-bristuff for upgrading from Etch.
* Move libc-client to not be last, so debian/backports/xorcom.etch would
  still work.

[ Faidon Liambotis ]
* Really enable the libcap/ToS functionality; the previous patch didn't
  enable the functionality, even though the code and the libcap.so
  dependency were there. (Closes: #454342)
* Fix a minor issue with init script's stop target when running with
  safe_asterisk.
* Add chan_vpb, adding support for VoiceTronix OpenSwitch and OpenLine
  cards. (Closes: #396499)
* Fix debian/watch by using a pkg-voip wrapper to avoid upstream's silly
  redirections. (Closes: #449706)
* Use DEBVERSION as asterisk's version string.
* Disable the MD5 build sum that breaks all out-of-tree plugins (duh!).
* Create /usr/local/share/asterisk/sounds to put all site-specific
  non-modifiable sounds.
* Add a note about bugs.debian.org to the banner.
* Add noload for res_config_* since loading them results in errors and
  doesn't provide any functionality.
* News entries were added but we never shipped the file; ship NEWS.Debian.
* Add an entry to NEWS.Debian warning users about app_voicemail_*.so
  (Closes: #452596)
* Provide options in /etc/default/asterisk for configuring safe_asterisk.
  (Closes: #381786)

[ Tzafrir Cohen ]
* Provide a custom sounds directory under /var/lib - user-modifieble at
  runtime and hence not under /usr. (Closes: #337209)

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
#include "asterisk.h"
37
37
 
38
 
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 82286 $")
 
38
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 89571 $")
39
39
 
40
40
#include <stdlib.h>
41
41
#include <stdio.h>
1572
1572
                goto outrun;
1573
1573
        }
1574
1574
 
1575
 
        retryzap = strcasecmp(chan->tech->type, "Zap");
 
1575
        retryzap = (strcasecmp(chan->tech->type, "Zap") || chan->spies ? 1 : 0);
1576
1576
        user->zapchannel = !retryzap;
1577
1577
 
1578
1578
 zapretry:
1890
1890
                                break;
1891
1891
 
1892
1892
                        if (c) {
1893
 
                                if (c->fds[0] != origfd) {
 
1893
                                if (c->fds[0] != origfd || (user->zapchannel && c->spies)) {
1894
1894
                                        if (using_pseudo) {
1895
1895
                                                /* Kill old pseudo */
1896
1896
                                                close(fd);
1897
1897
                                                using_pseudo = 0;
1898
1898
                                        }
1899
1899
                                        ast_log(LOG_DEBUG, "Ooh, something swapped out under us, starting over\n");
1900
 
                                        retryzap = strcasecmp(c->tech->type, "Zap");
 
1900
                                        retryzap = (strcasecmp(c->tech->type, "Zap") || c->spies ? 1 : 0);
1901
1901
                                        user->zapchannel = !retryzap;
1902
1902
                                        goto zapretry;
1903
1903
                                }
4171
4171
                        trunk_ref->state = SLA_TRUNK_STATE_UP;
4172
4172
                        ast_device_state_changed("SLA:%s_%s", station->name, trunk_ref->trunk->name);
4173
4173
                }
 
4174
        } else if (trunk_ref->state == SLA_TRUNK_STATE_RINGING) {
 
4175
                struct sla_ringing_trunk *ringing_trunk;
 
4176
 
 
4177
                ast_mutex_lock(&sla.lock);
 
4178
                AST_LIST_TRAVERSE_SAFE_BEGIN(&sla.ringing_trunks, ringing_trunk, entry) {
 
4179
                        if (ringing_trunk->trunk == trunk_ref->trunk) {
 
4180
                                AST_LIST_REMOVE_CURRENT(&sla.ringing_trunks, entry);
 
4181
                                break;
 
4182
                        }
 
4183
                }
 
4184
                AST_LIST_TRAVERSE_SAFE_END
 
4185
                ast_mutex_unlock(&sla.lock);
 
4186
 
 
4187
                if (ringing_trunk) {
 
4188
                        ast_answer(ringing_trunk->trunk->chan);
 
4189
                        sla_change_trunk_state(ringing_trunk->trunk, SLA_TRUNK_STATE_UP, ALL_TRUNK_REFS, NULL);
 
4190
 
 
4191
                        free(ringing_trunk);
 
4192
 
 
4193
                        /* Queue up reprocessing ringing trunks, and then ringing stations again */
 
4194
                        sla_queue_event(SLA_EVENT_RINGING_TRUNK);
 
4195
                        sla_queue_event(SLA_EVENT_DIAL_STATE);
 
4196
                }
4174
4197
        }
4175
4198
 
4176
4199
        trunk_ref->chan = chan;
4406
4429
        while ((station_ref = AST_LIST_REMOVE_HEAD(&trunk->stations, entry)))
4407
4430
                free(station_ref);
4408
4431
 
4409
 
        ast_string_field_free_all(trunk);
 
4432
        ast_string_field_free_memory(trunk);
4410
4433
        free(trunk);
4411
4434
}
4412
4435
 
4432
4455
        while ((trunk_ref = AST_LIST_REMOVE_HEAD(&station->trunks, entry)))
4433
4456
                free(trunk_ref);
4434
4457
 
4435
 
        ast_string_field_free_all(station);
 
4458
        ast_string_field_free_memory(station);
4436
4459
        free(station);
4437
4460
}
4438
4461
 
4459
4482
                pthread_join(sla.thread, NULL);
4460
4483
        }
4461
4484
 
 
4485
        /* Drop any created contexts from the dialplan */
 
4486
        ast_context_destroy(NULL, sla_registrar);
 
4487
 
4462
4488
        ast_mutex_destroy(&sla.lock);
4463
4489
        ast_cond_destroy(&sla.cond);
4464
4490
}