Review Board 1.7.16


libpri: Add control of inband audio progress indication ie to the SETUP_ACKNOWLEDGE message.

Review Request #3520 - Created May 1, 2014 and submitted

rmudgett
1.4
AST-1338
Reviewers
asterisk-dev
LibPRI
This review and https://reviewboard.asterisk.org/r/3521/ work together to allow Asterisk to control the inband audio available progress indication ie on the SETUP_ACKNOWLEDGE message when dialtone is present.

Added support to the libpri API to control the inband audio available progress indication ie on the SETUP_ACKNOWLEDGE message.

* Added the progress indication ie progressmak value to the struct pri_event_setup_ack so the PRI_EVENT_SETUP_ACK event can indicate when a SETUP_ACKNOWLEDGE comes in with inband audio (ie dialtone).

* Added pri_setup_ack() so when the SETUP_ACKNOWLEDGE message is sent it can indicate if inband audio is present (ie dialtone).
Sent calls over an ISDN trunk with overlap dialing enabled that did and did not present dialtone for more digits.
Observed that the inband audio available progress indication ie was sent when needed on the SETUP_ACKNOWLEDGE message.
Added a debug message that indicated when Asterisk did and did not receive the inband audio indication for the SETUP_ACKNOWLEDGE message.
/branches/1.4/libpri.h
Revision 2319 New Change
[20] 1210 lines
[+20] [+] typedef struct pri_event_proceeding {
1211
typedef struct pri_event_setup_ack {
1211
typedef struct pri_event_setup_ack {
1212
	int e;
1212
	int e;
1213
	int channel;
1213
	int channel;
1214
	q931_call *call;
1214
	q931_call *call;
1215
	struct pri_subcommands *subcmds;
1215
	struct pri_subcommands *subcmds;

    
   
1216
	int progressmask;
1216
} pri_event_setup_ack;
1217
} pri_event_setup_ack;
1217

    
   
1218

   
1218
typedef struct pri_event_notify {
1219
typedef struct pri_event_notify {
1219
	int e;
1220
	int e;
1220
	int channel;
1221
	int channel;
[+20] [20] 185 lines
[+20] [+] const char *pri_facility_error2str(int facility_error_code);
1406
 *
1407
 *
1407
 * \return Descriptive reject string.
1408
 * \return Descriptive reject string.
1408
 */
1409
 */
1409
const char *pri_facility_reject2str(int facility_reject_code);
1410
const char *pri_facility_reject2str(int facility_reject_code);
1410

    
   
1411

   
1411
/* Acknowledge a call and place it on the given channel.  Set info to non-zero if there
1412
/*!
1412
   is in-band data available on the channel */
1413
 * \brief Send the ALERTING message.

    
   
1414
 *

    
   
1415
 * \param pri D channel controller.

    
   
1416
 * \param call Q.931 call leg.

    
   
1417
 * \param channel Encoded channel id to use.  If zero do not change channel id.

    
   
1418
 * \param info Nonzero to include a progress ie indicating inband audio available (ie ringback).

    
   
1419
 *

    
   
1420
 * \retval 0 on success.

    
   
1421
 * \retval -1 on error.

    
   
1422
 */
1413
int pri_acknowledge(struct pri *pri, q931_call *call, int channel, int info);
1423
int pri_acknowledge(struct pri *pri, q931_call *call, int channel, int info);
1414

    
   
1424

   
1415
/* Send a digit in overlap mode */
1425
/* Send a digit in overlap mode */
1416
int pri_information(struct pri *pri, q931_call *call, char digit);
1426
int pri_information(struct pri *pri, q931_call *call, char digit);
1417

    
   
1427

   
1418
#define PRI_KEYPAD_FACILITY_TX
1428
#define PRI_KEYPAD_FACILITY_TX
1419
/* Send a keypad facility string of digits */
1429
/* Send a keypad facility string of digits */
1420
int pri_keypad_facility(struct pri *pri, q931_call *call, const char *digits);
1430
int pri_keypad_facility(struct pri *pri, q931_call *call, const char *digits);
1421

    
   
1431

   
1422
/* Answer the incomplete(call without called number) call on the given channel.
1432
/*!
1423
   Set non-isdn to non-zero if you are not connecting to ISDN equipment */
1433
 * \brief Send the SETUP_ACKNOWLEDGE message.

    
   
1434
 *

    
   
1435
 * \param pri D channel controller.

    
   
1436
 * \param call Q.931 call leg.

    
   
1437
 * \param channel Encoded channel id to use.  If zero do not change channel id.

    
   
1438
 * \param nonisdn Nonzero to include a progress ie indicating non-end-to-end-ISDN.

    
   
1439
 *

    
   
1440
 * \retval 0 on success.

    
   
1441
 * \retval -1 on error.

    
   
1442
 */
1424
int pri_need_more_info(struct pri *pri, q931_call *call, int channel, int nonisdn);
1443
int pri_need_more_info(struct pri *pri, q931_call *call, int channel, int nonisdn);
1425

    
   
1444

   
1426
/* Answer(CONNECT) the call on the given channel.
1445
/*!
1427
   Set non-isdn to non-zero if you are not connecting to ISDN equipment */
1446
 * \brief Send the SETUP_ACKNOWLEDGE message.

    
   
1447
 *

    
   
1448
 * \param ctrl D channel controller.

    
   
1449
 * \param call Q.931 call leg.

    
   
1450
 * \param channel Encoded channel id to use.  If zero do not change channel id.

    
   
1451
 * \param nonisdn Nonzero to include a progress ie indicating non-end-to-end-ISDN.

    
   
1452
 * \param inband Nonzero to include a progress ie indicating inband audio available (ie dialtone).

    
   
1453
 *

    
   
1454
 * \retval 0 on success.

    
   
1455
 * \retval -1 on error.

    
   
1456
 */

    
   
1457
int pri_setup_ack(struct pri *ctrl, q931_call *call, int channel, int nonisdn, int inband);

    
   
1458

   

    
   
1459
/*!

    
   
1460
 * \brief Send the CONNECT message.

    
   
1461
 *

    
   
1462
 * \param pri D channel controller.

    
   
1463
 * \param call Q.931 call leg.

    
   
1464
 * \param channel Encoded channel id to use.  If zero do not change channel id.

    
   
1465
 * \param nonisdn Nonzero to include a progress ie indicating non-end-to-end-ISDN.

    
   
1466
 *

    
   
1467
 * \retval 0 on success.

    
   
1468
 * \retval -1 on error.

    
   
1469
 */
1428
int pri_answer(struct pri *pri, q931_call *call, int channel, int nonisdn);
1470
int pri_answer(struct pri *pri, q931_call *call, int channel, int nonisdn);
1429

    
   
1471

   
1430
/*!
1472
/*!
1431
 * \brief Send the manual CONNECT_ACKNOWLEDGE message.
1473
 * \brief Send the manual CONNECT_ACKNOWLEDGE message.
1432
 *
1474
 *
[+20] [20] 257 lines
[+20] [+] int pri_fd(struct pri *pri);
1690

    
   
1732

   
1691
/* Send progress with cause IE */
1733
/* Send progress with cause IE */
1692
int pri_progress_with_cause(struct pri *pri, q931_call *c, int channel, int info, int cause);
1734
int pri_progress_with_cause(struct pri *pri, q931_call *c, int channel, int info, int cause);
1693

    
   
1735

   
1694
#define PRI_PROCEEDING_FULL
1736
#define PRI_PROCEEDING_FULL
1695
/* Send call proceeding */
1737
/*!

    
   
1738
 * \brief Send the PROCEEDING message.

    
   
1739
 *

    
   
1740
 * \param pri D channel controller.

    
   
1741
 * \param c Q.931 call leg.

    
   
1742
 * \param channel Encoded channel id to use.  If zero do not change channel id.

    
   
1743
 * \param info Nonzero to include a progress ie indicating inband audio available.

    
   
1744
 *

    
   
1745
 * \retval 0 on success.

    
   
1746
 * \retval -1 on error.

    
   
1747
 */
1696
int pri_proceeding(struct pri *pri, q931_call *c, int channel, int info);
1748
int pri_proceeding(struct pri *pri, q931_call *c, int channel, int info);
1697

    
   
1749

   
1698
/* Enable inband progress when a DISCONNECT is received */
1750
/* Enable inband progress when a DISCONNECT is received */
1699
void pri_set_inbanddisconnect(struct pri *pri, unsigned int enable);
1751
void pri_set_inbanddisconnect(struct pri *pri, unsigned int enable);
1700

    
   
1752

   
[+20] [20] 533 lines
/branches/1.4/pri.c
Revision 2319 New Change
 
/branches/1.4/pri_q931.h
Revision 2319 New Change
 
/branches/1.4/q931.c
Revision 2319 New Change
 
  1. /branches/1.4/libpri.h: Loading...
  2. /branches/1.4/pri.c: Loading...
  3. /branches/1.4/pri_q931.h: Loading...
  4. /branches/1.4/q931.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.