*** main/devicestate.c.org 2017-07-12 20:12:08.000000000 +0900 --- main/devicestate.c 2018-05-04 02:21:55.024753051 +0900 *************** *** 283,288 **** --- 283,290 ---- return AST_DEVICE_RINGINUSE; else if (!strcasecmp(val, "ONHOLD")) return AST_DEVICE_ONHOLD; + else if (!strcasecmp(val, "IUSE")) + return AST_DEVICE_IUSE; return AST_DEVICE_UNKNOWN; } *** main/pbx.c.org 2017-07-12 20:12:08.000000000 +0900 --- main/pbx.c 2018-05-04 03:45:34.474296938 +0900 *************** *** 573,579 **** { AST_EXTENSION_RINGING, "Ringing" }, { AST_EXTENSION_INUSE | AST_EXTENSION_RINGING, "InUse&Ringing" }, { AST_EXTENSION_ONHOLD, "Hold" }, ! { AST_EXTENSION_INUSE | AST_EXTENSION_ONHOLD, "InUse&Hold" } }; struct pbx_exception { --- 573,580 ---- { AST_EXTENSION_RINGING, "Ringing" }, { AST_EXTENSION_INUSE | AST_EXTENSION_RINGING, "InUse&Ringing" }, { AST_EXTENSION_ONHOLD, "Hold" }, ! { AST_EXTENSION_INUSE | AST_EXTENSION_ONHOLD, "InUse&Hold" }, ! { AST_EXTENSION_IUSE, "I-use" } }; struct pbx_exception { *************** *** 2960,2965 **** --- 2961,2968 ---- return AST_EXTENSION_INUSE; case AST_DEVICE_NOT_INUSE: return AST_EXTENSION_NOT_INUSE; + case AST_DEVICE_IUSE: + return AST_EXTENSION_IUSE; case AST_DEVICE_TOTAL: /* not a device state, included for completeness */ break; } *************** *** 3252,3257 **** --- 3255,3261 ---- break; case AST_DEVICE_ONHOLD: case AST_DEVICE_INUSE: + case AST_DEVICE_IUSE: /* find up channel */ search_state = AST_STATE_UP; break; *** funcs/func_extstate.c.org 2017-07-12 20:12:08.000000000 +0900 --- funcs/func_extstate.c 2018-05-04 02:24:21.915031242 +0900 *************** *** 58,64 **** NoOp(4567@home has state ${EXTENSION_STATE(4567@home)}) The possible values returned by this function are: UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING | ! RINGINUSE | HOLDINUSE | ONHOLD ***/ --- 58,64 ---- NoOp(4567@home has state ${EXTENSION_STATE(4567@home)}) The possible values returned by this function are: UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING | ! RINGINUSE | HOLDINUSE | ONHOLD | IUSE ***/ *************** *** 91,96 **** --- 91,98 ---- break; case AST_EXTENSION_ONHOLD: res = "ONHOLD"; + case AST_EXTENSION_IUSE: + res = "IUSE"; break; } *** funcs/func_devstate.c.org 2017-07-12 20:12:08.000000000 +0900 --- funcs/func_devstate.c 2018-05-04 02:31:13.685808776 +0900 *************** *** 70,76 **** exten => 1234,hint,Custom:lamp1 The possible values for both uses of this function are: UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING | ! RINGINUSE | ONHOLD --- 70,76 ---- exten => 1234,hint,Custom:lamp1 The possible values for both uses of this function are: UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING | ! RINGINUSE | ONHOLD | IUSE *************** *** 251,257 **** " Change a custom device to a new state.\n" " The possible values for the state are:\n" "UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING\n" ! "RINGINUSE | ONHOLD\n" "\n" "Examples:\n" " devstate change Custom:mystate1 INUSE\n" --- 251,257 ---- " Change a custom device to a new state.\n" " The possible values for the state are:\n" "UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING\n" ! "RINGINUSE | ONHOLD | IUSE\n" "\n" "Examples:\n" " devstate change Custom:mystate1 INUSE\n" *************** *** 261,267 **** case CLI_GENERATE: { static const char * const cmds[] = { "UNKNOWN", "NOT_INUSE", "INUSE", "BUSY", ! "UNAVAILABLE", "RINGING", "RINGINUSE", "ONHOLD", NULL }; if (a->pos == e->args + 1) return ast_cli_complete(a->word, cmds, a->n); --- 261,268 ---- case CLI_GENERATE: { static const char * const cmds[] = { "UNKNOWN", "NOT_INUSE", "INUSE", "BUSY", ! "UNAVAILABLE", "RINGING", "RINGINUSE", "ONHOLD", ! "IUSE", NULL }; if (a->pos == e->args + 1) return ast_cli_complete(a->word, cmds, a->n); *** include/asterisk/pbx.h.org 2017-07-12 20:12:08.000000000 +0900 --- include/asterisk/pbx.h 2018-05-04 03:10:33.370274295 +0900 *************** *** 67,72 **** --- 67,73 ---- AST_EXTENSION_UNAVAILABLE = 1 << 2, /*!< All devices UNAVAILABLE/UNREGISTERED */ AST_EXTENSION_RINGING = 1 << 3, /*!< All devices RINGING */ AST_EXTENSION_ONHOLD = 1 << 4, /*!< All devices ONHOLD */ + AST_EXTENSION_IUSE = 1 << 5, /*!< All devices IUSE */ }; /*! *** include/asterisk/devicestate.h.org 2017-07-12 20:12:08.000000000 +0900 --- include/asterisk/devicestate.h 2018-05-04 02:50:48.468021605 +0900 *************** *** 59,64 **** --- 59,65 ---- AST_DEVICE_RINGING, /*!< Device is ringing */ AST_DEVICE_RINGINUSE, /*!< Device is ringing *and* in use */ AST_DEVICE_ONHOLD, /*!< Device is on hold */ + AST_DEVICE_IUSE, /*!< Device is i-use (panasonic) */ AST_DEVICE_TOTAL, /*!< Total num of device states, used for testing */ }; *** channels/chan_sip.c.org 2017-07-12 20:12:08.000000000 +0900 --- channels/chan_sip.c 2018-05-04 02:54:06.858396616 +0900 *************** *** 15107,15112 **** --- 15107,15118 ---- pidfstate = "busy"; pidfnote = "On hold"; break; + case AST_EXTENSION_IUSE: + statestring = "I-use"; + local_state = NOTIFY_INUSE; + pidfstate = "busy"; + pidfnote = "I-use"; + break; case AST_EXTENSION_NOT_INUSE: default: /* Default setting */