aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-30 22:02:53 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-30 22:02:53 +0000
commitddf73448a4bbc0f78315aa2ab4f7debdce335696 (patch)
tree5e2497401af03a4e687e3ed728be730db82fdb8a
parentf1b975bfadb53fcc4321ee335540b8c6f4c7783a (diff)
parentdb1a2718186b0a4483b24f202a96794e2c2e00e2 (diff)
Creating tag for the release of asterisk-1.2.8
git-svn-id: http://svn.digium.com/svn/asterisk/tags/1.2.8@30950 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--.lastclean1
-rw-r--r--.version1
-rw-r--r--ChangeLog2141
-rw-r--r--apps/app_dial.c17
-rw-r--r--apps/app_hasnewvoicemail.c129
-rw-r--r--apps/app_meetme.c10
-rw-r--r--apps/app_osplookup.c36
-rw-r--r--apps/app_queue.c245
-rw-r--r--apps/app_sms.c26
-rw-r--r--apps/app_sql_postgres.c7
-rw-r--r--apps/app_voicemail.c249
-rw-r--r--apps/app_waitforsilence.c2
-rw-r--r--asterisk.c6
-rw-r--r--channel.c2
-rw-r--r--channels/chan_iax2.c875
-rw-r--r--channels/chan_local.c2
-rw-r--r--channels/chan_sip.c324
-rw-r--r--channels/chan_zap.c7
-rw-r--r--codecs/gsm/Makefile52
-rw-r--r--configs/extensions.conf.sample6
-rw-r--r--configs/sip.conf.sample4
-rw-r--r--dnsmgr.c3
-rw-r--r--enum.c16
-rw-r--r--include/asterisk/linkedlists.h50
-rw-r--r--include/asterisk/lock.h21
-rw-r--r--logger.c2
-rw-r--r--pbx.c3
-rw-r--r--res/res_agi.c6
-rw-r--r--res/res_features.c25
-rw-r--r--utils/smsq.c4
30 files changed, 1306 insertions, 2966 deletions
diff --git a/.lastclean b/.lastclean
deleted file mode 100644
index 45a4fb75d..000000000
--- a/.lastclean
+++ /dev/null
@@ -1 +0,0 @@
-8
diff --git a/.version b/.version
deleted file mode 100644
index db6fb4a91..000000000
--- a/.version
+++ /dev/null
@@ -1 +0,0 @@
-1.2.8
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index 7c11aefd1..000000000
--- a/ChangeLog
+++ /dev/null
@@ -1,2141 +0,0 @@
-2006-05-15 Kevin P. Fleming <kpfleming@digium.com>
-
- * Asterisk 1.2.8 released
-
-2006-05-13 04:08 +0000 [r27093] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_voicemail.c: Bug 7134 - File descriptor leak with ODBC
- storage of voicemail
-
-2006-05-11 23:02 +0000 [r27051] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * funcs/func_logic.c: Bug 7086 - pbx_checkcondition substitution,
- so that arbitrary strings are true (for regex)
-
-2006-05-11 09:05 +0000 [r26760-26773] Kevin P. Fleming <kpfleming@digium.com>
-
- * rtp.c: backport fix from trunk for bug #6934, ensuring that RTP
- mark bit is changed when SSRC changes
-
- * channels/chan_sip.c: ensure that we send a response to REGISTER
- requests that are successfully authenticated but contain invalid
- Contact URIs
-
-2006-05-09 14:18 +0000 [r26050-26090] BJ Weschke <bweschke@btwtech.com>
-
- * channels/chan_sip.c, doc/README.variables: Add the appropriate
- jumping behavior that is the standard for 1.2.X to SIPGetHeader
- that is now deprecated in /trunk. #7111 (blitzrage!!!)
-
- * apps/app_voicemail.c: Correct memory leak in find_user_realtime
- #7118 (fnordian)
-
-2006-05-08 15:09 +0000 [r25608] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Issue 7103 - mikma - The header is named
- "Require" - Don't reply to ACK (Not using patch against trunk)
-
-2006-05-08 14:12 +0000 [r25518-25563] BJ Weschke <bweschke@btwtech.com>
-
- * channels/chan_agent.c: Don't show agents as available when they
- are in wrap-up time. #6726 (ZX81)
-
- * apps/app_queue.c: Make QueueStatusComplete event thread safe by
- wrapping it inside the queue lock clause already there. #7013
- (bziherl reporting)
-
- * apps/app_queue.c: Don't recheck valid_exit() after getting the
- result from say_position (which already checks it). Should
- prevent another loop if the caller hits digits during the
- position announcement. #6776 (tgj reporting)
-
-2006-05-08 11:16 +0000 [r25442] Joshua Colp <jcolp@digium.com>
-
- * res/res_features.c: Incorrect log statement when playing transfer
- sounds (issue #7008 reported and fixed by nathan)
-
-2006-05-07 13:38 +0000 [r25288-25322] BJ Weschke <bweschke@btwtech.com>
-
- * apps/app_meetme.c: Fix playback behavior to exit correctly when
- we receive a hangup during playback of the invalid pin message.
- #7091 (AntD reporting)
-
- * asterisk.c: Reset the value of ast_mainpid if we fork so future
- remote unix connections display the correct PID. #7098 (tzafrir
- reporting)
-
-2006-05-06 02:32 +0000 [r25015-25165] Russell Bryant <russell@digium.com>
-
- * frame.c: re-add a couple of lines that I shouldn't have removed
- in the previous commit. I think I should be going to bed now ...
-
- * frame.c: fix a problem where the frame's data pointer is
- overwritten by the newly allocated data buffer before the data
- can be copied from it. This is in the ast_frisolate() function
- which is rarely used. (issue #6732, stefankroon)
-
- * channels/chan_zap.c: ensure that the appropriate manager events
- are sent in all of the places where alarms are detected or
- cleared (issue #6866, flefoll)
-
- * channels/chan_h323.c: update chan_h323 to reflect the new
- prototype for rtp_set_peer (issue #6560, casper) This was fixed a
- couple months ago in the trunk, but never in 1.2.
-
-2006-05-05 20:44 +0000 [r25014] BJ Weschke <bweschke@btwtech.com>
-
- * apps/app_voicemail.c, include/asterisk/app.h, app.c: Voicemail
- fixes along with an API change approved by russellb to fix the
- bug(s). (jcollie and supczinskib) #7064
-
-2006-05-05 17:39 +0000 [r24837-24911] Russell Bryant <russell@digium.com>
-
- * apps/app_while.c: use the correct function name ...
-
- * apps/app_while.c, apps/app_macro.c: use pbx_checkcondition()
- instead of ast_true() to evaluate the condition for MacroIf and
- WhileIf (issue #7086)
-
-2006-05-04 16:27 +0000 [r24706] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_queue.c: Bug 7023 - reload should not unpause members
-
-2006-05-04 11:17 +0000 [r24567-24669] BJ Weschke <bweschke@btwtech.com>
-
- * apps/app_verbose.c: Make sure that only the "|" is a recognized
- delimiter for Verbose(), as the app documentation already
- specifies. #7080 (alessiof reporting)
-
- * apps/app_dial.c: Correct application documentation to make users
- aware that certain options cannot be used in conjunction with
- others. #6666 (chotaire)
-
-2006-05-03 18:31 +0000 [r24496] Russell Bryant <russell@digium.com>
-
- * redhat/asterisk.spec: fix up "make rpm" - don't reference the
- gzipped man page, because we don't store them compressed anymore
- - add some files that currently were not listed (issue #6837)
-
-2006-05-03 12:39 +0000 [r24381] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Issue #7074 - Problem with long contact
- lines
-
-2006-05-02 19:39 +0000 [r24295] BJ Weschke <bweschke@btwtech.com>
-
- * file.c: Make certain ast_stopstream() sets the channel's stream
- members to NULL after closing them. #7067 (jcomellas)
-
-2006-05-02 02:12 +0000 [r24019-24097] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_privacy.c: Prompt does not request '#' to end input, so
- the application should not require it
-
- * apps/app_nbscat.c, apps/app_festival.c, apps/app_mp3.c,
- apps/app_zapras.c, asterisk.c, apps/app_externalivr.c,
- apps/app_ices.c, res/res_musiconhold.c,
- include/asterisk/options.h: Bug 6864 - drop realtime priority on
- ALL external processes
-
-2006-05-01 19:34 +0000 [r23985-23988] BJ Weschke <bweschke@btwtech.com>
-
- * apps/app_voicemail.c: Correct a condition from the prior patch
- that could happen in rare circumstances and cause a core dump.
- Thanks Qwell!
-
- * apps/app_voicemail.c: Make sure that when someone 0's out while
- recording a msg and then chooses to DELETE the recorded file, the
- .txt file isn't left around by itself to cause problems later.
- #7061 (dimitripietro reporting, blitzrage confirmed)
-
-2006-05-01 15:12 +0000 [r23951] Russell Bryant <russell@digium.com>
-
- * pbx.c: add missing locking of the dialplan functions list in the
- "show functions" CLI command
-
-2006-05-01 10:45 +0000 [r23305-23899] Kevin P. Fleming <kpfleming@digium.com>
-
- * apps/app_skel.c: fix this to actually compile so people can learn
- from it
-
- * cdr/cdr_sqlite.c: eliminate compiler warning
-
- * channels/chan_iax2.c: remove a pointless comparison, since the
- buffer is smaller than the length being checked for
-
- * Makefile, editline/configure, cdr/Makefile, channels/Makefile,
- db1-ast/Makefile: allow top-level OPTIMIZE setting to affect
- builds in these subdirectories too
-
- * Makefile: let the compiler determine whether hardware or software
- floating point should be used (like we do in the editline
- subdirectory)
-
- * Makefile, apps/Makefile: remove extraneous -m64 flag that is not
- needed remove old 'look' target which is no longer needed (these
- are coming from Debian patches <G>)
-
- * editline/makelist: ensure that the script output is correctly
- generated when the system's character set does not use the
- English lowercase/uppercase character groups
-
- * Makefile: do installation in subdirs as a separate target (so
- external modules can use the Makefile more easily) generate final
- messages -after- running any post-install script that may be
- present
-
-2006-04-28 16:40 +0000 [r23176] Russell Bryant <russell@digium.com>
-
- * configs/zapata.conf.sample, configs/mgcp.conf.sample,
- configs/sip.conf.sample: note that group assignments must be from
- 0 to 63 (issue #7048)
-
-2006-04-27 19:11 +0000 [r22954] Joshua Colp <jcolp@digium.com>
-
- * apps/app_queue.c: Queue(somequeue,,,,) -> interpreted as
- Queue(somequeue,,,,0) (issue #7044 reported nathan fixed by
- jsmith - sort of)
-
-2006-04-27 16:12 +0000 [r22866] Matt Frederickson <creslin@digium.com>
-
- * channels/chan_zap.c: Fix buglet in channel reassignment on
- SETUP_ACK
-
-2006-04-26 19:18 +0000 [r22596] Matt O'Gorman <mogorman@digium.com>
-
- * apps/app_voicemail.c: do not allow for users to forward voicemail
- to themselves, patch from 7001
-
-2006-04-21 22:39 +0000 [r22112-22113] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * channel.c: Rolling back change until kpfleming is comfy
-
- * channel.c: Bug 7004 - release all threads waiting on a condition
- prior to freeing it
-
-2006-04-19 21:10 +0000 [r21638] Kevin P. Fleming <kpfleming@digium.com>
-
- * contrib/scripts/safe_asterisk.8, contrib/scripts/safe_asterisk:
- support system-specific scripts in safe_asterisk, before starting
- Asterisk proper
-
-2006-04-19 18:43 +0000 [r21597] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * cdr/cdr_odbc.c: Bug 6553 - plug memory leaks when ODBC connection
- is down
-
-2006-04-18 23:31 +0000 [r21237] Kevin P. Fleming <kpfleming@digium.com>
-
- * pbx.c: properly handle brace-wrapped strings in variable/function
- references in the dialplan
-
-2006-04-18 06:26 +0000 [r20966-21037] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_random.c: Bug 6984 - off by one error in Random()
-
- * res/res_musiconhold.c: Bug 6544 - when we remove a music class,
- the thread servicing it should die
-
-2006-04-14 17:21 +0000 [r20034-20037] Kevin P. Fleming <kpfleming@digium.com>
-
- * sounds.txt: uncomment files that actually do exist (oops)
-
- * sounds.txt: update text to match actual prompts being distributed
- (thanks to Kinsey in the support department for reviewing all the
- prompts!)
-
-2006-04-13 20:37 +0000 [r19891] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_voicemail.c: Bug 6947 - Allow vm broadcasts to more than
- 256 characters worth of mailboxes
-
-2006-04-13 Kevin P. Fleming <kpfleming@digium.com>
-
- * Asterisk 1.2.7.1 released
-
-2006-04-13 17:40 +0000 [r19812] Kevin P. Fleming <kpfleming@digium.com>
-
- * apps/app_page.c: oops... let's not set a variable and then
- immediately overwrite it while assuming its old value will
- magically return
-
-2006-04-13 15:56 +0000 [r19768] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * pbx.c: Bug 6957 - variable names beginning with CALLERID weren't
- substituted correctly
-
-2006-04-12 Kevin P. Fleming <kpfleming@digium.com>
-
- * Asterisk 1.2.7 released
-
-2006-04-11 22:39 +0000 [r19394-19397] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_dial.c: Bug 6490 - telco intercept should report
- NOANSWER instead of CHANUNAVAIL
-
- * apps/app_voicemail.c: Bug 6061 - Fix ODBC storage of VM on PGSQL
- and MSSQL
-
-2006-04-11 21:58 +0000 [r19353] Kevin P. Fleming <kpfleming@digium.com>
-
- * Makefile: don't create a 'voicemail' symlink in the sounds
- directory; app_voicemail has not needed it since January of 2005
- (issue #6613)
-
-2006-04-11 21:55 +0000 [r19351] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * asterisk.c: Bug 6097 - possible descriptor leak
-
-2006-04-11 21:50 +0000 [r19345-19348] Kevin P. Fleming <kpfleming@digium.com>
-
- * apps/app_page.c: don't call the originating device as part of the
- Page() operation (issue #6932)
-
- * channel.c: simplify spy queue flushing logic, and always force a
- flush when one side gets full, even if the other side is not
- empty (issue #6457)
-
- * pbx/pbx_config.c: don't destroy the entire dialplan during
- 'reload', just atomically replace it like 'extensions reload'
- does (issue #6047)
-
-2006-04-11 20:46 +0000 [r19303] Joshua Colp <joshnet@nbnet.nb.ca>
-
- * include/asterisk/linkedlists.h: Minor linked lists bug fix. When
- you're dealing with swapping entries around a lot it can cause a
- seg fault.
-
-2006-04-11 20:11 +0000 [r19301] Kevin P. Fleming <kpfleming@digium.com>
-
- * apps/app_dial.c: handle call time limit properly when warning is
- requested _after_ call would hae already ended (issue #6356)
-
-2006-04-11 01:05 +0000 [r18866-19008] BJ Weschke <bweschke@btwtech.com>
-
- * apps/app_voicemail.c, app.c: When using the silence detector in
- ast_play_and_record() and ast_play_and_prepend(), the truncation
- code never gets called to remove the detected silence, because
- the value of res is zero when control gets to that point. #6903
- w/some mods (softins)
-
- * res/res_features.c: Don't say that we can pass an 'exten'
- argument in the documentation of Park() when we really cannot.
- #6902 (opsys)
-
-2006-04-08 19:20 +0000 [r18436-18494] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_voicemail.c: Bug 6914 - .txt file fails to rename on
- operator out
-
- * formats/format_jpeg.c: Bug 6913 - fix for possible buffer
- overflow
-
-2006-04-07 14:16 +0000 [r18250-18260] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: - Fix cause codes - Add cause code for
- incompatible formats
-
- * channels/chan_sip.c: - Fix possible minor memory leak in chan_sip
- - Return proper cause code on memory allocation error
-
-2006-04-06 22:15 +0000 [r18087-18089] Kevin P. Fleming <kpfleming@digium.com>
-
- * apps/app_meetme.c: fix typo
-
- * apps/app_meetme.c: small fix... don't try to check conference
- details if it couldn't be created or found
-
- * apps/app_meetme.c: don't try to support 'i' or 'r' options if
- chan_zap is not loaded, and warn the user when they attempt to
- use them (issue #6675) update application help text to more
- clearly define when Zaptel and chan_zap are required
-
-2006-04-06 17:24 +0000 [r17945] Russell Bryant <russell@digium.com>
-
- * apps/app_alarmreceiver.c: move continue out of block that checks
- verbose level (issue #6880)
-
-2006-04-06 17:00 +0000 [r17702-17905] Joshua Colp <joshnet@nbnet.nb.ca>
-
- * pbx.c: Unlock channel on failure so that ast_mutex_destroy
- doesn't throw a fit (issue #6647 reported by casper)
-
-2006-04-05 06:50 +0000 [r17335-17489] Olle Johansson <oej@edvina.net>
-
- * CREDITS, enum.c: Issue #6654: Enum crash on ADDRESS record,
- possibly bad record, but still a crash
-
- * channels/chan_zap.c: Issue #6878 - Unhide DNDstate manager events
- (thanks casper)
-
- * apps/app_queue.c: Issue #6882 - move "res=-1" out of verbosity
- block, minor code cleanups (casper)
-
-2006-04-04 15:24 +0000 [r17283] Matt O'Gorman <mogorman@digium.com>
-
- * apps/app_senddtmf.c: Adds documentation to show what the w flag.
- Patch from Ian Kinner at Digium.
-
-2006-04-03 20:38 +0000 [r17074-17150] Olle Johansson <oej@edvina.net>
-
- * configs/features.conf.sample: Issue 6870 - document that parking
- lots need to be numeric
-
- * channels/chan_sip.c: Issue #6848 take two - Use the tag provided
- by the SUBSCRIBE request when sending NOTIFY
-
- * channels/chan_sip.c: Ugly patch to avoid hangup causes in
- non-final responses
-
-2006-03-31 19:11 +0000 [r16744-16771] Russell Bryant <russell@digium.com>
-
- * channels/chan_iax2.c: move a NULL check to before the first time
- the pointer is dereferenced (issue #6832)
-
- * channels/chan_iax2.c: fix the situation where bindport is
- specified but bindaddr is not (issue #6616)
-
-2006-03-31 18:24 +0000 [r16742] Kevin P. Fleming <kpfleming@digium.com>
-
- * pbx.c: ensure that hint watchers (subscribers) cannot be added or
- removed while the dialplan is being modified
-
-2006-03-30 22:56 +0000 [r16579-16581] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * channels/chan_sip.c: Bug 6853 - Manager fixes: 1) extra ActionID,
- 2) missing colon
-
- * asterisk.c: Bug 6849 - trivial typo fix
-
-2006-03-30 21:44 +0000 [r16534-16559] Joshua Colp <joshnet@nbnet.nb.ca>
-
- * codecs/gsm/Makefile: Add another check for 64-bit goodness (issue
- #6850 reported by evilbunny)
-
- * res/res_musiconhold.c: Do not exceed the array size for maximum
- allowed moh files. (issue #6842)
-
-2006-03-30 01:34 +0000 [r16303-16346] Olle Johansson <oej@edvina.net>
-
- * res/res_features.c: Set initial value on adsipark
-
- * apps/app_groupcount.c: Typo fix.
-
- * configs/extensions.conf.sample: Typo (Issue 6839, casper)
-
-2006-03-29 19:11 +0000 [r16082-16192] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * include/asterisk/pbx.h, apps/app_stack.c, pbx.c: Bug 6830 - Let
- GosubIf work with the same conditions as a GotoIf (change in API
- approved by Russell)
-
- * pbx.c: Bug 6835 - Updates to GotoIf help text
-
-2006-03-29 04:15 +0000 [r16008] Russell Bryant <russell@digium.com>
-
- * strcompat.c: tell unsetenv for solaris to return the result of
- the setenv call
-
-2006-03-29 00:58 +0000 [r15898] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Issue #6823 - Portability issue with the
- registration port number patch from yesterday. Be compatible with
- more systems than OS/X :-) Thanks Rizzo for the advice.
-
-2006-03-29 00:32 +0000 [r15896] Kevin P. Fleming <kpfleming@digium.com>
-
- * include/asterisk/linkedlists.h: ensure that list traversal loops
- which skip entries properly update the 'previous entry' pointer
- so when entries _are_ removed the list does not get damaged
-
-2006-03-28 20:22 +0000 [r15703-15743] Russell Bryant <russell@digium.com>
-
- * agi/Makefile, strcompat.c, astmm.c: backport astmm + sparc fixes
- from the trunk
-
- * channels/chan_iax2.c: fix Bus Error on sparc (issue #6354)
-
-2006-03-28 19:07 +0000 [r15699] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Fix breakage of NAT support for peers with
- qualify=yes. Thanks Damin for access to your system, sorry folks.
-
-2006-03-28 18:09 +0000 [r15658] Russell Bryant <russell@digium.com>
-
- * pbx/pbx_ael.c: fix the order in which for loops are expanded
- (issue #6810)
-
-2006-03-28 17:48 +0000 [r15615] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * contrib/init.d/rc.redhat.asterisk: Bug 6815 - Adding quotes to
- make bash happy
-
-2006-03-27 23:45 +0000 [r15366-15381] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Issue #6736 - Use flags for OPTION messages.
- Thanks Casper!
-
- * channels/chan_sip.c: Issue #6597 - sip show registry shows
- incorrect port
-
- * channels/chan_sip.c: Issue #6409 - Use "s" extension when there's
- no username in the URI
-
-2006-03-26 Kevin P. Fleming <kpfleming@digium.com>
-
- * Asterisk 1.2.6 released
-
-2006-03-25 05:07 +0000 [r14821-14868] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * contrib/init.d/rc.redhat.asterisk: Bug 6601 - More configuration
- abilities for the RH init script
-
- * apps/app_voicemail.c: Fix incorrect size of zeroing (left over
- from when maxmsg was hardcoded at 100)
-
- * apps/app_voicemail.c: Bug 6783 - When context is specified,
- voicemail should look for mailboxes in that context
-
-2006-03-24 14:48 +0000 [r14704] Russell Bryant <russell@digium.com>
-
- * image.c: use the correct variable in an error message (issue
- #6791)
-
-2006-03-24 04:53 +0000 [r14610-14659] BJ Weschke <bweschke@btwtech.com>
-
- * apps/app_voicemail.c: Fix a typo in the app description
-
- * include/asterisk/sched.h: Doxygen comment typo corrections
-
-2006-03-23 21:51 +0000 [r14523] Joshua Colp <joshnet@nbnet.nb.ca>
-
- * res/res_features.c: Issue #6764 - Return BUSY signal when other
- party is busy at Attended Transfer (Reported by mnachev)
-
-2006-03-23 21:44 +0000 [r14522] Matt Frederickson <creslin@digium.com>
-
- * channels/chan_zap.c: Fix SETUP_ACK handling so that we change
- channels if so requested
-
-2006-03-23 20:43 +0000 [r14467] BJ Weschke <bweschke@btwtech.com>
-
- * apps/app_meetme.c: Bug #5884 - fix a possible race state in
- app_meetme when a channel has gone away and we are reading
- continuously for more frames. (mneuhauser)
-
-2006-03-23 20:13 +0000 [r14462] Russell Bryant <russell@digium.com>
-
- * apps/app_readfile.c: don't crash when asked to read from a file
- that doesn't exist (issue #6786)
-
-2006-03-22 22:18 +0000 [r14191-14276] Joshua Colp <joshnet@nbnet.nb.ca>
-
- * apps/app_voicemail.c: Fix a minor code issue
-
- * apps/app_voicemail.c: Issue #6781 - Verbose levels not enforced
- in app_voicemail (Reported by flobi)
-
- * include/asterisk/cdr.h, cdr.c: Issue #5918 - Disposition showing
- FAILED even though call is answered successfully (Reported by
- tracinet)
-
- * pbx.c: Issue #6780 - ast_pbx_outgoing_cdr_failed description fix.
- (Reported and fixed by casper)
-
-2006-03-22 09:10 +0000 [r14140] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Issue #6766 - fix ;user=phone functionality.
- (Reported by alein, fix by russell - thanks!)
-
-2006-03-21 18:59 +0000 [r13814-13964] Russell Bryant <russell@digium.com>
-
- * configs/features.conf.sample: add a note explaining how to set
- the DYNAMIC_FEATURES variable to allow the use of custom features
- (issue #6747)
-
- * res/res_features.c: fix crash when using the ParkAndAnnounce
- application. When using this application, there will be no peer
- channel to play the parking announcement to. (issue #6756)
-
- * funcs/func_strings.c: fix REGEX on strings that contain quotes
- (issue #6678)
-
- * sounds.txt: fix spelling of whiskey
-
- * apps/app_meetme.c: don't add conference participant if the user
- hangs up while recording their name (issue #6661)
-
- * sample.call: re-add the Account parameter to the sample call file
- since it's not really deprecated since the CDR function is no
- longer built in
-
-2006-03-21 06:24 +0000 [r13707-13748] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_voicemail.c: Bug 6714 - Workaround to avoid retrieving
- incomplete voicemail message
-
- * editline/term.c: Do away with some warnings and fix some
- indentation
-
-2006-03-20 17:36 +0000 [r13634] Olle Johansson <oej@edvina.net>
-
- * channels/chan_iax2.c: Do not overwrite ANI if it's set by IE
- (sendani=yes in the peer)
-
-2006-03-19 09:59 +0000 [r13550] Russell Bryant <russell@digium.com>
-
- * apps/app_dial.c: revert the change made in revision 12927 in
- favor of keeping the original behavior of the option. The
- documentation has now been updated to reflect the actual
- behavior. (issue #6523)
-
-2006-03-19 09:25 +0000 [r13547] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Reset global_rtautoclear at sip reload
-
-2006-03-16 20:05 +0000 [r13279] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * ast_expr2.y, ast_expr2.c: Bug 6737 - Fix compile warning on OS X
-
-2006-03-16 17:58 +0000 [r13239] Olle Johansson <oej@edvina.net>
-
- * configs/sip.conf.sample: Issue #6690 - clarify progressinband
- default setting
-
-2006-03-16 17:42 +0000 [r13237] Russell Bryant <russell@digium.com>
-
- * channels/chan_zap.c: always use the callerid signalling method
- set in the zt_pvt strucutre as opposed to the last one read from
- the config file (issue #6734, with mods)
-
-2006-03-16 06:56 +0000 [r13197] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: To quote giant developers: "Oops". Thanks,
- Tony!
-
-2006-03-15 22:16 +0000 [r13161] Russell Bryant <russell@digium.com>
-
- * cdr.c: - remove some calculations that will always result in 0 -
- if a CDR was never started, don't try to calculate a duration and
- consider it failed
-
-2006-03-15 13:01 +0000 [r13026] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Issue #6728: Remove parameters to Event:
- header on SUBSCRIBE requests
-
-2006-03-14 18:41 +0000 [r12925-12927] Russell Bryant <russell@digium.com>
-
- * apps/app_dial.c: when using the G() option to Dial, fix sending
- the called channel to 1 priority beyond what was specified (issue
- #6523)
-
- * apps/app_queue.c: fix a problem with not loading realtime queue
- members by always reloading a realtime queue from the database
- even if it is found in the list (issue #6680)
-
-2006-03-12 19:26 +0000 [r12646] Russell Bryant <russell@digium.com>
-
- * pbx.c: add locking to protect the list of global dialplan
- variables
-
-2006-03-12 17:57 +0000 [r12577] Russell Bryant <russell@digium.com>
-
- * codecs/gsm/Makefile: fix build on parisc (issue #6704)
-
-2006-03-10 12:13 +0000 [r12477-12495] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Issue #5937 - Make sure SIP CANCEL's are
- re-transmitted
-
- * channels/chan_sip.c: Issue #6576 - SIP_CODEC not used for early
- media (reported by gpapadop73)
-
-2006-03-08 10:51 +0000 [r12458] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Issue #6657 - Ignore 183 session progress
- without SDP
-
-2006-03-07 00:05 +0000 [r12161-12195] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * channels/chan_sip.c: Bug 6020 - Race condition where packet could
- be lost if first packet on list is acked
-
- * editline/np/vis.c, editline/readline.c: Bug 6664 - More fixes for
- Solaris
-
-2006-03-06 14:23 +0000 [r12036-12072] Olle Johansson <oej@edvina.net>
-
- * channel.c: Revert earlier change
-
- * channel.c: Fix for astmm compilation
-
-2006-03-06 02:32 +0000 [r11946] Russell Bryant <russell@digium.com>
-
- * configs/zapata.conf.sample: fix a typo in the description of the
- ringtimeout option
-
-2006-03-05 12:40 +0000 [r11849] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Clear page2 flags at reload too
-
-2006-03-04 11:45 +0000 [r11778] BJ Weschke <bweschke@btwtech.com>
-
- * apps/app_mixmonitor.c: Substitute variables in the post_process
- string (if it exists) before those variables could possibly
- disappear (channel hangup) #6462
-
-2006-03-03 Kevin P. Fleming <kpfleming@digium.com>
-
- * Asterisk 1.2.5 released
-
-2006-03-03 00:38 +0000 [r11607-11635] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * Makefile: Bug 6638 - Use POSIX command for Solaris
-
- * build_tools/make_build_h: Bug 6638 - Change from a historic BSD
- command to a POSIX command for determining username
-
- * asterisk.c: Bug 6637 - Fixes for Solaris
-
- * Makefile: If debugging, the frame pointer is helpful
-
-2006-03-02 19:05 +0000 [r11528-11561] Russell Bryant <russell@digium.com>
-
- * res/res_monitor.c: fix inaccurate ack message to ChangeMonitor
- action (issue #6630)
-
- * asterisk.sgml: make the terminology used in the synopsis match
- the option description
-
- * asterisk.sgml: add the -L option to the synopsis on the man page
-
-2006-03-01 17:41 +0000 [r11479-11503] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * cdr/cdr_manager.c, cdr/cdr_tds.c, res/res_config_odbc.c,
- include/asterisk/cdr.h, cdr/cdr_pgsql.c, cdr/cdr_odbc.c, cdr.c:
- Bug 6615 - Fix 64bit conversion errors by using a long int
-
- * build_tools/make_svn_branch_name: Bug 6618 - Solaris
- compatibility fix
-
-2006-02-28 19:46 +0000 [r11382-11410] Russell Bryant <russell@digium.com>
-
- * channels/chan_iax2.c: fix the output that indicates whether
- qualify smoothing is on or not (issue #6608)
-
- * asterisk.c: adjust the keys directory when astvarlibdir is
- specified in asterisk.conf (issue #6602)
-
- * res/res_agi.c: add a missing newline in the agi app description
- (thanks wunderkin!)
-
-2006-02-27 15:20 +0000 [r11250-11281] Russell Bryant <russell@digium.com>
-
- * cli.c: don't try to print the help text for a CLI command when
- RESULT_SHOWUSAGE is returned if there is no help text available
- (issue #6604)
-
- * channels/chan_sip.c: fix finding realtime peers that are not
- dynamic by ip address (issue #6093)
-
- * channel.c: don't hang up the channel if its state is set to UP
- before we return from ast_call (issue #6569)
-
-2006-02-26 16:26 +0000 [r11165] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * include/asterisk/logger.h, logger.c: Bug 5950 - reenable queue
- log rotation; also, eliminate redundant code
-
-2006-02-25 19:54 +0000 [r11120] Matt Frederickson <creslin@digium.com>
-
- * translate.c: Backport of fix to translation optimizations. Thanks
- again file!
-
-2006-02-25 05:08 +0000 [r11058-11089] Kevin P. Fleming <kpfleming@digium.com>
-
- * translate.c: factor the number of translation steps required into
- translation path decisions, so that equal cost paths that require
- fewer translations are preferred
-
- * translate.c: reformat code to fit guidelines remember which
- translation paths are multi-step paths
-
- * channel.c: ensure that spy frame queueing is able to deal with
- translation failing for any reason (issue #6546)
-
-2006-02-23 23:06 +0000 [r10952] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * Makefile: set PWD properly
-
-2006-02-23 14:57 +0000 [r10736-10863] Kevin P. Fleming <kpfleming@digium.com>
-
- * dnsmgr.c, include/asterisk/linkedlists.h: backport list handling
- fix from trunk (solves memory leak problem in cdr variables and
- device state watchers) remove unused variable to silence
- compiler warning
-
- * configs/iax.conf.sample: add comment warning people about trying
- to use hostnames/IPs in the sample config
-
-2006-02-20 23:01 +0000 [r10577] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * app.c: Would be nice to tell people to look in the right file to
- increase a constant
-
-2006-02-20 06:17 +0000 [r10511-10535] Mark Spencer <markster@digium.com>
-
- * channels/chan_sip.c: Handle ACKing properly (remove gratuitous
- -1)
-
- * channels/chan_iax2.c: Fix numerous places in jitter buffer where
- freed memory is referenced
-
-2006-02-19 18:29 +0000 [r10462-10487] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * formats/format_sln.c: Okay, fseek doesn't return an offset
-
- * apps/app_voicemail.c: Fix possible lack of initialization of
- useadsi
-
- * formats/format_sln.c: Bug 6539 - Division by two negates error
- flag
-
-2006-02-18 00:17 +0000 [r10409] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * app.c: Bug 6529 - memory leak in ast_play_and_prepend
-
-2006-02-17 01:55 +0000 [r10301-10368] Russell Bryant <russell@digium.com>
-
- * jitterbuf.c: fix incorrent index calculation for jitterbuffer
- history (issue #6517)
-
- * apps/app_voicemail.c: when executing the Directory application
- from voicemail and a context is not specified, use the "default"
- context, not the channel's current context (issue #6507)
-
-2006-02-15 01:21 +0000 [r10108-10137] Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/chan_agent.c: ensure that agents logged in via the
- manager interface are stored in the persistence database (related
- to issue #6301)
-
- * funcs/func_enum.c: handle longer ENUM lookup results (issue
- #6476)
-
- * res/res_agi.c: ensure that FastAGI launcher can handle system
- call interruption (issue #6449)
-
-2006-02-14 20:56 +0000 [r10021] Matt O'Gorman <mogorman@digium.com>
-
- * apps/app_meetme.c: bug fix from 6485 with musiconhold not being
- turned off by app_meetme
-
-2006-02-14 20:20 +0000 [r10018] Kevin P. Fleming <kpfleming@digium.com>
-
- * apps/app_queue.c: don't double-increment abandon counter for
- calls that are hung up while dialing members (issue #6289)
-
-2006-02-14 19:11 +0000 [r9990] Mark Spencer <markster@digium.com>
-
- * apps/app_meetme.c: Fix stopstream in menus (bug #6137)
-
-2006-02-14 18:50 +0000 [r9961-9964] BJ Weschke <bweschke@btwtech.com>
-
- * asterisk.c: #ifdef the include too.
-
- * asterisk.c: #ifdef'd the prctl fix to only try and compile on
- linux systems. Thanks rizzo for pointing this out.
-
-2006-02-14 18:30 +0000 [r9953-9958] Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/chan_sip.c: when answering INVITE, don't send codecs the
- peer didn't offer (issue #6052)
-
- * rtp.c: revert yesterday's temporary fix for issue #6052
-
-2006-02-14 04:45 +0000 [r9861-9870] BJ Weschke <bweschke@btwtech.com>
-
- * asterisk.c: Fixed my silly backport error from r9861
-
- * asterisk.c: Merged changes from r9844 from /trunk. Make sure that
- PR_SET_DUMPABLE is set to make certain that we still dump core if
- Asterisk has setuid'd to run as non-root.
-
-2006-02-14 00:46 +0000 [r9818] Kevin P. Fleming <kpfleming@digium.com>
-
- * rtp.c: don't try to use peer's dynamic codec numbers, it leads to
- duplication (issue #6052)
-
-2006-02-13 17:37 +0000 [r9756] Josh Roberson <josh@asteriasgi.com>
-
- * apps/app_meetme.c: Don't set the formats before we stop
- indications. (issue #6380)
-
-2006-02-11 19:23 +0000 [r9581-9609] Russell Bryant <russell@digium.com>
-
- * channels/chan_mgcp.c, channels/chan_sip.c, pbx/pbx_dundi.c,
- channels/chan_iax2.c: fix memory leak from not destroying the
- scheduler context on module unload
-
- * apps/app_page.c: fix due to CDR changes
-
- * manager.c, pbx/pbx_spool.c, include/asterisk/channel.h,
- include/asterisk/pbx.h, include/asterisk/manager.h, channel.c,
- pbx.c: now that CDR is a loadable module, don't depend on it
- elsewhere (issue #6460)
-
-2006-02-11 15:22 +0000 [r9528] Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/chan_sip.c, cdr.c: clean up my mess from thread-starting
- change
-
-2006-02-11 06:29 +0000 [r9493] BJ Weschke <bweschke@btwtech.com>
-
- * channels/chan_sip.c: kpfleming's fix from r9472 backported to 1.2
-
-2006-02-10 20:38 +0000 [r9404] Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/chan_mgcp.c, dnsmgr.c, channels/chan_sip.c,
- devicestate.c, channels/chan_modem.c, cdr.c: don't create monitor
- threads in detached mode, when we need to be able to
- pthread_join() them later if the module is unloaded (solve
- crash-on-unload problem for these channel modules)
-
-2006-02-09 21:10 +0000 [r9323-9326] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_voicemail.c: Revert behavior change from previous commit
- (fixes only)
-
- * apps/app_voicemail.c: Backport 5929 to 1.2
-
-2006-02-09 02:31 +0000 [r9246-9262] Russell Bryant <russell@digium.com>
-
- * apps/Makefile: add another location for postgresql headers (issue
- #6419)
-
- * channels/chan_iax2.c: reload peercontext on iax2 reload (issue
- #6442)
-
-2006-02-08 22:34 +0000 [r9233] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * cdr/Makefile: Leave it to RH/CentOS to put the freetds headers in
- a completely nonstandard location.
-
-2006-02-08 22:12 +0000 [r9232] Matt O'Gorman <mogorman@digium.com>
-
- * logger.c, channels/chan_oss.c: Make logger report
- error,warning,notice if logger.conf not found, also updated
- chan_oss to give correct error message if its config file is not
- found.
-
-2006-02-05 17:10 +0000 [r9156] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_macro.c: Bug 6176 - Fix race condition
-
-2006-02-02 18:37 +0000 [r9086] Kevin P. Fleming <kpfleming@digium.com>
-
- * Makefile: don't override ASTERISKVERSIONNUM to 000000 for non-svn
- builds
-
-2006-02-02 16:12 +0000 [r9073] Matt Frederickson <creslin@digium.com>
-
- * res/res_odbc.c: Fix for (#6309), potential (highly unlikely)
- memory leak in res_odbc
-
-2006-01-30 Russell Bryant <russell@digium.com>
-
- * Asterisk 1.2.4 Released
-
-2006-01-30 17:08 +0000 [r8905] Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/chan_zap.c: disable buggy PRI user-user code until it
- can be fixed
-
-2006-01-28 13:52 +0000 [r8808] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Issue 6182 - Don't remove scheduled event
- until it's really done. (reported by malverian)
-
-2006-01-27 08:02 +0000 [r8785] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Issue 6362 - Register without Contact: and
- Expires: fails (reporter: op)
-
-2006-01-27 00:52 +0000 [r8758] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * ast_expr2.h, ast_expr2f.c, ast_expr2.c: Bug 6072 - Revisions to
- the source bison and flex files don't auto-regenerate these files
-
-2006-01-26 19:42 +0000 [r8729] Russell Bryant <russell@digium.com>
-
- * channels/chan_zap.c: fix problem with dtmf on e&m (issue #6364)
-
-2006-01-26 14:39 +0000 [r8710] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Issue 5898: Registrations does not get
- deleted if there's an active SIP dialog
-
-2006-01-25 19:14 +0000 [r8666-8677] Russell Bryant <russell@digium.com>
-
- * channels/chan_sip.c: don't call ast_update_realtime with
- uninitialized variables if we get a registration with an expirey
- of 0 seconds (issue #6173)
-
- * channels/chan_features.c: fix memory leak (inspired by issue
- #6351)
-
-2006-01-25 Russell Bryant <russell@digium.com>
-
- * Asterisk 1.2.3 Released
-
-2006-01-25 09:46 +0000 [r8632] Olle Johansson <oej@edvina.net>
-
- * channel.c: Issue #6439 - the "timebomb" bug. Patch by Markster
- over GPRS
-
-2006-01-25 05:38 +0000 [r8619] Russell Bryant <russell@digium.com>
-
- * utils/astman.c: don't leak almost 200 bytes for each new channel
- (issue #6330)
-
-2006-01-25 01:50 +0000 [r8608] Kevin P. Fleming <kpfleming@digium.com>
-
- * apps/app_dial.c: ensure hangup cause code is handled properly
- when channel does not return a frame (issue #6346)
-
-2006-01-24 22:55 +0000 [r8600] Russell Bryant <russell@digium.com>
-
- * asterisk.c: completely arbitrary whitespace change for testing
- something with svnmerge ...
-
-2006-01-24 22:32 +0000 [r8588] Kevin P. Fleming <kpfleming@digium.com>
-
- * channel.c: ensure that channel cannot become zombie after we
- check but before we try to start indications
-
-2006-01-24 20:37 +0000 [r8573] Matt Frederickson <creslin@digium.com>
-
- * channels/chan_zap.c: Backport fix for #6229, hangup on polarity
- reversal
-
-2006-01-24 19:21 +0000 [r8537-8562] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Issue 6114: Don't hangup on BYE/ALSO with no
- channel.
-
- * channels/chan_sip.c: Issue #6308 - never send response to ACK.
- (Reported by whiskerp)
-
-2006-01-22 19:03 +0000 [r8437-8445] Russell Bryant <russell@digium.com>
-
- * apps/app_queue.c: fix memory leak from not freeing the queue
- member list when freeing an old queue
-
- * channel.c: fix MixMonitor crash (issue #6321, probably others)
-
-2006-01-22 15:13 +0000 [r8433] BJ Weschke <bweschke@btwtech.com>
-
- * channels/chan_sip.c: Bug fix: Correct some scenarios where
- CALL_LIMIT could not be getting adjusted properly allowing
- chan_sip to send calls when it really shouldn't. Bug #6111
-
-2006-01-22 08:52 +0000 [r8429] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * channels/chan_sip.c: Bug 6281 - Cannot set more than a single
- header with SIPAddHeader
-
-2006-01-22 02:05 +0000 [r8412-8418] Russell Bryant <russell@digium.com>
-
- * pbx.c: add a modified fix to prevent writing outside of the
- provided workspace when calculating a substring (issue #6271)
-
- * pbx.c: temporarily revert substring fix pending the result of the
- discussion in issue #6271
-
- * pbx.c: prevent the possibility of writing outside of the
- available workspace (issue #6271)
-
-2006-01-21 18:29 +0000 [r8394] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_queue.c: Bug 5936 - AddQueueMember fails on realtime
- queue, if queue not yet loaded
-
-2006-01-20 18:34 +0000 [r8347] Russell Bryant <russell@digium.com>
-
- * apps/app_queue.c: fix invalid value of prev_q (issue #6302)
-
-2006-01-20 01:00 +0000 [r8320] Matt O'Gorman <mogorman@digium.com>
-
- * channels/chan_iax2.c: solved problem with delayreject and iax
- trunking bug 4291
-
-2006-01-19 19:40 +0000 [r8281] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Enable "musicclass" setting for sip peers as
- per the config sample.
-
-2006-01-19 19:14 +0000 [r8276] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * ast_expr2.y, ast_expr2.fl: Bug 6072 - Memory leaks in the
- expression parser
-
-2006-01-19 04:56 +0000 [r8232-8242] Russell Bryant <russell@digium.com>
-
- * channels/chan_sip.c: fix Message-Account header to use the ip
- address if the fromdomain isn't set (issue #6278)
-
- * apps/app_milliwatt.c: fix a seg fault due to assuming that space
- gets allocatted on the stack in the same order that we declare
- the variables (issue #6290)
-
-2006-01-18 21:02 +0000 [r8194] Matt O'Gorman <mogorman@digium.com>
-
- * apps/app_meetme.c: Solves issue with the login proccess in meetme
- patch from 6136
-
-2006-01-18 02:49 +0000 [r8173] Russell Bryant <russell@digium.com>
-
- * ChangeLog (removed): remove ChangeLog from the 1.2 branch. It
- will only be present in the tags.
-
-2006-01-18 Russell Bryant <russell@digium.com>
-
- * Asterisk 1.2.2 Released
-
-2006-01-18 00:47 +0000 [r8140-8162] Matt O'Gorman <mogorman@digium.com>
-
- * loader.c: Changed order of autoload so that pbx_ comes before
- channels, and in doing so cause bug 6002 to not be an issue
-
- * apps/app_festival.c: Stop any generators running on a channel
- when festival is called as described in 5996
-
-2006-01-17 18:29 +0000 [r8134] Matt Frederickson <creslin@digium.com>
-
- * res/res_features.c: Backport of fix for #6094
-
-2006-01-17 16:55 +0000 [r8124] Matt O'Gorman <mogorman@digium.com>
-
- * logger.c: Fixed code ordering of logger_init and queue_log_init
- bug 6263
-
-2006-01-17 13:11 +0000 [r8112-8122] Kevin P. Fleming <kpfleming@digium.com>
-
- * asterisk.c: update CLI copyright notice
-
- * asterisk.c: do rlimit check _after_ reading config file, in case
- 'dumpcore' is specified there
-
-2006-01-14 19:06 +0000 [r8074] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * funcs/func_strings.c: Bug 6238 - Fix segfault when delimiter not
- specified
-
-2006-01-13 06:07 +0000 [r8047] Russell Bryant <russell@digium.com>
-
- * channels/chan_agent.c: fix spelling errors (issue #6227)
-
-2006-01-12 06:14 +0000 [r7999] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_voicemail.c, configs/voicemail.conf.sample: Bug 6211 -
- Add option deletevoicemail as equivalent to option delete for
- Realtime
-
-2006-01-11 19:08 +0000 [r7965-7986] Russell Bryant <russell@digium.com>
-
- * channels/chan_agent.c: move variable to correct scope (issue
- #6197)
-
- * apps/app_voicemail.c: fix temp greetings with ODBC storage (issue
- #6078)
-
- * channels/chan_sip.c: fix mem leak on module unload (issue #6190)
-
- * app.c: don't override an error condition that occurred when
- acting on the primary channel when stopping the autoservice on
- the peer channel. (from issue #6087)
-
- * translate.c: lock list of translators *before* recalculating the
- translation matrix
-
-2006-01-11 04:38 +0000 [r7963] Matt O'Gorman <mogorman@digium.com>
-
- * channel.c: Minor typo refrenced in 6191
-
-2006-01-11 04:19 +0000 [r7957-7960] Russell Bryant <russell@digium.com>
-
- * pbx.c: fix locking error - lock instead of unlock
-
- * apps/app_dial.c: fix a little typo
-
-2006-01-11 01:30 +0000 [r7955] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_voicemail.c: Bug 6192 - behave correctly when mailbox is
- specified as argument
-
-2006-01-10 08:48 +0000 [r7939] Olle Johansson <oej@edvina.net>
-
- * doc/README.cdr: - Adding reference to README.tds - Reformatting
- table
-
-2006-01-09 22:48 +0000 [r7917] Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/chan_iax2.c: re-initialize _all_ sequence numbers when
- transfer completes
-
-2006-01-09 22:07 +0000 [r7915] Russell Bryant <russell@digium.com>
-
- * file.c: add missing unlock (issue #6112)
-
-2006-01-09 20:08 +0000 [r7904-7908] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * pbx/pbx_spool.c: Bug 6157 - Memory leak
-
- * doc/README.variables: Update variable documentation to match the
- code
-
-2006-01-09 18:11 +0000 [r7898-7900] Kevin P. Fleming <kpfleming@digium.com>
-
- * asterisk.c: commit user/group-related changes from trunk
-
- * db.c: backport fix from revision 7856 of trunk
-
- * apps/app_voicemail.c: fix breakage introduced in revision 7871
-
-2006-01-09 05:11 +0000 [r7870-7871] Russell Bryant <russell@digium.com>
-
- * apps/app_voicemail.c: fix seg fault when using greek syntax in
- VoicemMailMain (issue #6142)
-
- * manager.c: backport fix for unnecessary unlock (issue #6171)
-
-2006-01-07 07:27 +0000 [r7848] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * pbx/pbx_spool.c: Bug 6156 - catch all threading errors, not just
- simple failure
-
-2006-01-06 00:34 +0000 [r7831] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * pbx/pbx_config.c: Dumb error messages - "Context 'context'
- already included in 'in' context"
-
-2006-01-06 00:21 +0000 [r7829] Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/chan_agent.c: update agent persistence when an agent
- gets logged off by autologoff
-
-2006-01-05 23:53 +0000 [r7827] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * include/asterisk/strings.h: Bug 6076 - Fix documentation of
- ast_trim_blank return value
-
-2006-01-05 23:49 +0000 [r7825] Kevin P. Fleming <kpfleming@digium.com>
-
- * channel.c: eliminate rounding errors that caused call time limits
- to be inaccurate (issue #5913) round 'time left' reported during
- call limit warnings up to sound more accurate
-
-2006-01-05 23:07 +0000 [r7823] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * res/res_features.c: Bug 6081 - fix for memory leak, formatting
- fixes
-
-2006-01-05 20:52 +0000 [r7819] Kevin P. Fleming <kpfleming@digium.com>
-
- * formats/format_pcm.c, formats/format_pcm_alaw.c: ensure that
- variable is initialized
-
-2006-01-05 09:13 +0000 [r7812] Olle Johansson <oej@edvina.net>
-
- * res/res_features.c: Fix copyright of changed file
-
-2006-01-05 00:58 +0000 [r7799-7809] Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/chan_agent.c: send device state updates for auto-logoff
- of agents as well
-
- * formats/format_pcm.c, formats/format_pcm_alaw.c: doh... fseek()
- has no useful return value
-
- * formats/format_pcm.c, formats/format_pcm_alaw.c: use proper
- fwrite() parameters and return value
-
- * formats/format_pcm.c, formats/format_pcm_alaw.c: return properly
- after extending file
-
- * formats/format_pcm.c, formats/format_pcm_alaw.c: ensure that
- ulaw/alaw sound files are filled with silence when extended (not
- zeroes)
-
- * channel.c: make monitoring more tolerant of peers that deliver
- frames in bursts
-
-2006-01-04 21:46 +0000 [r7792-7795] Olle Johansson <oej@edvina.net>
-
- * res/res_features.c: Issue #5980: Removing extra CR+LF in manager
- events - needs port to trunk
-
- * channels/chan_sip.c: Fixing typo in XML for video updates.
-
-2006-01-04 07:06 +0000 [r7773] Russell Bryant <russell@digium.com>
-
- * funcs/func_moh.c: use a more correct way of determining the size
- of the destination buffer
-
-2006-01-04 05:27 +0000 [r7771] BJ Weschke <bweschke@btwtech.com>
-
- * apps/app_privacy.c: Fix the 'if' clause to be true under the
- right conditions. Bug #6126
-
-2006-01-03 20:22 +0000 [r7746] Kevin P. Fleming <kpfleming@digium.com>
-
- * ast_expr.y (removed): remove unused 'old' expression parser
-
-2006-01-03 18:15 +0000 [r7743] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_stack.c: Bug 6121 - typo in application description
-
-2006-01-03 17:24 +0000 [r7736-7740] Kevin P. Fleming <kpfleming@digium.com>
-
- * include/asterisk/chanspy.h, apps/app_chanspy.c,
- apps/app_mixmonitor.c, channel.c: revert incorrect fix for bug
- #6048 from revision 7709 put in correct (simpler) fix add doxygen
- docs for channel spy 'state' values
-
- * channels/chan_sip.c: backport rport scanning fix from trunk (bug
- #6071)
-
- * ast_expr2f.c, ast_expr2.fl: don't leak memory for (most)
- expression evaluations
-
-2006-01-02 07:31 +0000 [r7709] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_mixmonitor.c: Bug 6084 - MixMonitor after a 'cli stop
- monitor' deadlocks
-
-2006-01-02 02:04 +0000 [r7706] BJ Weschke <bweschke@btwtech.com>
-
- * channels/chan_sip.c, channels/chan_iax2.c: Fix compiler warnings.
-
-2005-12-30 14:54 +0000 [r7677] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * channel.c: Bug 6091 - Fix race condition around uniqueid
-
-2005-12-28 17:35 +0000 [r7663-7665] Russell Bryant <russell@digium.com>
-
- * channels/chan_sip.c: fix memory leak in build_rpid (issue #6070)
-
- * apps/app_chanspy.c: backport fix for permissions of created
- recordings (issue #6067)
-
-2005-12-27 00:07 +0000 [r7641] Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/chan_zap.c: backport fix to ensure that DSP is never
- enabled on pseudo channels
-
-2005-12-26 20:32 +0000 [r7637] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * cdr/cdr_tds.c: Remove copy of code in libc, preferring code in
- utils.c (public domain code)
-
-2005-12-26 18:19 +0000 [r7634] Russell Bryant <russell@digium.com>
-
- * channels/chan_sip.c, channels/chan_agent.c, apps/app_sms.c,
- asterisk.c, config.c, pbx/pbx_dundi.c, apps/app_externalivr.c,
- apps/app_queue.c, channels/chan_iax2.c, cli.c,
- apps/app_chanspy.c, res/res_monitor.c: cast time_t to an int in
- printf/scanf (issue #5635)
-
-2005-12-23 06:38 +0000 [r7608] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_hasnewvoicemail.c: Bug 6051 - VMCOUNT should work as
- documented and count all, not quit after finding 1
-
-2005-12-23 03:01 +0000 [r7606] Kevin P. Fleming <kpfleming@digium.com>
-
- * asterisk.c: add license reference to copyright notice displayed
- when CLI session begins add 'show warranty' and 'show license'
- CLI commands (still need a complete list of non-GPL components
- included in Asterisk)
-
-2005-12-23 00:00 +0000 [r7605] BJ Weschke <bweschke@btwtech.com>
-
- * apps/app_waitforsilence.c: Another app documentation tweak.
-
-2005-12-22 22:04 +0000 [r7601] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_voicemail.c: Bug 6050 SQL requires the use of single
- ticks to delimit values, not quotes
-
-2005-12-22 20:36 +0000 [r7595-7599] Russell Bryant <russell@digium.com>
-
- * channels/chan_sip.c, configs/sip.conf.sample: revert changes to
- videosupport to allow per-peer setting, since it isn't quite
- complete and there is not an obvious fix at this point
-
- * channels/chan_sip.c: remove stray unlock (issue #5955)
-
-2005-12-21 22:23 +0000 [r7586] Josh Roberson <josh@asteriasgi.com>
-
- * channels/chan_sip.c: Actually put in the per-peer settings for
- sip video, as they didn't make it in at astricon somehow, and
- I've been too busy up until now to redo it.
-
-2005-12-21 20:01 +0000 [r7582] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * channels/chan_alsa.c: Allow a chan_alsa that failed to open sound
- devices to be unloaded.
-
-2005-12-21 19:53 +0000 [r7580] BJ Weschke <bweschke@btwtech.com>
-
- * channels/chan_agent.c: Bug #6040 - Documentation correction
-
-2005-12-21 19:23 +0000 [r7577] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * pbx/pbx_ael.c: Bug 5777 - Remove parentheses on Goto in AEL, so
- that it parses correctly
-
-2005-12-20 20:21 +0000 [r7550-7557] Russell Bryant <russell@digium.com>
-
- * res/res_agi.c: check array bounds when parsing arguments to AGI
- (issue #5868)
-
- * channels/chan_iax2.c: backport fix for reloading peer context
- (issue #6007)
-
- * apps/app_directed_pickup.c: backport fix for segfault on directed
- pickup when no CDR is available (issue #5998)
-
-2005-12-20 12:58 +0000 [r7546] Kevin P. Fleming <kpfleming@digium.com>
-
- * apps/app_meetme.c: backport fix for larger-than-20ms-frames from
- trunk (bug #5697)
-
-2005-12-19 23:47 +0000 [r7529] Russell Bryant <russell@digium.com>
-
- * channels/chan_sip.c: I messed up and accidently committed this to
- the trunk first ... - add note on required values of sip_methods
- struct - remove duplicate function prototype - remove duplicate
- ast_mutex_lock (issue #6025)
-
-2005-12-19 19:06 +0000 [r7521-7523] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * file.c: Bug 5988 - record append option not working
-
- * cdr.c: Bug 6026 - segfault for the sequence NoCDR(),
- SetAMAFlags()
-
-2005-12-17 18:55 +0000 [r7517-7519] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * doc/README.ael: Document that curley braces must be on the same
- line as the keyword.
-
- * apps/app_chanspy.c: Bug 6009 - off by one error
-
-2005-12-17 03:59 +0000 [r7510-7515] Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/chan_sip.c: Max-Forwards headers must only be present on
- requests, not responses
-
- * channels/chan_sip.c: forcibly expire previous subscriptions from
- a peer when they resubscribe (keeps them from building up and
- waiting for expiration, and stops us sending unwanted NOTIFY
- messages to devices)
-
- * build_tools/make_svn_branch_name: fix some buglet when building
- team branch version strings
-
-2005-12-17 01:02 +0000 [r7508] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * include/asterisk/linkedlists.h: We want to check the previous
- value, not the current value (which was just changed).
-
-2005-12-16 00:49 +0000 [r7497] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_cut.c: First field is truncated
-
-2005-12-15 10:52 +0000 [r7490] Christian Richter <christian.richter@beronet.com>
-
- * doc/README.misdn, channels/misdn/mISDNuser.patch (added),
- channels/misdn/isdn_lib_intern.h, channels/misdn/mISDN.patch
- (added), channels/misdn/isdn_lib.h, channels/chan_misdn.c,
- channels/misdn/Makefile, channels/misdn/chan_misdn_config.h,
- channels/misdn/ie.c, channels/chan_misdn_config.c,
- channels/misdn/isdn_msg_parser.c, channels/Makefile,
- channels/misdn/isdn_lib.c: * Added mISDN/mISDNuser Echo cancel
- Patch * Fixed Makefiles so that chan_misdn can be compiled again
- * added some hints, that mISDN cannot be compiled against gcc-4,
- SMP, Spinlock Debug * fixed some Minor issues in chan_misdn,
- regarding Type Of Number and Presentation
-
-2005-12-15 02:51 +0000 [r7482] BJ Weschke <bweschke@btwtech.com>
-
- * channel.c: Bug #6003 - Don't free the channel structure until
- after having sent the manager event.
-
-2005-12-13 18:54 +0000 [r7435-7470] Kevin P. Fleming <kpfleming@digium.com>
-
- * doc/README.variables: clarify substring documentation
-
- * utils.c: correct broken math in tvfix() for timestamp values over
- one million
-
- * apps/app_dial.c: restore ability of caller to hangup calls that
- are still ringing (issue #5839)
-
- * channels/chan_sip.c, pbx.c: ensure that hangups while incoming
- calls are in early state are handled properly (issue #5919)
-
- * channels/chan_agent.c: only report AGENT_IDLE for callback mode
- agents when they are actually idle (issue #5902)
-
- * app.c: use the stream's current point when pausing/unpausing,
- instead of elapsed time (which doesn't work when the stream has
- been skipped forward or backward) (issue #5897)
-
- * apps/app_externalivr.c: set all the child file descriptors to
- non-blocking so that we don't hang if the child fails to send a
- newline-terminated command or error message
-
-2005-12-12 17:19 +0000 [r7433] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * include/asterisk/linkedlists.h: Typo
-
-2005-12-11 06:08 +0000 [r7430] Russell Bryant <russell@digium.com>
-
- * utils/astman.c: silence a couple of compiler warnings about
- pointer signedness
-
-2005-12-11 01:26 +0000 [r7427-7429] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * include/asterisk/linkedlists.h: Bug 5965 - major bug in
- AST_LIST_REMOVE
-
- * apps/app_voicemail.c: Bug 5967
-
-2005-12-10 18:10 +0000 [r7425] BJ Weschke <bweschke@btwtech.com>
-
- * channels/chan_zap.c: Bug #5877 Make sure the digit string from
- E&M wink DNIS collection is properly null terminated as it grows.
-
-2005-12-08 23:45 +0000 [r7404-7406] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_voicemail.c: Bug 5960
-
- * configs/res_odbc.conf.sample: Documenting two keywords that were
- previously missing
-
-2005-12-08 01:05 +0000 [r7382-7386] Kevin P. Fleming <kpfleming@digium.com>
-
- * pbx.c: initialize the buffer before using it...
-
- * pbx.c: ensure that hints are allowed to use global variable
- references
-
-2005-12-06 Kevin P. Fleming <kpfleming@digium.com>
-
- * Asterisk 1.2.1 Released
-
-2005-12-05 06:47 +0000 [r7335-7340] Russell Bryant <russell@digium.com>
-
- * Makefile: remove ASTERISKVERSIONNUM from the version string given
- to doxygen
-
- * apps/app_queue.c: don't delete dynamic queue members when
- reloading the static members from a realtime database (issue
- #5922)
-
- * channels/chan_sip.c: fix the order of arguments to an error
- message (issue #5927)
-
-2005-12-04 18:03 +0000 [r7329] Kevin P. Fleming <kpfleming@digium.com>
-
- * build_tools/make_svn_branch_name: use a more efficient way to get
- the revision number, that will also report if the working copy
- contains uncommitted modifications
-
-2005-12-03 19:55 +0000 [r7310] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * apps/app_voicemail.c: Bug 5925: check for "Unknown", as that's
- what app_voicemail puts into the field for Unknown callerid Also,
- remove useless res checks (initialized to 0; never set)
-
-2005-12-03 01:24 +0000 [r7299] Olle Johansson <oej@edvina.net>
-
- * configs/sip.conf.sample: Documenting the default registerattempts
- setting as 0, continue hammering the server for ever and ever ;-)
-
-2005-12-02 21:12 +0000 [r7285] Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
-
- * contrib/init.d/rc.debian.asterisk,
- contrib/init.d/rc.mandrake.asterisk,
- contrib/init.d/rc.redhat.asterisk,
- contrib/init.d/rc.gentoo.asterisk,
- contrib/init.d/rc.mandrake.zaptel,
- contrib/init.d/rc.slackware.asterisk: Turn on executable bits for
- startup scripts, and fix bash var interpolation for Mandrake
-
-2005-12-02 00:52 +0000 [r7275] Olle Johansson <oej@edvina.net>
-
- * channels/chan_sip.c: Bug #5907. Improve SIP INFO DTMF debugging
- output. (1.2 & Trunk)
-
-2005-12-02 00:51 +0000 [r7266-7274] Kevin P. Fleming <kpfleming@digium.com>
-
- * apps/app_page.c, pbx.c: inherit channel variables into channels
- created by Page() application (issue #5888)
-
- * apps/app_voicemail.c, configs/voicemail.conf.sample, UPGRADE.txt:
- allow previous context-searching behavior to be used if desired
- (issue #5899)
-
- * apps/app_voicemail.c: properly handle password changes when
- mailbox is last line of config file and not followed by a newline
- (issue #5870) reformat password changing code to conform to
- coding guidelines (issue #5870)
-
- * channels/chan_agent.c: protect agent_bridgedchannel() from
- segfaulting when there is no bridged channel (issue #5879)
-
- * channels/chan_local.c: allow variables to exist on both 'halves'
- of the Local channel (issue #5810)
-
- * apps/app_festival.c: don't block waiting for the Festival server
- forever when it goes away (issue #5882)
-
- * channel.c: ensure channel's scheduling context is freed (issue
- #5788)
-
- * Makefile, patches (removed): Makefile 'update' target now
- supports updating from Subversion repositories (issue #5875)
- remove support for 'patches' subdirectory, it's no longer useful
-
-2005-12-01 23:18 +0000 [r7261-7265] Olle Johansson <oej@edvina.net>
-
- * doc/README.misdn: Changing bug report address to the Asterisk
- issue tracker
-
- * doc/README.jitterbuffer, doc/README.realtime: Removing references
- to 1.1dev, replacing with 1.2, in documentation files.
-
- * doc/README.misdn: Fixing some spelling errors, as well as
- changing "cvs" to "subversion" in misdn documentation.
-
-2005-12-01 19:25 +0000 [r7257] Kevin P. Fleming <kpfleming@digium.com>
-
- * build_tools/make_svn_branch_name: ensure that 'svn info' output
- is in the expected language for the script to parse (issue #5880)
-
-2005-12-01 02:33 +0000 [r7228-7251] Russell Bryant <russell@digium.com>
-
- * apps/app_externalivr.c: use ast_app_separate_args to split
- arguments (issue #5686)
-
- * apps/app_queue.c: fix queue weight feature - compare member
- interfaces instead of pointers to the members, since each queue
- has its own list of members. (issue #5863)
-
- * build_tools/make_svn_branch_name: use '=' instead of '==' for
- string comparisons. /bin/bash is ok with this, but /bin/sh is
- not. (issue #5885)
-
- * redhat/asterisk (removed), Makefile: remove outdated redhat init
- script and provide the updated one in 'make rpm' (issue #5786)
-
- * contrib/init.d/rc.debian.asterisk,
- contrib/init.d/rc.redhat.asterisk: Comment out LD_ASSUME_KERNEL
- by default. Print error messages if the asterisk executable or
- the asterisk configuration directory are not found. (issue #5785,
- #5708)
-
- * apps/app_dial.c: fix DIALEDTIME when call has not been answered
- (issue #5862)
-
- * rtp.c: do not allow an rtp message with zero type (issue #5749)
-
- * pbx.c: fix hint case sensitivity (issue #5856)
-
- * configs/sip.conf.sample: add description of the "fromdomain"
- option (issue #5874)
-
-2005-11-30 03:52 +0000 [r7227] Josh Roberson <josh@asteriasgi.com>
-
- * apps/app_voicemail.c, UPGRADE.txt, ChangeLog: backport fix from
- trunk
-
-2005-11-30 03:37 +0000 [r7219-7226] Kevin P. Fleming <kpfleming@digium.com>
-
- * doc/cdr.txt, doc/CODING-GUIDELINES, include/asterisk.h,
- doc/README.mp3: remove remaining CVS references
-
- * channel.c: port memory leak fix from rev 7223 in trunk
-
- * include/asterisk/lock.h: do the multiple-lock check for cond_wait
- properly...
-
-2005-11-29 06:12 +0000 [r7216-7218] Russell Bryant <russell@digium.com>
-
- * apps/app_cut.c: print an error message if invalid arguments are
- specified
-
- * apps/app_skel.c: fix a couple of typos and a buglet
-
-2005-11-29 01:25 +0000 [r7199-7213] Kevin P. Fleming <kpfleming@digium.com>
-
- * include/asterisk/lock.h: if the lock protected a pthread_cond is
- held recursively, warn before waiting onthe condition
-
- * Makefile, build_tools/make_svn_branch_name (added): port version
- string computation from trunk
-
- * / (added): branch renames remove unneeded branches
-
-2005-11-29 Josh Roberson <josh@asteriasgi.com>
-
- * apps/app_voicemail.c: Only look in 'default' context when no context defined to VoiceMailMain(). (issue #5887)
-
-2005-11-25 Russell Bryant <russell@digium.com>
-
- * apps/app_dial.c: Properly duplicate the string for ANI (issue #5850)
-
-2005-11-23 Russell Bryant <russell@digium.com>
-
- * configs/voicemail.conf.sample: Add note to indicate that #include should not be used for this file. (issue #5828)
-
- * indications.c: Fix spelling of "cadence", allowing the old misspelling for backwards compatability. (issue #5826)
- * configs/indications.conf.sample: Fix spelling of "cadence", allowing the old misspelling for backwards compatability. (issue #5826)
- * include/asterisk/indications.h: Fix spelling of "cadence", allowing the old misspelling for backwards compatability. (issue #5826)
- * res/res_indications.c: Fix spelling of "cadence", allowing the old misspelling for backwards compatability. (issue #5826)
-
- * apps/app_voicemail.c: Remove left over "yay!" debugging message. (issue #5829)
-
-2005-11-21 Kevin P. Fleming <kpfleming@digium.com>
-
- * apps/app_cut.c: remove unnecessary include that causes spurious rebuilding
-
- * channels/chan_sip.c (build_peer): ensure that case changes made to peer names are not ignored during reload operations
- (build_peer): when a peer is changed from dynamic to static mode, reset the default port number if no other has been specified
-
- * channels/chan_iax2.c (build_peer and build_user): ensure that case changes made to peer/user names are not ignored during reload operations
- (build_peer): when a peer is changed from dynamic to static mode, reset the default port number if no other has been specified
-
-2005-11-21 Russell Bryant <russell@digium.com>
-
- * Makefile: Revert previous change for Darwin.
-
- * apps/app_osplookup.c: Properly populate the number of results. (issue #5789)
-
- * Makefile: Don't hard-code that poll functionality needs to be provided on Darwin.
- * apps/Makefile: Fix incorrect portion of the patch to fix 'make install' on Solaris.
-
- * channels/chan_iax2.c (iax2_getpeername): Return non-zero to indicate that a peer was found when using realtime (issue #5815)
-
-2005-11-20 Russell Bryant <russell@digium.com>
-
- * Makefile apps/Makefile: Fix 'make install' for Solaris. (issue #5775)
-
- * apps/app_record.c: Don't leak a frame if writing it to the file fails. (issue #5787)
-
- * Makefile: Create the monitor spool directory when the other spool directories are created.
-
- * channels/chan_sip.c channels/chan_iax2.c: Change warning messages about the number of scheduled events happening all at once to debug messages. (issue #5794)
-
- * pbx/pbx_spool.c: Fix crash when a value is not specified with a variable on a Set: line in a call file. (issue #5806)
-
- * apps/app_meetme.c: Fix the 'X' option to the MeetMe application. (issue #5773)
-
- * apps/app_voicemail.c: Correct the use of a mailbox entered by the calling party instead of indicated as an argument to the Voicemail application. (issue #5774)
-
- * apps/app_controlplayback.c: Fix logic in checking for success when jumping to priority n+101.
- * apps/app_md5.c: Fix logic in checking for success when jumping to priority n+101.
-
- * apps/app_hasnewvoicemail.c: Fix a typo in the application description. Also, fix the logic in checking for success when jumping to priority n+101. (issue #5795)
-
- * UPGRADE.txt: Add a note on a second way that the IAX2 channel naming convention has changed. (issue #5792)
- * channels/chan_iax2.c: Fix alignment of the output for the "iax2 show peer <peer>" CLI command (issue #5792)
-
- * channels/Makefile: Re-add chan_oss to the default build. (issue #5799)
-
- * res/res_musiconhold.c: Fix incorrect argument for the buffer size to an ast_copy_string call (issue #5803)
-
- * funcs/func_enum.c: Shorten the module description (issue #5791)
-
-2005-11-17 Russell Bryant <russell@digium.com>
-
- * Makefile: Fix the output of Makefile generated variables to doxygen
-
- * channels/chan_sip.c: Add missing carriage return and line feed to the SDP line indicating that we don't support VAD (issue #5780)
-
-2005-11-16 Kevin P. Fleming <kpfleming@digium.com>
-
- * Asterisk 1.2.0 released.
-
-2005-11-16 Jeremy McNamara <jj@nufone.net>
-
- * apps/app_voicemail.c (load_config): do not terminate asterisk if no voicemail config file
- * channels/chan_skinny: Don't register channel type until ready, code formatting updates
-
-2005-11-16 Josh Roberson <josh@asteriasgi.com>
-
- * Makefile: Update to fix non-responsive remote console on Darwin (OSX)(issue #5757)
-
-2005-11-16 Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/Makefile: don't build chan_modem and sub-modules by default
- * configs/modules.conf.sample: explicitly 'noload' chan_modem.so and submodules, in case old versions exist
-
- * res/Makefile: issue mpg123 not-installed warning at 'make install' time, not 'make'
-
- * apps/app_forkcdr.c (forkcdr_exec): issue warning (and don't segfault) if ForkCDR is called on a channel that doesn't have a CDR (issue #5763)
-
- * channel.c (ast_queue_hangup): ensure that the channel lock is held before changing its fields... (issue #5770)
-
- * res/res_musiconhold.c: don't spit out incorrect log messages (and leak memory) during reload (issue #5766)
-
- * channels/chan_sip.c (process_sdp): don't pass video codec number into ast_getformatname(), it is not valid input for that function (issue #5764)
-
- * pbx/pbx_ael.c (match_assignment): properly parse equal signs surrounded by whitespace (issue #5761)
-
- * doc/README.realtime: document the limitations of using FreeTDS with Realtime (issue #5767)
-
-2005-11-15 Kevin P. Fleming <kpfleming@digium.com>
-
- * Makefile: use -g3 for compiler to include macro information for debugger
-
- * astmm.c (__ast_vasprintf): don't re-use the ap list without copying it; that's not safe on some platforms (issue #5035)
-
- * doc/README.backtrace: add note about properly building Asterisk to be able to produce backtraces; wrap text and remove DOS line endings
-
- * channels/chan_sip.c (add_codec_to_sdp): add 'annexb=no' to G.729A SDP (issue #5539)
-
- * channels/chan_alsa.c (alsa_hangup): handle autohangup properly (issue #5672)
-
- * channels/chan_misdn.c (and other files): various fixes (issue #5739)
-
- * channels/chan_sip.c (handle_request_info): properly forward 'flash' events received via SIP INFO (issue #5751, different patch)
-
- * apps/app_disa.c (disa_exec): don't duplicate constant strings when not needed
-
- * apps/app_playback.c (playback_exec): use correct logic tests for options (issue #5752)
-
- * apps/app_disa.c (disa_exec): use standard arg parsing routines (issue #5736)
-
-2005-11-15 Russell Bryant <russell@digium.com>
-
- * manager.c: Don't crash on a SetVar action if the channel name is not set, or variable's value is not set (issue #5760)
-
- * doc/README.variables: Add application exit status variables
-
-2005-11-14 Josh Roberson <josh@asteriasgi.com>
-
- * manager.c: Fix crash on variable passing from AMI originate (issue #5737)
-
-2005-11-14 Russell Bryant <russell@digium.com>
-
- * many files: Merge doxygen documentation updates. (issue #5605)
-
- * apps/app_dial.c: Fix typo in RetryDial description.
-
-2005-11-12 Russell Bryant <russell@digium.com>
-
- * channels/chan_oss.c: Fix a typo in an error message.
-
-2005-11-11 Kevin P. Fleming <kpfleming@digium.com>
-
- * Asterisk 1.2.0-rc2 released.
-
-2005-11-11 Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/chan_sip.c (thread_safe_rand): ensure that threads don't get the same random number (issue #5712)
-
- * apps/app_voicemail.c (forward_message): correct bugs in message forwarding (issue #5718)
- (copy_message): use correct path for locking (issue #5704)
-
- * apps/app_dial.c (wait_for_answer): correct flag copying for automon feature (issue #5720)
-
- * channels/chan_iax2.c: correct comment
-
- * apps/app_voicemail.c (close_mailbox): correct previous commit (issue #5663)
- (vm_change_password): fix password change writing (issue #5721)
-
- * channels/chan_sip.c (transmit_invite): remove useless debug message; don't try to add OSP tokens to OPTIONS pings
-
- * apps/app_voicemail.c (close_mailbox): properly remove deleted messages at mailbox close time (issue #5663)
-
-2005-11-11 Mark Spencer <markster@digium.com>
-
- * channels/chan_zap.c (zt_bridge): only enable/disable DTMF detection on SUB_REAL channels
-
-2005-11-10 Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/chan_iax2.c: ensure that system headers that provide basic types are included first (issue #5713)
-
-2005-11-11 Russell Bryant <russell@digium.com>
-
- * many files in apps/: Clean up application descriptions. Clarify some wording and make sure they wrap at 80 characters.
-
-2005-11-10 Mark Spencer <markster@digium.com>
-
- * rtp.c (ast_rtp_raw_write): use unsigned int for return value from calc_txstamp() (issue #5595)
- (calc_txstamp): never return a value that was less than zero before being turned into 'unsigned int' (issue #5595)
-
-2005-11-10 Kevin P. Fleming <kpfleming@digium.com>
-
- * include/asterisk/chanspy.h: move spy-related stuff into separate header so chan_h323 can build (issue #5590)
-
- * include/asterisk/linkedlists.h (AST_LIST_HEAD_SET_NOLOCK): properly initialize tail pointer when list head is directly set (issue #5669)
-
- * app.c (ast_app_parse_options): ok, so we aren't all perfect... let's make the while loop actually work properly here (issue #5684)
-
- * apps/app_disa.c (disa_exec): correct password file parsing (issue #5676)
-
- * apps/app_meetme.c (conf_run): don't restrict admin users from joining a locked conference (issue #5680)
-
- * channels/chan_misdn.c: include stdio.h (issue #5671)
- * channels/chan_misdn_config.c: fix prototype warning (issue #5671)
-
- * pbx.c: remove apps that were deprecated before 1.0 was released (issue #5673)
-
- * apps/app_striplsd.c, apps/app_substring.c: remove apps that were deprecated before 1.0 was released (issue #5673)
-
- * include/asterisk/lock.h (PTHREAD_MUTEX_RECURSIVE_NP): work around header problems on Cygwin (issue #5668)
-
- * pbx/pbx_ael.c: handle switch default cases inside macros properly (issue #5354)
-
- * configs/voicemail.conf.sample (format): add strong warning about changing format list when mailboxes contain messages (issue #5689)
-
- * many files: ensure that system headers are included before Asterisk headers (issue #5693)
-
- * channels/chan_iax2.c (complete_iax2_show_peer): don't return from function without releasing lock (issue #5685)
-
- * channels/iax2-provision.c (iax_provision_reload): don't leak memory (issue #5700)
-
- * pbx/pbx_ael.c (handle_macro): don't leak memory (issue #5701)
- (handle_context): ditto
-
- * res/res_features.c (load_config): properly initialize referenced variable (issue #5703)
-
- * apps/app_queue.c (rqm_exec): correct segfault problem (issue #5705)
- (aqm_exec): ditto
-
- * app.c (ast_app_parse_options): don't increment 's' until after checking for NULL (related to issue #5630)
-
- * apps/app_rpt.c: solve a memory leak (config structure was not freed) (issue #5706)
-
-2005-11-10 Russell Bryant <russell@digium.com>
-
- * app.c (ast_app_separate_args): Don't consider the open parenthesis as part of the arguments to an option. (issue #5630)
-
- * many files: Change all references to ast_separate_app_args to ast_app_separate_args
-
- * many files in apps/: Clean up some application descriptions. Make sure all descriptions in changed files are wrapped at 80 characters.
-
-2005-11-09 Russell Bryant <russell@digium.com>
-
- * pbx.c: Clean up descriptions of built-in dialplan applications. Changes include clearer wording and not referring to return values.
-
-2005-11-09 Kevin P. Fleming <kpfleming@digium.com>
-
- * channels/chan_iax2.c (update_registry): don't complain about unspecifed registration expiration intervals, just use the minimum
-
-2005-11-08 Kevin P. Fleming <kpfleming@digium.com>
-
- * Asterisk 1.2.0-rc1 released.
-
- * include/asterisk/file.h: add test to ensure that stdio.h is included before this file (issue #5658)
-
- * res/res_odbc.c (odbc_prepare_and_execute): add new API call for use to properly handle prepared statements across server disconnects (issue #5563)
-
- * pbx.c (pbx_substitute_variables_helper_full): use already-substituted buffer for parsing variable name (issue #5664)
-
- * channels/chan_zap.c (zt_request): return AST_CAUSE_CONGESTION when a group-channel is requested and the group exists but all channels are busy (issue #3360, related fix)
- * channels/chan_iax2.c (create_addr): treat UNREACHABLE as AST_CAUSE_UNREGISTERED so that it will generate CHANUNAVAIL from app_dial (issue #3360)
-
- * res/res_features.c (ast_bridge_call_thread_launch): set SCHED_RR separately from thread creation, so it won't fail when running as non-root (issue #5601, different fix)
-
- * pbx.c (pbx_builtin_pushvar_helper): add new API function for setting variables that can exist multiple times (issue #2720)
- * apps/Makefile (APPS): add app_stack (issue #2720)
- * apps/app_stack.c: new applications (issue #2720)
-
- * apps/app_meetme.c: fix two audio delay problems related to using non-Zap channels in conferences (issues #3599 and #4252)
- * configs/meetme.conf.sample: add documentation of new 'audiobuffers' setting to control buffering on incoming audio from non-Zap channels
-
- * channels/chan_local.c (local_call): move channel variables from incoming to outgoing instead of inheriting them (issue #5604)
-
- * many files: add explicit include of stdio.h (issue #5650)
-
-2005-11-07 Kevin P. Fleming <kpfleming@digium.com>
-
- * UPGRADE.txt (Parking): add note about new parking behavior (issue #5532)
-
- * many files: more Cygwin compatibility, and proper getloadavg() prototype/macro (issue #5569)
-
- * include/asterisk/lock.h (__ast_pthread_mutex_lock): correct build with DETECT_DEADLOCKS defined (issue #5570)
-
-2005-11-07 Russell Bryant <russell@digium.com>
-
- * apps/app_queue.c: upgrade to new arg/option API and implement priority jumping control (issue #5580)
- * many files: Add missing include of stdio.h, and remove some duplicate and unused header includes
-
- * include/asterisk/app.h: Increment the arg_index in the options structure to fix applicaiton options that have arguments to them
-
-2005-11-07 Kevin P. Fleming <kpfleming@digium.com>
-
- * cryptostub.c: include necessary headers
- * include/asterisk/crypto.h: don't include unnecessary headers
-
- * manager.c (action_setvar): add support for setting global variables (issue #5571)
-
- * Makefile: correct cross-compilation issue introduced in Cygwin patches (issue #5572)
-
- * apps/app_voicemail.c: upgrade to new arg/option API and implement priority jumping control (issue #5649)
-
- * asterisk.c (main): setpriority() failure is not a reason to stop the process (issue #5581)
-
- * say.c (ast_say_date_with_format_da): say hours properly (issue #5576)
-
- * manager.c (astman_get_variables): restore old multiple-variable behavior for "Variable" header (issue #5585)
-
- * many files: don't check for NULL before calling ast_strlen_zero, it can do it itself (issue #5648)
-
- * pbx.c (handle_show_hints): use proper state-to-string function for hint state (issue #5583)
-
- * rtp.c: use unsigned format for debug packet output (issue #5595)
-
- * asterisk.c (main): force a dnsmgr background refresh after all other modules are initialized (issue #5599)
- * dnsmgr.c: add ability to start a background refresh on demand (issue #5599)
-
- * apps/app_dial.c (HANDLE_CAUSE): set CDR disposition to match cause code (issue #5602)
-
- * asterisk.c: support 'runuser' and 'rungroup' options in asterisk.conf (issue #5621)
-
- * res/Makefile, apps/Makefile, channels/Makefile, Makefile: support WITHOUT_ZAPTEL define to forcibly avoid building Zaptel support (issue #5634)
-
- * Makefile: various fixes (issue #5633)
-
- * apps/app_osplookup.c: upgrade to new arg/option API and implement priority jumping control
-
- * channels/chan_misdn.c: various fixes (issue #5639)
- * channels/misdn/isdn_lib.c: various fixes (issue #5639)
-
- * apps/app_playback.c: upgrade to new arg/option API and implement priority jumping control
-
- * apps/app_privacy.c: upgrade to new arg/option API and implement priority jumping control
-
- * apps/app_sendtext.c: upgrade to new arg/option API and implement priority jumping control
-
- * apps/app_transfer.c: upgrade to new arg/option API and implement priority jumping control
-
- * apps/app_txtcidname.c: upgrade to new arg/option API and implement priority jumping control
-
- * Makefile: restore function of 'dont-optimize'
-
- * config.c (config_text_file_load): don't generate log message when stat() fails
-
- * many files: clean up application documentation to not refer to return values, since they cannot be used in the dialplan (work done by Neil Lewis)
-
-2005-11-06 Russell Bryant <russell@digium.com>
-
- * many files: alphabetize options in applicaiton descriptions
-
- * channels/chan_iax2.c: Use an enum to define iax peer/user flags as well as the pvt structure state. Use the ast_flags macros for checking or setting the state.
-
- * sounds.txt: Add missing words from the description of the vm-opts prompt
-
- * apps/app_externalivr.c: Add a space that fixes building on older versions of gcc
-
- * many files: Add doxygen updates to categorize modules into groups. Convert a lot of comments over to doxygen style. Add some text giving a basic overview of channels.
-
- * many files: Update applications to add an exit status variable, make priority jumping optional, and use new args parsing macros
-
- * pbx.c cdr.c res/res_features.c apps/app_dial.c include/asterisk/cdr.h: Convert some built-in applications to use new args parsing macros. Change ast_cdr_reset to take a pointer to an ast_flags structure instead of an integer for flags.
-
- * channels/chan_agent.c: Don't loop forever on an invalid options string
-
- * apps/app_disa.c apps/app_forkcdr.c: Fix to use correct arguments to ast_cdr_reset
-
-2005-11-05 Kevin P. Fleming <kpfleming@digium.com>
-
- * Makefile: don't rebuild asterisk/build.h unless the asterisk binary is going to be relinked for some other reason (stops spurious recompile/link every time 'make' is issued); clean up variable substitutions to use consistent syntax
- * asterisk.c: don't include asterisk/build.h (it's unnecessary)
- * cli.c: don't include asterisk/build.h, use extern references to buildinfo.c
- * buildinfo.c: new file to hold version info strings
-
-2005-11-04 Kevin P. Fleming <kpfleming@digium.com>
-
- * apps/app_mixmonitor.c (mixmonitor_exec): correct app name in an error message
-
-2005-11-04 Russell Bryant <russell@digium.com>
-
- * channels/chan_iax2.c: Create a function that stores a peer's status in a given buffer. Use this function in "iax2 show peers" and "iax2 show peer <peername>". Also, add the peer's status as an option to the IAXPEER dialplan function.
-
-2005-11-04 Kevin P. Fleming <kpfleming@digium.com>
-
- * include/asterisk/compiler.h: don't try to use always_inline on old compilers
-
-2005-11-03 Russell Bryant <russell@digium.com>
-
- * res/res_agi.c: initialize buffer for result so that the contents are always valid in the response to GET FULL VARIABLE
-
-2005-11-03 Kevin P. Fleming <kpfleming@digium.com>
-
- * doc/README.variables: document DYNAMIC_FEATURES
-
- * res/res_features.c (ast_bridge_call): remove unused variables
-
- * apps/app_dial.c (dial_exec_full): simplify options and flag usage
-
- * include/asterisk/app.h: re-work application arg/option parsing APIs for consistent naming, add doxygen docs for option API
- * many files: update to new APIs
-
-2005-11-02 Kevin P. Fleming <kpfleming@digium.com>
-
- * apps/app_dial.c (dial_exec_full): convert to use API calls for argument/option parsing
-
- * include/asterisk/channel.h: add doxygen docs for silence generator APIs
-
- * channel.c (ast_channel_bridge): simplify native-bridge return logic, remove 'unsuccessful' message since it causes too many questions :-)
-
-2005-11-01 Kevin P. Fleming <kpfleming@digium.com>
-
- * stdtime/localtime.c: fix build failure on uClibc systems (issue #5558)
- * devicestate.c: same
-
- * many files: make chan_misdn actually build (issue #5566)
-
- * many files: more Cygwin build system support (issue #4678)
-
- * apps/app_parkandannounce.c (parkandannounce_exec): supply parent channel to ast_request_and_dial so channel variables can be inherited (issue #5564)
- * include/asterisk/channel.h: add parent_channel field
- * channel.c (__ast_request_and_dial): use parent_channel field to inherit variables into new channel
-
- * apps/app_cut.c (cut_internal): use ast_app_separate_args() instead of open code (issue #5560)
-
- * apps/app_mixmonitor.c (launch_monitor_thread): ast_strlen_zero can handle NULL input (issue #5561)
- (mixmonitor_exec): same
-
- * res/res_features.c (ast_feature_request_and_dial): ensure that channel variables are inherited from the channel placing the call (issue #5499)
-
- * utils.c (getloadavg): change to using _BSD_SOURCE as the indicator for whether this function is present or not (issue #5549)
-
- * include/asterisk/utils.h (ast_slinear_saturated_add): force to be inlined whenever possible
- (ast_slinear_saturated_multiply): same
- (ast_slinear_saturated_divide): same
- (inaddrcmp): same
- * include/asterisk/strings.h (ast_strlen_zero): force to be inlined whenever possible
- * include/asterisk/compiler.h (force_inline): add macro to force inlining of functions
-
- * app.c (ast_play_and_record): use ast_silence_generator during recording if requested
- * asterisk.c: add global option to enable silence-during-record (issue #5135)
- * channel.c (silence_generator_alloc): new
- (silence_generator_release): new
- (silence_generator_generate): new
- (ast_channel_start_silence_generator): new API call to start generating silence on a channel
- (ast_channel_stop_silence_generator): parallel call to stop silence generation
- * apps/app_record.c (record_exec): use ast_silence_generator during recording if requested
-
-2005-11-01 Kevin P. Fleming <kpfleming@digium.com>
-
- * Asterisk 1.2.0-beta2 released.
-
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 88f147a7c..4481910fb 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -471,6 +471,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
o->chan = ast_request(tech, in->nativeformats, stuff, &cause);
if (!o->chan)
ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
+ else
+ ast_channel_inherit_variables(in, o->chan);
} else {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", o->chan->name);
@@ -937,20 +939,26 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
}
if( privdb_val == AST_PRIVACY_DENY ) {
+ strcpy(status, "NOANSWER");
ast_verbose( VERBOSE_PREFIX_3 "Privacy DB reports PRIVACY_DENY for this callerid. Dial reports unavailable\n");
res=0;
goto out;
}
else if( privdb_val == AST_PRIVACY_KILL ) {
- ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 201);
+ strcpy(status, "DONTCALL");
+ if (option_priority_jumping || ast_test_flag(&opts, OPT_PRIORITY_JUMP)) {
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 201);
+ }
res = 0;
goto out; /* Is this right? */
}
else if( privdb_val == AST_PRIVACY_TORTURE ) {
- ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 301);
+ strcpy(status, "TORTURE");
+ if (option_priority_jumping || ast_test_flag(&opts, OPT_PRIORITY_JUMP)) {
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 301);
+ }
res = 0;
goto out; /* is this right??? */
-
}
else if( privdb_val == AST_PRIVACY_UNKNOWN ) {
/* Get the user's intro, store it in priv-callerintros/$CID,
@@ -1060,6 +1068,8 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
tmp->chan = ast_request(tech, chan->nativeformats, stuff, &cause);
if (!tmp->chan)
ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
+ else
+ ast_channel_inherit_variables(chan, tmp->chan);
} else {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", tmp->chan->name);
@@ -1306,6 +1316,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
opt_args[OPT_ARG_PRIVACY], privcid);
ast_privacy_set(opt_args[OPT_ARG_PRIVACY], privcid, AST_PRIVACY_DENY);
}
+ strcpy(status,"NOANSWER");
if (ast_test_flag(&opts, OPT_MUSICBACK)) {
ast_moh_stop(chan);
} else if (ast_test_flag(&opts, OPT_RINGBACK)) {
diff --git a/apps/app_hasnewvoicemail.c b/apps/app_hasnewvoicemail.c
index d5e7664f6..dbfea6a65 100644
--- a/apps/app_hasnewvoicemail.c
+++ b/apps/app_hasnewvoicemail.c
@@ -47,6 +47,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/utils.h"
#include "asterisk/app.h"
#include "asterisk/options.h"
+#ifdef USE_ODBC_STORAGE
+#include "asterisk/res_odbc.h"
+
+static char odbc_database[80];
+static char odbc_table[80];
+#endif
static char *tdesc = "Indicator for whether a voice mailbox has messages in a given folder.";
static char *app_hasvoicemail = "HasVoicemail";
@@ -77,25 +83,93 @@ STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
-static int hasvoicemail_internal(char *context, char *box, char *folder)
+#ifdef USE_ODBC_STORAGE
+static int hasvoicemail_internal(const char *context, const char *mailbox, const char *folder)
{
- char vmpath[256];
- DIR *vmdir;
- struct dirent *vment;
- int count=0;
-
- snprintf(vmpath,sizeof(vmpath), "%s/voicemail/%s/%s/%s", (char *)ast_config_AST_SPOOL_DIR, context, box, folder);
- if ((vmdir = opendir(vmpath))) {
- /* No matter what the format of VM, there will always be a .txt file for each message. */
- while ((vment = readdir(vmdir))) {
- if (!strncmp(vment->d_name + 7, ".txt", 4)) {
- count++;
- }
+ int nummsgs = 0;
+ int res;
+ SQLHSTMT stmt;
+ char sql[256];
+ char rowdata[20];
+
+ if (!folder)
+ folder = "INBOX";
+ /* If no mailbox, return immediately */
+ if (ast_strlen_zero(mailbox))
+ return 0;
+ if (ast_strlen_zero(context))
+ context = "default";
+
+ odbc_obj *obj;
+ obj = fetch_odbc_obj(odbc_database, 0);
+ if (obj) {
+ res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
+ if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
+ goto yuck;
+ }
+ snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s/voicemail/%s/%s/%s'", odbc_table, ast_config_AST_SPOOL_DIR, context, mailbox, folder);
+ res = SQLPrepare(stmt, sql, SQL_NTS);
+ if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
+ SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+ goto yuck;
}
- closedir(vmdir);
+ res = odbc_smart_execute(obj, stmt);
+ if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
+ SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+ goto yuck;
+ }
+ res = SQLFetch(stmt);
+ if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ ast_log(LOG_WARNING, "SQL Fetch error!\n[%s]\n\n", sql);
+ SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+ goto yuck;
+ }
+ res = SQLGetData(stmt, 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);
+ if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ ast_log(LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
+ SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+ goto yuck;
+ }
+ nummsgs = atoi(rowdata);
+ SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+ } else
+ ast_log(LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
+
+yuck:
+ return nummsgs;
+}
+
+#else
+
+static int hasvoicemail_internal(const char *context, const char *mailbox, const char *folder)
+{
+ DIR *dir;
+ struct dirent *de;
+ char fn[256];
+ int count = 0;
+
+ if (ast_strlen_zero(folder))
+ folder = "INBOX";
+ if (ast_strlen_zero(context))
+ context = "default";
+ /* If no mailbox, return immediately */
+ if (ast_strlen_zero(mailbox))
+ return 0;
+ snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/%s", ast_config_AST_SPOOL_DIR, context, mailbox, folder);
+ dir = opendir(fn);
+ if (!dir)
+ return 0;
+ while ((de = readdir(dir))) {
+ if (!strncasecmp(de->d_name, "msg", 3) && !strcasecmp(de->d_name + 8, "txt"))
+ count++;
}
+ closedir(dir);
return count;
}
+#endif
static int hasvoicemail_exec(struct ast_channel *chan, void *data)
{
@@ -222,6 +296,31 @@ struct ast_custom_function acf_vmcount = {
.read = acf_vmcount_exec,
};
+static int load_config(void)
+{
+#ifdef USE_ODBC_STORAGE
+ struct ast_config *cfg;
+ char *tmp;
+ cfg = ast_config_load("voicemail.conf");
+ if (cfg) {
+ if (! (tmp = ast_variable_retrieve(cfg, "general", "odbcstorage")))
+ tmp = "asterisk";
+ ast_copy_string(odbc_database, tmp, sizeof(odbc_database));
+
+ if (! (tmp = ast_variable_retrieve(cfg, "general", "odbctable")))
+ tmp = "voicemessages";
+ ast_copy_string(odbc_table, tmp, sizeof(odbc_table));
+ ast_config_destroy(cfg);
+ }
+#endif
+ return 0;
+}
+
+int reload(void)
+{
+ return load_config();
+}
+
int unload_module(void)
{
int res;
@@ -238,7 +337,7 @@ int unload_module(void)
int load_module(void)
{
int res;
-
+ load_config();
res = ast_custom_function_register(&acf_vmcount);
res |= ast_register_application(app_hasvoicemail, hasvoicemail_exec, hasvoicemail_synopsis, hasvoicemail_descrip);
res |= ast_register_application(app_hasnewvoicemail, hasvoicemail_exec, hasnewvoicemail_synopsis, hasnewvoicemail_descrip);
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 891b51554..69996c8f7 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -96,7 +96,6 @@ static const char *descrip =
" 's' -- Present menu (user or admin) when '*' is received ('send' to menu)\n"
" 't' -- set talk only mode. (Talk only, no listening)\n"
" 'T' -- set talker detection (sent to manager interface and meetme list)\n"
-" 'v' -- video mode\n"
" 'w' -- wait until the marked user enters the conference\n"
" 'x' -- close the conference when last marked user exits\n"
" 'X' -- allow user to exit the conference by entering a valid single\n"
@@ -166,7 +165,7 @@ struct ast_conf_user {
int talking; /* Is user talking */
int zapchannel; /* Is a Zaptel channel */
char usrvalue[50]; /* Custom User Value */
- char namerecloc[AST_MAX_EXTENSION]; /* Name Recorded file Location */
+ char namerecloc[PATH_MAX]; /* Name Recorded file Location */
time_t jointime; /* Time the user joined the conference */
struct volume talk;
struct volume listen;
@@ -212,7 +211,7 @@ static void *recordthread(void *args);
#define CONFFLAG_STARMENU (1 << 4) /* If set asterisk will provide a menu to the user when '*' is pressed */
#define CONFFLAG_TALKER (1 << 5) /* If set the use can only send audio to the conference */
#define CONFFLAG_QUIET (1 << 6) /* If set there will be no enter or leave sounds */
-#define CONFFLAG_VIDEO (1 << 7) /* Set to enable video mode */
+#define CONFFLAG_ANNOUNCEUSERCOUNT (1 << 7) /* If set, when user joins the conference, they will be told the number of users that are already in */
#define CONFFLAG_AGI (1 << 8) /* Set to run AGI Script in Background */
#define CONFFLAG_MOH (1 << 9) /* Set to have music on hold when user is alone in conference */
#define CONFFLAG_MARKEDEXIT (1 << 10) /* If set the MeetMe will return if all marked with this flag left */
@@ -227,7 +226,6 @@ static void *recordthread(void *args);
#define CONFFLAG_EMPTY (1 << 19)
#define CONFFLAG_EMPTYNOPIN (1 << 20)
#define CONFFLAG_ALWAYSPROMPT (1 << 21)
-#define CONFFLAG_ANNOUNCEUSERCOUNT (1 << 22) /* If set, when user joins the conference, they will be told the number of users that are already in */
AST_APP_OPTIONS(meetme_opts, {
@@ -629,7 +627,7 @@ static int conf_cmd(int fd, int argc, char **argv) {
user->chan->name,
user->userflags & CONFFLAG_ADMIN ? "(Admin)" : "",
user->userflags & CONFFLAG_MONITOR ? "(Listen only)" : "",
- user->adminflags & ADMINFLAG_MUTED ? "(Admn Muted)" : "",
+ user->adminflags & ADMINFLAG_MUTED ? "(Admin Muted)" : "",
istalking(user->talking));
ast_cli(fd,"%d users in that conference.\n",cnf->users);
@@ -1071,7 +1069,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
if (!firstpass && !(confflags & CONFFLAG_MONITOR) && !(confflags & CONFFLAG_ADMIN)) {
firstpass = 1;
if (!(confflags & CONFFLAG_QUIET))
- if (!(confflags & CONFFLAG_WAITMARKED) || (conf->markedusers >= 1))
+ if (!(confflags & CONFFLAG_WAITMARKED) || ((confflags & CONFFLAG_MARKEDUSER) && (conf->markedusers >= 1)))
conf_play(chan, conf, ENTER);
}
diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c
index 2fe2d016a..f436d7cfa 100644
--- a/apps/app_osplookup.c
+++ b/apps/app_osplookup.c
@@ -216,31 +216,33 @@ static int ospnext_exec(struct ast_channel *chan, void *data)
cause = str2cause(args.cause);
temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
result.handle = -1;
- if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
- temp = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
- if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.numresults) != 1)) {
- result.numresults = 0;
- }
- if ((res = ast_osp_next(&result, cause)) > 0) {
- char tmp[80];
- snprintf(tmp, sizeof(tmp), "%d", result.handle);
- pbx_builtin_setvar_helper(chan, "_OSPHANDLE", tmp);
- pbx_builtin_setvar_helper(chan, "_OSPTECH", result.tech);
- pbx_builtin_setvar_helper(chan, "_OSPDEST", result.dest);
- pbx_builtin_setvar_helper(chan, "_OSPTOKEN", result.token);
- snprintf(tmp, sizeof(tmp), "%d", result.numresults);
- pbx_builtin_setvar_helper(chan, "_OSPRESULTS", tmp);
- pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "SUCCESS");
- }
+ if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.handle) != 1)) {
+ result.handle = -1;
+ }
+ temp = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
+ if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.numresults) != 1)) {
+ result.numresults = 0;
+ }
+ if ((res = ast_osp_next(&result, cause)) > 0) {
+ char tmp[80];
+ snprintf(tmp, sizeof(tmp), "%d", result.handle);
+ pbx_builtin_setvar_helper(chan, "_OSPHANDLE", tmp);
+ pbx_builtin_setvar_helper(chan, "_OSPTECH", result.tech);
+ pbx_builtin_setvar_helper(chan, "_OSPDEST", result.dest);
+ pbx_builtin_setvar_helper(chan, "_OSPTOKEN", result.token);
+ snprintf(tmp, sizeof(tmp), "%d", result.numresults);
+ pbx_builtin_setvar_helper(chan, "_OSPRESULTS", tmp);
+ pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "SUCCESS");
} else {
if (!res) {
if (result.handle < 0)
ast_log(LOG_NOTICE, "OSP Lookup Next failed for handle '%d'\n", result.handle);
else
ast_log(LOG_DEBUG, "No OSP handle specified\n");
- pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "FAILED");
} else
ast_log(LOG_DEBUG, "Got hangup on '%s' while doing OSP Next!\n", chan->name);
+
+ pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "FAILED");
}
if (!res) {
/* Look for a "busy" place */
diff --git a/apps/app_queue.c b/apps/app_queue.c
index a35a3ee19..53929b309 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -303,6 +303,13 @@ struct member {
struct member *next; /*!< Next member */
};
+struct ast_member_interfaces {
+ char interface[80];
+ AST_LIST_ENTRY(ast_member_interfaces) list; /*!< Next call queue */
+};
+
+static AST_LIST_HEAD_STATIC(interfaces, ast_member_interfaces);
+
/* values used in multi-bit flags in ast_call_queue */
#define QUEUE_EMPTY_NORMAL 1
#define QUEUE_EMPTY_STRICT 2
@@ -431,6 +438,8 @@ static enum queue_member_status get_member_status(const struct ast_call_queue *q
enum queue_member_status result = QUEUE_NO_MEMBERS;
for (member = q->members; member; member = member->next) {
+ if (member->paused) continue;
+
switch (member->status) {
case AST_DEVICE_INVALID:
/* nothing to do */
@@ -456,6 +465,7 @@ static void *changethread(void *data)
struct ast_call_queue *q;
struct statechange *sc = data;
struct member *cur;
+ struct ast_member_interfaces *curint;
char *loc;
char *technology;
@@ -468,36 +478,50 @@ static void *changethread(void *data)
free(sc);
return NULL;
}
- if (option_debug)
- ast_log(LOG_DEBUG, "Device '%s/%s' changed to state '%d' (%s)\n", technology, loc, sc->state, devstate2str(sc->state));
- ast_mutex_lock(&qlock);
- for (q = queues; q; q = q->next) {
- ast_mutex_lock(&q->lock);
- cur = q->members;
- while(cur) {
- if (!strcasecmp(sc->dev, cur->interface)) {
- if (cur->status != sc->state) {
- cur->status = sc->state;
- if (!q->maskmemberstatus) {
- manager_event(EVENT_FLAG_AGENT, "QueueMemberStatus",
- "Queue: %s\r\n"
- "Location: %s\r\n"
- "Membership: %s\r\n"
- "Penalty: %d\r\n"
- "CallsTaken: %d\r\n"
- "LastCall: %d\r\n"
- "Status: %d\r\n"
- "Paused: %d\r\n",
- q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
- cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
+
+ AST_LIST_LOCK(&interfaces);
+ AST_LIST_TRAVERSE(&interfaces, curint, list) {
+ if (!strcasecmp(curint->interface, sc->dev))
+ break;
+ }
+ AST_LIST_UNLOCK(&interfaces);
+
+ if (curint) {
+
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Device '%s/%s' changed to state '%d' (%s)\n", technology, loc, sc->state, devstate2str(sc->state));
+ ast_mutex_lock(&qlock);
+ for (q = queues; q; q = q->next) {
+ ast_mutex_lock(&q->lock);
+ cur = q->members;
+ while(cur) {
+ if (!strcasecmp(sc->dev, cur->interface)) {
+ if (cur->status != sc->state) {
+ cur->status = sc->state;
+ if (!q->maskmemberstatus) {
+ manager_event(EVENT_FLAG_AGENT, "QueueMemberStatus",
+ "Queue: %s\r\n"
+ "Location: %s\r\n"
+ "Membership: %s\r\n"
+ "Penalty: %d\r\n"
+ "CallsTaken: %d\r\n"
+ "LastCall: %d\r\n"
+ "Status: %d\r\n"
+ "Paused: %d\r\n",
+ q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
+ cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
+ }
}
}
+ cur = cur->next;
}
- cur = cur->next;
+ ast_mutex_unlock(&q->lock);
}
- ast_mutex_unlock(&q->lock);
- }
- ast_mutex_unlock(&qlock);
+ ast_mutex_unlock(&qlock);
+ } else {
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Device '%s/%s' changed to state '%d' (%s) but we don't care because they're not a member of any queue.\n", technology, loc, sc->state, devstate2str(sc->state));
+ }
free(sc);
return NULL;
}
@@ -594,6 +618,99 @@ static void clear_queue(struct ast_call_queue *q)
q->wrapuptime = 0;
}
+static int add_to_interfaces(char *interface)
+{
+ struct ast_member_interfaces *curint, *newint;
+
+ if (!interface)
+ return 0;
+
+ AST_LIST_LOCK(&interfaces);
+ AST_LIST_TRAVERSE(&interfaces, curint, list) {
+ if (!strcasecmp(curint->interface, interface))
+ break;
+ }
+
+ if (!curint) {
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Adding %s to the list of interfaces that make up all of our queue members.\n", interface);
+
+ if ((newint = malloc(sizeof(*newint)))) {
+ memset(newint, 0, sizeof(*newint));
+ ast_copy_string(newint->interface, interface, sizeof(newint->interface));
+ AST_LIST_INSERT_HEAD(&interfaces, newint, list);
+ }
+ }
+ AST_LIST_UNLOCK(&interfaces);
+
+ return 0;
+}
+
+static int interface_exists_global(char *interface)
+{
+ struct ast_call_queue *q;
+ struct member *mem;
+ int ret = 0;
+
+ if (!interface)
+ return ret;
+
+ ast_mutex_lock(&qlock);
+ for (q = queues; q && !ret; q = q->next) {
+ ast_mutex_lock(&q->lock);
+ mem = q->members;
+ while(mem) {
+ if (!strcasecmp(interface, mem->interface)) {
+ ret = 1;
+ break;
+ }
+ mem = mem->next;
+ }
+ ast_mutex_unlock(&q->lock);
+ }
+ ast_mutex_unlock(&qlock);
+
+ return ret;
+}
+
+
+static int remove_from_interfaces(char *interface)
+{
+ struct ast_member_interfaces *curint;
+
+ if (!interface)
+ return 0;
+
+ AST_LIST_LOCK(&interfaces);
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&interfaces, curint, list) {
+ if (!strcasecmp(curint->interface, interface) && !interface_exists_global(interface)) {
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Removing %s from the list of interfaces that make up all of our queue members.\n", interface);
+ AST_LIST_REMOVE_CURRENT(&interfaces, list);
+ free(curint);
+ }
+ }
+ AST_LIST_TRAVERSE_SAFE_END;
+ AST_LIST_UNLOCK(&interfaces);
+
+ return 0;
+}
+
+static void clear_and_free_interfaces(void)
+{
+ struct ast_member_interfaces *curint;
+
+ AST_LIST_LOCK(&interfaces);
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&interfaces, curint, list) {
+ AST_LIST_REMOVE_CURRENT(&interfaces, list);
+ free(curint);
+ }
+ AST_LIST_TRAVERSE_SAFE_END;
+ AST_LIST_UNLOCK(&interfaces);
+
+ return;
+}
+
/*! \brief Configure a queue parameter.
\par
For error reporting, line number is passed for .conf static configuration.
@@ -744,6 +861,7 @@ static void rt_handle_member_record(struct ast_call_queue *q, char *interface, c
m = create_queue_member(interface, penalty, 0);
if (m) {
m->dead = 0;
+ add_to_interfaces(interface);
if (prev_m) {
prev_m->next = m;
} else {
@@ -768,6 +886,7 @@ static void free_members(struct ast_call_queue *q, int all)
prev->next = next;
else
q->members = next;
+ remove_from_interfaces(curm->interface);
free(curm);
} else
prev = curm;
@@ -915,6 +1034,7 @@ static struct ast_call_queue *find_queue_by_name_rt(const char *queuename, struc
} else {
q->members = next_m;
}
+ remove_from_interfaces(m->interface);
free(m);
} else {
prev_m = m;
@@ -1031,9 +1151,9 @@ static int join_queue(char *queuename, struct queue_ent *qe, enum queue_result *
qe->chan->cid.cid_num ? qe->chan->cid.cid_num : "unknown",
qe->chan->cid.cid_name ? qe->chan->cid.cid_name : "unknown",
q->name, qe->pos, q->count );
-#if 0
-ast_log(LOG_NOTICE, "Queue '%s' Join, Channel '%s', Position '%d'\n", q->name, qe->chan->name, qe->pos );
-#endif
+
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Queue '%s' Join, Channel '%s', Position '%d'\n", q->name, qe->chan->name, qe->pos );
}
ast_mutex_unlock(&q->lock);
ast_mutex_unlock(&qlock);
@@ -1179,13 +1299,16 @@ static int say_position(struct queue_ent *qe)
ast_verbose(VERBOSE_PREFIX_3 "Told %s in %s their queue position (which was %d)\n",
qe->chan->name, qe->parent->name, qe->pos);
res = play_file(qe->chan, qe->parent->sound_thanks);
+ if (res && !valid_exit(qe, res))
+ res = 0;
playout:
/* Set our last_pos indicators */
qe->last_pos = now;
qe->last_pos_said = qe->pos;
+
/* Don't restart music on hold if we're about to exit the caller from the queue */
- if (res)
+ if (!res)
ast_moh_start(qe->chan, qe->moh);
return res;
@@ -1554,7 +1677,7 @@ static int background_file(struct queue_ent *qe, struct ast_channel *chan, char
if (!res) {
/* Wait for a keypress */
res = ast_waitstream(chan, AST_DIGIT_ANY);
- if (res <= 0 || !valid_exit(qe, res))
+ if (res < 0 || !valid_exit(qe, res))
res = 0;
/* Stop playback */
@@ -1592,8 +1715,9 @@ static int say_periodic_announcement(struct queue_ent *qe)
/* play the announcement */
res = background_file(qe, qe->chan, qe->parent->sound_periodicannounce);
- /* Resume Music on Hold */
- ast_moh_start(qe->chan, qe->moh);
+ /* Resume Music on Hold if the caller is going to stay in the queue */
+ if (!res)
+ ast_moh_start(qe->chan, qe->moh);
/* update last_periodic_announce_time */
qe->last_periodic_announce_time = now;
@@ -1918,18 +2042,17 @@ static int wait_our_turn(struct queue_ent *qe, int ringing, enum queue_result *r
}
/* Make a position announcement, if enabled */
- if (qe->parent->announcefrequency && !ringing)
- res = say_position(qe);
- if (res)
+ if (qe->parent->announcefrequency && !ringing &&
+ (res = say_position(qe)))
break;
/* Make a periodic announcement, if enabled */
- if (qe->parent->periodicannouncefrequency && !ringing)
- res = say_periodic_announcement(qe);
+ if (qe->parent->periodicannouncefrequency && !ringing &&
+ (res = say_periodic_announcement(qe)))
+ break;
/* Wait a second before checking again */
- if (!res) res = ast_waitfordigit(qe->chan, RECHECK * 1000);
- if (res)
+ if ((res = ast_waitfordigit(qe->chan, RECHECK * 1000)))
break;
}
return res;
@@ -2123,10 +2246,10 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
cur = cur->next;
}
- if (qe->parent->timeout)
- to = qe->parent->timeout * 1000;
- else
- to = -1;
+ if (qe->expire && (!qe->parent->timeout || (qe->expire - now) <= qe->parent->timeout))
+ to = (qe->expire - now) * 1000;
+ else
+ to = (qe->parent->timeout) ? qe->parent->timeout * 1000 : -1;
ring_one(qe, outgoing, &numbusies);
ast_mutex_unlock(&qe->parent->lock);
if (use_weight)
@@ -2228,7 +2351,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
if (res < 0) {
ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "SYSCOMPAT", "%s", "");
ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", qe->chan->name, peer->name);
- record_abandoned(qe);
+ record_abandoned(qe);
ast_hangup(peer);
return -1;
}
@@ -2305,13 +2428,10 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
(long)(time(NULL) - callstart));
}
- if(bridge != AST_PBX_NO_HANGUP_PEER)
+ if (bridge != AST_PBX_NO_HANGUP_PEER)
ast_hangup(peer);
update_queue(qe->parent, member);
- if (bridge == 0)
- res = 1; /* JDG: bridge successfull, leave app_queue */
- else
- res = bridge; /* bridge error, stay in the queue */
+ res = bridge ? -1 : 0;
}
out:
hangupcalls(outgoing, NULL);
@@ -2419,6 +2539,8 @@ static int remove_from_queue(char *queuename, char *interface)
}
ast_mutex_unlock(&q->lock);
}
+ if (res == RES_OKAY)
+ remove_from_interfaces(interface);
ast_mutex_unlock(&qlock);
return res;
}
@@ -2438,6 +2560,9 @@ static int add_to_queue(char *queuename, char *interface, int penalty, int pause
if (q) {
ast_mutex_lock(&q->lock);
if (interface_exists(q, interface) == NULL) {
+
+ add_to_interfaces(interface);
+
new_member = create_queue_member(interface, penalty, paused);
if (new_member != NULL) {
@@ -2989,9 +3114,8 @@ check_turns:
if (makeannouncement) {
/* Make a position announcement, if enabled */
- if (qe.parent->announcefrequency && !ringing)
- res = say_position(&qe);
- if (res) {
+ if (qe.parent->announcefrequency && !ringing &&
+ (res = say_position(&qe))) {
ast_queue_log(queuename, chan->uniqueid, "NONE", "EXITWITHKEY", "%s|%d", qe.digits, qe.pos);
break;
}
@@ -3000,10 +3124,8 @@ check_turns:
makeannouncement = 1;
/* Make a periodic announcement, if enabled */
- if (qe.parent->periodicannouncefrequency && !ringing)
- res = say_periodic_announcement(&qe);
-
- if (res && valid_exit(&qe, res)) {
+ if (qe.parent->periodicannouncefrequency && !ringing &&
+ (res = say_periodic_announcement(&qe))) {
ast_queue_log(queuename, chan->uniqueid, "NONE", "EXITWITHKEY", "%c|%d", res, qe.pos);
break;
}
@@ -3016,8 +3138,9 @@ check_turns:
record_abandoned(&qe);
ast_queue_log(queuename, chan->uniqueid, "NONE", "ABANDON", "%d|%d|%ld", qe.pos, qe.opos, (long)time(NULL) - qe.start);
}
- } else if (res > 0)
+ } else if (valid_exit(&qe, res)) {
ast_queue_log(queuename, chan->uniqueid, "NONE", "EXITWITHKEY", "%s|%d", qe.digits, qe.pos);
+ }
break;
}
@@ -3080,7 +3203,7 @@ check_turns:
if (!is_our_turn(&qe)) {
if (option_debug)
ast_log(LOG_DEBUG, "Darn priorities, going back in queue (%s)!\n",
- qe.chan->name);
+ qe.chan->name);
goto check_turns;
}
}
@@ -3251,6 +3374,8 @@ static void reload_queues(void)
}
free(cur);
} else {
+ /* Add them to the master int list if necessary */
+ add_to_interfaces(interface);
newm->next = q->members;
q->members = newm;
}
@@ -3275,6 +3400,7 @@ static void reload_queues(void)
q->members = cur->next;
newm = cur;
}
+ remove_from_interfaces(cur->interface);
}
}
if (!new)
@@ -3827,6 +3953,7 @@ int unload_module(void)
{
int res;
+ clear_and_free_interfaces();
res = ast_cli_unregister(&cli_show_queue);
res |= ast_cli_unregister(&cli_show_queues);
res |= ast_cli_unregister(&cli_add_queue_member);
diff --git a/apps/app_sms.c b/apps/app_sms.c
index 4c15cc185..beaf4e2a1 100644
--- a/apps/app_sms.c
+++ b/apps/app_sms.c
@@ -1178,25 +1178,24 @@ static void sms_messagetx(sms_t * h)
static int sms_generate (struct ast_channel *chan, void *data, int len, int samples)
{
struct ast_frame f = { 0 };
- unsigned char waste[AST_FRIENDLY_OFFSET];
+#define MAXSAMPLES 800
#ifdef OUTALAW
- unsigned char buf[800];
+ unsigned char *buf;
#else
- signed short buf[800];
+ short *buf;
#endif
+#define SAMPLE2LEN sizeof(*buf)
sms_t *h = data;
int i;
- if (len > sizeof (buf)) {
- ast_log (LOG_WARNING, "Only doing %d bytes (%d bytes requested)\n", (int)(sizeof (buf) / sizeof (signed short)), len);
- len = sizeof (buf);
-#ifdef OUTALAW
- samples = len;
-#else
- samples = len / 2;
-#endif
+ if (samples > MAXSAMPLES) {
+ ast_log (LOG_WARNING, "Only doing %d samples (%d requested)\n",
+ MAXSAMPLES, samples);
+ samples = MAXSAMPLES;
}
- waste[0] = 0; /* make compiler happy */
+ len = samples * SAMPLE2LEN + AST_FRIENDLY_OFFSET;
+ buf = alloca(len);
+
f.frametype = AST_FRAME_VOICE;
#ifdef OUTALAW
f.subclass = AST_FORMAT_ALAW;
@@ -1206,8 +1205,7 @@ static int sms_generate (struct ast_channel *chan, void *data, int len, int samp
f.datalen = samples * 2;
#endif
f.offset = AST_FRIENDLY_OFFSET;
- f.mallocd = 0;
- f.data = buf;
+ f.data = buf + AST_FRIENDLY_OFFSET;
f.samples = samples;
f.src = "app_sms";
/* create a buffer containing the digital sms pattern */
diff --git a/apps/app_sql_postgres.c b/apps/app_sql_postgres.c
index d9ba1bfb7..6f554a677 100644
--- a/apps/app_sql_postgres.c
+++ b/apps/app_sql_postgres.c
@@ -132,7 +132,7 @@ struct ast_PGSQL_id {
AST_LIST_ENTRY(ast_PGSQL_id) entries;
} *ast_PGSQL_id;
-AST_LIST_HEAD(PGSQLidshead,ast_PGSQL_id) PGSQLidshead;
+static AST_LIST_HEAD_STATIC(PGSQLidshead,ast_PGSQL_id);
static void *find_identifier(int identifier,int identifier_type) {
struct PGSQLidshead *headp;
@@ -551,11 +551,6 @@ int unload_module(void)
int load_module(void)
{
- struct PGSQLidshead *headp;
-
- headp=&PGSQLidshead;
-
- AST_LIST_HEAD_INIT(headp);
return ast_register_application(app, PGSQL_exec, synopsis, descrip);
}
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 017c75c38..b595944f2 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2006,7 +2006,7 @@ static char *mbox(int id)
#ifdef USE_ODBC_STORAGE
static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
{
- int x = 0;
+ int x = -1;
int res;
SQLHSTMT stmt;
char sql[256];
@@ -2018,6 +2018,7 @@ static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
*newmsgs = 0;
if (oldmsgs)
*oldmsgs = 0;
+
/* If no mailbox, return immediately */
if (ast_strlen_zero(mailbox))
return 0;
@@ -2099,7 +2100,7 @@ static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
}
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
*oldmsgs = atoi(rowdata);
- x = 1;
+ x = 0;
} else
ast_log(LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
@@ -2364,17 +2365,17 @@ struct leave_vm_options {
static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_options *options)
{
- char tmptxtfile[256], txtfile[256];
+ char txtfile[256], tmptxtfile[256];
char callerid[256];
FILE *txt;
- int res = 0;
+ int res = 0, txtdes;
int msgnum;
int duration = 0;
int ausemacro = 0;
int ousemacro = 0;
int ouseexten = 0;
char date[256];
- char dir[256];
+ char dir[256], tmpdir[260];
char fn[256];
char prefile[256]="";
char tempfile[256]="";
@@ -2429,6 +2430,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
DISPOSE(tempfile, -1);
/* It's easier just to try to make it than to check for its existence */
create_dirpath(dir, sizeof(dir), vmu->context, ext, "INBOX");
+ create_dirpath(tmpdir, sizeof(tmpdir), vmu->context, ext, "tmp");
/* Check current or macro-calling context for special extensions */
if (ast_test_flag(vmu, VM_OPERATOR)) {
@@ -2535,22 +2537,25 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
if (!ast_strlen_zero(fmt)) {
msgnum = 0;
- if (vm_lock_path(dir)) {
- free_user(vmu);
- return ERROR_LOCK_PATH;
+ if (count_messages(vmu, dir) >= vmu->maxmsg) {
+ res = ast_streamfile(chan, "vm-mailboxfull", chan->language);
+ if (!res)
+ res = ast_waitstream(chan, "");
+ ast_log(LOG_WARNING, "No more messages possible\n");
+ pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
+ goto leave_vm_out;
}
- /*
- * This operation can be very expensive if done say over NFS or if the mailbox has 100+ messages
- * in the mailbox. So we should get this first so we don't cut off the first few seconds of the
- * message.
- */
- do {
- make_file(fn, sizeof(fn), dir, msgnum);
- if (!EXISTS(dir,msgnum,fn,chan->language))
- break;
- msgnum++;
- } while (msgnum < vmu->maxmsg);
+ snprintf(tmptxtfile, sizeof(tmptxtfile), "%s/XXXXXX", tmpdir);
+ txtdes = mkstemp(tmptxtfile);
+ if (txtdes < 0) {
+ res = ast_streamfile(chan, "vm-mailboxfull", chan->language);
+ if (!res)
+ res = ast_waitstream(chan, "");
+ ast_log(LOG_ERROR, "Unable to create message file: %s\n", strerror(errno));
+ pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
+ goto leave_vm_out;
+ }
/* Now play the beep once we have the message number for our next message. */
if (res >= 0) {
@@ -2559,101 +2564,104 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
if (!res)
res = ast_waitstream(chan, "");
}
- if (msgnum < vmu->maxmsg) {
- /* assign a variable with the name of the voicemail file */
- pbx_builtin_setvar_helper(chan, "VM_MESSAGEFILE", fn);
-
- /* Store information */
- snprintf(txtfile, sizeof(txtfile), "%s.txt", fn);
- snprintf(tmptxtfile, sizeof(tmptxtfile), "%s.txt.tmp", fn);
- txt = fopen(tmptxtfile, "w+");
- if (txt) {
- get_date(date, sizeof(date));
- fprintf(txt,
- ";\n"
- "; Message Information file\n"
- ";\n"
- "[message]\n"
- "origmailbox=%s\n"
- "context=%s\n"
- "macrocontext=%s\n"
- "exten=%s\n"
- "priority=%d\n"
- "callerchan=%s\n"
- "callerid=%s\n"
- "origdate=%s\n"
- "origtime=%ld\n"
- "category=%s\n",
- ext,
- chan->context,
- chan->macrocontext,
- chan->exten,
- chan->priority,
- chan->name,
- ast_callerid_merge(callerid, sizeof(callerid), chan->cid.cid_name, chan->cid.cid_num, "Unknown"),
- date, (long)time(NULL),
- category ? category : "");
- } else
- ast_log(LOG_WARNING, "Error opening text file for output\n");
- res = play_record_review(chan, NULL, fn, vmmaxmessage, fmt, 1, vmu, &duration, dir, options->record_gain);
- if (res == '0') {
- if (txt && EXISTS(dir,msgnum,fn,chan->language)) {
- fclose(txt);
- rename(tmptxtfile, txtfile);
- } else if (txt && !EXISTS(dir,msgnum,fn,chan->language)) {
- if (option_debug)
- ast_log(LOG_DEBUG, "The recorded media file is gone, so we should remove the .txt file too!\n");
- fclose(txt);
- unlink(tmptxtfile);
- }
- goto transfer;
- }
- if (res > 0)
- res = 0;
- if (txt) {
- fprintf(txt, "duration=%d\n", duration);
- fclose(txt);
- rename(tmptxtfile, txtfile);
- }
-
+
+ /* Store information */
+ txt = fdopen(txtdes, "w+");
+ if (txt) {
+ get_date(date, sizeof(date));
+ fprintf(txt,
+ ";\n"
+ "; Message Information file\n"
+ ";\n"
+ "[message]\n"
+ "origmailbox=%s\n"
+ "context=%s\n"
+ "macrocontext=%s\n"
+ "exten=%s\n"
+ "priority=%d\n"
+ "callerchan=%s\n"
+ "callerid=%s\n"
+ "origdate=%s\n"
+ "origtime=%ld\n"
+ "category=%s\n",
+ ext,
+ chan->context,
+ chan->macrocontext,
+ chan->exten,
+ chan->priority,
+ chan->name,
+ ast_callerid_merge(callerid, sizeof(callerid), chan->cid.cid_name, chan->cid.cid_num, "Unknown"),
+ date, (long)time(NULL),
+ category ? category : "");
+ } else
+ ast_log(LOG_WARNING, "Error opening text file for output\n");
+ res = play_record_review(chan, NULL, tmptxtfile, vmmaxmessage, fmt, 1, vmu, &duration, NULL, options->record_gain);
+
+ if (txt) {
if (duration < vmminmessage) {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Recording was %d seconds long but needs to be at least %d - abandoning\n", duration, vmminmessage);
DELETE(dir,msgnum,fn);
- /* XXX We should really give a prompt too short/option start again, with leave_vm_out called only after a timeout XXX */
- pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
- goto leave_vm_out;
- }
- /* Are there to be more recipients of this message? */
- while (tmpptr) {
- struct ast_vm_user recipu, *recip;
- char *exten, *context;
-
- exten = strsep(&tmpptr, "&");
- context = strchr(exten, '@');
- if (context) {
- *context = '\0';
- context++;
- }
- if ((recip = find_user(&recipu, context, exten))) {
- copy_message(chan, vmu, 0, msgnum, duration, recip, fmt);
- free_user(recip);
+ } else {
+ fprintf(txt, "duration=%d\n", duration);
+ fclose(txt);
+ if (vm_lock_path(dir)) {
+ ast_log(LOG_ERROR, "Couldn't lock directory %s. Voicemail will be lost.\n", dir);
+ /* Delete files */
+ ast_filedelete(tmptxtfile, NULL);
+ unlink(tmptxtfile);
+ } else {
+ for (;;) {
+ make_file(fn, sizeof(fn), dir, msgnum);
+ if (!EXISTS(dir, msgnum, fn, NULL))
+ break;
+ msgnum++;
+ }
+
+ /* assign a variable with the name of the voicemail file */
+ pbx_builtin_setvar_helper(chan, "VM_MESSAGEFILE", fn);
+
+ snprintf(txtfile, sizeof(txtfile), "%s.txt", fn);
+ ast_filerename(tmptxtfile, fn, NULL);
+ rename(tmptxtfile, txtfile);
+
+ ast_unlock_path(dir);
+
+ /* Are there to be more recipients of this message? */
+ while (tmpptr) {
+ struct ast_vm_user recipu, *recip;
+ char *exten, *context;
+
+ exten = strsep(&tmpptr, "&");
+ context = strchr(exten, '@');
+ if (context) {
+ *context = '\0';
+ context++;
+ }
+ if ((recip = find_user(&recipu, context, exten))) {
+ copy_message(chan, vmu, 0, msgnum, duration, recip, fmt);
+ free_user(recip);
+ }
+ }
+ if (ast_fileexists(fn, NULL, NULL)) {
+ STORE(dir, vmu->mailbox, vmu->context, msgnum);
+ notify_new_message(chan, vmu, msgnum, duration, fmt, chan->cid.cid_num, chan->cid.cid_name);
+ DISPOSE(dir, msgnum);
+ }
}
}
- if (ast_fileexists(fn, NULL, NULL)) {
- STORE(dir, vmu->mailbox, vmu->context, msgnum);
- notify_new_message(chan, vmu, msgnum, duration, fmt, chan->cid.cid_num, chan->cid.cid_name);
- DISPOSE(dir, msgnum);
- }
- pbx_builtin_setvar_helper(chan, "VMSTATUS", "SUCCESS");
- } else {
- ast_unlock_path(dir);
- res = ast_streamfile(chan, "vm-mailboxfull", chan->language);
- if (!res)
- res = ast_waitstream(chan, "");
- ast_log(LOG_WARNING, "No more messages possible\n");
- pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
}
+
+ if (res == '0') {
+ goto transfer;
+ } else if (res > 0)
+ res = 0;
+
+ if (duration < vmminmessage)
+ /* XXX We should really give a prompt too short/option start again, with leave_vm_out called only after a timeout XXX */
+ pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");
+ else
+ pbx_builtin_setvar_helper(chan, "VMSTATUS", "SUCCESS");
} else
ast_log(LOG_WARNING, "No format for saving voicemail?\n");
leave_vm_out:
@@ -5302,7 +5310,7 @@ static int vm_execmain(struct ast_channel *chan, void *data)
case '5': /* Leave VoiceMail */
if (ast_test_flag(vmu, VM_SVMAIL)) {
- cmd = forward_message(chan, context, vms.curdir, vms.curmsg, vmu, vmfmts, 1, record_gain);
+ cmd = forward_message(chan, vmu->context, vms.curdir, vms.curmsg, vmu, vmfmts, 1, record_gain);
if (cmd == ERROR_LOCK_PATH) {
res = cmd;
goto out;
@@ -5383,7 +5391,7 @@ static int vm_execmain(struct ast_channel *chan, void *data)
case '8':
if (vms.lastmsg > -1) {
- cmd = forward_message(chan, context, vms.curdir, vms.curmsg, vmu, vmfmts, 0, record_gain);
+ cmd = forward_message(chan, vmu->context, vms.curdir, vms.curmsg, vmu, vmfmts, 0, record_gain);
if (cmd == ERROR_LOCK_PATH) {
res = cmd;
goto out;
@@ -5530,7 +5538,7 @@ static int vm_exec(struct ast_channel *chan, void *data)
LOCAL_USER_REMOVE(u);
return -1;
}
- ast_copy_flags(&leave_options, &flags, OPT_SILENT | OPT_BUSY_GREETING | OPT_UNAVAIL_GREETING);
+ ast_copy_flags(&leave_options, &flags, OPT_SILENT | OPT_BUSY_GREETING | OPT_UNAVAIL_GREETING | OPT_PRIORITY_JUMP);
if (ast_test_flag(&flags, OPT_RECORDGAIN)) {
int gain;
@@ -6513,20 +6521,21 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
res = ast_play_and_wait(chan, "vm-star-cancel");
if (!res)
res = ast_waitfordigit(chan, 6000);
- if (!res)
+ if (!res) {
retries++;
- if (retries > 3)
- res = 't';
- break;
-
+ if (retries > 3)
+ res = 't';
}
- if (res == 't')
- res = 0;
- else if (res == '*')
- res = -1;
+ break;
+
}
+ if (res == 't')
+ res = 0;
+ else if (res == '*')
+ res = -1;
}
-
+ }
+
}
else if (option == 1) { /* Reply */
/* Send reply directly to sender */
diff --git a/apps/app_waitforsilence.c b/apps/app_waitforsilence.c
index 615eddbce..64839f352 100644
--- a/apps/app_waitforsilence.c
+++ b/apps/app_waitforsilence.c
@@ -69,7 +69,7 @@ static int do_waiting(struct ast_channel *chan, int maxsilence) {
int totalsilence = 0;
int dspsilence = 0;
int gotsilence = 0;
- static int silencethreshold = 64;
+ static int silencethreshold = 128;
int rfmt = 0;
int res = 0;
struct ast_dsp *sildet; /* silence detector dsp */
diff --git a/asterisk.c b/asterisk.c
index 334d322df..c0605f036 100644
--- a/asterisk.c
+++ b/asterisk.c
@@ -1803,13 +1803,17 @@ static void ast_remotecontrol(char * data)
if (option_exec && data) { /* hack to print output then exit if asterisk -rx is used */
char tempchar;
+#ifdef __Darwin__
struct pollfd fds[0];
fds[0].fd = ast_consock;
fds[0].events = POLLIN;
fds[0].revents = 0;
- while(poll(fds, 1, 100) > 0) {
+ while (poll(fds, 1, 100) > 0) {
ast_el_read_char(el, &tempchar);
}
+#else
+ while (!ast_el_read_char(el, &tempchar));
+#endif
return;
}
for(;;) {
diff --git a/channel.c b/channel.c
index ae4c747e4..77ad5f34e 100644
--- a/channel.c
+++ b/channel.c
@@ -1950,10 +1950,12 @@ struct ast_frame *ast_read(struct ast_channel *chan)
chan->dtmfq[strlen(chan->dtmfq)] = f->subclass;
else
ast_log(LOG_WARNING, "Dropping deferred DTMF digits on %s\n", chan->name);
+ ast_frfree(f);
f = &null_frame;
} else if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_ANSWER)) {
if (prestate == AST_STATE_UP) {
ast_log(LOG_DEBUG, "Dropping duplicate answer!\n");
+ ast_frfree(f);
f = &null_frame;
}
/* Answer the CDR */
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index a1ce6907b..d113a89ac 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -464,7 +464,10 @@ struct chan_iax2_pvt {
int maxtime;
/*! Peer Address */
struct sockaddr_in addr;
+ /*! Actual used codec preferences */
struct ast_codec_pref prefs;
+ /*! Requested codec preferences */
+ struct ast_codec_pref rprefs;
/*! Our call number */
unsigned short callno;
/*! Peer callno */
@@ -4755,9 +4758,12 @@ static int check_access(int callno, struct sockaddr_in *sin, struct iax_ies *ies
if (ies->version)
version = ies->version;
- if(ies->codec_prefs)
+ /* Use provided preferences until told otherwise for actual preferences */
+ if(ies->codec_prefs) {
+ ast_codec_pref_convert(&iaxs[callno]->rprefs, ies->codec_prefs, 32, 0);
ast_codec_pref_convert(&iaxs[callno]->prefs, ies->codec_prefs, 32, 0);
-
+ }
+
if (!gotcapability)
iaxs[callno]->peercapability = iaxs[callno]->peerformat;
if (version > IAX_PROTO_VERSION) {
@@ -6279,8 +6285,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
struct ast_iax2_meta_trunk_hdr *mth;
struct ast_iax2_meta_trunk_entry *mte;
struct ast_iax2_meta_trunk_mini *mtm;
- char dblbuf[4096]; /* Declaration of dblbuf must immediately *preceed* fr on the stack */
- struct iax_frame fr;
+ struct iax_frame *fr;
struct iax_frame *cur;
char iabuf[INET_ADDRSTRLEN];
struct ast_frame f;
@@ -6299,11 +6304,12 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
struct iax_frame *duped_fr;
char host_pref_buf[128];
char caller_pref_buf[128];
- struct ast_codec_pref pref,rpref;
+ struct ast_codec_pref pref;
char *using_prefs = "mine";
- dblbuf[0] = 0; /* Keep GCC from whining */
- fr.callno = 0;
+ /* allocate an iax_frame with 4096 bytes of data buffer */
+ fr = alloca(sizeof(*fr) + 4096);
+ fr->callno = 0;
res = recvfrom(fd, buf, sizeof(buf), 0,(struct sockaddr *) &sin, &len);
if (res < 0) {
@@ -6323,7 +6329,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
}
if ((vh->zeros == 0) && (ntohs(vh->callno) & 0x8000)) {
/* This is a video frame, get call number */
- fr.callno = find_callno(ntohs(vh->callno) & ~0x8000, dcallno, &sin, new, 1, fd);
+ fr->callno = find_callno(ntohs(vh->callno) & ~0x8000, dcallno, &sin, new, 1, fd);
minivid = 1;
} else if (meta->zeros == 0) {
unsigned char metatype;
@@ -6374,16 +6380,16 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
/* Stop if we don't have enough data */
if (len > res)
break;
- fr.callno = find_callno(callno & ~IAX_FLAG_FULL, 0, &sin, NEW_PREVENT, 1, fd);
- if (fr.callno) {
- ast_mutex_lock(&iaxsl[fr.callno]);
+ fr->callno = find_callno(callno & ~IAX_FLAG_FULL, 0, &sin, NEW_PREVENT, 1, fd);
+ if (fr->callno) {
+ ast_mutex_lock(&iaxsl[fr->callno]);
/* If it's a valid call, deliver the contents. If not, we
drop it, since we don't have a scallno to use for an INVAL */
/* Process as a mini frame */
f.frametype = AST_FRAME_VOICE;
- if (iaxs[fr.callno]) {
- if (iaxs[fr.callno]->voiceformat > 0) {
- f.subclass = iaxs[fr.callno]->voiceformat;
+ if (iaxs[fr->callno]) {
+ if (iaxs[fr->callno]->voiceformat > 0) {
+ f.subclass = iaxs[fr->callno]->voiceformat;
f.datalen = len;
if (f.datalen >= 0) {
if (f.datalen)
@@ -6391,11 +6397,11 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
else
f.data = NULL;
if(trunked_ts) {
- fr.ts = (iaxs[fr.callno]->last & 0xFFFF0000L) | (trunked_ts & 0xffff);
+ fr->ts = (iaxs[fr->callno]->last & 0xFFFF0000L) | (trunked_ts & 0xffff);
} else
- fr.ts = fix_peerts(&rxtrunktime, fr.callno, ts);
+ fr->ts = fix_peerts(&rxtrunktime, fr->callno, ts);
/* Don't pass any packets until we're started */
- if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED)) {
+ if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED)) {
/* Common things */
f.src = "IAX2";
f.mallocd = 0;
@@ -6404,28 +6410,28 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
f.samples = ast_codec_get_samples(&f);
else
f.samples = 0;
- fr.outoforder = 0;
- iax_frame_wrap(&fr, &f);
+ fr->outoforder = 0;
+ iax_frame_wrap(fr, &f);
#ifdef BRIDGE_OPTIMIZATION
- if (iaxs[fr.callno]->bridgecallno) {
+ if (iaxs[fr->callno]->bridgecallno) {
forward_delivery(&fr);
} else {
duped_fr = iaxfrdup2(&fr);
if (duped_fr) {
- schedule_delivery(duped_fr, updatehistory, 1, &fr.ts);
+ schedule_delivery(duped_fr, updatehistory, 1, &fr->ts);
}
}
#else
- duped_fr = iaxfrdup2(&fr);
+ duped_fr = iaxfrdup2(fr);
if (duped_fr) {
- schedule_delivery(duped_fr, updatehistory, 1, &fr.ts);
+ schedule_delivery(duped_fr, updatehistory, 1, &fr->ts);
}
#endif
- if (iaxs[fr.callno]->last < fr.ts) {
- iaxs[fr.callno]->last = fr.ts;
+ if (iaxs[fr->callno]->last < fr->ts) {
+ iaxs[fr->callno]->last = fr->ts;
#if 1
if (option_debug)
- ast_log(LOG_DEBUG, "For call=%d, set last=%d\n", fr.callno, fr.ts);
+ ast_log(LOG_DEBUG, "For call=%d, set last=%d\n", fr->callno, fr->ts);
#endif
}
}
@@ -6434,10 +6440,10 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
}
} else {
ast_log(LOG_WARNING, "Received trunked frame before first full voice frame\n ");
- iax2_vnak(fr.callno);
+ iax2_vnak(fr->callno);
}
}
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ ast_mutex_unlock(&iaxsl[fr->callno]);
}
ptr += len;
res -= len;
@@ -6470,13 +6476,13 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
f.subclass = 0;
}
- if (!fr.callno)
- fr.callno = find_callno(ntohs(mh->callno) & ~IAX_FLAG_FULL, dcallno, &sin, new, 1, fd);
+ if (!fr->callno)
+ fr->callno = find_callno(ntohs(mh->callno) & ~IAX_FLAG_FULL, dcallno, &sin, new, 1, fd);
- if (fr.callno > 0)
- ast_mutex_lock(&iaxsl[fr.callno]);
+ if (fr->callno > 0)
+ ast_mutex_lock(&iaxsl[fr->callno]);
- if (!fr.callno || !iaxs[fr.callno]) {
+ if (!fr->callno || !iaxs[fr->callno]) {
/* A call arrived for a nonexistent destination. Unless it's an "inval"
frame, reply with an inval */
if (ntohs(mh->callno) & IAX_FLAG_FULL) {
@@ -6489,14 +6495,14 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
raw_hangup(&sin, ntohs(fh->dcallno) & ~IAX_FLAG_RETRANS, ntohs(mh->callno) & ~IAX_FLAG_FULL,
fd);
}
- if (fr.callno > 0)
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ if (fr->callno > 0)
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
- if (ast_test_flag(iaxs[fr.callno], IAX_ENCRYPTED)) {
- if (decrypt_frame(fr.callno, fh, &f, &res)) {
+ if (ast_test_flag(iaxs[fr->callno], IAX_ENCRYPTED)) {
+ if (decrypt_frame(fr->callno, fh, &f, &res)) {
ast_log(LOG_NOTICE, "Packet Decrypt Failed!\n");
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
#ifdef DEBUG_SUPPORT
@@ -6506,24 +6512,24 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
}
/* count this frame */
- iaxs[fr.callno]->frames_received++;
+ iaxs[fr->callno]->frames_received++;
- if (!inaddrcmp(&sin, &iaxs[fr.callno]->addr) && !minivid &&
+ if (!inaddrcmp(&sin, &iaxs[fr->callno]->addr) && !minivid &&
f.subclass != IAX_COMMAND_TXCNT && /* for attended transfer */
f.subclass != IAX_COMMAND_TXACC) /* for attended transfer */
- iaxs[fr.callno]->peercallno = (unsigned short)(ntohs(mh->callno) & ~IAX_FLAG_FULL);
+ iaxs[fr->callno]->peercallno = (unsigned short)(ntohs(mh->callno) & ~IAX_FLAG_FULL);
if (ntohs(mh->callno) & IAX_FLAG_FULL) {
if (option_debug && iaxdebug)
ast_log(LOG_DEBUG, "Received packet %d, (%d, %d)\n", fh->oseqno, f.frametype, f.subclass);
/* Check if it's out of order (and not an ACK or INVAL) */
- fr.oseqno = fh->oseqno;
- fr.iseqno = fh->iseqno;
- fr.ts = ntohl(fh->ts);
+ fr->oseqno = fh->oseqno;
+ fr->iseqno = fh->iseqno;
+ fr->ts = ntohl(fh->ts);
#ifdef IAXTESTS
if (test_resync) {
if (option_debug)
- ast_log(LOG_DEBUG, "Simulating frame ts resync, was %u now %u\n", fr.ts, fr.ts + test_resync);
- fr.ts += test_resync;
+ ast_log(LOG_DEBUG, "Simulating frame ts resync, was %u now %u\n", fr->ts, fr->ts + test_resync);
+ fr->ts += test_resync;
}
#endif /* IAXTESTS */
#if 0
@@ -6536,8 +6542,8 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
#endif
if ((ntohs(fh->dcallno) & IAX_FLAG_RETRANS) || (f.frametype != AST_FRAME_VOICE))
updatehistory = 0;
- if ((iaxs[fr.callno]->iseqno != fr.oseqno) &&
- (iaxs[fr.callno]->iseqno ||
+ if ((iaxs[fr->callno]->iseqno != fr->oseqno) &&
+ (iaxs[fr->callno]->iseqno ||
((f.subclass != IAX_COMMAND_TXCNT) &&
(f.subclass != IAX_COMMAND_TXREADY) && /* for attended transfer */
(f.subclass != IAX_COMMAND_TXREL) && /* for attended transfer */
@@ -6557,8 +6563,8 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
/* If it's not an ACK packet, it's out of order. */
if (option_debug)
ast_log(LOG_DEBUG, "Packet arrived out of order (expecting %d, got %d) (frametype = %d, subclass = %d)\n",
- iaxs[fr.callno]->iseqno, fr.oseqno, f.frametype, f.subclass);
- if (iaxs[fr.callno]->iseqno > fr.oseqno) {
+ iaxs[fr->callno]->iseqno, fr->oseqno, f.frametype, f.subclass);
+ if (iaxs[fr->callno]->iseqno > fr->oseqno) {
/* If we've already seen it, ack it XXX There's a border condition here XXX */
if ((f.frametype != AST_FRAME_IAX) ||
((f.subclass != IAX_COMMAND_ACK) && (f.subclass != IAX_COMMAND_INVAL))) {
@@ -6566,13 +6572,13 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
ast_log(LOG_DEBUG, "Acking anyway\n");
/* XXX Maybe we should handle its ack to us, but then again, it's probably outdated anyway, and if
we have anything to send, we'll retransmit and get an ACK back anyway XXX */
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
}
} else {
/* Send a VNAK requesting retransmission */
- iax2_vnak(fr.callno);
+ iax2_vnak(fr->callno);
}
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
} else {
@@ -6583,67 +6589,67 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
(f.subclass != IAX_COMMAND_TXACC) &&
(f.subclass != IAX_COMMAND_VNAK)) ||
(f.frametype != AST_FRAME_IAX))
- iaxs[fr.callno]->iseqno++;
+ iaxs[fr->callno]->iseqno++;
}
/* A full frame */
if (res < sizeof(struct ast_iax2_full_hdr)) {
ast_log(LOG_WARNING, "midget packet received (%d of %d min)\n", res, (int)sizeof(struct ast_iax2_full_hdr));
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
f.datalen = res - sizeof(struct ast_iax2_full_hdr);
/* Handle implicit ACKing unless this is an INVAL, and only if this is
from the real peer, not the transfer peer */
- if (!inaddrcmp(&sin, &iaxs[fr.callno]->addr) &&
+ if (!inaddrcmp(&sin, &iaxs[fr->callno]->addr) &&
((f.subclass != IAX_COMMAND_INVAL) ||
(f.frametype != AST_FRAME_IAX))) {
unsigned char x;
/* XXX This code is not very efficient. Surely there is a better way which still
properly handles boundary conditions? XXX */
/* First we have to qualify that the ACKed value is within our window */
- for (x=iaxs[fr.callno]->rseqno; x != iaxs[fr.callno]->oseqno; x++)
- if (fr.iseqno == x)
+ for (x=iaxs[fr->callno]->rseqno; x != iaxs[fr->callno]->oseqno; x++)
+ if (fr->iseqno == x)
break;
- if ((x != iaxs[fr.callno]->oseqno) || (iaxs[fr.callno]->oseqno == fr.iseqno)) {
+ if ((x != iaxs[fr->callno]->oseqno) || (iaxs[fr->callno]->oseqno == fr->iseqno)) {
/* The acknowledgement is within our window. Time to acknowledge everything
that it says to */
- for (x=iaxs[fr.callno]->rseqno; x != fr.iseqno; x++) {
+ for (x=iaxs[fr->callno]->rseqno; x != fr->iseqno; x++) {
/* Ack the packet with the given timestamp */
if (option_debug && iaxdebug)
ast_log(LOG_DEBUG, "Cancelling transmission of packet %d\n", x);
ast_mutex_lock(&iaxq.lock);
for (cur = iaxq.head; cur ; cur = cur->next) {
/* If it's our call, and our timestamp, mark -1 retries */
- if ((fr.callno == cur->callno) && (x == cur->oseqno)) {
+ if ((fr->callno == cur->callno) && (x == cur->oseqno)) {
cur->retries = -1;
/* Destroy call if this is the end */
if (cur->final) {
if (iaxdebug && option_debug)
- ast_log(LOG_DEBUG, "Really destroying %d, having been acked on final message\n", fr.callno);
- iax2_destroy_nolock(fr.callno);
+ ast_log(LOG_DEBUG, "Really destroying %d, having been acked on final message\n", fr->callno);
+ iax2_destroy_nolock(fr->callno);
}
}
}
ast_mutex_unlock(&iaxq.lock);
}
/* Note how much we've received acknowledgement for */
- if (iaxs[fr.callno])
- iaxs[fr.callno]->rseqno = fr.iseqno;
+ if (iaxs[fr->callno])
+ iaxs[fr->callno]->rseqno = fr->iseqno;
else {
/* Stop processing now */
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
} else
- ast_log(LOG_DEBUG, "Received iseqno %d not within window %d->%d\n", fr.iseqno, iaxs[fr.callno]->rseqno, iaxs[fr.callno]->oseqno);
+ ast_log(LOG_DEBUG, "Received iseqno %d not within window %d->%d\n", fr->iseqno, iaxs[fr->callno]->rseqno, iaxs[fr->callno]->oseqno);
}
- if (inaddrcmp(&sin, &iaxs[fr.callno]->addr) &&
+ if (inaddrcmp(&sin, &iaxs[fr->callno]->addr) &&
((f.frametype != AST_FRAME_IAX) ||
((f.subclass != IAX_COMMAND_TXACC) &&
(f.subclass != IAX_COMMAND_TXCNT)))) {
/* Only messages we accept from a transfer host are TXACC and TXCNT */
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
@@ -6651,7 +6657,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
if (f.frametype == AST_FRAME_IAX) {
if (iax_parse_ies(&ies, buf + sizeof(struct ast_iax2_full_hdr), f.datalen)) {
ast_log(LOG_WARNING, "Undecodable frame received from '%s'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr));
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
f.data = NULL;
@@ -6665,59 +6671,59 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
memset(&ies, 0, sizeof(ies));
}
if (f.frametype == AST_FRAME_VOICE) {
- if (f.subclass != iaxs[fr.callno]->voiceformat) {
- iaxs[fr.callno]->voiceformat = f.subclass;
+ if (f.subclass != iaxs[fr->callno]->voiceformat) {
+ iaxs[fr->callno]->voiceformat = f.subclass;
ast_log(LOG_DEBUG, "Ooh, voice format changed to %d\n", f.subclass);
- if (iaxs[fr.callno]->owner) {
+ if (iaxs[fr->callno]->owner) {
int orignative;
retryowner:
- if (ast_mutex_trylock(&iaxs[fr.callno]->owner->lock)) {
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ if (ast_mutex_trylock(&iaxs[fr->callno]->owner->lock)) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
usleep(1);
- ast_mutex_lock(&iaxsl[fr.callno]);
- if (iaxs[fr.callno] && iaxs[fr.callno]->owner) goto retryowner;
+ ast_mutex_lock(&iaxsl[fr->callno]);
+ if (iaxs[fr->callno] && iaxs[fr->callno]->owner) goto retryowner;
}
- if (iaxs[fr.callno]) {
- if (iaxs[fr.callno]->owner) {
- orignative = iaxs[fr.callno]->owner->nativeformats;
- iaxs[fr.callno]->owner->nativeformats = f.subclass;
- if (iaxs[fr.callno]->owner->readformat)
- ast_set_read_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->readformat);
- iaxs[fr.callno]->owner->nativeformats = orignative;
- ast_mutex_unlock(&iaxs[fr.callno]->owner->lock);
+ if (iaxs[fr->callno]) {
+ if (iaxs[fr->callno]->owner) {
+ orignative = iaxs[fr->callno]->owner->nativeformats;
+ iaxs[fr->callno]->owner->nativeformats = f.subclass;
+ if (iaxs[fr->callno]->owner->readformat)
+ ast_set_read_format(iaxs[fr->callno]->owner, iaxs[fr->callno]->owner->readformat);
+ iaxs[fr->callno]->owner->nativeformats = orignative;
+ ast_mutex_unlock(&iaxs[fr->callno]->owner->lock);
}
} else {
ast_log(LOG_DEBUG, "Neat, somebody took away the channel at a magical time but i found it!\n");
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
}
}
}
if (f.frametype == AST_FRAME_VIDEO) {
- if (f.subclass != iaxs[fr.callno]->videoformat) {
+ if (f.subclass != iaxs[fr->callno]->videoformat) {
ast_log(LOG_DEBUG, "Ooh, video format changed to %d\n", f.subclass & ~0x1);
- iaxs[fr.callno]->videoformat = f.subclass & ~0x1;
+ iaxs[fr->callno]->videoformat = f.subclass & ~0x1;
}
}
if (f.frametype == AST_FRAME_IAX) {
- if (iaxs[fr.callno]->initid > -1) {
+ if (iaxs[fr->callno]->initid > -1) {
/* Don't auto congest anymore since we've gotten something usefulb ack */
- ast_sched_del(sched, iaxs[fr.callno]->initid);
- iaxs[fr.callno]->initid = -1;
+ ast_sched_del(sched, iaxs[fr->callno]->initid);
+ iaxs[fr->callno]->initid = -1;
}
/* Handle the IAX pseudo frame itself */
if (option_debug && iaxdebug)
ast_log(LOG_DEBUG, "IAX subclass %d received\n", f.subclass);
/* Update last ts unless the frame's timestamp originated with us. */
- if (iaxs[fr.callno]->last < fr.ts &&
+ if (iaxs[fr->callno]->last < fr->ts &&
f.subclass != IAX_COMMAND_ACK &&
f.subclass != IAX_COMMAND_PONG &&
f.subclass != IAX_COMMAND_LAGRP) {
- iaxs[fr.callno]->last = fr.ts;
+ iaxs[fr->callno]->last = fr->ts;
if (option_debug && iaxdebug)
- ast_log(LOG_DEBUG, "For call=%d, set last=%d\n", fr.callno, fr.ts);
+ ast_log(LOG_DEBUG, "For call=%d, set last=%d\n", fr->callno, fr->ts);
}
switch(f.subclass) {
@@ -6725,163 +6731,165 @@ retryowner:
/* Do nothing */
break;
case IAX_COMMAND_QUELCH:
- if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED)) {
+ if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED)) {
/* Generate Manager Hold event, if necessary*/
- if (iaxs[fr.callno]->owner) {
+ if (iaxs[fr->callno]->owner) {
manager_event(EVENT_FLAG_CALL, "Hold",
"Channel: %s\r\n"
"Uniqueid: %s\r\n",
- iaxs[fr.callno]->owner->name,
- iaxs[fr.callno]->owner->uniqueid);
+ iaxs[fr->callno]->owner->name,
+ iaxs[fr->callno]->owner->uniqueid);
}
- ast_set_flag(iaxs[fr.callno], IAX_QUELCH);
+ ast_set_flag(iaxs[fr->callno], IAX_QUELCH);
if (ies.musiconhold) {
- if (iaxs[fr.callno]->owner &&
- ast_bridged_channel(iaxs[fr.callno]->owner))
- ast_moh_start(ast_bridged_channel(iaxs[fr.callno]->owner), NULL);
+ if (iaxs[fr->callno]->owner &&
+ ast_bridged_channel(iaxs[fr->callno]->owner))
+ ast_moh_start(ast_bridged_channel(iaxs[fr->callno]->owner), NULL);
}
}
break;
case IAX_COMMAND_UNQUELCH:
- if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED)) {
+ if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED)) {
/* Generate Manager Unhold event, if necessary*/
- if (iaxs[fr.callno]->owner && ast_test_flag(iaxs[fr.callno], IAX_QUELCH)) {
+ if (iaxs[fr->callno]->owner && ast_test_flag(iaxs[fr->callno], IAX_QUELCH)) {
manager_event(EVENT_FLAG_CALL, "Unhold",
"Channel: %s\r\n"
"Uniqueid: %s\r\n",
- iaxs[fr.callno]->owner->name,
- iaxs[fr.callno]->owner->uniqueid);
+ iaxs[fr->callno]->owner->name,
+ iaxs[fr->callno]->owner->uniqueid);
}
- ast_clear_flag(iaxs[fr.callno], IAX_QUELCH);
- if (iaxs[fr.callno]->owner &&
- ast_bridged_channel(iaxs[fr.callno]->owner))
- ast_moh_stop(ast_bridged_channel(iaxs[fr.callno]->owner));
+ ast_clear_flag(iaxs[fr->callno], IAX_QUELCH);
+ if (iaxs[fr->callno]->owner &&
+ ast_bridged_channel(iaxs[fr->callno]->owner))
+ ast_moh_stop(ast_bridged_channel(iaxs[fr->callno]->owner));
}
break;
case IAX_COMMAND_TXACC:
- if (iaxs[fr.callno]->transferring == TRANSFER_BEGIN) {
+ if (iaxs[fr->callno]->transferring == TRANSFER_BEGIN) {
/* Ack the packet with the given timestamp */
ast_mutex_lock(&iaxq.lock);
for (cur = iaxq.head; cur ; cur = cur->next) {
/* Cancel any outstanding txcnt's */
- if ((fr.callno == cur->callno) && (cur->transfer))
+ if ((fr->callno == cur->callno) && (cur->transfer))
cur->retries = -1;
}
ast_mutex_unlock(&iaxq.lock);
memset(&ied1, 0, sizeof(ied1));
- iax_ie_append_short(&ied1, IAX_IE_CALLNO, iaxs[fr.callno]->callno);
- send_command(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_TXREADY, 0, ied1.buf, ied1.pos, -1);
- iaxs[fr.callno]->transferring = TRANSFER_READY;
+ iax_ie_append_short(&ied1, IAX_IE_CALLNO, iaxs[fr->callno]->callno);
+ send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_TXREADY, 0, ied1.buf, ied1.pos, -1);
+ iaxs[fr->callno]->transferring = TRANSFER_READY;
}
break;
case IAX_COMMAND_NEW:
/* Ignore if it's already up */
- if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD))
+ if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD))
break;
if (ies.provverpres && ies.serviceident && sin.sin_addr.s_addr)
check_provisioning(&sin, fd, ies.serviceident, ies.provver);
/* If we're in trunk mode, do it now, and update the trunk number in our frame before continuing */
- if (ast_test_flag(iaxs[fr.callno], IAX_TRUNK)) {
- fr.callno = make_trunk(fr.callno, 1);
+ if (ast_test_flag(iaxs[fr->callno], IAX_TRUNK)) {
+ fr->callno = make_trunk(fr->callno, 1);
}
/* For security, always ack immediately */
if (delayreject)
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
- if (check_access(fr.callno, &sin, &ies)) {
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+ if (check_access(fr->callno, &sin, &ies)) {
/* They're not allowed on */
- auth_fail(fr.callno, IAX_COMMAND_REJECT);
+ auth_fail(fr->callno, IAX_COMMAND_REJECT);
if (authdebug)
- ast_log(LOG_NOTICE, "Rejected connect attempt from %s, who was trying to reach '%s@%s'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->exten, iaxs[fr.callno]->context);
+ ast_log(LOG_NOTICE, "Rejected connect attempt from %s, who was trying to reach '%s@%s'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->exten, iaxs[fr->callno]->context);
break;
}
/* This might re-enter the IAX code and need the lock */
- if (strcasecmp(iaxs[fr.callno]->exten, "TBD")) {
- ast_mutex_unlock(&iaxsl[fr.callno]);
- exists = ast_exists_extension(NULL, iaxs[fr.callno]->context, iaxs[fr.callno]->exten, 1, iaxs[fr.callno]->cid_num);
- ast_mutex_lock(&iaxsl[fr.callno]);
+ if (strcasecmp(iaxs[fr->callno]->exten, "TBD")) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
+ exists = ast_exists_extension(NULL, iaxs[fr->callno]->context, iaxs[fr->callno]->exten, 1, iaxs[fr->callno]->cid_num);
+ ast_mutex_lock(&iaxsl[fr->callno]);
} else
exists = 0;
- if (ast_strlen_zero(iaxs[fr.callno]->secret) && ast_strlen_zero(iaxs[fr.callno]->inkeys)) {
- if (strcmp(iaxs[fr.callno]->exten, "TBD") && !exists) {
+ if (ast_strlen_zero(iaxs[fr->callno]->secret) && ast_strlen_zero(iaxs[fr->callno]->inkeys)) {
+ if (strcmp(iaxs[fr->callno]->exten, "TBD") && !exists) {
memset(&ied0, 0, sizeof(ied0));
iax_ie_append_str(&ied0, IAX_IE_CAUSE, "No such context/extension");
iax_ie_append_byte(&ied0, IAX_IE_CAUSECODE, AST_CAUSE_NO_ROUTE_DESTINATION);
- send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
+ send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
if (authdebug)
- ast_log(LOG_NOTICE, "Rejected connect attempt from %s, request '%s@%s' does not exist\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->exten, iaxs[fr.callno]->context);
+ ast_log(LOG_NOTICE, "Rejected connect attempt from %s, request '%s@%s' does not exist\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->exten, iaxs[fr->callno]->context);
} else {
/* Select an appropriate format */
- if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOPREFS)) {
- if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP)) {
+ if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOPREFS)) {
+ if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP)) {
using_prefs = "reqonly";
} else {
using_prefs = "disabled";
}
- format = iaxs[fr.callno]->peerformat & iaxs[fr.callno]->capability;
+ format = iaxs[fr->callno]->peerformat & iaxs[fr->callno]->capability;
memset(&pref, 0, sizeof(pref));
strcpy(caller_pref_buf, "disabled");
strcpy(host_pref_buf, "disabled");
} else {
using_prefs = "mine";
- if(ies.codec_prefs) {
- ast_codec_pref_convert(&rpref, ies.codec_prefs, 32, 0);
+ /* If the information elements are in here... use them */
+ if (ies.codec_prefs)
+ ast_codec_pref_convert(&iaxs[fr->callno]->rprefs, ies.codec_prefs, 32, 0);
+ if (ast_codec_pref_index(&iaxs[fr->callno]->rprefs, 0)) {
/* If we are codec_first_choice we let the caller have the 1st shot at picking the codec.*/
- if (ast_test_flag(iaxs[fr.callno], IAX_CODEC_USER_FIRST)) {
- pref = rpref;
+ if (ast_test_flag(iaxs[fr->callno], IAX_CODEC_USER_FIRST)) {
+ pref = iaxs[fr->callno]->rprefs;
using_prefs = "caller";
} else {
- pref = iaxs[fr.callno]->prefs;
+ pref = iaxs[fr->callno]->prefs;
}
} else
- pref = iaxs[fr.callno]->prefs;
-
- format = ast_codec_choose(&pref, iaxs[fr.callno]->capability & iaxs[fr.callno]->peercapability, 0);
- ast_codec_pref_string(&rpref, caller_pref_buf, sizeof(caller_pref_buf) - 1);
- ast_codec_pref_string(&iaxs[fr.callno]->prefs, host_pref_buf, sizeof(host_pref_buf) - 1);
+ pref = iaxs[fr->callno]->prefs;
+
+ format = ast_codec_choose(&pref, iaxs[fr->callno]->capability & iaxs[fr->callno]->peercapability, 0);
+ ast_codec_pref_string(&iaxs[fr->callno]->rprefs, caller_pref_buf, sizeof(caller_pref_buf) - 1);
+ ast_codec_pref_string(&iaxs[fr->callno]->prefs, host_pref_buf, sizeof(host_pref_buf) - 1);
}
if (!format) {
- if(!ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP))
- format = iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability;
+ if(!ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP))
+ format = iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability;
if (!format) {
memset(&ied0, 0, sizeof(ied0));
iax_ie_append_str(&ied0, IAX_IE_CAUSE, "Unable to negotiate codec");
iax_ie_append_byte(&ied0, IAX_IE_CAUSECODE, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
- send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
+ send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
if (authdebug) {
- if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP))
- ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested 0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->capability);
+ if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP))
+ ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested 0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->peerformat, iaxs[fr->callno]->capability);
else
- ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->peercapability, iaxs[fr.callno]->capability);
+ ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->peerformat, iaxs[fr->callno]->peercapability, iaxs[fr->callno]->capability);
}
} else {
/* Pick one... */
- if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP)) {
- if(!(iaxs[fr.callno]->peerformat & iaxs[fr.callno]->capability))
+ if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP)) {
+ if(!(iaxs[fr->callno]->peerformat & iaxs[fr->callno]->capability))
format = 0;
} else {
- if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOPREFS)) {
- using_prefs = ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP) ? "reqonly" : "disabled";
+ if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOPREFS)) {
+ using_prefs = ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP) ? "reqonly" : "disabled";
memset(&pref, 0, sizeof(pref));
- format = ast_best_codec(iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability);
+ format = ast_best_codec(iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability);
strcpy(caller_pref_buf,"disabled");
strcpy(host_pref_buf,"disabled");
} else {
using_prefs = "mine";
- if(ies.codec_prefs) {
+ if (ast_codec_pref_index(&iaxs[fr->callno]->rprefs, 0)) {
/* Do the opposite of what we tried above. */
- if (ast_test_flag(iaxs[fr.callno], IAX_CODEC_USER_FIRST)) {
- pref = iaxs[fr.callno]->prefs;
+ if (ast_test_flag(iaxs[fr->callno], IAX_CODEC_USER_FIRST)) {
+ pref = iaxs[fr->callno]->prefs;
} else {
- pref = rpref;
+ pref = iaxs[fr->callno]->rprefs;
using_prefs = "caller";
}
- format = ast_codec_choose(&pref, iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability, 1);
+ format = ast_codec_choose(&pref, iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability, 1);
} else /* if no codec_prefs IE do it the old way */
- format = ast_best_codec(iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability);
+ format = ast_best_codec(iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability);
}
}
@@ -6889,11 +6897,11 @@ retryowner:
memset(&ied0, 0, sizeof(ied0));
iax_ie_append_str(&ied0, IAX_IE_CAUSE, "Unable to negotiate codec");
iax_ie_append_byte(&ied0, IAX_IE_CAUSECODE, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
- ast_log(LOG_ERROR, "No best format in 0x%x???\n", iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability);
- send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
+ ast_log(LOG_ERROR, "No best format in 0x%x???\n", iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability);
+ send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
if (authdebug)
- ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->peercapability, iaxs[fr.callno]->capability);
- ast_set_flag(iaxs[fr.callno], IAX_ALREADYGONE);
+ ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->peerformat, iaxs[fr->callno]->peercapability, iaxs[fr->callno]->capability);
+ ast_set_flag(iaxs[fr->callno], IAX_ALREADYGONE);
break;
}
}
@@ -6902,9 +6910,9 @@ retryowner:
/* No authentication required, let them in */
memset(&ied1, 0, sizeof(ied1));
iax_ie_append_int(&ied1, IAX_IE_FORMAT, format);
- send_command(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACCEPT, 0, ied1.buf, ied1.pos, -1);
- if (strcmp(iaxs[fr.callno]->exten, "TBD")) {
- ast_set_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED);
+ send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACCEPT, 0, ied1.buf, ied1.pos, -1);
+ if (strcmp(iaxs[fr->callno]->exten, "TBD")) {
+ ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Accepting UNAUTHENTICATED call from %s:\n"
"%srequested format = %s,\n"
@@ -6914,7 +6922,7 @@ retryowner:
"%spriority = %s\n",
ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr),
VERBOSE_PREFIX_4,
- ast_getformatname(iaxs[fr.callno]->peerformat),
+ ast_getformatname(iaxs[fr->callno]->peerformat),
VERBOSE_PREFIX_4,
caller_pref_buf,
VERBOSE_PREFIX_4,
@@ -6924,10 +6932,10 @@ retryowner:
VERBOSE_PREFIX_4,
using_prefs);
- if(!(c = ast_iax2_new(fr.callno, AST_STATE_RING, format)))
- iax2_destroy_nolock(fr.callno);
+ if(!(c = ast_iax2_new(fr->callno, AST_STATE_RING, format)))
+ iax2_destroy_nolock(fr->callno);
} else {
- ast_set_flag(&iaxs[fr.callno]->state, IAX_STATE_TBD);
+ ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD);
/* If this is a TBD call, we're ready but now what... */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Accepted unauthenticated TBD call from %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr));
@@ -6936,35 +6944,35 @@ retryowner:
}
break;
}
- if (iaxs[fr.callno]->authmethods & IAX_AUTH_MD5)
- merge_encryption(iaxs[fr.callno],ies.encmethods);
+ if (iaxs[fr->callno]->authmethods & IAX_AUTH_MD5)
+ merge_encryption(iaxs[fr->callno],ies.encmethods);
else
- iaxs[fr.callno]->encmethods = 0;
- authenticate_request(iaxs[fr.callno]);
- ast_set_flag(&iaxs[fr.callno]->state, IAX_STATE_AUTHENTICATED);
+ iaxs[fr->callno]->encmethods = 0;
+ authenticate_request(iaxs[fr->callno]);
+ ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_AUTHENTICATED);
break;
case IAX_COMMAND_DPREQ:
/* Request status in the dialplan */
- if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_TBD) &&
- !ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED) && ies.called_number) {
+ if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD) &&
+ !ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED) && ies.called_number) {
if (iaxcompat) {
/* Spawn a thread for the lookup */
- spawn_dp_lookup(fr.callno, iaxs[fr.callno]->context, ies.called_number, iaxs[fr.callno]->cid_num);
+ spawn_dp_lookup(fr->callno, iaxs[fr->callno]->context, ies.called_number, iaxs[fr->callno]->cid_num);
} else {
/* Just look it up */
- dp_lookup(fr.callno, iaxs[fr.callno]->context, ies.called_number, iaxs[fr.callno]->cid_num, 1);
+ dp_lookup(fr->callno, iaxs[fr->callno]->context, ies.called_number, iaxs[fr->callno]->cid_num, 1);
}
}
break;
case IAX_COMMAND_HANGUP:
- ast_set_flag(iaxs[fr.callno], IAX_ALREADYGONE);
- ast_log(LOG_DEBUG, "Immediately destroying %d, having received hangup\n", fr.callno);
+ ast_set_flag(iaxs[fr->callno], IAX_ALREADYGONE);
+ ast_log(LOG_DEBUG, "Immediately destroying %d, having received hangup\n", fr->callno);
/* Set hangup cause according to remote */
- if (ies.causecode && iaxs[fr.callno]->owner)
- iaxs[fr.callno]->owner->hangupcause = ies.causecode;
+ if (ies.causecode && iaxs[fr->callno]->owner)
+ iaxs[fr->callno]->owner->hangupcause = ies.causecode;
/* Send ack immediately, before we destroy */
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
- iax2_destroy_nolock(fr.callno);
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+ iax2_destroy_nolock(fr->callno);
break;
case IAX_COMMAND_REJECT:
memset(&f, 0, sizeof(f));
@@ -6972,101 +6980,101 @@ retryowner:
f.subclass = AST_CONTROL_CONGESTION;
/* Set hangup cause according to remote */
- if (ies.causecode && iaxs[fr.callno]->owner)
- iaxs[fr.callno]->owner->hangupcause = ies.causecode;
+ if (ies.causecode && iaxs[fr->callno]->owner)
+ iaxs[fr->callno]->owner->hangupcause = ies.causecode;
- iax2_queue_frame(fr.callno, &f);
- if (ast_test_flag(iaxs[fr.callno], IAX_PROVISION)) {
+ iax2_queue_frame(fr->callno, &f);
+ if (ast_test_flag(iaxs[fr->callno], IAX_PROVISION)) {
/* Send ack immediately, before we destroy */
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
- iax2_destroy_nolock(fr.callno);
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+ iax2_destroy_nolock(fr->callno);
break;
}
- if (iaxs[fr.callno]->owner) {
+ if (iaxs[fr->callno]->owner) {
if (authdebug)
- ast_log(LOG_WARNING, "Call rejected by %s: %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[fr.callno]->addr.sin_addr), ies.cause ? ies.cause : "<Unknown>");
+ ast_log(LOG_WARNING, "Call rejected by %s: %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[fr->callno]->addr.sin_addr), ies.cause ? ies.cause : "<Unknown>");
}
- ast_log(LOG_DEBUG, "Immediately destroying %d, having received reject\n", fr.callno);
+ ast_log(LOG_DEBUG, "Immediately destroying %d, having received reject\n", fr->callno);
/* Send ack immediately, before we destroy */
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
- iaxs[fr.callno]->error = EPERM;
- iax2_destroy_nolock(fr.callno);
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+ iaxs[fr->callno]->error = EPERM;
+ iax2_destroy_nolock(fr->callno);
break;
case IAX_COMMAND_TRANSFER:
- if (iaxs[fr.callno]->owner && ast_bridged_channel(iaxs[fr.callno]->owner) && ies.called_number) {
+ if (iaxs[fr->callno]->owner && ast_bridged_channel(iaxs[fr->callno]->owner) && ies.called_number) {
if (!strcmp(ies.called_number, ast_parking_ext())) {
- if (iax_park(ast_bridged_channel(iaxs[fr.callno]->owner), iaxs[fr.callno]->owner)) {
- ast_log(LOG_WARNING, "Failed to park call on '%s'\n", ast_bridged_channel(iaxs[fr.callno]->owner)->name);
+ if (iax_park(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->owner)) {
+ ast_log(LOG_WARNING, "Failed to park call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
} else
- ast_log(LOG_DEBUG, "Parked call on '%s'\n", ast_bridged_channel(iaxs[fr.callno]->owner)->name);
+ ast_log(LOG_DEBUG, "Parked call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
} else {
- if (ast_async_goto(ast_bridged_channel(iaxs[fr.callno]->owner), iaxs[fr.callno]->context, ies.called_number, 1))
- ast_log(LOG_WARNING, "Async goto of '%s' to '%s@%s' failed\n", ast_bridged_channel(iaxs[fr.callno]->owner)->name,
- ies.called_number, iaxs[fr.callno]->context);
+ if (ast_async_goto(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->context, ies.called_number, 1))
+ ast_log(LOG_WARNING, "Async goto of '%s' to '%s@%s' failed\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name,
+ ies.called_number, iaxs[fr->callno]->context);
else
- ast_log(LOG_DEBUG, "Async goto of '%s' to '%s@%s' started\n", ast_bridged_channel(iaxs[fr.callno]->owner)->name,
- ies.called_number, iaxs[fr.callno]->context);
+ ast_log(LOG_DEBUG, "Async goto of '%s' to '%s@%s' started\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name,
+ ies.called_number, iaxs[fr->callno]->context);
}
} else
- ast_log(LOG_DEBUG, "Async goto not applicable on call %d\n", fr.callno);
+ ast_log(LOG_DEBUG, "Async goto not applicable on call %d\n", fr->callno);
break;
case IAX_COMMAND_ACCEPT:
/* Ignore if call is already up or needs authentication or is a TBD */
- if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD | IAX_STATE_AUTHENTICATED))
+ if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD | IAX_STATE_AUTHENTICATED))
break;
- if (ast_test_flag(iaxs[fr.callno], IAX_PROVISION)) {
+ if (ast_test_flag(iaxs[fr->callno], IAX_PROVISION)) {
/* Send ack immediately, before we destroy */
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
- iax2_destroy_nolock(fr.callno);
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+ iax2_destroy_nolock(fr->callno);
break;
}
if (ies.format) {
- iaxs[fr.callno]->peerformat = ies.format;
+ iaxs[fr->callno]->peerformat = ies.format;
} else {
- if (iaxs[fr.callno]->owner)
- iaxs[fr.callno]->peerformat = iaxs[fr.callno]->owner->nativeformats;
+ if (iaxs[fr->callno]->owner)
+ iaxs[fr->callno]->peerformat = iaxs[fr->callno]->owner->nativeformats;
else
- iaxs[fr.callno]->peerformat = iaxs[fr.callno]->capability;
+ iaxs[fr->callno]->peerformat = iaxs[fr->callno]->capability;
}
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Call accepted by %s (format %s)\n", ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[fr.callno]->addr.sin_addr), ast_getformatname(iaxs[fr.callno]->peerformat));
- if (!(iaxs[fr.callno]->peerformat & iaxs[fr.callno]->capability)) {
+ ast_verbose(VERBOSE_PREFIX_3 "Call accepted by %s (format %s)\n", ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[fr->callno]->addr.sin_addr), ast_getformatname(iaxs[fr->callno]->peerformat));
+ if (!(iaxs[fr->callno]->peerformat & iaxs[fr->callno]->capability)) {
memset(&ied0, 0, sizeof(ied0));
iax_ie_append_str(&ied0, IAX_IE_CAUSE, "Unable to negotiate codec");
iax_ie_append_byte(&ied0, IAX_IE_CAUSECODE, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
- send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
+ send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
if (authdebug)
- ast_log(LOG_NOTICE, "Rejected call to %s, format 0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->capability);
+ ast_log(LOG_NOTICE, "Rejected call to %s, format 0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->peerformat, iaxs[fr->callno]->capability);
} else {
- ast_set_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED);
- if (iaxs[fr.callno]->owner) {
+ ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
+ if (iaxs[fr->callno]->owner) {
/* Switch us to use a compatible format */
- iaxs[fr.callno]->owner->nativeformats = iaxs[fr.callno]->peerformat;
+ iaxs[fr->callno]->owner->nativeformats = iaxs[fr->callno]->peerformat;
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Format for call is %s\n", ast_getformatname(iaxs[fr.callno]->owner->nativeformats));
+ ast_verbose(VERBOSE_PREFIX_3 "Format for call is %s\n", ast_getformatname(iaxs[fr->callno]->owner->nativeformats));
retryowner2:
- if (ast_mutex_trylock(&iaxs[fr.callno]->owner->lock)) {
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ if (ast_mutex_trylock(&iaxs[fr->callno]->owner->lock)) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
usleep(1);
- ast_mutex_lock(&iaxsl[fr.callno]);
- if (iaxs[fr.callno] && iaxs[fr.callno]->owner) goto retryowner2;
+ ast_mutex_lock(&iaxsl[fr->callno]);
+ if (iaxs[fr->callno] && iaxs[fr->callno]->owner) goto retryowner2;
}
- if (iaxs[fr.callno] && iaxs[fr.callno]->owner) {
+ if (iaxs[fr->callno] && iaxs[fr->callno]->owner) {
/* Setup read/write formats properly. */
- if (iaxs[fr.callno]->owner->writeformat)
- ast_set_write_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->writeformat);
- if (iaxs[fr.callno]->owner->readformat)
- ast_set_read_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->readformat);
- ast_mutex_unlock(&iaxs[fr.callno]->owner->lock);
+ if (iaxs[fr->callno]->owner->writeformat)
+ ast_set_write_format(iaxs[fr->callno]->owner, iaxs[fr->callno]->owner->writeformat);
+ if (iaxs[fr->callno]->owner->readformat)
+ ast_set_read_format(iaxs[fr->callno]->owner, iaxs[fr->callno]->owner->readformat);
+ ast_mutex_unlock(&iaxs[fr->callno]->owner->lock);
}
}
}
ast_mutex_lock(&dpcache_lock);
- dp = iaxs[fr.callno]->dpentries;
+ dp = iaxs[fr->callno]->dpentries;
while(dp) {
if (!(dp->flags & CACHE_FLAG_TRANSMITTED)) {
- iax2_dprequest(dp, fr.callno);
+ iax2_dprequest(dp, fr->callno);
}
dp = dp->peer;
}
@@ -7074,71 +7082,71 @@ retryowner2:
break;
case IAX_COMMAND_POKE:
/* Send back a pong packet with the original timestamp */
- send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_PONG, fr.ts, NULL, 0, -1);
+ send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_PONG, fr->ts, NULL, 0, -1);
break;
case IAX_COMMAND_PING:
#ifdef BRIDGE_OPTIMIZATION
- if (iaxs[fr.callno]->bridgecallno) {
+ if (iaxs[fr->callno]->bridgecallno) {
/* If we're in a bridged call, just forward this */
- forward_command(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_PING, fr.ts, NULL, 0, -1);
+ forward_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_PING, fr->ts, NULL, 0, -1);
} else {
struct iax_ie_data pingied;
- construct_rr(iaxs[fr.callno], &pingied);
+ construct_rr(iaxs[fr->callno], &pingied);
/* Send back a pong packet with the original timestamp */
- send_command(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_PONG, fr.ts, pingied.buf, pingied.pos, -1);
+ send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_PONG, fr->ts, pingied.buf, pingied.pos, -1);
}
#else
{
struct iax_ie_data pingied;
- construct_rr(iaxs[fr.callno], &pingied);
+ construct_rr(iaxs[fr->callno], &pingied);
/* Send back a pong packet with the original timestamp */
- send_command(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_PONG, fr.ts, pingied.buf, pingied.pos, -1);
+ send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_PONG, fr->ts, pingied.buf, pingied.pos, -1);
}
#endif
break;
case IAX_COMMAND_PONG:
#ifdef BRIDGE_OPTIMIZATION
- if (iaxs[fr.callno]->bridgecallno) {
+ if (iaxs[fr->callno]->bridgecallno) {
/* Forward to the other side of the bridge */
- forward_command(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_PONG, fr.ts, NULL, 0, -1);
+ forward_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_PONG, fr->ts, NULL, 0, -1);
} else {
/* Calculate ping time */
- iaxs[fr.callno]->pingtime = calc_timestamp(iaxs[fr.callno], 0, &f) - fr.ts;
+ iaxs[fr->callno]->pingtime = calc_timestamp(iaxs[fr->callno], 0, &f) - fr->ts;
}
#else
/* Calculate ping time */
- iaxs[fr.callno]->pingtime = calc_timestamp(iaxs[fr.callno], 0, &f) - fr.ts;
+ iaxs[fr->callno]->pingtime = calc_timestamp(iaxs[fr->callno], 0, &f) - fr->ts;
#endif
/* save RR info */
- save_rr(&fr, &ies);
+ save_rr(fr, &ies);
- if (iaxs[fr.callno]->peerpoke) {
- peer = iaxs[fr.callno]->peerpoke;
+ if (iaxs[fr->callno]->peerpoke) {
+ peer = iaxs[fr->callno]->peerpoke;
if ((peer->lastms < 0) || (peer->historicms > peer->maxms)) {
- if (iaxs[fr.callno]->pingtime <= peer->maxms) {
- ast_log(LOG_NOTICE, "Peer '%s' is now REACHABLE! Time: %d\n", peer->name, iaxs[fr.callno]->pingtime);
- manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Reachable\r\nTime: %d\r\n", peer->name, iaxs[fr.callno]->pingtime);
+ if (iaxs[fr->callno]->pingtime <= peer->maxms) {
+ ast_log(LOG_NOTICE, "Peer '%s' is now REACHABLE! Time: %d\n", peer->name, iaxs[fr->callno]->pingtime);
+ manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Reachable\r\nTime: %d\r\n", peer->name, iaxs[fr->callno]->pingtime);
ast_device_state_changed("IAX2/%s", peer->name); /* Activate notification */
}
} else if ((peer->historicms > 0) && (peer->historicms <= peer->maxms)) {
- if (iaxs[fr.callno]->pingtime > peer->maxms) {
- ast_log(LOG_NOTICE, "Peer '%s' is now TOO LAGGED (%d ms)!\n", peer->name, iaxs[fr.callno]->pingtime);
- manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Lagged\r\nTime: %d\r\n", peer->name, iaxs[fr.callno]->pingtime);
+ if (iaxs[fr->callno]->pingtime > peer->maxms) {
+ ast_log(LOG_NOTICE, "Peer '%s' is now TOO LAGGED (%d ms)!\n", peer->name, iaxs[fr->callno]->pingtime);
+ manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: IAX2/%s\r\nPeerStatus: Lagged\r\nTime: %d\r\n", peer->name, iaxs[fr->callno]->pingtime);
ast_device_state_changed("IAX2/%s", peer->name); /* Activate notification */
}
}
- peer->lastms = iaxs[fr.callno]->pingtime;
+ peer->lastms = iaxs[fr->callno]->pingtime;
if (peer->smoothing && (peer->lastms > -1))
- peer->historicms = (iaxs[fr.callno]->pingtime + peer->historicms) / 2;
+ peer->historicms = (iaxs[fr->callno]->pingtime + peer->historicms) / 2;
else if (peer->smoothing && peer->lastms < 0)
peer->historicms = (0 + peer->historicms) / 2;
else
- peer->historicms = iaxs[fr.callno]->pingtime;
+ peer->historicms = iaxs[fr->callno]->pingtime;
if (peer->pokeexpire > -1)
ast_sched_del(sched, peer->pokeexpire);
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
- iax2_destroy_nolock(fr.callno);
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+ iax2_destroy_nolock(fr->callno);
peer->callno = 0;
/* Try again eventually */
ast_log(LOG_DEBUG, "Peer lastms %d, historicms %d, maxms %d\n", peer->lastms, peer->historicms, peer->maxms);
@@ -7151,158 +7159,158 @@ retryowner2:
case IAX_COMMAND_LAGRQ:
case IAX_COMMAND_LAGRP:
#ifdef BRIDGE_OPTIMIZATION
- if (iaxs[fr.callno]->bridgecallno) {
- forward_command(iaxs[fr.callno], AST_FRAME_IAX, f.subclass, fr.ts, NULL, 0, -1);
+ if (iaxs[fr->callno]->bridgecallno) {
+ forward_command(iaxs[fr->callno], AST_FRAME_IAX, f.subclass, fr->ts, NULL, 0, -1);
} else {
#endif
f.src = "LAGRQ";
f.mallocd = 0;
f.offset = 0;
f.samples = 0;
- iax_frame_wrap(&fr, &f);
+ iax_frame_wrap(fr, &f);
if(f.subclass == IAX_COMMAND_LAGRQ) {
/* Received a LAGRQ - echo back a LAGRP */
- fr.af.subclass = IAX_COMMAND_LAGRP;
- iax2_send(iaxs[fr.callno], &fr.af, fr.ts, -1, 0, 0, 0);
+ fr->af.subclass = IAX_COMMAND_LAGRP;
+ iax2_send(iaxs[fr->callno], &fr->af, fr->ts, -1, 0, 0, 0);
} else {
/* Received LAGRP in response to our LAGRQ */
unsigned int ts;
/* This is a reply we've been given, actually measure the difference */
- ts = calc_timestamp(iaxs[fr.callno], 0, &fr.af);
- iaxs[fr.callno]->lag = ts - fr.ts;
+ ts = calc_timestamp(iaxs[fr->callno], 0, &fr->af);
+ iaxs[fr->callno]->lag = ts - fr->ts;
if (option_debug && iaxdebug)
ast_log(LOG_DEBUG, "Peer %s lag measured as %dms\n",
- ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[fr.callno]->addr.sin_addr), iaxs[fr.callno]->lag);
+ ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[fr->callno]->addr.sin_addr), iaxs[fr->callno]->lag);
}
#ifdef BRIDGE_OPTIMIZATION
}
#endif
break;
case IAX_COMMAND_AUTHREQ:
- if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD)) {
- ast_log(LOG_WARNING, "Call on %s is already up, can't start on it\n", iaxs[fr.callno]->owner ? iaxs[fr.callno]->owner->name : "<Unknown>");
+ if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD)) {
+ ast_log(LOG_WARNING, "Call on %s is already up, can't start on it\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
break;
}
- if (authenticate_reply(iaxs[fr.callno], &iaxs[fr.callno]->addr, &ies, iaxs[fr.callno]->secret, iaxs[fr.callno]->outkey)) {
+ if (authenticate_reply(iaxs[fr->callno], &iaxs[fr->callno]->addr, &ies, iaxs[fr->callno]->secret, iaxs[fr->callno]->outkey)) {
ast_log(LOG_WARNING,
"I don't know how to authenticate %s to %s\n",
- ies.username ? ies.username : "<unknown>", ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[fr.callno]->addr.sin_addr));
+ ies.username ? ies.username : "<unknown>", ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[fr->callno]->addr.sin_addr));
}
break;
case IAX_COMMAND_AUTHREP:
/* For security, always ack immediately */
if (delayreject)
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
/* Ignore once we've started */
- if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD)) {
- ast_log(LOG_WARNING, "Call on %s is already up, can't start on it\n", iaxs[fr.callno]->owner ? iaxs[fr.callno]->owner->name : "<Unknown>");
+ if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD)) {
+ ast_log(LOG_WARNING, "Call on %s is already up, can't start on it\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
break;
}
- if (authenticate_verify(iaxs[fr.callno], &ies)) {
+ if (authenticate_verify(iaxs[fr->callno], &ies)) {
if (authdebug)
- ast_log(LOG_NOTICE, "Host %s failed to authenticate as %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[fr.callno]->addr.sin_addr), iaxs[fr.callno]->username);
+ ast_log(LOG_NOTICE, "Host %s failed to authenticate as %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[fr->callno]->addr.sin_addr), iaxs[fr->callno]->username);
memset(&ied0, 0, sizeof(ied0));
- auth_fail(fr.callno, IAX_COMMAND_REJECT);
+ auth_fail(fr->callno, IAX_COMMAND_REJECT);
break;
}
- if (strcasecmp(iaxs[fr.callno]->exten, "TBD")) {
+ if (strcasecmp(iaxs[fr->callno]->exten, "TBD")) {
/* This might re-enter the IAX code and need the lock */
- exists = ast_exists_extension(NULL, iaxs[fr.callno]->context, iaxs[fr.callno]->exten, 1, iaxs[fr.callno]->cid_num);
+ exists = ast_exists_extension(NULL, iaxs[fr->callno]->context, iaxs[fr->callno]->exten, 1, iaxs[fr->callno]->cid_num);
} else
exists = 0;
- if (strcmp(iaxs[fr.callno]->exten, "TBD") && !exists) {
+ if (strcmp(iaxs[fr->callno]->exten, "TBD") && !exists) {
if (authdebug)
- ast_log(LOG_NOTICE, "Rejected connect attempt from %s, request '%s@%s' does not exist\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->exten, iaxs[fr.callno]->context);
+ ast_log(LOG_NOTICE, "Rejected connect attempt from %s, request '%s@%s' does not exist\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->exten, iaxs[fr->callno]->context);
memset(&ied0, 0, sizeof(ied0));
iax_ie_append_str(&ied0, IAX_IE_CAUSE, "No such context/extension");
iax_ie_append_byte(&ied0, IAX_IE_CAUSECODE, AST_CAUSE_NO_ROUTE_DESTINATION);
- send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
+ send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
} else {
/* Select an appropriate format */
- if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOPREFS)) {
- if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP)) {
+ if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOPREFS)) {
+ if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP)) {
using_prefs = "reqonly";
} else {
using_prefs = "disabled";
}
- format = iaxs[fr.callno]->peerformat & iaxs[fr.callno]->capability;
+ format = iaxs[fr->callno]->peerformat & iaxs[fr->callno]->capability;
memset(&pref, 0, sizeof(pref));
strcpy(caller_pref_buf, "disabled");
strcpy(host_pref_buf, "disabled");
} else {
using_prefs = "mine";
- if(ies.codec_prefs) {
- /* If we are codec_first_choice we let the caller have the 1st shot at picking the codec.*/
- ast_codec_pref_convert(&rpref, ies.codec_prefs, 32, 0);
- if (ast_test_flag(iaxs[fr.callno], IAX_CODEC_USER_FIRST)) {
- ast_codec_pref_convert(&pref, ies.codec_prefs, 32, 0);
+ if (ies.codec_prefs)
+ ast_codec_pref_convert(&iaxs[fr->callno]->rprefs, ies.codec_prefs, 32, 0);
+ if (ast_codec_pref_index(&iaxs[fr->callno]->rprefs, 0)) {
+ if (ast_test_flag(iaxs[fr->callno], IAX_CODEC_USER_FIRST)) {
+ pref = iaxs[fr->callno]->rprefs;
using_prefs = "caller";
} else {
- pref = iaxs[fr.callno]->prefs;
+ pref = iaxs[fr->callno]->prefs;
}
} else /* if no codec_prefs IE do it the old way */
- pref = iaxs[fr.callno]->prefs;
+ pref = iaxs[fr->callno]->prefs;
- format = ast_codec_choose(&pref, iaxs[fr.callno]->capability & iaxs[fr.callno]->peercapability, 0);
- ast_codec_pref_string(&rpref, caller_pref_buf, sizeof(caller_pref_buf) - 1);
- ast_codec_pref_string(&iaxs[fr.callno]->prefs, host_pref_buf, sizeof(host_pref_buf) - 1);
+ format = ast_codec_choose(&pref, iaxs[fr->callno]->capability & iaxs[fr->callno]->peercapability, 0);
+ ast_codec_pref_string(&iaxs[fr->callno]->rprefs, caller_pref_buf, sizeof(caller_pref_buf) - 1);
+ ast_codec_pref_string(&iaxs[fr->callno]->prefs, host_pref_buf, sizeof(host_pref_buf) - 1);
}
if (!format) {
- if(!ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP)) {
- ast_log(LOG_DEBUG, "We don't do requested format %s, falling back to peer capability %d\n", ast_getformatname(iaxs[fr.callno]->peerformat), iaxs[fr.callno]->peercapability);
- format = iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability;
+ if(!ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP)) {
+ ast_log(LOG_DEBUG, "We don't do requested format %s, falling back to peer capability %d\n", ast_getformatname(iaxs[fr->callno]->peerformat), iaxs[fr->callno]->peercapability);
+ format = iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability;
}
if (!format) {
if (authdebug) {
- if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP))
- ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested 0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->capability);
+ if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP))
+ ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested 0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->peerformat, iaxs[fr->callno]->capability);
else
- ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->peercapability, iaxs[fr.callno]->capability);
+ ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->peerformat, iaxs[fr->callno]->peercapability, iaxs[fr->callno]->capability);
}
memset(&ied0, 0, sizeof(ied0));
iax_ie_append_str(&ied0, IAX_IE_CAUSE, "Unable to negotiate codec");
iax_ie_append_byte(&ied0, IAX_IE_CAUSECODE, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
- send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
+ send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
} else {
/* Pick one... */
- if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP)) {
- if(!(iaxs[fr.callno]->peerformat & iaxs[fr.callno]->capability))
+ if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP)) {
+ if(!(iaxs[fr->callno]->peerformat & iaxs[fr->callno]->capability))
format = 0;
} else {
- if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOPREFS)) {
- using_prefs = ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP) ? "reqonly" : "disabled";
+ if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOPREFS)) {
+ using_prefs = ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP) ? "reqonly" : "disabled";
memset(&pref, 0, sizeof(pref));
- format = ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP) ?
- iaxs[fr.callno]->peerformat : ast_best_codec(iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability);
+ format = ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP) ?
+ iaxs[fr->callno]->peerformat : ast_best_codec(iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability);
strcpy(caller_pref_buf,"disabled");
strcpy(host_pref_buf,"disabled");
} else {
using_prefs = "mine";
- if(ies.codec_prefs) {
+ if (ast_codec_pref_index(&iaxs[fr->callno]->rprefs, 0)) {
/* Do the opposite of what we tried above. */
- if (ast_test_flag(iaxs[fr.callno], IAX_CODEC_USER_FIRST)) {
- pref = iaxs[fr.callno]->prefs;
+ if (ast_test_flag(iaxs[fr->callno], IAX_CODEC_USER_FIRST)) {
+ pref = iaxs[fr->callno]->prefs;
} else {
- pref = rpref;
+ pref = iaxs[fr->callno]->rprefs;
using_prefs = "caller";
}
- format = ast_codec_choose(&pref, iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability, 1);
+ format = ast_codec_choose(&pref, iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability, 1);
} else /* if no codec_prefs IE do it the old way */
- format = ast_best_codec(iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability);
+ format = ast_best_codec(iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability);
}
}
if (!format) {
- ast_log(LOG_ERROR, "No best format in 0x%x???\n", iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability);
+ ast_log(LOG_ERROR, "No best format in 0x%x???\n", iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability);
if (authdebug) {
- if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP))
- ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested 0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->capability);
+ if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP))
+ ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested 0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->peerformat, iaxs[fr->callno]->capability);
else
- ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->peercapability, iaxs[fr.callno]->capability);
+ ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->peerformat, iaxs[fr->callno]->peercapability, iaxs[fr->callno]->capability);
}
memset(&ied0, 0, sizeof(ied0));
iax_ie_append_str(&ied0, IAX_IE_CAUSE, "Unable to negotiate codec");
iax_ie_append_byte(&ied0, IAX_IE_CAUSECODE, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
- send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
+ send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
}
}
}
@@ -7310,9 +7318,9 @@ retryowner2:
/* Authentication received */
memset(&ied1, 0, sizeof(ied1));
iax_ie_append_int(&ied1, IAX_IE_FORMAT, format);
- send_command(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACCEPT, 0, ied1.buf, ied1.pos, -1);
- if (strcmp(iaxs[fr.callno]->exten, "TBD")) {
- ast_set_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED);
+ send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACCEPT, 0, ied1.buf, ied1.pos, -1);
+ if (strcmp(iaxs[fr->callno]->exten, "TBD")) {
+ ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Accepting AUTHENTICATED call from %s:\n"
"%srequested format = %s,\n"
@@ -7322,7 +7330,7 @@ retryowner2:
"%spriority = %s\n",
ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr),
VERBOSE_PREFIX_4,
- ast_getformatname(iaxs[fr.callno]->peerformat),
+ ast_getformatname(iaxs[fr->callno]->peerformat),
VERBOSE_PREFIX_4,
caller_pref_buf,
VERBOSE_PREFIX_4,
@@ -7332,11 +7340,11 @@ retryowner2:
VERBOSE_PREFIX_4,
using_prefs);
- ast_set_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED);
- if(!(c = ast_iax2_new(fr.callno, AST_STATE_RING, format)))
- iax2_destroy_nolock(fr.callno);
+ ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
+ if(!(c = ast_iax2_new(fr->callno, AST_STATE_RING, format)))
+ iax2_destroy_nolock(fr->callno);
} else {
- ast_set_flag(&iaxs[fr.callno]->state, IAX_STATE_TBD);
+ ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD);
/* If this is a TBD call, we're ready but now what... */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Accepted AUTHENTICATED TBD call from %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr));
@@ -7345,147 +7353,147 @@ retryowner2:
}
break;
case IAX_COMMAND_DIAL:
- if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_TBD)) {
- ast_clear_flag(&iaxs[fr.callno]->state, IAX_STATE_TBD);
- ast_copy_string(iaxs[fr.callno]->exten, ies.called_number ? ies.called_number : "s", sizeof(iaxs[fr.callno]->exten));
- if (!ast_exists_extension(NULL, iaxs[fr.callno]->context, iaxs[fr.callno]->exten, 1, iaxs[fr.callno]->cid_num)) {
+ if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD)) {
+ ast_clear_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD);
+ ast_copy_string(iaxs[fr->callno]->exten, ies.called_number ? ies.called_number : "s", sizeof(iaxs[fr->callno]->exten));
+ if (!ast_exists_extension(NULL, iaxs[fr->callno]->context, iaxs[fr->callno]->exten, 1, iaxs[fr->callno]->cid_num)) {
if (authdebug)
- ast_log(LOG_NOTICE, "Rejected dial attempt from %s, request '%s@%s' does not exist\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->exten, iaxs[fr.callno]->context);
+ ast_log(LOG_NOTICE, "Rejected dial attempt from %s, request '%s@%s' does not exist\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->exten, iaxs[fr->callno]->context);
memset(&ied0, 0, sizeof(ied0));
iax_ie_append_str(&ied0, IAX_IE_CAUSE, "No such context/extension");
iax_ie_append_byte(&ied0, IAX_IE_CAUSECODE, AST_CAUSE_NO_ROUTE_DESTINATION);
- send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
+ send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
} else {
- ast_set_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED);
+ ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Accepting DIAL from %s, formats = 0x%x\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->peerformat);
- ast_set_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED);
- send_command(iaxs[fr.callno], AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, 0, NULL, 0, -1);
- if(!(c = ast_iax2_new(fr.callno, AST_STATE_RING, iaxs[fr.callno]->peerformat)))
- iax2_destroy_nolock(fr.callno);
+ ast_verbose(VERBOSE_PREFIX_3 "Accepting DIAL from %s, formats = 0x%x\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->peerformat);
+ ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
+ send_command(iaxs[fr->callno], AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, 0, NULL, 0, -1);
+ if(!(c = ast_iax2_new(fr->callno, AST_STATE_RING, iaxs[fr->callno]->peerformat)))
+ iax2_destroy_nolock(fr->callno);
}
}
break;
case IAX_COMMAND_INVAL:
- iaxs[fr.callno]->error = ENOTCONN;
- ast_log(LOG_DEBUG, "Immediately destroying %d, having received INVAL\n", fr.callno);
- iax2_destroy_nolock(fr.callno);
+ iaxs[fr->callno]->error = ENOTCONN;
+ ast_log(LOG_DEBUG, "Immediately destroying %d, having received INVAL\n", fr->callno);
+ iax2_destroy_nolock(fr->callno);
if (option_debug)
- ast_log(LOG_DEBUG, "Destroying call %d\n", fr.callno);
+ ast_log(LOG_DEBUG, "Destroying call %d\n", fr->callno);
break;
case IAX_COMMAND_VNAK:
ast_log(LOG_DEBUG, "Received VNAK: resending outstanding frames\n");
/* Force retransmission */
- vnak_retransmit(fr.callno, fr.iseqno);
+ vnak_retransmit(fr->callno, fr->iseqno);
break;
case IAX_COMMAND_REGREQ:
case IAX_COMMAND_REGREL:
/* For security, always ack immediately */
if (delayreject)
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
- if (register_verify(fr.callno, &sin, &ies)) {
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+ if (register_verify(fr->callno, &sin, &ies)) {
/* Send delayed failure */
- auth_fail(fr.callno, IAX_COMMAND_REGREJ);
+ auth_fail(fr->callno, IAX_COMMAND_REGREJ);
break;
}
- if ((ast_strlen_zero(iaxs[fr.callno]->secret) && ast_strlen_zero(iaxs[fr.callno]->inkeys)) || ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_AUTHENTICATED)) {
+ if ((ast_strlen_zero(iaxs[fr->callno]->secret) && ast_strlen_zero(iaxs[fr->callno]->inkeys)) || ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_AUTHENTICATED)) {
if (f.subclass == IAX_COMMAND_REGREL)
memset(&sin, 0, sizeof(sin));
- if (update_registry(iaxs[fr.callno]->peer, &sin, fr.callno, ies.devicetype, fd, ies.refresh))
+ if (update_registry(iaxs[fr->callno]->peer, &sin, fr->callno, ies.devicetype, fd, ies.refresh))
ast_log(LOG_WARNING, "Registry error\n");
if (ies.provverpres && ies.serviceident && sin.sin_addr.s_addr)
check_provisioning(&sin, fd, ies.serviceident, ies.provver);
break;
}
- registry_authrequest(iaxs[fr.callno]->peer, fr.callno);
+ registry_authrequest(iaxs[fr->callno]->peer, fr->callno);
break;
case IAX_COMMAND_REGACK:
- if (iax2_ack_registry(&ies, &sin, fr.callno))
+ if (iax2_ack_registry(&ies, &sin, fr->callno))
ast_log(LOG_WARNING, "Registration failure\n");
/* Send ack immediately, before we destroy */
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
- iax2_destroy_nolock(fr.callno);
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+ iax2_destroy_nolock(fr->callno);
break;
case IAX_COMMAND_REGREJ:
- if (iaxs[fr.callno]->reg) {
+ if (iaxs[fr->callno]->reg) {
if (authdebug) {
- ast_log(LOG_NOTICE, "Registration of '%s' rejected: '%s' from: '%s'\n", iaxs[fr.callno]->reg->username, ies.cause ? ies.cause : "<unknown>", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr));
- manager_event(EVENT_FLAG_SYSTEM, "Registry", "Channel: IAX2\r\nUsername: %s\r\nStatus: Rejected\r\nCause: %s\r\n", iaxs[fr.callno]->reg->username, ies.cause ? ies.cause : "<unknown>");
+ ast_log(LOG_NOTICE, "Registration of '%s' rejected: '%s' from: '%s'\n", iaxs[fr->callno]->reg->username, ies.cause ? ies.cause : "<unknown>", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr));
+ manager_event(EVENT_FLAG_SYSTEM, "Registry", "Channel: IAX2\r\nUsername: %s\r\nStatus: Rejected\r\nCause: %s\r\n", iaxs[fr->callno]->reg->username, ies.cause ? ies.cause : "<unknown>");
}
- iaxs[fr.callno]->reg->regstate = REG_STATE_REJECTED;
+ iaxs[fr->callno]->reg->regstate = REG_STATE_REJECTED;
}
/* Send ack immediately, before we destroy */
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
- iax2_destroy_nolock(fr.callno);
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+ iax2_destroy_nolock(fr->callno);
break;
case IAX_COMMAND_REGAUTH:
/* Authentication request */
- if (registry_rerequest(&ies, fr.callno, &sin)) {
+ if (registry_rerequest(&ies, fr->callno, &sin)) {
memset(&ied0, 0, sizeof(ied0));
iax_ie_append_str(&ied0, IAX_IE_CAUSE, "No authority found");
iax_ie_append_byte(&ied0, IAX_IE_CAUSECODE, AST_CAUSE_FACILITY_NOT_SUBSCRIBED);
- send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
+ send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
}
break;
case IAX_COMMAND_TXREJ:
- iaxs[fr.callno]->transferring = 0;
+ iaxs[fr->callno]->transferring = 0;
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel '%s' unable to transfer\n", iaxs[fr.callno]->owner ? iaxs[fr.callno]->owner->name : "<Unknown>");
- memset(&iaxs[fr.callno]->transfer, 0, sizeof(iaxs[fr.callno]->transfer));
- if (iaxs[fr.callno]->bridgecallno) {
- if (iaxs[iaxs[fr.callno]->bridgecallno]->transferring) {
- iaxs[iaxs[fr.callno]->bridgecallno]->transferring = 0;
- send_command(iaxs[iaxs[fr.callno]->bridgecallno], AST_FRAME_IAX, IAX_COMMAND_TXREJ, 0, NULL, 0, -1);
+ ast_verbose(VERBOSE_PREFIX_3 "Channel '%s' unable to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
+ memset(&iaxs[fr->callno]->transfer, 0, sizeof(iaxs[fr->callno]->transfer));
+ if (iaxs[fr->callno]->bridgecallno) {
+ if (iaxs[iaxs[fr->callno]->bridgecallno]->transferring) {
+ iaxs[iaxs[fr->callno]->bridgecallno]->transferring = 0;
+ send_command(iaxs[iaxs[fr->callno]->bridgecallno], AST_FRAME_IAX, IAX_COMMAND_TXREJ, 0, NULL, 0, -1);
}
}
break;
case IAX_COMMAND_TXREADY:
- if (iaxs[fr.callno]->transferring == TRANSFER_BEGIN) {
- iaxs[fr.callno]->transferring = TRANSFER_READY;
+ if (iaxs[fr->callno]->transferring == TRANSFER_BEGIN) {
+ iaxs[fr->callno]->transferring = TRANSFER_READY;
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel '%s' ready to transfer\n", iaxs[fr.callno]->owner ? iaxs[fr.callno]->owner->name : "<Unknown>");
- if (iaxs[fr.callno]->bridgecallno) {
- if (iaxs[iaxs[fr.callno]->bridgecallno]->transferring == TRANSFER_READY) {
+ ast_verbose(VERBOSE_PREFIX_3 "Channel '%s' ready to transfer\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>");
+ if (iaxs[fr->callno]->bridgecallno) {
+ if (iaxs[iaxs[fr->callno]->bridgecallno]->transferring == TRANSFER_READY) {
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Releasing %s and %s\n", iaxs[fr.callno]->owner ? iaxs[fr.callno]->owner->name : "<Unknown>",
- iaxs[iaxs[fr.callno]->bridgecallno]->owner ? iaxs[iaxs[fr.callno]->bridgecallno]->owner->name : "<Unknown>");
+ ast_verbose(VERBOSE_PREFIX_3 "Releasing %s and %s\n", iaxs[fr->callno]->owner ? iaxs[fr->callno]->owner->name : "<Unknown>",
+ iaxs[iaxs[fr->callno]->bridgecallno]->owner ? iaxs[iaxs[fr->callno]->bridgecallno]->owner->name : "<Unknown>");
/* They're both ready, now release them. */
- iaxs[iaxs[fr.callno]->bridgecallno]->transferring = TRANSFER_RELEASED;
- iaxs[fr.callno]->transferring = TRANSFER_RELEASED;
- ast_set_flag(iaxs[iaxs[fr.callno]->bridgecallno], IAX_ALREADYGONE);
- ast_set_flag(iaxs[fr.callno], IAX_ALREADYGONE);
+ iaxs[iaxs[fr->callno]->bridgecallno]->transferring = TRANSFER_RELEASED;
+ iaxs[fr->callno]->transferring = TRANSFER_RELEASED;
+ ast_set_flag(iaxs[iaxs[fr->callno]->bridgecallno], IAX_ALREADYGONE);
+ ast_set_flag(iaxs[fr->callno], IAX_ALREADYGONE);
/* Stop doing lag & ping requests */
- stop_stuff(fr.callno);
- stop_stuff(iaxs[fr.callno]->bridgecallno);
+ stop_stuff(fr->callno);
+ stop_stuff(iaxs[fr->callno]->bridgecallno);
memset(&ied0, 0, sizeof(ied0));
memset(&ied1, 0, sizeof(ied1));
- iax_ie_append_short(&ied0, IAX_IE_CALLNO, iaxs[iaxs[fr.callno]->bridgecallno]->peercallno);
- iax_ie_append_short(&ied1, IAX_IE_CALLNO, iaxs[fr.callno]->peercallno);
- send_command(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_TXREL, 0, ied0.buf, ied0.pos, -1);
- send_command(iaxs[iaxs[fr.callno]->bridgecallno], AST_FRAME_IAX, IAX_COMMAND_TXREL, 0, ied1.buf, ied1.pos, -1);
+ iax_ie_append_short(&ied0, IAX_IE_CALLNO, iaxs[iaxs[fr->callno]->bridgecallno]->peercallno);
+ iax_ie_append_short(&ied1, IAX_IE_CALLNO, iaxs[fr->callno]->peercallno);
+ send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_TXREL, 0, ied0.buf, ied0.pos, -1);
+ send_command(iaxs[iaxs[fr->callno]->bridgecallno], AST_FRAME_IAX, IAX_COMMAND_TXREL, 0, ied1.buf, ied1.pos, -1);
}
}
}
break;
case IAX_COMMAND_TXREQ:
- try_transfer(iaxs[fr.callno], &ies);
+ try_transfer(iaxs[fr->callno], &ies);
break;
case IAX_COMMAND_TXCNT:
- if (iaxs[fr.callno]->transferring)
- send_command_transfer(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_TXACC, 0, NULL, 0);
+ if (iaxs[fr->callno]->transferring)
+ send_command_transfer(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_TXACC, 0, NULL, 0);
break;
case IAX_COMMAND_TXREL:
/* Send ack immediately, rather than waiting until we've changed addresses */
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
- complete_transfer(fr.callno, &ies);
- stop_stuff(fr.callno); /* for attended transfer to work with libiax */
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+ complete_transfer(fr->callno, &ies);
+ stop_stuff(fr->callno); /* for attended transfer to work with libiax */
break;
case IAX_COMMAND_DPREP:
- complete_dpreply(iaxs[fr.callno], &ies);
+ complete_dpreply(iaxs[fr->callno], &ies);
break;
case IAX_COMMAND_UNSUPPORT:
ast_log(LOG_NOTICE, "Peer did not understand our iax command '%d'\n", ies.iax_unknown);
@@ -7495,17 +7503,17 @@ retryowner2:
memset(&ied0, 0, sizeof(ied0));
res = iax_firmware_append(&ied0, (unsigned char *)ies.devicetype, ies.fwdesc);
if (res < 0)
- send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
+ send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
else if (res > 0)
- send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_FWDATA, 0, ied0.buf, ied0.pos, -1);
+ send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_FWDATA, 0, ied0.buf, ied0.pos, -1);
else
- send_command(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_FWDATA, 0, ied0.buf, ied0.pos, -1);
+ send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_FWDATA, 0, ied0.buf, ied0.pos, -1);
break;
default:
- ast_log(LOG_DEBUG, "Unknown IAX command %d on %d/%d\n", f.subclass, fr.callno, iaxs[fr.callno]->peercallno);
+ ast_log(LOG_DEBUG, "Unknown IAX command %d on %d/%d\n", f.subclass, fr->callno, iaxs[fr->callno]->peercallno);
memset(&ied0, 0, sizeof(ied0));
iax_ie_append_byte(&ied0, IAX_IE_IAX_UNKNOWN, f.subclass);
- send_command(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_UNSUPPORT, 0, ied0.buf, ied0.pos, -1);
+ send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_UNSUPPORT, 0, ied0.buf, ied0.pos, -1);
}
/* Don't actually pass these frames along */
if ((f.subclass != IAX_COMMAND_ACK) &&
@@ -7513,23 +7521,23 @@ retryowner2:
(f.subclass != IAX_COMMAND_TXACC) &&
(f.subclass != IAX_COMMAND_INVAL) &&
(f.subclass != IAX_COMMAND_VNAK)) {
- if (iaxs[fr.callno] && iaxs[fr.callno]->aseqno != iaxs[fr.callno]->iseqno)
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
+ if (iaxs[fr->callno] && iaxs[fr->callno]->aseqno != iaxs[fr->callno]->iseqno)
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
}
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
/* Unless this is an ACK or INVAL frame, ack it */
- if (iaxs[fr.callno]->aseqno != iaxs[fr.callno]->iseqno)
- send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
+ if (iaxs[fr->callno]->aseqno != iaxs[fr->callno]->iseqno)
+ send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
} else if (minivid) {
f.frametype = AST_FRAME_VIDEO;
- if (iaxs[fr.callno]->videoformat > 0)
- f.subclass = iaxs[fr.callno]->videoformat | (ntohs(vh->ts) & 0x8000 ? 1 : 0);
+ if (iaxs[fr->callno]->videoformat > 0)
+ f.subclass = iaxs[fr->callno]->videoformat | (ntohs(vh->ts) & 0x8000 ? 1 : 0);
else {
ast_log(LOG_WARNING, "Received mini frame before first full video frame\n ");
- iax2_vnak(fr.callno);
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ iax2_vnak(fr->callno);
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
f.datalen = res - sizeof(struct ast_iax2_video_hdr);
@@ -7539,25 +7547,25 @@ retryowner2:
f.data = NULL;
#ifdef IAXTESTS
if (test_resync) {
- fr.ts = (iaxs[fr.callno]->last & 0xFFFF8000L) | ((ntohs(mh->ts) + test_resync) & 0x7fff);
+ fr->ts = (iaxs[fr->callno]->last & 0xFFFF8000L) | ((ntohs(mh->ts) + test_resync) & 0x7fff);
} else
#endif /* IAXTESTS */
- fr.ts = (iaxs[fr.callno]->last & 0xFFFF8000L) | (ntohs(mh->ts) & 0x7fff);
+ fr->ts = (iaxs[fr->callno]->last & 0xFFFF8000L) | (ntohs(mh->ts) & 0x7fff);
} else {
/* A mini frame */
f.frametype = AST_FRAME_VOICE;
- if (iaxs[fr.callno]->voiceformat > 0)
- f.subclass = iaxs[fr.callno]->voiceformat;
+ if (iaxs[fr->callno]->voiceformat > 0)
+ f.subclass = iaxs[fr->callno]->voiceformat;
else {
ast_log(LOG_WARNING, "Received mini frame before first full voice frame\n ");
- iax2_vnak(fr.callno);
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ iax2_vnak(fr->callno);
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
f.datalen = res - sizeof(struct ast_iax2_mini_hdr);
if (f.datalen < 0) {
ast_log(LOG_WARNING, "Datalen < 0?\n");
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
if (f.datalen)
@@ -7566,15 +7574,15 @@ retryowner2:
f.data = NULL;
#ifdef IAXTESTS
if (test_resync) {
- fr.ts = (iaxs[fr.callno]->last & 0xFFFF0000L) | ((ntohs(mh->ts) + test_resync) & 0xffff);
+ fr->ts = (iaxs[fr->callno]->last & 0xFFFF0000L) | ((ntohs(mh->ts) + test_resync) & 0xffff);
} else
#endif /* IAXTESTS */
- fr.ts = (iaxs[fr.callno]->last & 0xFFFF0000L) | ntohs(mh->ts);
+ fr->ts = (iaxs[fr->callno]->last & 0xFFFF0000L) | ntohs(mh->ts);
/* FIXME? Surely right here would be the right place to undo timestamp wraparound? */
}
/* Don't pass any packets until we're started */
- if (!ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED)) {
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ if (!ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED)) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
/* Common things */
@@ -7588,43 +7596,43 @@ retryowner2:
ast_frame_byteswap_be(&f);
} else
f.samples = 0;
- iax_frame_wrap(&fr, &f);
+ iax_frame_wrap(fr, &f);
/* If this is our most recent packet, use it as our basis for timestamping */
- if (iaxs[fr.callno]->last < fr.ts) {
- /*iaxs[fr.callno]->last = fr.ts; (do it afterwards cos schedule/forward_delivery needs the last ts too)*/
- fr.outoforder = 0;
+ if (iaxs[fr->callno]->last < fr->ts) {
+ /*iaxs[fr->callno]->last = fr->ts; (do it afterwards cos schedule/forward_delivery needs the last ts too)*/
+ fr->outoforder = 0;
} else {
if (option_debug && iaxdebug)
- ast_log(LOG_DEBUG, "Received out of order packet... (type=%d, subclass %d, ts = %d, last = %d)\n", f.frametype, f.subclass, fr.ts, iaxs[fr.callno]->last);
- fr.outoforder = -1;
+ ast_log(LOG_DEBUG, "Received out of order packet... (type=%d, subclass %d, ts = %d, last = %d)\n", f.frametype, f.subclass, fr->ts, iaxs[fr->callno]->last);
+ fr->outoforder = -1;
}
#ifdef BRIDGE_OPTIMIZATION
- if (iaxs[fr.callno]->bridgecallno) {
+ if (iaxs[fr->callno]->bridgecallno) {
forward_delivery(&fr);
} else {
duped_fr = iaxfrdup2(&fr);
if (duped_fr) {
- schedule_delivery(duped_fr, updatehistory, 0, &fr.ts);
+ schedule_delivery(duped_fr, updatehistory, 0, &fr->ts);
}
}
#else
- duped_fr = iaxfrdup2(&fr);
+ duped_fr = iaxfrdup2(fr);
if (duped_fr) {
- schedule_delivery(duped_fr, updatehistory, 0, &fr.ts);
+ schedule_delivery(duped_fr, updatehistory, 0, &fr->ts);
}
#endif
- if (iaxs[fr.callno]->last < fr.ts) {
- iaxs[fr.callno]->last = fr.ts;
+ if (iaxs[fr->callno]->last < fr->ts) {
+ iaxs[fr->callno]->last = fr->ts;
#if 1
if (option_debug && iaxdebug)
- ast_log(LOG_DEBUG, "For call=%d, set last=%d\n", fr.callno, fr.ts);
+ ast_log(LOG_DEBUG, "For call=%d, set last=%d\n", fr->callno, fr->ts);
#endif
}
/* Always run again */
- ast_mutex_unlock(&iaxsl[fr.callno]);
+ ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
@@ -8081,6 +8089,7 @@ static int peer_set_srcaddr(struct iax2_peer *peer, const char *srcaddr)
int res;
sin.sin_port = 0;
+ sin.sin_family = AF_INET;
res = check_srcaddr((struct sockaddr *) &sin, sizeof(sin));
if (res == 0) {
/* ip address valid. */
diff --git a/channels/chan_local.c b/channels/chan_local.c
index f843fd95d..14ef083f6 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -344,6 +344,8 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout)
else
p->chan->cid.cid_ani = NULL;
+ p->chan->cid.cid_pres = p->owner->cid.cid_pres;
+
strncpy(p->chan->language, p->owner->language, sizeof(p->chan->language) - 1);
strncpy(p->chan->accountcode, p->owner->accountcode, sizeof(p->chan->accountcode) - 1);
p->chan->cdrflags = p->owner->cdrflags;
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index aa651015d..cf7e8892c 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -349,6 +349,8 @@ static char default_notifymime[AST_MAX_EXTENSION] = DEFAULT_NOTIFYMIME;
static int global_notifyringing = 1; /*!< Send notifications on ringing */
+static int global_alwaysauthreject = 0; /*!< Send 401 Unauthorized for all failing requests */
+
static int default_qualify = 0; /*!< Default Qualify= setting */
static struct ast_flags global_flags = {0}; /*!< global SIP_ flags */
@@ -454,11 +456,13 @@ struct sip_request {
int headers; /*!< # of SIP Headers */
int method; /*!< Method of this request */
char *header[SIP_MAX_HEADERS];
- int lines; /*!< SDP Content */
+ int lines; /*!< Body Content */
char *line[SIP_MAX_LINES];
char data[SIP_MAX_PACKET];
int debug; /*!< Debug flag for this packet */
unsigned int flags; /*!< SIP_PKT Flags for this packet */
+ unsigned int sdp_start; /*!< the line number where the SDP begins */
+ unsigned int sdp_end; /*!< the line number where the SDP ends */
};
struct sip_pkt;
@@ -525,8 +529,8 @@ struct sip_auth {
#define SIP_REALTIME (1 << 11) /*!< Flag for realtime users */
#define SIP_USECLIENTCODE (1 << 12) /*!< Trust X-ClientCode info message */
#define SIP_OUTGOING (1 << 13) /*!< Is this an outgoing call? */
-#define SIP_SELFDESTRUCT (1 << 14)
-#define SIP_DYNAMIC (1 << 15) /*!< Is this a dynamic peer? */
+#define SIP_SELFDESTRUCT (1 << 14) /*!< This is an autocreated peer */
+#define SIP_CAN_BYE (1 << 15) /*!< Can we send BYE for this dialog? */
/* --- Choices for DTMF support in SIP channel */
#define SIP_DTMF (3 << 16) /*!< three settings, uses two bits */
#define SIP_DTMF_RFC2833 (0 << 16) /*!< RTP DTMF */
@@ -576,6 +580,7 @@ struct sip_auth {
#define SIP_PAGE2_RTAUTOCLEAR (1 << 2)
#define SIP_PAGE2_IGNOREREGEXPIRE (1 << 3)
#define SIP_PAGE2_RT_FROMCONTACT (1 << 4)
+#define SIP_PAGE2_DYNAMIC (1 << 5) /*!< Is this a dynamic peer? */
/* SIP packet flags */
#define SIP_PKT_DEBUG (1 << 0) /*!< Debug this packet */
@@ -2452,12 +2457,18 @@ static int sip_hangup(struct ast_channel *ast)
/* stop retransmitting an INVITE that has not received a response */
__sip_pretend_ack(p);
- /* Send a new request: CANCEL */
- transmit_request_with_auth(p, SIP_CANCEL, p->ocseq, 1, 0);
- /* Actually don't destroy us yet, wait for the 487 on our original
- INVITE, but do set an autodestruct just in case we never get it. */
- ast_clear_flag(&locflags, SIP_NEEDDESTROY);
- sip_scheddestroy(p, 32000);
+ /* are we allowed to send CANCEL yet? if not, mark
+ it pending */
+ if (!ast_test_flag(p, SIP_CAN_BYE)) {
+ ast_set_flag(p, SIP_PENDINGBYE);
+ } else {
+ /* Send a new request: CANCEL */
+ transmit_request_with_auth(p, SIP_CANCEL, p->ocseq, 1, 0);
+ /* Actually don't destroy us yet, wait for the 487 on our original
+ INVITE, but do set an autodestruct just in case we never get it. */
+ ast_clear_flag(&locflags, SIP_NEEDDESTROY);
+ sip_scheddestroy(p, 32000);
+ }
if ( p->initid != -1 ) {
/* channel still up - reverse dec of inUse counter
only if the channel is not auto-congested */
@@ -2849,8 +2860,8 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title)
return tmp;
}
-/*! \brief get_sdp_by_line: Reads one line of SIP message body */
-static char* get_sdp_by_line(char* line, char *name, int nameLen)
+/*! \brief get_body_by_line: Reads one line of message body */
+static char *get_body_by_line(char *line, char *name, int nameLen)
{
if (strncasecmp(line, name, nameLen) == 0 && line[nameLen] == '=') {
return ast_skip_blanks(line + nameLen + 1);
@@ -2858,36 +2869,49 @@ static char* get_sdp_by_line(char* line, char *name, int nameLen)
return "";
}
-/*! \brief get_sdp: Gets all kind of SIP message bodies, including SDP,
- but the name wrongly applies _only_ sdp */
+/*! \brief get_sdp: get a specific line from the SDP */
static char *get_sdp(struct sip_request *req, char *name)
{
int x;
int len = strlen(name);
char *r;
- for (x=0; x<req->lines; x++) {
- r = get_sdp_by_line(req->line[x], name, len);
+ for (x = req->sdp_start; x < req->sdp_end; x++) {
+ r = get_body_by_line(req->line[x], name, len);
if (r[0] != '\0')
return r;
}
return "";
}
-
-static void sdpLineNum_iterator_init(int* iterator)
+static void sdpLineNum_iterator_init(int *iterator, struct sip_request *req)
{
- *iterator = 0;
+ *iterator = req->sdp_start;
}
-static char* get_sdp_iterate(int* iterator,
+static char *get_sdp_iterate(int *iterator,
struct sip_request *req, char *name)
{
int len = strlen(name);
char *r;
- while (*iterator < req->lines) {
- r = get_sdp_by_line(req->line[(*iterator)++], name, len);
+ while (*iterator < req->sdp_end) {
+ r = get_body_by_line(req->line[(*iterator)++], name, len);
+ if (r[0] != '\0')
+ return r;
+ }
+ return "";
+}
+
+/*! \brief get_body: get a specific line from the message body */
+static char *get_body(struct sip_request *req, char *name)
+{
+ int x;
+ int len = strlen(name);
+ char *r;
+
+ for (x = 0; x < req->lines; x++) {
+ r = get_body_by_line(req->line[x], name, len);
if (r[0] != '\0')
return r;
}
@@ -3390,6 +3414,68 @@ static void parse_request(struct sip_request *req)
determine_firstline_parts(req);
}
+/*!
+ \brief Determine whether a SIP message contains an SDP in its body
+ \param req the SIP request to process
+ \return 1 if SDP found, 0 if not found
+
+ Also updates req->sdp_start and req->sdp_end to indicate where the SDP
+ lives in the message body.
+*/
+static int find_sdp(struct sip_request *req)
+{
+ char *content_type;
+ char *search;
+ char *boundary;
+ unsigned int x;
+
+ content_type = get_header(req, "Content-Type");
+
+ /* if the body contains only SDP, this is easy */
+ if (!strcasecmp(content_type, "application/sdp")) {
+ req->sdp_start = 0;
+ req->sdp_end = req->lines;
+ return 1;
+ }
+
+ /* if it's not multipart/mixed, there cannot be an SDP */
+ if (strncasecmp(content_type, "multipart/mixed", 15))
+ return 0;
+
+ /* if there is no boundary marker, it's invalid */
+ if (!(search = strcasestr(content_type, ";boundary=")))
+ return 0;
+
+ search += 10;
+
+ if (ast_strlen_zero(search))
+ return 0;
+
+ /* make a duplicate of the string, with two extra characters
+ at the beginning */
+ boundary = ast_strdupa(search - 2);
+ boundary[0] = boundary[1] = '-';
+
+ /* search for the boundary marker, but stop when there are not enough
+ lines left for it, the Content-Type header and at least one line of
+ body */
+ for (x = 0; x < (req->lines - 2); x++) {
+ if (!strncasecmp(req->line[x], boundary, strlen(boundary)) &&
+ !strcasecmp(req->line[x + 1], "Content-Type: application/sdp")) {
+ req->sdp_start = x + 2;
+ /* search for the end of the body part */
+ for ( ; x < req->lines; x++) {
+ if (!strncasecmp(req->line[x], boundary, strlen(boundary)))
+ break;
+ }
+ req->sdp_end = x;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
/*! \brief process_sdp: Process SIP SDP and activate RTP channels---*/
static int process_sdp(struct sip_pvt *p, struct sip_request *req)
{
@@ -3424,13 +3510,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
time(&p->lastrtprx);
time(&p->lastrtptx);
- /* Get codec and RTP info from SDP */
- if (strcasecmp(get_header(req, "Content-Type"), "application/sdp")) {
- ast_log(LOG_NOTICE, "Content is '%s', not 'application/sdp'\n", get_header(req, "Content-Type"));
- return -1;
- }
m = get_sdp(req, "m");
- sdpLineNum_iterator_init(&destiterator);
+ sdpLineNum_iterator_init(&destiterator, req);
c = get_sdp_iterate(&destiterator, req, "c");
if (ast_strlen_zero(m) || ast_strlen_zero(c)) {
ast_log(LOG_WARNING, "Insufficient information for SDP (m = '%s', c = '%s')\n", m, c);
@@ -3446,7 +3527,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
ast_log(LOG_WARNING, "Unable to lookup host in c= line, '%s'\n", c);
return -1;
}
- sdpLineNum_iterator_init(&iterator);
+ sdpLineNum_iterator_init(&iterator, req);
ast_set_flag(p, SIP_NOVIDEO);
while ((m = get_sdp_iterate(&iterator, req, "m"))[0] != '\0') {
int found = 0;
@@ -3551,15 +3632,15 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
/* Next, scan through each "a=rtpmap:" line, noting each
* specified RTP payload type (with corresponding MIME subtype):
*/
- sdpLineNum_iterator_init(&iterator);
+ sdpLineNum_iterator_init(&iterator, req);
while ((a = get_sdp_iterate(&iterator, req, "a"))[0] != '\0') {
char* mimeSubtype = ast_strdupa(a); /* ensures we have enough space */
- if (!strcasecmp(a, "sendonly")) {
- sendonly=1;
+ if (!strcasecmp(a, "sendonly") || !strcasecmp(a, "inactive")) {
+ sendonly = 1;
continue;
}
if (!strcasecmp(a, "sendrecv")) {
- sendonly=0;
+ sendonly = 0;
}
if (sscanf(a, "rtpmap: %u %[^/]/", &codec, mimeSubtype) != 2) continue;
if (debug)
@@ -5639,17 +5720,24 @@ static void destroy_association(struct sip_peer *peer)
static int expire_register(void *data)
{
struct sip_peer *peer = data;
+
+ if (!peer) /* Hmmm. We have no peer. Weird. */
+ return 0;
memset(&peer->addr, 0, sizeof(peer->addr));
destroy_association(peer);
manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: SIP/%s\r\nPeerStatus: Unregistered\r\nCause: Expired\r\n", peer->name);
- register_peer_exten(peer, 0);
+ register_peer_exten(peer, 0); /* Remove regexten */
peer->expire = -1;
ast_device_state_changed("SIP/%s", peer->name);
+
+ /* Do we need to release this peer from memory?
+ Only for realtime peers and autocreated peers
+ */
if (ast_test_flag(peer, SIP_SELFDESTRUCT) || ast_test_flag((&peer->flags_page2), SIP_PAGE2_RTAUTOCLEAR)) {
- peer = ASTOBJ_CONTAINER_UNLINK(&peerl, peer);
+ peer = ASTOBJ_CONTAINER_UNLINK(&peerl, peer); /* Remove from peer list */
ASTOBJ_UNREF(peer, sip_destroy_peer);
}
@@ -6349,6 +6437,15 @@ static int cb_extensionstate(char *context, char* exten, int state, void *data)
return 0;
}
+/*! \brief Send a fake 401 Unauthorized response when the administrator
+ wants to hide the names of local users/peers from fishers
+*/
+static void transmit_fake_auth_response(struct sip_pvt *p, struct sip_request *req, char *randdata, int randlen, int reliable)
+{
+ snprintf(randdata, randlen, "%08x", thread_safe_rand());
+ transmit_response_with_auth(p, "401 Unauthorized", req, randdata, reliable, "WWW-Authenticate", 0);
+}
+
/*! \brief register_verify: Verify registration of user */
static int register_verify(struct sip_pvt *p, struct sockaddr_in *sin, struct sip_request *req, char *uri, int ignore)
{
@@ -6405,7 +6502,7 @@ static int register_verify(struct sip_pvt *p, struct sockaddr_in *sin, struct si
ASTOBJ_UNREF(peer,sip_destroy_peer);
}
if (peer) {
- if (!ast_test_flag(peer, SIP_DYNAMIC)) {
+ if (!ast_test_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC)) {
ast_log(LOG_ERROR, "Peer '%s' is trying to register, but not configured as host=dynamic\n", peer->name);
} else {
ast_copy_flags(p, peer, SIP_NAT);
@@ -6480,8 +6577,12 @@ static int register_verify(struct sip_pvt *p, struct sockaddr_in *sin, struct si
transmit_response(p, "403 Authentication user name does not match account name", &p->initreq);
break;
case -3:
- /* URI not found */
- transmit_response(p, "404 Not found", &p->initreq);
+ if (global_alwaysauthreject) {
+ transmit_fake_auth_response(p, &p->initreq, p->randdata, sizeof(p->randdata), 1);
+ } else {
+ /* URI not found */
+ transmit_response(p, "404 Not found", &p->initreq);
+ }
/* Set res back to -2 because we don't want to return an invalid domain message. That check already happened up above. */
res = -2;
break;
@@ -6665,6 +6766,7 @@ static int get_refer_info(struct sip_pvt *sip_pvt, struct sip_request *outgoing_
struct sip_request *req = NULL;
struct sip_pvt *sip_pvt_ptr = NULL;
struct ast_channel *chan = NULL, *peer = NULL;
+ const char *transfercontext;
req = outgoing_req;
@@ -6741,8 +6843,12 @@ static int get_refer_info(struct sip_pvt *sip_pvt, struct sip_request *outgoing_
*ptr = '\0';
}
+ transfercontext = pbx_builtin_getvar_helper(sip_pvt->owner, "TRANSFER_CONTEXT");
+ if (ast_strlen_zero(transfercontext))
+ transfercontext = sip_pvt->context;
+
if (sip_debug_test_pvt(sip_pvt)) {
- ast_verbose("Transfer to %s in %s\n", refer_to, sip_pvt->context);
+ ast_verbose("Transfer to %s in %s\n", refer_to, transfercontext);
if (referred_by)
ast_verbose("Transfer from %s in %s\n", referred_by, sip_pvt->context);
}
@@ -6767,7 +6873,7 @@ static int get_refer_info(struct sip_pvt *sip_pvt, struct sip_request *outgoing_
INVITE with a replaces header -anthm XXX */
/* The only way to find out is to use the dialplan - oej */
}
- } else if (ast_exists_extension(NULL, sip_pvt->context, refer_to, 1, NULL) || !strcmp(refer_to, ast_parking_ext())) {
+ } else if (ast_exists_extension(NULL, transfercontext, refer_to, 1, NULL) || !strcmp(refer_to, ast_parking_ext())) {
/* This is an unsupervised transfer (blind transfer) */
ast_log(LOG_DEBUG,"Unsupervised transfer to (Refer-To): %s\n", refer_to);
@@ -6786,7 +6892,7 @@ static int get_refer_info(struct sip_pvt *sip_pvt, struct sip_request *outgoing_
pbx_builtin_setvar_helper(peer, "BLINDTRANSFER", chan->name);
}
return 0;
- } else if (ast_canmatch_extension(NULL, sip_pvt->context, refer_to, 1, NULL)) {
+ } else if (ast_canmatch_extension(NULL, transfercontext, refer_to, 1, NULL)) {
return 1;
}
@@ -7071,6 +7177,7 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme
}
if (!ast_strlen_zero(user->cid_name) && !ast_strlen_zero(p->cid_num))
ast_copy_string(p->cid_name, user->cid_name, sizeof(p->cid_name));
+ ast_copy_string(p->peername, user->name, sizeof(p->peername));
ast_copy_string(p->username, user->name, sizeof(p->username));
ast_copy_string(p->peersecret, user->secret, sizeof(p->peersecret));
ast_copy_string(p->subscribecontext, user->subscribecontext, sizeof(p->subscribecontext));
@@ -7205,14 +7312,17 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme
ast_verbose("Found no matching peer or user for '%s:%d'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), p->recv.sin_addr), ntohs(p->recv.sin_port));
/* do we allow guests? */
- if (!global_allowguest)
- res = -1; /* we don't want any guests, authentication will fail */
+ if (!global_allowguest) {
+ if (global_alwaysauthreject)
+ res = -4; /* reject with fake authorization request */
+ else
+ res = -1; /* we don't want any guests, authentication will fail */
#ifdef OSP_SUPPORT
- else if (global_allowguest == 2) {
+ } else if (global_allowguest == 2) {
ast_copy_flags(p, &global_flags, SIP_OSPAUTH);
res = check_auth(p, req, p->randdata, sizeof(p->randdata), "", "", "", sipmethod, uri, reliable, ignore);
- }
#endif
+ }
}
}
@@ -7542,7 +7652,7 @@ static int _sip_show_peers(int fd, int *total, struct mansession *s, struct mess
snprintf(srch, sizeof(srch), FORMAT, name,
iterator->addr.sin_addr.s_addr ? ast_inet_ntoa(iabuf, sizeof(iabuf), iterator->addr.sin_addr) : "(Unspecified)",
- ast_test_flag(iterator, SIP_DYNAMIC) ? " D " : " ", /* Dynamic or not? */
+ ast_test_flag(&iterator->flags_page2, SIP_PAGE2_DYNAMIC) ? " D " : " ", /* Dynamic or not? */
(ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? " N " : " ", /* NAT=yes? */
iterator->ha ? " A " : " ", /* permit/deny */
ntohs(iterator->addr.sin_port), status);
@@ -7550,7 +7660,7 @@ static int _sip_show_peers(int fd, int *total, struct mansession *s, struct mess
if (!s) {/* Normal CLI list */
ast_cli(fd, FORMAT, name,
iterator->addr.sin_addr.s_addr ? ast_inet_ntoa(iabuf, sizeof(iabuf), iterator->addr.sin_addr) : "(Unspecified)",
- ast_test_flag(iterator, SIP_DYNAMIC) ? " D " : " ", /* Dynamic or not? */
+ ast_test_flag(&iterator->flags_page2, SIP_PAGE2_DYNAMIC) ? " D " : " ", /* Dynamic or not? */
(ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? " N " : " ", /* NAT=yes? */
iterator->ha ? " A " : " ", /* permit/deny */
@@ -7572,7 +7682,7 @@ static int _sip_show_peers(int fd, int *total, struct mansession *s, struct mess
iterator->name,
iterator->addr.sin_addr.s_addr ? ast_inet_ntoa(iabuf, sizeof(iabuf), iterator->addr.sin_addr) : "-none-",
ntohs(iterator->addr.sin_port),
- ast_test_flag(iterator, SIP_DYNAMIC) ? "yes" : "no", /* Dynamic or not? */
+ ast_test_flag(&iterator->flags_page2, SIP_PAGE2_DYNAMIC) ? "yes" : "no", /* Dynamic or not? */
(ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? "yes" : "no", /* NAT=yes? */
iterator->ha ? "yes" : "no", /* permit/deny */
status);
@@ -7945,7 +8055,7 @@ static int _sip_show_peer(int type, int fd, struct mansession *s, struct message
ast_cli(fd, " VM Extension : %s\n", peer->vmexten);
ast_cli(fd, " LastMsgsSent : %d\n", peer->lastmsgssent);
ast_cli(fd, " Call limit : %d\n", peer->call_limit);
- ast_cli(fd, " Dynamic : %s\n", (ast_test_flag(peer, SIP_DYNAMIC)?"Yes":"No"));
+ ast_cli(fd, " Dynamic : %s\n", (ast_test_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC)?"Yes":"No"));
ast_cli(fd, " Callerid : %s\n", ast_callerid_merge(cbuf, sizeof(cbuf), peer->cid_name, peer->cid_num, "<unspecified>"));
ast_cli(fd, " Expire : %d\n", peer->expire);
ast_cli(fd, " Insecure : %s\n", insecure2str(ast_test_flag(peer, SIP_INSECURE_PORT), ast_test_flag(peer, SIP_INSECURE_INVITE)));
@@ -8017,7 +8127,7 @@ static int _sip_show_peer(int type, int fd, struct mansession *s, struct message
ast_cli(fd, "VoiceMailbox: %s\r\n", peer->mailbox);
ast_cli(fd, "LastMsgsSent: %d\r\n", peer->lastmsgssent);
ast_cli(fd, "Call limit: %d\r\n", peer->call_limit);
- ast_cli(fd, "Dynamic: %s\r\n", (ast_test_flag(peer, SIP_DYNAMIC)?"Y":"N"));
+ ast_cli(fd, "Dynamic: %s\r\n", (ast_test_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC)?"Y":"N"));
ast_cli(fd, "Callerid: %s\r\n", ast_callerid_merge(cbuf, sizeof(cbuf), peer->cid_name, peer->cid_num, ""));
ast_cli(fd, "RegExpire: %ld seconds\r\n", ast_sched_when(sched,peer->expire));
ast_cli(fd, "SIP-AuthInsecure: %s\r\n", insecure2str(ast_test_flag(peer, SIP_INSECURE_PORT), ast_test_flag(peer, SIP_INSECURE_INVITE)));
@@ -8181,6 +8291,7 @@ static int sip_show_settings(int fd, int argc, char *argv[])
ast_cli(fd, " URI user is phone no: %s\n", ast_test_flag(&global_flags, SIP_USEREQPHONE) ? "Yes" : "No");
ast_cli(fd, " Our auth realm %s\n", global_realm);
ast_cli(fd, " Realm. auth: %s\n", authl ? "Yes": "No");
+ ast_cli(fd, " Always auth rejects: %s\n", global_alwaysauthreject ? "Yes" : "No");
ast_cli(fd, " User Agent: %s\n", default_useragent);
ast_cli(fd, " MWI checking interval: %d secs\n", global_mwitime);
ast_cli(fd, " Reg. context: %s\n", ast_strlen_zero(regcontext) ? "(not set)" : regcontext);
@@ -8620,7 +8731,7 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req)
!strcasecmp(get_header(req, "Content-Type"), "application/vnd.nortelnetworks.digits")) {
/* Try getting the "signal=" part */
- if (ast_strlen_zero(c = get_sdp(req, "Signal")) && ast_strlen_zero(c = get_sdp(req, "d"))) {
+ if (ast_strlen_zero(c = get_body(req, "Signal")) && ast_strlen_zero(c = get_body(req, "d"))) {
ast_log(LOG_WARNING, "Unable to retrieve DTMF signal from INFO message from %s\n", p->callid);
transmit_response(p, "200 OK", req); /* Should return error */
return;
@@ -9280,7 +9391,7 @@ static char *function_sippeer(struct ast_channel *chan, char *cmd, char *data, c
} else if (!strcasecmp(colname, "expire")) {
snprintf(buf, len, "%d", peer->expire);
} else if (!strcasecmp(colname, "dynamic")) {
- ast_copy_string(buf, (ast_test_flag(peer, SIP_DYNAMIC) ? "yes" : "no"), len);
+ ast_copy_string(buf, (ast_test_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC) ? "yes" : "no"), len);
} else if (!strcasecmp(colname, "callerid_name")) {
ast_copy_string(buf, peer->cid_name, len);
} else if (!strcasecmp(colname, "callerid_num")) {
@@ -9440,11 +9551,18 @@ static void parse_moved_contact(struct sip_pvt *p, struct sip_request *req)
/*! \brief check_pendings: Check pending actions on SIP call ---*/
static void check_pendings(struct sip_pvt *p)
{
- /* Go ahead and send bye at this point */
if (ast_test_flag(p, SIP_PENDINGBYE)) {
- transmit_request_with_auth(p, SIP_BYE, 0, 1, 1);
- ast_set_flag(p, SIP_NEEDDESTROY);
- ast_clear_flag(p, SIP_NEEDREINVITE);
+ /* if we can't BYE, then this is really a pending CANCEL */
+ if (!ast_test_flag(p, SIP_CAN_BYE)) {
+ transmit_request_with_auth(p, SIP_CANCEL, p->ocseq, 1, 0);
+ /* Actually don't destroy us yet, wait for the 487 on our original
+ INVITE, but do set an autodestruct just in case we never get it. */
+ sip_scheddestroy(p, 32000);
+ } else {
+ transmit_request_with_auth(p, SIP_BYE, 0, 1, 1);
+ ast_set_flag(p, SIP_NEEDDESTROY);
+ ast_clear_flag(p, SIP_NEEDREINVITE);
+ }
} else if (ast_test_flag(p, SIP_NEEDREINVITE)) {
ast_log(LOG_DEBUG, "Sending pending reinvite on '%s'\n", p->callid);
/* Didn't get to reinvite yet, so do it now */
@@ -9474,6 +9592,10 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru
switch (resp) {
case 100: /* Trying */
sip_cancel_destroy(p);
+ /* must call check_pendings before setting CAN_BYE, so that
+ if PENDINGBYE is set it will know to send CANCEL instead */
+ check_pendings(p);
+ ast_set_flag(p, SIP_CAN_BYE);
break;
case 180: /* 180 Ringing */
sip_cancel_destroy(p);
@@ -9482,29 +9604,37 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru
if (p->owner->_state != AST_STATE_UP)
ast_setstate(p->owner, AST_STATE_RINGING);
}
- if (!strcasecmp(get_header(req, "Content-Type"), "application/sdp")) {
+ if (find_sdp(req)) {
process_sdp(p, req);
if (!ignore && p->owner) {
/* Queue a progress frame only if we have SDP in 180 */
ast_queue_control(p->owner, AST_CONTROL_PROGRESS);
}
}
+ /* must call check_pendings before setting CAN_BYE, so that
+ if PENDINGBYE is set it will know to send CANCEL instead */
+ check_pendings(p);
+ ast_set_flag(p, SIP_CAN_BYE);
break;
case 183: /* Session progress */
sip_cancel_destroy(p);
/* Ignore 183 Session progress without SDP */
- if (!strcasecmp(get_header(req, "Content-Type"), "application/sdp")) {
+ if (find_sdp(req)) {
process_sdp(p, req);
if (!ignore && p->owner) {
/* Queue a progress frame */
ast_queue_control(p->owner, AST_CONTROL_PROGRESS);
}
}
+ /* must call check_pendings before setting CAN_BYE, so that
+ if PENDINGBYE is set it will know to send CANCEL instead */
+ check_pendings(p);
+ ast_set_flag(p, SIP_CAN_BYE);
break;
case 200: /* 200 OK on invite - someone's answering our call */
sip_cancel_destroy(p);
p->authtries = 0;
- if (!strcasecmp(get_header(req, "Content-Type"), "application/sdp")) {
+ if (find_sdp(req)) {
process_sdp(p, req);
}
@@ -9961,7 +10091,7 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
} else if ((resp >= 100) && (resp < 200)) {
if (sipmethod == SIP_INVITE) {
sip_cancel_destroy(p);
- if (!ast_strlen_zero(get_header(req, "Content-Type")))
+ if (find_sdp(req))
process_sdp(p, req);
if (p->owner) {
/* Queue a progress frame */
@@ -10311,7 +10441,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
check_via(p, req);
if (p->owner) {
/* Handle SDP here if we already have an owner */
- if (!strcasecmp(get_header(req, "Content-Type"), "application/sdp")) {
+ if (find_sdp(req)) {
if (process_sdp(p, req)) {
transmit_response(p, "488 Not acceptable here", req);
if (!p->lastinvite)
@@ -10328,20 +10458,26 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
if (!p->lastinvite && !ignore && !p->owner) {
/* Handle authentication if this is our first invite */
res = check_user(p, req, SIP_INVITE, e, 1, sin, ignore);
- if (res) {
- if (res < 0) {
+ /* if an authentication challenge was sent, we are done here */
+ if (res > 0)
+ return 0;
+ if (res < 0) {
+ if (res == -4) {
+ ast_log(LOG_NOTICE, "Sending fake auth rejection for user %s\n", get_header(req, "From"));
+ transmit_fake_auth_response(p, req, p->randdata, sizeof(p->randdata), 1);
+ } else {
ast_log(LOG_NOTICE, "Failed to authenticate user %s\n", get_header(req, "From"));
if (ignore)
transmit_response(p, "403 Forbidden", req);
else
transmit_response_reliable(p, "403 Forbidden", req, 1);
- ast_set_flag(p, SIP_NEEDDESTROY);
- p->theirtag[0] = '\0'; /* Forget their to-tag, we'll get a new one */
}
+ ast_set_flag(p, SIP_NEEDDESTROY);
+ p->theirtag[0] = '\0'; /* Forget their to-tag, we'll get a new one */
return 0;
}
/* Process the SDP portion */
- if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
+ if (find_sdp(req)) {
if (process_sdp(p, req)) {
transmit_response(p, "488 Not acceptable here", req);
ast_set_flag(p, SIP_NEEDDESTROY);
@@ -10732,20 +10868,34 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
}
/* Handle authentication if this is our first subscribe */
res = check_user_full(p, req, SIP_SUBSCRIBE, e, 0, sin, ignore, mailbox, mailboxsize);
- if (res) {
- if (res < 0) {
+ /* if an authentication challenge was sent, we are done here */
+ if (res > 0)
+ return 0;
+ if (res < 0) {
+ if (res == -4) {
+ ast_log(LOG_NOTICE, "Sending fake auth rejection for user %s\n", get_header(req, "From"));
+ transmit_fake_auth_response(p, req, p->randdata, sizeof(p->randdata), 1);
+ } else {
ast_log(LOG_NOTICE, "Failed to authenticate user %s for SUBSCRIBE\n", get_header(req, "From"));
- ast_set_flag(p, SIP_NEEDDESTROY);
+ if (ignore)
+ transmit_response(p, "403 Forbidden", req);
+ else
+ transmit_response_reliable(p, "403 Forbidden", req, 1);
}
+ ast_set_flag(p, SIP_NEEDDESTROY);
return 0;
}
- /* Initialize the context if it hasn't been already */
+ gotdest = get_destination(p, NULL);
+ /* Initialize the context if it hasn't been already;
+ note this is done _after_ handling any domain lookups,
+ because the context specified there is for calls, not
+ subscriptions
+ */
if (!ast_strlen_zero(p->subscribecontext))
ast_copy_string(p->context, p->subscribecontext, sizeof(p->context));
else if (ast_strlen_zero(p->context))
strcpy(p->context, default_context);
/* Get destination right away */
- gotdest = get_destination(p, NULL);
build_contact(p);
if (gotdest) {
if (gotdest < 0)
@@ -11078,7 +11228,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
if (seqno == p->pendinginvite) {
p->pendinginvite = 0;
__sip_ack(p, seqno, FLAG_RESPONSE, 0);
- if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
+ if (find_sdp(req)) {
if (process_sdp(p, req))
return -1;
}
@@ -11111,6 +11261,7 @@ static int sipsock_read(int *id, int fd, short events, void *ignore)
int nounlock;
int recount = 0;
char iabuf[INET_ADDRSTRLEN];
+ unsigned int lockretry = 100;
len = sizeof(sin);
memset(&req, 0, sizeof(req));
@@ -11127,8 +11278,9 @@ static int sipsock_read(int *id, int fd, short events, void *ignore)
}
if (res == sizeof(req.data)) {
ast_log(LOG_DEBUG, "Received packet exceeds buffer. Data is possibly lost\n");
- }
- req.data[res] = '\0';
+ req.data[sizeof(req.data) - 1] = '\0';
+ } else
+ req.data[res] = '\0';
req.len = res;
if(sip_debug_test_addr(&sin))
ast_set_flag(&req, SIP_PKT_DEBUG);
@@ -11162,9 +11314,16 @@ retrylock:
ast_log(LOG_DEBUG, "Failed to grab lock, trying again...\n");
ast_mutex_unlock(&p->lock);
ast_mutex_unlock(&netlock);
- /* Sleep infintismly short amount of time */
+ /* Sleep for a very short amount of time */
usleep(1);
- goto retrylock;
+ if (--lockretry)
+ goto retrylock;
+ }
+ if (!lockretry) {
+ ast_log(LOG_ERROR, "We could NOT get the channel lock for %s! \n", p->owner->name);
+ ast_log(LOG_ERROR, "SIP MESSAGE JUST IGNORED: %s \n", req.data);
+ ast_log(LOG_ERROR, "BAD! BAD! BAD!\n");
+ return 1;
}
memcpy(&p->recv, &sin, sizeof(p->recv));
if (recordhistory) {
@@ -12025,7 +12184,7 @@ static struct sip_peer *temp_peer(const char *name)
peer->rtpholdtimeout = global_rtpholdtimeout;
peer->rtpkeepalive = global_rtpkeepalive;
ast_set_flag(peer, SIP_SELFDESTRUCT);
- ast_set_flag(peer, SIP_DYNAMIC);
+ ast_set_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC);
peer->prefs = prefs;
reg_source_db(peer);
@@ -12156,7 +12315,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int
ast_log(LOG_WARNING, "You can't have a dynamic outbound proxy, you big silly head at line %d.\n", v->lineno);
} else {
/* They'll register with us */
- ast_set_flag(peer, SIP_DYNAMIC);
+ ast_set_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC);
if (!found) {
/* Initialize stuff iff we're not found, otherwise
we keep going with what we had */
@@ -12173,7 +12332,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int
if (peer->expire > -1)
ast_sched_del(sched, peer->expire);
peer->expire = -1;
- ast_clear_flag(peer, SIP_DYNAMIC);
+ ast_clear_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC);
if (!obproxyfound || !strcasecmp(v->name, "outboundproxy")) {
if (ast_get_ip_or_srv(&peer->addr, v->value, "_sip._udp")) {
ASTOBJ_UNREF(peer, sip_destroy_peer);
@@ -12196,7 +12355,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int
} else if (!strcasecmp(v->name, "permit") || !strcasecmp(v->name, "deny")) {
peer->ha = ast_append_ha(v->name, v->value, peer->ha);
} else if (!strcasecmp(v->name, "port")) {
- if (!realtime && ast_test_flag(peer, SIP_DYNAMIC))
+ if (!realtime && ast_test_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC))
peer->defaddr.sin_port = htons(atoi(v->value));
else
peer->addr.sin_port = htons(atoi(v->value));
@@ -12278,7 +12437,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int
*/
v=v->next;
}
- if (!ast_test_flag((&global_flags_page2), SIP_PAGE2_IGNOREREGEXPIRE) && ast_test_flag(peer, SIP_DYNAMIC) && realtime) {
+ if (!ast_test_flag((&global_flags_page2), SIP_PAGE2_IGNOREREGEXPIRE) && ast_test_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC) && realtime) {
time_t nowtime;
time(&nowtime);
@@ -12290,7 +12449,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int
}
}
ast_copy_flags(peer, &peerflags, mask.flags);
- if (!found && ast_test_flag(peer, SIP_DYNAMIC) && !ast_test_flag(peer, SIP_REALTIME))
+ if (!found && ast_test_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC) && !ast_test_flag(peer, SIP_REALTIME))
reg_source_db(peer);
ASTOBJ_UNMARK(peer);
ast_free_ha(oldha);
@@ -12347,6 +12506,7 @@ static int reload_config(void)
ast_copy_string(default_useragent, DEFAULT_USERAGENT, sizeof(default_useragent));
ast_copy_string(default_notifymime, DEFAULT_NOTIFYMIME, sizeof(default_notifymime));
global_notifyringing = 1;
+ global_alwaysauthreject = 0;
ast_copy_string(global_realm, DEFAULT_REALM, sizeof(global_realm));
ast_copy_string(global_musicclass, "default", sizeof(global_musicclass));
ast_copy_string(default_callerid, DEFAULT_CALLERID, sizeof(default_callerid));
@@ -12446,6 +12606,8 @@ static int reload_config(void)
ast_copy_string(default_notifymime, v->value, sizeof(default_notifymime));
} else if (!strcasecmp(v->name, "notifyringing")) {
global_notifyringing = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "alwaysauthreject")) {
+ global_alwaysauthreject = ast_true(v->value);
} else if (!strcasecmp(v->name, "musicclass") || !strcasecmp(v->name, "musiconhold")) {
ast_copy_string(global_musicclass, v->value, sizeof(global_musicclass));
} else if (!strcasecmp(v->name, "language")) {
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 6dae296bc..c167db2ba 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -2119,9 +2119,8 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout)
prilocaldialplan = PRI_LOCAL_ISDN;
}
}
- pri_sr_set_caller(sr, l ? (l + ldp_strip) : NULL, n, prilocaldialplan,
- l ? (p->use_callingpres ? ast->cid.cid_pres : PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN) :
- PRES_NUMBER_NOT_AVAILABLE);
+ pri_sr_set_caller(sr, l ? (l + ldp_strip) : NULL, n, prilocaldialplan,
+ p->use_callingpres ? ast->cid.cid_pres : (l ? PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN : PRES_NUMBER_NOT_AVAILABLE));
pri_sr_set_redirecting(sr, ast->cid.cid_rdnis, p->pri->localdialplan - 1, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, PRI_REDIR_UNCONDITIONAL);
#ifdef SUPPORT_USERUSER
@@ -10718,6 +10717,8 @@ static int setup_zap(int reload)
v->value, v->lineno);
} else if (!strcasecmp(v->name, "minunused")) {
minunused = atoi(v->value);
+ } else if (!strcasecmp(v->name, "minidle")) {
+ minidle = atoi(v->value);
} else if (!strcasecmp(v->name, "idleext")) {
ast_copy_string(idleext, v->value, sizeof(idleext));
} else if (!strcasecmp(v->name, "idledial")) {
diff --git a/codecs/gsm/Makefile b/codecs/gsm/Makefile
index 5da9cd465..9058f1293 100644
--- a/codecs/gsm/Makefile
+++ b/codecs/gsm/Makefile
@@ -38,31 +38,33 @@ WAV49 = -DWAV49
######### probably require gcc.
ifneq (${OSARCH},Darwin)
-ifneq (${OSARCH},SunOS)
-ifneq (${PROC},x86_64)
-ifneq (${PROC},amd64)
-ifneq (${PROC},ultrasparc)
-ifneq ($(shell uname -m),ppc)
-ifneq ($(shell uname -m),ppc64)
-ifneq ($(shell uname -m),alpha)
-ifneq ($(shell uname -m),armv4l)
-ifneq (${PROC},sparc64)
-ifneq (${PROC},arm)
-ifneq (${PROC},ppc)
-ifneq (${PROC},ppc64)
+ ifneq (${OSARCH},SunOS)
+ ifneq (${PROC},x86_64)
+ ifneq (${PROC},amd64)
+ ifneq (${PROC},ultrasparc)
+ ifneq ($(shell uname -m),ppc)
+ ifneq ($(shell uname -m),ppc64)
+ ifneq ($(shell uname -m),alpha)
+ ifneq ($(shell uname -m),armv4l)
+ ifneq (${PROC},sparc64)
+ ifneq (${PROC},arm)
+ ifneq (${PROC},ppc)
+ ifneq (${PROC},ppc64)
+ ifneq (${PROC},s390)
OPTIMIZE+=-march=$(PROC)
-endif
-endif
-endif
-endif
-endif
-endif
-endif
-endif
-endif
-endif
-endif
-endif
+ endif
+ endif
+ endif
+ endif
+ endif
+ endif
+ endif
+ endif
+ endif
+ endif
+ endif
+ endif
+ endif
endif
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
@@ -240,6 +242,7 @@ ifneq ($(shell uname -m),armv4l)
ifneq ($(shell uname -m),sparc64)
ifneq (${PROC},arm)
ifneq ($(shell uname -m), parisc)
+ifneq (${PROC}, s390)
GSM_SOURCES+= $(SRC)/k6opt.s
endif
endif
@@ -251,6 +254,7 @@ endif
endif
endif
endif
+endif
TOAST_SOURCES = $(SRC)/toast.c \
$(SRC)/toast_lin.c \
diff --git a/configs/extensions.conf.sample b/configs/extensions.conf.sample
index 7d46f08ab..5c55ef501 100644
--- a/configs/extensions.conf.sample
+++ b/configs/extensions.conf.sample
@@ -442,12 +442,10 @@ exten => 8500,n,Goto(s,6)
include => demo
;
-; Extensions like the two below can be used for FWD, Nikotel, sipgate etc.
-; Note that you must have a [sipprovider] section in sip.conf whereas
-; the otherprovider.net example does not require such a peer definition
+; An extension like the one below can be used for FWD, Nikotel, sipgate etc.
+; Note that you must have a [sipprovider] section in sip.conf
;
;exten => _41X.,1,Dial(SIP/${EXTEN:2}@sipprovider,,r)
-;exten => _42X.,1,Dial(SIP/user:passwd@${EXTEN:2}@otherprovider.net,30,rT)
; Real extensions would go here. Generally you want real extensions to be
; 4 or 5 digits long (although there is no such requirement) and start with a
diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample
index 400fbcb7e..ecaef3c89 100644
--- a/configs/sip.conf.sample
+++ b/configs/sip.conf.sample
@@ -107,6 +107,10 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; Useful to limit subscriptions to local extensions
; Settable per peer/user also
;notifyringing = yes ; Notify subscriptions on RINGING state
+;alwaysauthreject = yes ; When an incoming INVITE or REGISTER is to be rejected,
+ ; for any reason, always reject with '401 Unauthorized'
+ ; instead of letting the requester know whether there was
+ ; a matching user or peer for their request
;
; If regcontext is specified, Asterisk will dynamically create and destroy a
diff --git a/dnsmgr.c b/dnsmgr.c
index f1a9dbe59..de8324741 100644
--- a/dnsmgr.c
+++ b/dnsmgr.c
@@ -57,7 +57,7 @@ struct ast_dnsmgr_entry {
char name[1];
};
-static AST_LIST_HEAD(entry_list, ast_dnsmgr_entry) entry_list;
+static AST_LIST_HEAD_STATIC(entry_list, ast_dnsmgr_entry);
AST_MUTEX_DEFINE_STATIC(refresh_lock);
@@ -289,7 +289,6 @@ int dnsmgr_init(void)
ast_log(LOG_ERROR, "Unable to create schedule context.\n");
return -1;
}
- AST_LIST_HEAD_INIT(&entry_list);
ast_cli_register(&cli_reload);
ast_cli_register(&cli_status);
return do_reload(1);
diff --git a/enum.c b/enum.c
index 194f708ed..9daef1ef7 100644
--- a/enum.c
+++ b/enum.c
@@ -80,27 +80,29 @@ struct naptr {
} __attribute__ ((__packed__));
/*--- parse_ie: Parse NAPTR record information elements */
-static int parse_ie(char *data, int maxdatalen, char *src, int srclen)
+static unsigned int parse_ie(unsigned char *data, unsigned int maxdatalen, unsigned char *src, unsigned int srclen)
{
- int len, olen;
+ unsigned int len, olen;
- len = olen = (int)src[0];
+ len = olen = (unsigned int) src[0];
src++;
srclen--;
- if (len > srclen || len < 0 ) {
+
+ if (len > srclen) {
ast_log(LOG_WARNING, "ENUM parsing failed: Wanted %d characters, got %d\n", len, srclen);
return -1;
}
+
if (len > maxdatalen)
len = maxdatalen;
memcpy(data, src, len);
+
return olen + 1;
}
/*--- parse_naptr: Parse DNS NAPTR record used in ENUM ---*/
-static int parse_naptr(char *dst, int dstsize, char *tech, int techsize, char *answer, int len, char *naptrinput)
+static int parse_naptr(unsigned char *dst, int dstsize, char *tech, int techsize, unsigned char *answer, int len, unsigned char *naptrinput)
{
-
char tech_return[80];
char *oanswer = answer;
char flags[512] = "";
@@ -344,7 +346,7 @@ static int txt_callback(void *context, char *answer, int len, char *fullanswer)
/*--- enum_callback: Callback from ENUM lookup function */
static int enum_callback(void *context, char *answer, int len, char *fullanswer)
{
- struct enum_context *c = (struct enum_context *)context;
+ struct enum_context *c = (struct enum_context *)context;
void *p = NULL;
int res;
diff --git a/include/asterisk/linkedlists.h b/include/asterisk/linkedlists.h
index 5f8a57b16..fec406f6e 100644
--- a/include/asterisk/linkedlists.h
+++ b/include/asterisk/linkedlists.h
@@ -101,6 +101,23 @@ struct name { \
}
/*!
+ \brief Defines initial values for a declaration of AST_LIST_HEAD
+*/
+#define AST_LIST_HEAD_INIT_VALUE { \
+ .first = NULL, \
+ .last = NULL, \
+ .lock = AST_MUTEX_INIT_VALUE, \
+ }
+
+/*!
+ \brief Defines initial values for a declaration of AST_LIST_HEAD_NOLOCK
+*/
+#define AST_LIST_HEAD_NOLOCK_INIT_VALUE { \
+ .first = NULL, \
+ .last = NULL, \
+ }
+
+/*!
\brief Defines a structure to be used to hold a list of specified type, statically initialized.
\param name This will be the name of the defined structure.
\param type This is the type of each list entry.
@@ -122,11 +139,18 @@ struct name { \
struct type *first; \
struct type *last; \
ast_mutex_t lock; \
-} name = { \
- .first = NULL, \
- .last = NULL, \
- .lock = AST_MUTEX_INIT_VALUE, \
-};
+} name = AST_LIST_HEAD_INIT_VALUE
+
+/*!
+ \brief Defines a structure to be used to hold a list of specified type, statically initialized.
+
+ This is the same as AST_LIST_HEAD_STATIC, except without the lock included.
+*/
+#define AST_LIST_HEAD_NOLOCK_STATIC(name, type) \
+struct name { \
+ struct type *first; \
+ struct type *last; \
+} name = AST_LIST_HEAD_NOLOCK_INIT_VALUE
/*!
\brief Initializes a list head structure with a specified first entry.
@@ -184,6 +208,12 @@ struct { \
#define AST_LIST_FIRST(head) ((head)->first)
/*!
+ \brief Returns the last entry contained in a list.
+ \param head This is a pointer to the list tail structure
+ */
+#define AST_LIST_LAST(head) ((head)->last)
+
+/*!
\brief Returns the next entry in the list after the given entry.
\param elm This is a pointer to the current entry.
\param field This is the name of the field (declared using AST_LIST_ENTRY())
@@ -433,11 +463,13 @@ struct { \
(head)->last = NULL; \
} else { \
typeof(elm) curelm = (head)->first; \
- while (curelm->field.next != (elm)) \
+ while (curelm && (curelm->field.next != (elm))) \
curelm = curelm->field.next; \
- curelm->field.next = (elm)->field.next; \
- if ((head)->last == (elm)) \
- (head)->last = curelm; \
+ if (curelm) { \
+ curelm->field.next = (elm)->field.next; \
+ if ((head)->last == (elm)) \
+ (head)->last = curelm; \
+ } \
} \
(elm)->field.next = NULL; \
} while (0)
diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h
index 38c4e64ac..cf9549751 100644
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -97,6 +97,13 @@ typedef struct ast_mutex_info ast_mutex_t;
typedef pthread_cond_t ast_cond_t;
+static pthread_mutex_t empty_mutex;
+
+static void __attribute__((constructor)) init_empty_mutex(void)
+{
+ memset(&empty_mutex, 0, sizeof(empty_mutex));
+}
+
static inline int __ast_pthread_mutex_init_attr(const char *filename, int lineno, const char *func,
const char *mutex_name, ast_mutex_t *t,
pthread_mutexattr_t *attr)
@@ -105,14 +112,16 @@ static inline int __ast_pthread_mutex_init_attr(const char *filename, int lineno
int canlog = strcmp(filename, "logger.c");
if ((t->mutex) != ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
- __ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is already initialized.\n",
- filename, lineno, func, mutex_name);
- __ast_mutex_logger("%s line %d (%s): Error: previously initialization of mutex '%s'.\n",
- t->file, t->lineno, t->func, mutex_name);
+ if ((t->mutex) != (empty_mutex)) {
+ __ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is already initialized.\n",
+ filename, lineno, func, mutex_name);
+ __ast_mutex_logger("%s line %d (%s): Error: previously initialization of mutex '%s'.\n",
+ t->file, t->lineno, t->func, mutex_name);
#ifdef THREAD_CRASH
- DO_THREAD_CRASH;
+ DO_THREAD_CRASH;
#endif
- return 0;
+ return 0;
+ }
}
#endif
diff --git a/logger.c b/logger.c
index 0a397ff46..0cb0f06d0 100644
--- a/logger.c
+++ b/logger.c
@@ -384,6 +384,7 @@ int reload_logger(int rotate)
FILE *myf;
int x, res = 0;
+ ast_mutex_lock(&msglist_lock); /* to avoid deadlock */
ast_mutex_lock(&loglock);
if (eventlog)
fclose(eventlog);
@@ -490,6 +491,7 @@ int reload_logger(int rotate)
}
}
ast_mutex_unlock(&loglock);
+ ast_mutex_unlock(&msglist_lock);
return res;
}
diff --git a/pbx.c b/pbx.c
index 7cd94e6d2..ee00f3a47 100644
--- a/pbx.c
+++ b/pbx.c
@@ -3706,6 +3706,7 @@ void ast_merge_contexts_and_delete(struct ast_context **extcontexts, const char
int length;
struct ast_state_cb *thiscb, *prevcb;
+ memset(&store, 0, sizeof(store));
AST_LIST_HEAD_INIT(&store);
/* it is very important that this function hold the hintlock _and_ the conlock
@@ -4064,7 +4065,7 @@ static unsigned int get_month(char *mon)
}
if (c) {
e = 0;
- while((e < 12) && strcasecmp(mon, months[e])) e++;
+ while((e < 12) && strcasecmp(c, months[e])) e++;
if (e >= 12) {
ast_log(LOG_WARNING, "Invalid month '%s', assuming none\n", c);
return 0;
diff --git a/res/res_agi.c b/res/res_agi.c
index 8f9654443..14713fcc2 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -941,6 +941,9 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, char
return RESULT_FAILURE;
}
+ /* Request a video update */
+ ast_indicate(chan, AST_CONTROL_VIDUPDATE);
+
chan->stream = fs;
ast_applystream(chan,fs);
/* really should have checks */
@@ -1004,6 +1007,9 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, char
}
}
break;
+ case AST_FRAME_VIDEO:
+ ast_writestream(fs, f);
+ break;
}
ast_frfree(f);
if (gotsilence)
diff --git a/res/res_features.c b/res/res_features.c
index f83cadecc..a122abf5f 100644
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -641,7 +641,7 @@ static int builtin_blindtransfer(struct ast_channel *chan, struct ast_channel *p
ast_verbose(VERBOSE_PREFIX_3 "Unable to find extension '%s' in context '%s'\n", newext, transferer_real_context);
}
if (!ast_strlen_zero(xferfailsound))
- res = ast_streamfile(transferer, xferfailsound, transferee->language);
+ res = ast_streamfile(transferer, xferfailsound, transferer->language);
else
res = 0;
if (res) {
@@ -866,7 +866,7 @@ struct ast_call_feature builtin_features[] =
};
-static AST_LIST_HEAD(feature_list,ast_call_feature) feature_list;
+static AST_LIST_HEAD_STATIC(feature_list,ast_call_feature);
/* register new feature into feature_list*/
void ast_register_feature(struct ast_call_feature *feature)
@@ -944,8 +944,12 @@ static int feature_exec_app(struct ast_channel *chan, struct ast_channel *peer,
if (ast_test_flag(feature, AST_FEATURE_FLAG_CALLEE))
work = peer;
res = pbx_exec(work, app, feature->app_args, 1);
- if (res < 0)
- return res;
+ if (res == AST_PBX_KEEPALIVE)
+ return FEATURE_RETURN_PBX_KEEPALIVE;
+ else if (res == AST_PBX_NO_HANGUP_PEER)
+ return FEATURE_RETURN_NO_HANGUP_PEER;
+ else if (res)
+ return FEATURE_RETURN_SUCCESSBREAK;
} else {
ast_log(LOG_WARNING, "Could not find application (%s)\n", feature->app);
return -2;
@@ -1021,7 +1025,10 @@ static int ast_feature_interpret(struct ast_channel *chan, struct ast_channel *p
if (!strcmp(feature->exten, code)) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 " Feature Found: %s exten: %s\n",feature->sname, tok);
- res = feature->operation(chan, peer, config, code, sense);
+ if (sense == FEATURE_SENSE_CHAN)
+ res = feature->operation(chan, peer, config, code, sense);
+ else
+ res = feature->operation(peer, chan, config, code, sense);
break;
} else if (!strncmp(feature->exten, code, strlen(code))) {
res = FEATURE_RETURN_STOREDIGITS;
@@ -1426,6 +1433,9 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
featurecode = peer_featurecode;
}
featurecode[strlen(featurecode)] = f->subclass;
+ /* Get rid of the frame before we start doing "stuff" with the channels */
+ ast_frfree(f);
+ f = NULL;
config->feature_timer = backup_config.feature_timer;
res = ast_feature_interpret(chan, peer, config, featurecode, sense);
switch(res) {
@@ -1438,10 +1448,8 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
}
if (res >= FEATURE_RETURN_PASSDIGITS) {
res = 0;
- } else {
- ast_frfree(f);
+ } else
break;
- }
hasfeatures = !ast_strlen_zero(chan_featurecode) || !ast_strlen_zero(peer_featurecode);
if (hadfeatures && !hasfeatures) {
/* Restore backup */
@@ -2137,7 +2145,6 @@ int load_module(void)
{
int res;
- AST_LIST_HEAD_INIT(&feature_list);
memset(parking_ext, 0, sizeof(parking_ext));
memset(parking_con, 0, sizeof(parking_con));
diff --git a/utils/smsq.c b/utils/smsq.c
index 361fc2679..429ca0004 100644
--- a/utils/smsq.c
+++ b/utils/smsq.c
@@ -142,7 +142,7 @@ static char txqcheck (char *dir, char *queue, char subaddress, char *channel, ch
p = channel;
p = strchr (p, 'X');
if (p)
- fprintf (f, "%.*s%c%s\n", p - channel, channel, subaddress, p + 1);
+ fprintf (f, "%.*s%c%s\n", (int)(p - channel), channel, subaddress, p + 1);
else
fprintf (f, "%s\n", channel);
}
@@ -153,7 +153,7 @@ static char txqcheck (char *dir, char *queue, char subaddress, char *channel, ch
{
p = strchr (callerid, 'X');
if (p)
- fprintf (f, "%.*s%c%s", p - callerid, callerid, subaddress, p + 1);
+ fprintf (f, "%.*s%c%s", (int)(p - callerid), callerid, subaddress, p + 1);
else
fprintf (f, "%s", callerid);
}