Asterisk GoSub() function not working - voip

I've recently started to read about Asterisk and I really liked the idea of using the GoSub() function, but for some unknown to me reason I it seems that it is not installed:
Im using Asterisk 11.5.1
Below is my extensions.conf file:
[default]
exten => _.,1,Hangup()
[internal]
exten => 101,1,Noop(Going to internal contex exten:${EXTEN})
same => n,GoSub(sub-logger,start,1())
same => Dial(SIP/stefan)
exten => 102,1,Noop(Going to internal contex exten:${EXTEN})
same => n,GoSub(sub-logger,start,1())
same => n,Dial(SIP/nasko)
exten => 103,1,Noop(Na babati fyr4iloto)
exten => _9.,1,Dial(SIP/${EXTEN:1}#planet-phone)
exten => _.,1,Hangup()
[external]
exten => _.,1,Hangup()
[sub-logger]
exten => start,1,Noop(inside the subroutine)
;same => n,Noop(Channel : ${CHANNEL})
;same => n,Noop(Context : ${CONTEXT})
;same => n,Noop(Extensions : ${EXTEN})
;same => n,Noop(Date/time call : ${DATETIME})
same => n,Return()
When I register and try to call 101 or 102 I receive the following in the console:
== Using SIP RTP CoS mark 5
-- Executing [101#internal:1] NoOp("SIP/nasko-00000033", "Going to internal contex exten:101") in new stack
[Sep 22 19:47:41] WARNING[18071][C-00000025]: pbx.c:4621 pbx_extension_helper:No application 'GoSub' for extension (internal, 101, 2)
== Spawn extension (internal, 101, 2) exited non-zero on 'SIP/nasko-00000033'
-- Executing [h#internal:1] Hangup("SIP/nasko-00000033", "") in new stack
== Spawn extension (internal, h, 1) exited non-zero on 'SIP/nasko-00000033'
I searched a lot on in google but I wasnt able to find any explanation for this problem.
If someone has any idea please share it here!
THanks!

Did you load the app_stack module?
Maybe you want to add autoload on in modules.conf

Related

Logstash file input not reparsing file

I have the following problem, I need logstash to reparse already parsed files:
Scenario that doesn't work but should:
upload file to watched folder
logstash processes it, saves to elastic, removes it (file_completed_action => "log_and_delete"), great
I upload the same file again, same name, same content.
logstash doesnt do anything, I want it to process it again
Here is my file input config:
file {
mode => "read"
exclude => "*.tif"
path => ["/home/xmls/*.xml"]
file_completed_action => "log_and_delete"
file_completed_log_path => "/var/log/logstash/completed.log"
sincedb_path => "/dev/null"
start_position => "beginning"
codec => multiline {
pattern => ".*"
what => "previous"
max_lines => 100000
max_bytes => "200 MiB"
}
type => "my-custom-type-1"
}
sincedb_path is set to /dev/null, it should not remember processed files, also tried setting ignore_older to 0, didn't help.
Also tried messing with queue settings in logstash.yml, changed it to persistent, didn't work ...
I'm using logstash version 7.5, logstash-input-file (4.1.11), running in linux machine.
When I restart logstash, then the unprocessed files get processed and cleaned up.
I need it to work without restarting.

Problem connecting to Azure Service Bus using rabbitmq-amqp1.0-client

I'm trying to connect Azure Service Bus (AMQP 1.0) using this erlang client: https://github.com/rabbitmq/rabbitmq-amqp1.0-client
The elixir wrapper library https://github.com/pma/amqp doesn't seem like using AMQP 1.0. So I'm trying to use the erlang client directly.
I did the following:
git clone https://github.com/rabbitmq/rabbitmq-amqp1.0-client.git
cd rabbitmq-amqp1.0-client
make
make shell
Then I created a config as per the README file at https://github.com/rabbitmq/rabbitmq-amqp1.0-client
OpnConf = #{address => Hostname,
port => Port,
hostname => <<"abc-shankardevy.servicebus.windows.net">>,
tls_opts => {secure_port, [{versions, ['tlsv1.1']}]},
container_id => <<"test-container">>,
transfer_limit_margin => 100,
sasl => {plain, User, Password}}.
When I try to open the connection as in the README, I get the following error. I'm not able to follow the erlang error message. Any help is appreciated.
{ok, Connection} = amqp10_client:open_connection(OpnConf).
** exception exit: {noproc,{gen_server,call,
[amqp10_client_sup,
{start_child,[#{address =>
'abc-shankardevy.servicebus.windows.net',
container_id => <<"test-container">>,
hostname => <<"abc-shankardevy.servicebus.windows.net">>,
notify => <0.111.0>,port => 5671,
sasl =>
{plain,'RootManageSharedAccessKey',
'mykey'},
tls_opts => {secure_port,[{versions,['tlsv1.1']}]},
transfer_limit_margin => 100}]},
infinity]}}
in function gen_server:call/3 (gen_server.erl, line 223)
in call from amqp10_client_connection:open/1 (src/amqp10_client_connection.erl, line 110)
Try "starting" the application first:
application:ensure_all_started(amqp10_client).
It's complaining about not finding a certain process (noproc), namely the one called amqp10_client_sup. This process is started when the application is started, by this piece of code:
-module(amqp10_client_app).
-behaviour(application).
-export([start/2,
stop/1]).
start(_Type, _Args) ->
amqp10_client_sup:start_link().

Voximal - Cannot test the application

I've just installed the app on my asterisk 14 and i got some problems.
I've created this account in voximal.conf
[account2]
number=8000
name=test1
url=file:///var/lib/voximal/test.vxml
This is the content of my test.vxml
<?xml version="1.0"?>
<vxml version = "2.0" xmlns="http://www.w3.org/2001/vxml">
<form>
<block><audio src="hello.wav"/></block>
</form>
</vxml>
This is the content of my extensions.conf file
exten => 8000,1,Answer
exten => 8000,n,Wait(2)
exten => 8000,n,Voximal(test1)
exten => 8000,n,Hangup
And this is what I get when I call 8000 on my softphone
Executing [8000#from-internal:1] Answer("PJSIP/marc-00000005", "") in new stack
> 0x7fcbfc150140 -- Strict RTP learning after remote address set to: 192.168.79.1:40034
> 0x7fcbfc150140 -- Strict RTP switching to RTP target address 192.168.79.1:40034 as source
-- Executing [8000#from-internal:2] Wait("PJSIP/marc-00000005", "2") in new stack
> 0x7fcbfc150140 -- Strict RTP learning complete - Locking on source address 192.168.79.1:40034
-- Executing [8000#from-internal:3] Voximal("PJSIP/marc-00000005", "test1") in new stack
[Jan 3 09:15:56] ERROR[48508][C-00000006]: app_voximal.c:20285 vxml_exec: Cannot open new session, allocating context!
-- Executing [8000#from-internal:4] Hangup("PJSIP/marc-00000005", "") in new stack
I've tried this to identify the error:
exten => 8000,1,Voximal()
exten => 8000,n,NoOp(${VOXIMAL_ERROR})
exten => 8000,n,GotoIf($["${VOXIMAL_ERROR}" == ""]?hangup)
exten => 8000,n,Busy()
exten => 8000,n(hangup),Hangup()
And I got this:
Executing [8000#from-internal:1] Voximal("PJSIP/marc-00000000", "") in new stack
[Jan 3 09:28:08] ERROR[48842][C-00000001]: app_voximal.c:20285 vxml_exec: Cannot open new session, allocating context!
-- Executing [8000#from-internal:2] NoOp("PJSIP/marc-00000000", "LICENSE") in new stack
-- Executing [8000#from-internal:3] GotoIf("PJSIP/marc-00000000", "0?hangup") in new stack
-- Executing [8000#from-internal:4] Busy("PJSIP/marc-00000000", "") in new stack
Please help me!
The error : vxml_exec: Cannot open new session, allocating context!
It is because you didn't have enable the free 1 port of Voximal.
Have a look to your Voxiaml Licence with :
CLI> voximal show license
The default configuration needs an Internet connection to get the license.
If you are testing in a secure network, you need to set the key=evaluation (in the voximal.conf file or from the Web Interface) to enable localy the test/dev/free license.

File paths must be fully qualified error in puppet

I was trying to create a new file in my module, but every time I am getting an error for my file resource, saying:
File paths must be fully qualified, not '/the/path/that/I/have/given'.
What are the possible reasons for that error?
class fresh_start {
file { 'source_file.rb':
ensure => 'file',
source => 'puppet:///modules/fresh_start/source_file.rb',
path => '/etc/puppetlabs/code/environments/production/modules/fresh_start/destination_file.rb',
owner => 'root',
group => 'root',
mode => '0755', # Use 0700 if it is sensitive
notify => Exec['run_my_ruby']
}
exec { 'run_my_ruby':
command => 'ruby etc/puppetlabs/code/environments/production/modules/fresh_start/source_file.rb > /etc/puppetlabs/code/environments/production/modules/fresh_start/output.txt',
refreshonly => true,
}
}
I have also tried to put the file path in a variable and use that variable as the path attribute's value, but I got the same error.
This happens when you attempt to run code with Unix paths on Windows. Check out the Puppet source code here and here.
Using a debugger, we can see that Unix-style paths are rejected on a Windows platform:
[1] pry(main)> slash = '[\\\\/]'
=> "[\\\\/]"
[2] pry(main)> label = '[^\\\\/]+'
=> "[^\\\\/]+"
[3] pry(main)> AbsolutePathWindows = %r!^(?:(?:[A-Z]:#{slash})|(?:#{slash}#{slash}#{label}#{slash}#{label})|(?:#{slash}#{slash}\?#{slash}#{label}))!io
=> /^(?:(?:[A-Z]:[\\\/])|(?:[\\\/][\\\/][^\\\/]+[\\\/][^\\\/]+)|(?:[\\\/][\\\/]\?[\\\/][^\\\/]+))/i
[4] pry(main)> path = '/foo/bar'
=> "/foo/bar"
[5] pry(main)> path =~ AbsolutePathWindows
=> nil

Puppet: Found 1 dependency cycle

I am getting this error when applying my Puppet manifest:
Error: Could not apply complete catalog: Found 1 dependency cycle:
(Exec[pip install requirements] => File[change venv permissions] => File[enforce MinGW compiler] => Exec[pip install requirements])
Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz
Here is my Puppet manifest (the relevant part) and I don't see any dependency cycle there. Any ideas?
exec {'create virtualenv':
command => "$install_dir/Scripts/virtualenv.exe venv",
cwd => $project_dir,
require => Exec['install virtualenv'],
}
file { "fix Mingw32CCompiler":
path => "C:/Python27/Lib/distutils/cygwinccompiler.py",
content => template($cygwinc_template),
ensure => present,
require => Exec['create virtualenv'],
}
file { "enforce MinGW compiler":
path => "$project_dir/venv/Lib/distutils/distutils.cfg",
owner => $user,
content => $mingw,
ensure => present,
require => File['fix Mingw32CCompiler'],
}
exec {'pip install requirements':
timeout => 1200,
command => "$project_dir/venv/Scripts/pip.exe install -r $project_dir/requirements.txt",
require => File['enforce MinGW compiler'],
}
file {'change venv permissions':
path => "$project_dir/venv",
recurse => true,
owner => $user,
mode => 0770,
require => Exec['pip install requirements'],
}
In puppet files have an implicit require for any parent directories that are declared.
Effectively:
File['change venv permissions'] -> File['enforce MinGW compiler']
So the parent requires the exec, the exec requires the child, and the child requires the parent, creating a loop.
What was your last change (that's probably the moment you added the cycle).
Try the suggestion to generate the graph. Post the generated dot file as gist so that we can investigate further.
Take a look at Debugging cycle or missing dependency.

Resources