Review Board 1.7.16


Use stasis cache in more places

Review Request #2645 - Created June 26, 2013 and submitted

Joshua Colp
stasis_cache_usage
ASTERISK-21883
Reviewers
asterisk-dev
Asterisk
This change moves CLI/AGI/AMI commands to accessing the Stasis cache for retrieving information instead of directly accessing the data structures. I have also added an AMI action to get bridge information, and extended the "status" action to include the same information available as "core show channel".

Stuff given up:
1. Number of frames being read and written
2. First file descriptor
3. What the channel is blocked in

An additional question:
I'm not currently storing channel trace information in the snapshot and as a result it is not displayed. Is this a feature we still want to support? How widespread is it?
Executed the changed CLI commands, AMI actions, and AGI commands and ensured that the output is as expected.
/trunk/include/asterisk/channel.h
Diff Revision 3 Diff Revision 4
[20] 130 lines
[+20] [+] References:
131
extern "C" {
131
extern "C" {
132
#endif
132
#endif
133

    
   
133

   
134
#define AST_MAX_EXTENSION       80  /*!< Max length of an extension */
134
#define AST_MAX_EXTENSION       80  /*!< Max length of an extension */
135
#define AST_MAX_CONTEXT         80  /*!< Max length of a context */
135
#define AST_MAX_CONTEXT         80  /*!< Max length of a context */

    
   
136
#define AST_MAX_UNIQUEID       150  /*!< Max length of a channel uniqueid */

    
   
137
/*                                   150 = 127 (max systemname) + "-" + 10 (epoch

    
   
138
 *                                   timestamp) + "." + 10 (monotonically incrementing

    
   
139
 *                                   integer) + NULL. Note that if this value is ever

    
   
140
 *                                   changed, MAX_CHANNEL_ID should be updated in

    
   
141
 *                                   rtp_engine.h */
136
#define AST_MAX_ACCOUNT_CODE    20  /*!< Max length of an account code */
142
#define AST_MAX_ACCOUNT_CODE    20  /*!< Max length of an account code */
137
#define AST_CHANNEL_NAME        80  /*!< Max length of an ast_channel name */
143
#define AST_CHANNEL_NAME        80  /*!< Max length of an ast_channel name */
138
#define MAX_LANGUAGE            40  /*!< Max length of the language setting */
144
#define MAX_LANGUAGE            40  /*!< Max length of the language setting */
139
#define MAX_MUSICCLASS          80  /*!< Max length of the music class setting */
145
#define MAX_MUSICCLASS          80  /*!< Max length of the music class setting */
140
#define AST_MAX_USER_FIELD      256 /*!< Max length of the channel user field */
146
#define AST_MAX_USER_FIELD      256 /*!< Max length of the channel user field */
[+20] [20] 1461 lines
[+20] [+] void ast_channel_setwhentohangup_tv(struct ast_channel *chan, struct timeval offset);
1602
 * \retval non-zero on failure
1608
 * \retval non-zero on failure
1603
 */
1609
 */
1604
int ast_answer(struct ast_channel *chan);
1610
int ast_answer(struct ast_channel *chan);
1605

    
   
1611

   
1606
/*!
1612
/*!

    
   
1613
 * \brief Answer a channel, if it's not already answered.

    
   
1614
 *

    
   
1615
 * \param chan channel to answer

    
   
1616
 *

    
   
1617
 * \details See ast_answer()

    
   
1618
 *

    
   
1619
 * \retval 0 on success

    
   
1620
 * \retval non-zero on failure

    
   
1621
 */

    
   
1622
int ast_auto_answer(struct ast_channel *chan);

    
   
1623

   

    
   
1624
/*!
1607
 * \brief Answer a channel
1625
 * \brief Answer a channel
1608
 *
1626
 *
1609
 * \param chan channel to answer
1627
 * \param chan channel to answer
1610
 *
1628
 *
1611
 * This function answers a channel and handles all necessary call
1629
 * This function answers a channel and handles all necessary call
[+20] [20] 2761 lines
[+20] [+] int ast_channel_forward_endpoint(struct ast_channel *chan, struct ast_endpoint *endpoint);
4373
 * \retval The oldest linkedid value
4391
 * \retval The oldest linkedid value
4374
 * \since 12.0.0
4392
 * \since 12.0.0
4375
*/
4393
*/
4376
const char *ast_channel_oldest_linkedid(const char *a, const char *b);
4394
const char *ast_channel_oldest_linkedid(const char *a, const char *b);
4377

    
   
4395

   

    
   
4396
/*!

    
   
4397
 * \brief Removes the trailing identifiers from a channel name string

    
   
4398
 * \since 12.0.0

    
   
4399
 *

    
   
4400
 * \param channel_name string that you wish to turn into a dial string.

    
   
4401
 *                     This string will be edited in place.

    
   
4402
 */

    
   
4403
void ast_channel_name_to_dial_string(char *channel_name);
4378

    
   
4404

   
4379
#endif /* _ASTERISK_CHANNEL_H */
4405
#endif /* _ASTERISK_CHANNEL_H */
/trunk/include/asterisk/stasis_channels.h
Diff Revision 3 Diff Revision 4
 
/trunk/main/bridging.c
Diff Revision 3 Diff Revision 4
 
/trunk/main/channel.c
Diff Revision 3 Diff Revision 4
 
/trunk/main/channel_internal_api.c
Diff Revision 3 Diff Revision 4
 
/trunk/main/cli.c
Diff Revision 3 Diff Revision 4
 
/trunk/main/manager.c
Diff Revision 3 Diff Revision 4
 
/trunk/main/manager_bridging.c
Diff Revision 3 Diff Revision 4
 
/trunk/main/manager_channels.c
Diff Revision 3 Diff Revision 4
 
/trunk/main/pbx.c
Diff Revision 3 Diff Revision 4
 
/trunk/main/stasis_channels.c
Diff Revision 3 Diff Revision 4
 
/trunk/res/res_agi.c
Diff Revision 3 Diff Revision 4
 
  1. /trunk/include/asterisk/channel.h: Loading...
  2. /trunk/include/asterisk/stasis_channels.h: Loading...
  3. /trunk/main/bridging.c: Loading...
  4. /trunk/main/channel.c: Loading...
  5. /trunk/main/channel_internal_api.c: Loading...
  6. /trunk/main/cli.c: Loading...
  7. /trunk/main/manager.c: Loading...
  8. /trunk/main/manager_bridging.c: Loading...
  9. /trunk/main/manager_channels.c: Loading...
  10. /trunk/main/pbx.c: Loading...
  11. /trunk/main/stasis_channels.c: Loading...
  12. /trunk/res/res_agi.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.