Ticket #5927 (closed Bugs: invalid)

Opened 10 months ago

Last modified 10 months ago

macro-hangupcall-custom is not called

Reported by: Area51 Assigned to:
Priority: major Milestone: 2.11
Component: Custom Context Version: 2.9-branch
Keywords: macro-hangupcall-custom Cc:
Confirmation: Unreviewed Distro:
Backend Engine: Asterisk 1.8 Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

I am attempting to set a Custom DEVSTATE using custom context and have successfully used extensions_custom.conf to set state to INUSE:

[macro-dialout-trunk-predial-hook]
exten => s,1,Set(DEVICE_STATE(Custom:JS-DAHDI1)=INUSE)

In trying to set the state NOT_INUSE when the channel hangs up, I created:

[macro-hangupcall-custom]
exten => h,1,Set(DEVICE_STATE(Custom:JS-DAHDI1)=NOT_INUSE)

While [macro-hangupcall-custom] is included from extensions_additional.conf and "dialplan show" clearly lists the include, the CLI never shows this context. The attachments show excerpts from the CLI and "show dialplan"

Attachments

CLI.txt (2.4 kB) - added by Area51 on 07/20/12 12:31:24.
CLI showing dialout-trunk-predial-hook
dialplan show.txt (0.6 kB) - added by Area51 on 07/20/12 12:32:26.
pertinent parts of "dialplan show"
freepbx-2.9.0-DEVSTATE.diff (0.8 kB) - added by Area51 on 07/20/12 15:45:09.
incomplete hack to get it working. I'm no programmer so …

Change History

07/20/12 12:31:24 changed by Area51

  • attachment CLI.txt added.

CLI showing dialout-trunk-predial-hook

07/20/12 12:32:26 changed by Area51

  • attachment dialplan show.txt added.

pertinent parts of "dialplan show"

07/20/12 14:16:27 changed by Area51

I was able to force the devstate by editing extensions_additional.conf and changing [macro-hangupcall] to

[macro-hangupcall] include => macro-hangupcall-custom exten => s,1,Set(DEVICE_STATE(Custom:JS-DAHDI1)=NOT_INUSE) exten => s,n(start),GotoIf?($["${USE_CONFIRMATION}"="" | "${RINGGROUP_INDEX}"="" | "${CHANNEL}"!="${UNIQCHAN}"]?theend) exten => s,n(delrgi),Noop(Deleting: RG/${RINGGROUP_INDEX}/${CHANNEL} ${DB_DELETE(RG/${RINGGROUP_INDEX}/${CHANNEL})}) exten => s,n(theend),Hangup

; end of [macro-hangupcall]

It seems that the GotoIf? breaks the include statement (or I have my statement wrong in extensions_custom.conf). stuck!!!

07/20/12 14:44:01 changed by Area51

scruggs*CLI> dialplan show macro-hangupcall [ Context 'macro-hangupcall' created by 'pbx_config' ]

's' => 1. GotoIf?($["${USE_CONFIRMATION}"="" | "${RINGGROUP_INDEX}"="" | "${CHANNEL}"!="${UNIQCHAN}"]?theend) [pbx_config]

[delrgi] 2. Noop(Deleting: RG/${RINGGROUP_INDEX}/${CHANNEL} ${DB_DELETE(RG/${RINGGROUP_INDEX}/${CHANNEL})}) [pbx_config] [theend] 3. Hangup() [pbx_config]

Include => 'macro-hangupcall-custom' [pbx_config]

-= 1 extension (3 priorities) in 1 context. =- scruggs*CLI> scruggs*CLI> scruggs*CLI> dialplan show macro-hangupcall-custom [ Context 'macro-hangupcall-custom' created by 'pbx_config' ]

'h' => 100. Set(DEVICE_STATE(Custom:JS-DAHDI1)=NOT_INUSE) [pbx_config]

-= 1 extension (1 priority) in 1 context. =-

07/20/12 15:45:09 changed by Area51

  • attachment freepbx-2.9.0-DEVSTATE.diff added.

incomplete hack to get it working. I'm no programmer so ...

07/20/12 17:05:46 changed by Area51

OK, upgraded to 2.10 to see if there would be any difference. none. macro-hangupcall-custom never called. same patch will get me started but is not enough. it killn meh!

(in reply to: ↑ description ) 07/30/12 09:56:46 changed by Area51

Please kill this..

07/30/12 11:04:11 changed by p_lindheimer

  • status changed from new to closed.
  • resolution set to invalid.

deleting per reporter's request.

As an FYI, most included context will not be looked at by Asterisk unless there is no priority available to execute an instruction in the current context. It's beyond the scope of this ticket to describe further but books on Asterisk and other sources are available to further describe how included contexts work in Asterisk.