dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

402 Commits

Author SHA1 Message Date
mnicholson 959deafb08 Merged revisions 327512 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r327512 | mnicholson | 2011-07-11 08:53:59 -0500 (Mon, 11 Jul 2011) | 2 lines
  
  reset our buffer each iteration when doing variable substitution
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@327513 f38db490-d61c-443f-a65b-d21fe96a405b
2011-07-11 13:55:28 +00:00
mnicholson 66a5c9a88c Merged revisions 327106 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r327106 | mnicholson | 2011-07-08 14:52:51 -0500 (Fri, 08 Jul 2011) | 11 lines
  
  Reset our ast_str before passing it on to dialplan function backends.
  
  It is possible for a dialplan backend to not modify the given buffer or ast_str
  and still return success. This causes any previous value stored in the buffer
  to be used as if the new function call provided it. Some functions also append
  to the given buffer assuming it is empty.
  
  The test_substitution unit test has also been modified to detect this problem.
  
  (closes issue ASTERISK-17878)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@327107 f38db490-d61c-443f-a65b-d21fe96a405b
2011-07-08 19:54:23 +00:00
rmudgett bcec073697 Merged revisions 326985 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r326985 | rmudgett | 2011-07-07 20:08:05 -0500 (Thu, 07 Jul 2011) | 12 lines
  
  Some code cleanup in pbx.c
  
  * Mostly comment and format changes.
  
  * ast_context_remove_extension_callerid() and ast_add_extension_nolock()
  will write lock the found specific context.
  
  * ast_context_find() will now tolerate a NULL name.
  
  * Eliminated some inlined versions of find_context() and
  find_context_locked().
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@327000 f38db490-d61c-443f-a65b-d21fe96a405b
2011-07-08 01:26:01 +00:00
dvossel e30177b43f Merged revisions 324364 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r324364 | dvossel | 2011-06-21 15:11:52 -0500 (Tue, 21 Jun 2011) | 10 lines
  
  Fixes locking inversion issue in ast_async_goto()
  
  During this function we can not hold the "chan" lock while
  doing the masquerade, the explicit goto on the tmp chan, or
  the channel alloc.  Instead we need to get the channel lock,
  store off information about the channel that we need, and
  then let the channel lock go for the remainder of the function.
  
  Review: https://reviewboard.asterisk.org/r/1275/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@324365 f38db490-d61c-443f-a65b-d21fe96a405b
2011-06-21 20:15:41 +00:00
lmadsen c06cfb9110 Merged revisions 324115 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r324115 | lmadsen | 2011-06-17 11:14:54 -0400 (Fri, 17 Jun 2011) | 3 lines
  
  Fix grammar in documentation for Goto() and GotoIf()
  (closes issue ASTERISK-18023)
  Reported by: Tim Osman
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@324131 f38db490-d61c-443f-a65b-d21fe96a405b
2011-06-17 15:32:08 +00:00
russell dc555ef5df Merged revisions 317917 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r317917 | russell | 2011-05-06 16:06:33 -0500 (Fri, 06 May 2011) | 7 lines
  
  Fix calculation of free RAM to make minmemfree option work.
  
  (closes issue #17124)
  Reported by: loic
  Patches:
        pbx_c.diff uploaded by loic (license 1020)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@317919 f38db490-d61c-443f-a65b-d21fe96a405b
2011-05-06 21:07:49 +00:00
russell 681ceaeaac Merged revisions 316265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r316265 | russell | 2011-05-03 14:55:49 -0500 (Tue, 03 May 2011) | 5 lines
  
  Fix a bunch of compiler warnings generated by gcc 4.6.0.
  
  Most of these are -Wunused-but-set-variable, but there were a few others
  mixed in here, as well.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@316293 f38db490-d61c-443f-a65b-d21fe96a405b
2011-05-03 20:45:32 +00:00
rmudgett 131a2276bb Merged revisions 315645 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r315645 | rmudgett | 2011-04-26 17:14:31 -0500 (Tue, 26 Apr 2011) | 21 lines
  
  The 'e' special extension fails to trigger in at least two cases.
  
  The 'e' extension is a fall back for the 'i', 't', or 'T' extensions if
  any of them do not exist.  Many of the places the 'e' extension was
  supposed to be invoked fail because the priority was set wrong.  There
  were two places where the 'e' extension was not even checked for fall
  back.
  
  * Made invoke the 'e' extension similarly to the previous 'i', 't', or 'T'
  extension check and added the 'e' extension as a fall back to the two
  missing locations.
  
  * Prioritized and optimized some hangup tests associated with the 'e'
  extension.
  
  (closes issue #19136)
  Reported by: kshumard
  Tested by: rmudgett
  
  Review: https://reviewboard.asterisk.org/r/1196/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@315649 f38db490-d61c-443f-a65b-d21fe96a405b
2011-04-26 22:18:41 +00:00
tzafrir 3722083a5d fix a memory leak in device state
The callback handle_statechange (pbx.c) fails to release its data
pointer, leaking memory in the process.

Reported by: tzafrir
Patches:
      18735_pbx_free_callback.diff uploaded by tzafrir (license 46)

Review: https://reviewboard.asterisk.org/r/1110/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@308371 f38db490-d61c-443f-a65b-d21fe96a405b
2011-02-21 13:58:18 +00:00
pabelanger 6705f03406 Replace ast_log(LOG_DEBUG, ...) with ast_debug()
(closes issue #18556)
Reported by: kkm

Review: https://reviewboard.asterisk.org/r/1071/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@306258 f38db490-d61c-443f-a65b-d21fe96a405b
2011-02-04 16:55:39 +00:00
dvossel 4aca3187a3 Asterisk media architecture conversion - no more format bitfields
This patch is the foundation of an entire new way of looking at media in Asterisk.
The code present in this patch is everything required to complete phase1 of my
Media Architecture proposal.  For more information about this project visit the link below.
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal

The primary function of this patch is to convert all the usages of format
bitfields in Asterisk to use the new format and format_cap APIs.  Functionally
no change in behavior should be present in this patch.  Thanks to twilson
and russell for all the time they spent reviewing these changes.

Review: https://reviewboard.asterisk.org/r/1083/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@306010 f38db490-d61c-443f-a65b-d21fe96a405b
2011-02-03 16:22:10 +00:00
russell d60cbce132 Merged revisions 303549 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r303549 | russell | 2011-01-24 14:51:37 -0600 (Mon, 24 Jan 2011) | 45 lines
  
  Merged revisions 303548 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r303548 | russell | 2011-01-24 14:49:53 -0600 (Mon, 24 Jan 2011) | 38 lines
    
    Merged revisions 303546 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r303546 | russell | 2011-01-24 14:32:21 -0600 (Mon, 24 Jan 2011) | 31 lines
      
      Fix channel redirect out of MeetMe() and other issues with channel softhangup.
      
      Mantis issue #18585 reports that a channel redirect out of MeetMe() stopped
      working properly.  This issue includes a patch that resolves the issue by
      removing a call to ast_check_hangup() from app_meetme.c.  I left that in my
      patch, as it doesn't need to be there.  However, the rest of the patch fixes
      this problem with or without the change to app_meetme.
      
      The key difference between what happens before and after this patch is the
      effect of the END_OF_Q control frame.  After END_OF_Q is hit in ast_read(),
      ast_read() will return NULL.  With the ast_check_hangup() removed, app_meetme
      sees this which causes it to exit as intended.  Checking ast_check_hangup()
      caused app_meetme to exit earlier in the process, and the target of the
      redirect saw the condition where ast_read() returned NULL.
      
      Removing ast_check_hangup() works around the issue in app_meetme, but doesn't
      solve the issue if another application did the same thing.  There are also
      other edge cases where if an application finishes at the same time that a
      redirect happens, the target of the redirect will think that the channel hung
      up.  So, I made some changes in pbx.c to resolve it at a deeper level.  There
      are already places that unset the SOFTHANGUP_ASYNCGOTO flag in an attempt to
      abort the hangup process.  My patch extends this to remove the END_OF_Q frame
      from the channel's read queue, making the "abort hangup" more complete.  This
      same technique was used in every place where a softhangup flag was cleared.
      
      (closes issue #18585)
      Reported by: oej
      Tested by: oej, wedhorn, russell
      
      Review: https://reviewboard.asterisk.org/r/1082/
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@303551 f38db490-d61c-443f-a65b-d21fe96a405b
2011-01-24 20:57:28 +00:00
jpeeler 2ed3724d11 Merged revisions 302266 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r302266 | jpeeler | 2011-01-18 14:19:57 -0600 (Tue, 18 Jan 2011) | 34 lines
  
  Merged revisions 302265 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r302265 | jpeeler | 2011-01-18 14:13:52 -0600 (Tue, 18 Jan 2011) | 27 lines
    
    Convert device state callbacks to ao2 objects to fix a deadlock in chan_sip.
    
    Lock scenario presented here:
    Thread 1
     holds ast_rdlock_contexts &conlock
     holds handle_statechange hints
     holds handle_statechange hint
      waiting for cb_extensionstate
       Locked Here: chan_sip.c line 7428 (find_call)
    Thread 2
     holds handle_request_do &netlock
     holds find_call sip_pvt_ptr
      waiting for ast_rdlock_contexts &conlock
       Locked Here: pbx.c line 9911 (ast_rdlock_contexts)
    
    Chan_sip has an established locking order of locking the sip_pvt and then
    getting the context lock. So the as stated by the summary, the operations in
    thread 2 have been modified to no longer require the context lock.
    
    (closes issue #18310)
    Reported by: one47
    Patches: 
          statecbs_ao2.mk2.patch uploaded by one47 (license 23),
          modified by me
    
    Review: https://reviewboard.asterisk.org/r/1072/
  ........
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@302270 f38db490-d61c-443f-a65b-d21fe96a405b
2011-01-18 20:40:59 +00:00
pabelanger e3df45f6db Add dialplan variables for asterisk.conf directories
Review: https://reviewboard.asterisk.org/r/1075/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@301729 f38db490-d61c-443f-a65b-d21fe96a405b
2011-01-13 16:27:22 +00:00
schmidts c6d866ff51 move devices from hints into an ao2_container
by splitting up devices from hints into an own ao2_container the callback to
get these devices for statechange handling is faster.
with this changes the length of a device used in a hint isnt longer restricted
to 80 characters.

Tests showed that calling handle_statechange is 40 times faster if no hints
are used and 25 times faster if there are any hints.

(closes issue #17928)
Reported by: mdu113
Tested by: schmidts

Review: https://reviewboard.asterisk.org/r/1003/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@296752 f38db490-d61c-443f-a65b-d21fe96a405b
2010-11-30 09:49:25 +00:00
rmudgett 4ead3b5ab1 Merged revisions 295866 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r295866 | rmudgett | 2010-11-22 13:36:10 -0600 (Mon, 22 Nov 2010) | 60 lines
  
  Merged revisions 295843 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r295843 | rmudgett | 2010-11-22 13:28:23 -0600 (Mon, 22 Nov 2010) | 53 lines
    
    Merged revisions 295790 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r295790 | rmudgett | 2010-11-22 12:46:26 -0600 (Mon, 22 Nov 2010) | 46 lines
      
      The channel redirect function (CLI or AMI) hangs up the call instead of redirecting the call.
      
      To recreate the problem:
      1) Party A calls Party B
      2) Invoke CLI "channel redirect" command to redirect channel call leg
      associated with A.
      3) All associated channels are hung up.
      
      Note that if the CLI command were done on the channel call leg associated
      with B it works.
      
      This regression was a result of the fix for issue #16946
      (https://reviewboard.asterisk.org/r/740/).
      
      The regression affects all features that use an async goto to execute the
      dialplan because of an external event: Channel redirect, AMI redirect, SIP
      REFER, and FAX detection.
      
      The struct ast_channel._softhangup code is a mess.  The variable is used
      for several purposes that do not necessarily result in the call being hung
      up.  I have added doxygen comments to describe how the various _softhangup
      bits are used.  I have corrected all the places where the variable was
      tested in a non-bit oriented manner.
      
      The primary fix is the new AST_CONTROL_END_OF_Q frame.  It acts as a weak
      hangup request so the soft hangup requests that do not normally result in
      a hangup do not hangup.
      
      JIRA SWP-2470
      JIRA SWP-2489
      
      (closes issue #18171)
      Reported by: SantaFox
      (closes issue #18185)
      Reported by: kwemheuer
      (closes issue #18211)
      Reported by: zahir_koradia
      (closes issue #18230)
      Reported by: vmarrone
      (closes issue #18299)
      Reported by: mbrevda
      (closes issue #18322)
      Reported by: nerbos
      
      Review:	https://reviewboard.asterisk.org/r/1013/
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@295867 f38db490-d61c-443f-a65b-d21fe96a405b
2010-11-22 19:42:02 +00:00
russell 6ca98506c5 Merged revisions 290713 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r290713 | russell | 2010-10-07 13:00:52 +0200 (Thu, 07 Oct 2010) | 11 lines
  
  Merged revisions 290712 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r290712 | russell | 2010-10-07 12:53:56 +0200 (Thu, 07 Oct 2010) | 4 lines
    
    Don't crash when Set() is called without a value.
    
    Review: https://reviewboard.asterisk.org/r/949/
  ........
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@290714 f38db490-d61c-443f-a65b-d21fe96a405b
2010-10-07 11:12:50 +00:00
tilghman 39e66d0089 Merged revisions 290255 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r290255 | tilghman | 2010-10-04 18:23:11 -0500 (Mon, 04 Oct 2010) | 18 lines
  
  Merged revisions 290254 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r290254 | tilghman | 2010-10-04 18:14:59 -0500 (Mon, 04 Oct 2010) | 11 lines
    
    Change new pattern matcher to regard dashes the same as the old pattern matcher -- as visual candy to be ignored.
    
    Also change the AEL parser to not generate dashes within extensions, as those
    dashes would be ignored.  Update the AEL tests to match this behavior.
    
    (closes issue #17366)
     Reported by: murf
     Patches: 
           20100727__issue17366.diff.txt uploaded by tilghman (license 14)
     Tested by: tilghman
  ........
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@290256 f38db490-d61c-443f-a65b-d21fe96a405b
2010-10-04 23:23:57 +00:00
mnicholson e3dda7aa97 Merged revisions 287559 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r287559 | mnicholson | 2010-09-20 10:57:14 -0500 (Mon, 20 Sep 2010) | 21 lines
  
  Merged revisions 287558 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r287558 | mnicholson | 2010-09-20 10:56:21 -0500 (Mon, 20 Sep 2010) | 14 lines
    
    Use ast_str when processing hint state changes
    
    Merged revisions 287555 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r287555 | mnicholson | 2010-09-20 10:48:14 -0500 (Mon, 20 Sep 2010) | 5 lines
      
      Use ast_dynamic_str when processing hint state changes
      
      (related to issue #17928)
      Reported by: mdu113
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@287560 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-20 15:57:52 +00:00
mnicholson 2383794c85 Merged revisions 287309 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r287309 | mnicholson | 2010-09-17 08:37:10 -0500 (Fri, 17 Sep 2010) | 19 lines
  
  Merged revisions 287308 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r287308 | mnicholson | 2010-09-17 08:36:07 -0500 (Fri, 17 Sep 2010) | 12 lines
    
    Merged revisions 287307 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r287307 | mnicholson | 2010-09-17 08:34:34 -0500 (Fri, 17 Sep 2010) | 5 lines
      
      Use ast_strdup() instead of ast_strdupa() while processing in ast_hint_state_changed().
      
      (related to issue #17928)
      Reported by: mdu113
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@287310 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-17 13:38:22 +00:00
mnicholson bc6ee47f72 Merged revisions 287120 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r287120 | mnicholson | 2010-09-16 15:07:38 -0500 (Thu, 16 Sep 2010) | 22 lines
  
  Merged revisions 287119 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r287119 | mnicholson | 2010-09-16 15:06:16 -0500 (Thu, 16 Sep 2010) | 15 lines
    
    Merged revisions 287118 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r287118 | mnicholson | 2010-09-16 15:04:46 -0500 (Thu, 16 Sep 2010) | 8 lines
      
      Don't limit hint processing in ast_hint_state_changed() to AST_MAX_EXTENSION length strings.
      
      (closes issue #17928)
      Reported by: mdu113
      Patches:
            20100831__issue17928.diff.txt uploaded by tilghman (license 14)
      Tested by: mdu113
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@287121 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-16 20:08:51 +00:00
bbryant ee1b34f447 Merged revisions 285711 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r285711 | bbryant | 2010-09-09 14:51:52 -0400 (Thu, 09 Sep 2010) | 15 lines
  
  Merged revisions 285710 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r285710 | bbryant | 2010-09-09 14:50:13 -0400 (Thu, 09 Sep 2010) | 8 lines
    
    Fixes an issue with dialplan pattern matching where the specificity for pattern ranges and pattern special characters was inconsistent.
    
    (closes issue #16903)
    Reported by: Nick_Lewis
    Patches: 
          pbx.c-specificity.patch uploaded by Nick Lewis (license 657)
    Tested by: Nick_Lewis
  ........
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@285712 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-09 18:53:09 +00:00
russell 31bc392da0 Merged revisions 282015 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r282015 | russell | 2010-08-12 13:03:56 -0500 (Thu, 12 Aug 2010) | 2 lines
  
  Put back pointer value output for ast_debug(), such that it is only removed for verbose output.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@282016 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-12 18:04:19 +00:00
russell ad4feff403 Merged revisions 281982 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r281982 | russell | 2010-08-12 11:33:30 -0500 (Thu, 12 Aug 2010) | 5 lines
  
  Remove debugging output from verbose messages.
  
  Pointer values to internal objects is not terribly useful to users in the
  verbose messages about adding extensions and contexts.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@281983 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-12 16:48:54 +00:00
tilghman 34deca4ab8 Merged revisions 280984 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r280984 | tilghman | 2010-08-05 02:46:36 -0500 (Thu, 05 Aug 2010) | 22 lines
  
  Merged revisions 280983 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r280983 | tilghman | 2010-08-05 02:40:47 -0500 (Thu, 05 Aug 2010) | 15 lines
    
    Merged revisions 280982 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r280982 | tilghman | 2010-08-05 02:28:33 -0500 (Thu, 05 Aug 2010) | 8 lines
      
      Change context lock back to a mutex, because functionality depends upon the lock being recursive.
      
      (closes issue #17643)
       Reported by: zerohalo
       Patches: 
             20100726__issue17643.diff.txt uploaded by tilghman (license 14)
       Tested by: zerohalo
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@280985 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-05 07:47:30 +00:00
mnicholson 51be8039ab Merged revisions 277327 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r277327 | mnicholson | 2010-07-16 13:30:22 -0500 (Fri, 16 Jul 2010) | 8 lines
  
  Interpret device state AST_DEVICE_UNKNOWN as extension state AST_EXTENSION_NOT_INUSE.
  
  (closes issue #16035)
  Reported by: francesco_r
  Patches:
        pbx.c.patch uploaded by viniciusfontes (license 978)
  Tested by: francesco_r, agx, lawbar
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@277331 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-16 18:31:08 +00:00
rmudgett ad58aa92a2 ast_callerid restructuring
The purpose of this patch is to eliminate struct ast_callerid since it has
turned into a miscellaneous collection of various party information.

Eliminate struct ast_callerid and replace it with the following struct
organization:

struct ast_party_name {
	char *str;
	int char_set;
	int presentation;
	unsigned char valid;
};
struct ast_party_number {
	char *str;
	int plan;
	int presentation;
	unsigned char valid;
};
struct ast_party_subaddress {
	char *str;
	int type;
	unsigned char odd_even_indicator;
	unsigned char valid;
};
struct ast_party_id {
	struct ast_party_name name;
	struct ast_party_number number;
	struct ast_party_subaddress subaddress;
	char *tag;
};
struct ast_party_dialed {
	struct {
		char *str;
		int plan;
	} number;
	struct ast_party_subaddress subaddress;
	int transit_network_select;
};
struct ast_party_caller {
	struct ast_party_id id;
	char *ani;
	int ani2;
};

The new organization adds some new information as well.

* The party name and number now have their own presentation value that can
be manipulated independently.  ISDN supplies the presentation value for
the name and number at different times with the possibility that they
could be different.

* The party name and number now have a valid flag.  Before this change the
name or number string could be empty if the presentation were restricted.
Most channel drivers assume that the name or number is then simply not
available instead of indicating that the name or number was restricted.

* The party name now has a character set value.  SIP and Q.SIG have the
ability to indicate what character set a name string is using so it could
be presented properly.

* The dialed party now has a numbering plan value that could be useful to
have available.

The various channel drivers will need to be updated to support the new
core features as needed.  They have simply been converted to supply
current functionality at this time.


The following items of note were either corrected or enhanced:

* The CONNECTEDLINE() and REDIRECTING() dialplan functions were
consolidated into func_callerid.c to share party id handling code.

* CALLERPRES() is now deprecated because the name and number have their
own presentation values.

* Fixed app_alarmreceiver.c write_metadata().  The workstring[] could
contain garbage.  It also can only contain the caller id number so using
ast_callerid_parse() on it is silly.  There was also a typo in the
CALLERNAME if test.

* Fixed app_rpt.c using ast_callerid_parse() on the channel's caller id
number string.  ast_callerid_parse() alters the given buffer which in this
case is the channel's caller id number string.  Then using
ast_shrink_phone_number() could alter it even more.

* Fixed caller ID name and number memory leak in chan_usbradio.c.

* Fixed uninitialized char arrays cid_num[] and cid_name[] in
sig_analog.c.

* Protected access to a caller channel with lock in chan_sip.c.

* Clarified intent of code in app_meetme.c sla_ring_station() and
dial_trunk().  Also made save all caller ID data instead of just the name
and number strings.

* Simplified cdr.c set_one_cid().  It hand coded the ast_callerid_merge()
function.

* Corrected some weirdness with app_privacy.c's use of caller
presentation.

Review:	https://reviewboard.asterisk.org/r/702/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276347 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-14 15:48:36 +00:00
eliel 7a61a43adb Implement AstData API data providers as part of the GSOC 2010 project,
midterm evaluation.

Review: https://reviewboard.asterisk.org/r/757/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@274727 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-08 14:48:42 +00:00
tilghman 2572c06c35 Uh, yeah.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@274053 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-06 06:01:37 +00:00
tilghman ae4907a5fa Send DialPlanComplete as a response, not as a separate event.
Otherwise, it goes to all manager sessions and may exclude the current session,
if the Events mask excludes it.

(closes issue #17504)
 Reported by: rrb3942
 Patches: 
       showdialplan_patch.diff uploaded by rrb3942 (license 1003)
 Tested by: rrb3942


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@273054 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-29 22:39:22 +00:00
tilghman 68f58162f3 Merged revisions 270583 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r270583 | tilghman | 2010-06-15 13:25:12 -0500 (Tue, 15 Jun 2010) | 5 lines
  
  Variables have always been case-sensitive, so we should not be removing case-insensitive matches.
  
  Bug reported via the -dev list.  See
  http://lists.digium.com/pipermail/asterisk-dev/2010-June/044510.html
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@270584 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-15 18:26:26 +00:00
lmadsen 8c11ad9504 Fix some doxygen warnings.
(closes issue #17336)
Reported by: snuffy
Patches:
      doxygen-fixes1.diff uploaded by snuffy (license 35)
Tested by: russell

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@268969 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-08 14:38:18 +00:00
tilghman 8177411303 Let ExtensionState resolve dynamic hints.
(closes issue #16623)
 Reported by: tilghman
 Patches: 
       20100116__issue16623.diff.txt uploaded by tilghman (license 14)
 Tested by: lmadsen


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@264779 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-20 22:23:32 +00:00
mmichelson a0bdb8508f Fix potential invalid reads that could occur in pbx.c
Here is a cut and paste of my review request for this change:
This past weekend, Russell ran our current suite of unit tests for Asterisk
under valgrind. The PBX pattern match test caused valgrind to spew forth two
invalid read errors. This patch contains two changes that shut valgrind up and
do not cause any new memory leaks.

Change 1: In ast_context_remove_extension_callerid2, valgrind reported an
invalid read in the for loop close to the function's end. Specifically, one of
the the strcmp calls in the loop control was reading invalid memory. This was
because the caller of ast_context_remove_extension_callerid2 (__ast_context
destroy in this case) passed as a parameter a shallow copy of an ast_exten's
exten field. This same ast_exten was what was destroyed inside the for loop,
thus any iterations of the for loop beyond the destruction of the ast_exten
would result in invalid reads. My fix for this is to make a copy of the
ast_exten's exten field and pass the copy to
ast_context_remove_extension_callerid2. In addition, I have also acted
similarly with the ast_exten's matchcid field. Since in this case a NULL is
handled quite differently than an empty string, I needed to be a bit more
careful with its handling.

Change 2: In __ast_context_destroy, we iterated over a hashtab and called
ast_context_remove_extension_callerid2 on each item. Specifically, the hashtab
over which we were iterating was an ast_exten's peer_table. Inside of
ast_context_remove_extension_callerid2, we could possibly destroy this
ast_exten, which also caused the hashtab to be freed. Attempting to call
ast_hashtab_end_traversal on the hashtab iterator caused an invalid read to
occur when trying to read the iterator->tab->do_locking field since
iterator->tab had already been freed. My handling of this problem is a bit less
straightforward. With each iteration over the hashtab's contents, we set a
variable called "end_traversal" based on the return of
ast_context_remove_extension_callerid2. If 0 is ever returned, then we know
that the extension was found and destroyed. Because of this, we cannot call
ast_hashtab_end_traversal because we will be guaranteeing a read of invalid
memory. In such a case, we forego calling ast_hashtab_end_traversal and instead
call ast_free on the hashtab iterator.

Review: https://reviewboard.asterisk.org/r/585



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@254362 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-24 21:10:38 +00:00
russell 1cc6acc419 Use memmove() instead of memcpy() for a case where the buffers overlap.
Once again, valgrind is freaking awesome.  That is all.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@245610 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-08 23:23:45 +00:00
mmichelson 182dc0d6c4 Merged revisions 243486 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r243486 | mmichelson | 2010-01-27 12:06:43 -0600 (Wed, 27 Jan 2010) | 3 lines
  
  Use a safe list traversal while checking for duplicate vars in pbx_builtin_setvar_helper.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243487 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-27 18:08:02 +00:00
oej 52cccf6084 Change api for pbx_builtin_setvar to actually return error code if a function can't be written to.
This patch removes code that was duplicated from pbx.c to manager.c
in order to prevent API change in released versions of Asterisk.

There are propably also other places that would benefit from reading the
return code and react if a function returns error codes on writing a value into it.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242919 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-25 21:13:20 +00:00
alecdavis bbcc57ee3f Update CDR variables as pbx starts
Allows CDR variables added in cdr.c:set_one_cid to become visable during the call,
by executing ast_cdr_update() early in __ast_pbx run.
Reverts sig_pri changes in trunk that are specific to isdn technology only.

(closes issue #16638)
Reported by: alecdavis
Patches: 
      cdr_update.diff3.txt uploaded by alecdavis (license 585)
Tested by: alecdavis



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@241416 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-20 08:18:45 +00:00
jpeeler e1d0d936e6 Initialize data on the stack so that Park doesn't interpret random arguments.
passdata was only being set in pbx_substitue_variables when arguments were
passed.

(closes issue #16406)
(closes issue #16586)
Reported by: DLNoah
Patches: 
      bug16586v2.patch uploaded by jpeeler (license 325)
Tested by: DLNoah



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@241366 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-19 22:59:53 +00:00
seanbright 5e267160df Avoid a crash on Solaris when running 'core show functions.'
(closes issue #16309)
Reported by: asgaroth


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240717 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-17 19:45:48 +00:00
seanbright adc69e041d Convert a few places to use ast_calloc_with_stringfields where applicable.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240368 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-15 18:21:50 +00:00
tilghman 9d381c3185 Similarly, ensure that matchcid is duplicated correctly when merging contexts.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240175 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-14 17:34:53 +00:00
tilghman a2412ac2e9 Ensure that the callerid is NULL when the parent is effectively NULL.
This applies only to pattern-match hints, which create exact-match
hints on the fly.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240129 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-14 16:52:22 +00:00
tilghman 9110951119 Oops, another tag error
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239997 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-13 23:22:56 +00:00
tilghman 3d2bbbe25c Oops, missed a closing tag
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239996 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-13 23:21:46 +00:00
tilghman 0183b31199 Add the TESTTIME() dialplan function, which permits testing GotoIfTime.
Specifically, by setting TESTTIME() to a particular date and time, you
can test whether a dialplan correctly branches as was intended.  This was
developed after recent questions on the -users list on how to test their
holiday dialplan logic.
(closes issue #16464)
 Reported by: tilghman
 Patches: 
       20100112__issue16464.diff.txt uploaded by tilghman (license 14)
 
Review: https://reviewboard.asterisk.org/r/458/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239957 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-13 21:27:34 +00:00
tilghman 0fc96ee360 Blank callerid and NULL callerid should not compare equal.
The second is the default state for matching CID in the dialplan (no matching)
while the first matches one particular CallerID.  This is a regression.
(fixes AST-314, SWP-611)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239571 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-12 19:58:00 +00:00
dvossel ee10f9a749 fixes subscriptions being lost after 'module reload'
During a module reload if multiple extension configs are present,
such as both extensions.conf and extensions.ael, watchers for one
config's hints will be lost during the merging of the other config.

This happens because hint watchers are only preserved for the
current config being merged.  The old context list is destroyed
after the merging takes place, meaning any watchers that were not
perserved will be removed.

Now all hints are preserved during merging regardless of what config
file is being merged.  These hints are only restored if they
are present within the new context list.

(closes issue #16093)
Reported by: jlaroff



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237839 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-05 19:29:47 +00:00
tilghman 87a069d76c Merged revisions 237493 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r237493 | tilghman | 2010-01-04 14:57:35 -0600 (Mon, 04 Jan 2010) | 8 lines
  
  Regression in issue #15421 - Pattern matching
  (closes issue #16482)
   Reported by: wdoekes
   Patches: 
         astsvn-16482-betterfix.diff uploaded by wdoekes (license 717)
         20091223__issue16482.diff.txt uploaded by tilghman (license 14)
   Tested by: wdoekes, tilghman
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237494 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-04 20:59:01 +00:00
tilghman fda6c101b6 Merged revisions 237405 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r237405 | tilghman | 2010-01-04 12:19:00 -0600 (Mon, 04 Jan 2010) | 16 lines
  
  Add a flag to disable the Background behavior, for AGI users.
  This is in a section of code that relates to two other issues, namely
  issue #14011 and issue #14940), one of which was the behavior of
  Background when called with a context argument that matched the current
  context.  This fix broke FreePBX, however, in a post-Dial situation.
  Needless to say, this is an extremely difficult collision of several
  different issues.  While the use of an exception flag is ugly, fixing all
  of the issues linked is rather difficult (although if someone would like
  to propose a better solution, we're happy to entertain that suggestion).
  (closes issue #16434)
   Reported by: rickead2000
   Patches: 
         20091217__issue16434.diff.txt uploaded by tilghman (license 14)
         20091222__issue16434__1.6.1.diff.txt uploaded by tilghman (license 14)
   Tested by: rickead2000
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237406 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-04 18:28:28 +00:00