2

According to https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Function_PUSH, the command Push() should be perfectly valid. However, in my Asterisk 13.6 installation:

 same => n, Push(customer_codes,1234,5678,9087)

generates:

[Nov  6 11:19:07] WARNING[24966][C-00000002]: pbx.c:4972 pbx_extension_helper: No application 'Push' for extension

When I execute asterisk -x 'core show applications', I notice that Push(), Pop(), Shift() are conspicuously absent from the list.

Can anyone tell me which module these are found in, or what might be the problem?

MichelV69
  • 249
  • 1
  • 6

1 Answers1

1

The key to this is understanding the difference between Applications and Functions. Applications are things like Dial(), Playback(), Background() and can be used directly in the dialplan. Functions have to be used within the Applications available. The page you referenced even gives you an example.

Set(PUSH(array)=one,two,three)

For your example above, this should work:

same => n,Set(PUSH(customer_codes)=1234,5678,9087)

You can also see the available functions in asterisk by running:

core show functions
Matt W
  • 129
  • 3
  • Thank-you, good sir. I don't know how often I looked at that help page and somehow did not see exactly what you pointed out here. Cheers! – MichelV69 Nov 30 '15 at 14:25