Re: [asterisk-users] 13.22.0 - HTTP session count exceeded 100 sessions - instance unusable
Hi Joshua No back-off, but I am caching the last 5000 results and and first hitting the cache to see if a recent command already provided the information I'm seeking for a particular request. I'll see if I can do some simulation and see if I'm effectively DDOSing the local HTTP interface. I'll have to see if I maybe have a resource leak in my code that makes the HTTP request, which is set to "Connection: close" already (and not "Connection: keep-alive" at HTTP request header level) hang around and keep the HTTP connection open to Asterisk. Does the HTTP implementation in Asterisk heed this "Connection:" HTTP header? -- Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] 13.22.0 - HTTP session count exceeded 100 sessions - instance unusable
Hi Joshua No back-off, but I am caching the last 5000 result and and first hitting the cache to see if a recent command already provided the information I'm seeking for a particular request. From: Joshua C. Colp Sent: Wednesday, 01 July 2020 15:47 To: viljo...@verishare.co.za; Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] 13.22.0 - HTTP session count exceeded 100 sessions - instance unusable On Wed, Jul 1, 2020 at 10:32 AM Stefan Viljoen <mailto:viljo...@verishare.co.za> wrote: Hi Joshua HTTP is used on in our setup on http://127.0.0.1/mxml? to send commands to the server, such as http://127.0.0.1/mxml?action=login=myuser=thesecret to log in and then http://127.0.0.1/mxml?ActionID=123=BlindTransfer=Channel=local=123=1 etc. to control transfers, for example. ARI is not being used. WebRTC is not being used. I have in the meantime modified httpd.conf and halved the session_inactivity from 30 000 to 20 000 and session_keep_alive from 15 000 to 10 000, and increased the sessionlimit to 1000 (instead of 100) to see if shorter sessions expiring more frequently and just plain more available slots for sessions will help? So far so good, done about 55 000 new calls that way the past 32 minutes. Or am I barking up the wrong tree? It's possible it will help - but that still doesn't explain what exactly happened. Does your code have a back off strategy if HTTP requests fail? If not and they have an immediate retry with loop, then that may have effectively DDoSed things. It would also be good to explain why 100 connections were in use - did old connections not get closed? Was your load sufficient to just meet that amount? -- Joshua C. Colp Asterisk Technical Lead Sangoma Technologies Check us out at http://www.sangoma.com and http://www.asterisk.org -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] 13.22.0 - HTTP session count exceeded 100 sessions - instance unusable
Hi Joshua HTTP is used on in our setup on 127.0.0.1/mxml? to send commands to the server, such as http://127.0.0.1/mxml?action=login=myuser=thesecret to log in and then http://127.0.0.1/mxml?ActionID=123=BlindTransfer=Channel=local=123=1 etc. to control transfers, for example. ARI is not being used. WebRTC is not being used. I have in the meantime modified httpd.conf and halved the session_inactivity from 30 000 to 20 000 and session_keep_alive from 15 000 to 10 000, and increased the sessionlimit to 1000 (instead of 100) to see if shorter sessions expiring more frequently and just plain more available slots for sessions will help? So far so good, done about 55 000 new calls that way the past 32 minutes. Or am I barking up the wrong tree? Thanks! -- Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] 13.22.0 - HTTP session count exceeded 100 sessions - instance unusable
Hi all I'm running an Asterisk 13.22.0 instance on Centos 7 - I7-8700 12 core HT with 16GB of RAM. The server maintains a total active call count of approx 285 calls with 440 channels at any one time. The totals never go below 200 calls concurrently active. For the kernel, top reports load levels at around 5.0 to 6.0 constantly. I'm having issues where at random intervals, the CLI is filled with thousands of these lines [Jul 1 14:32:24] WARNING[11530]: http.c:1942 httpd_helper_thread: HTTP session count exceeded 100 sessions. This appears to be some form of race condition, the Asterisk instance goes completely unresponsive, all RTP stops and all calls get hung up the moment these appear on the CLI. All registered SIP phones then deregister off the server withing one to two minutes. At the time this takes place, kernel load spikes to about 9.0 and then falls off to under 1 while asterisk endlessly outputs the above warning in the Asterisk CLI. You can still log into the CLI but no command is executed, you also cannot get the Asterisk to stop with HUP / kill -1 and I have to kill -9 the Asterisk PID at the end of the day. I'm also, just prior the above taking place, getting tens of thousands of these warnings in the CLI: [Jul 1 14:30:39] WARNING[16819][C-04bf]: taskprocessor.c:895 taskprocessor_push: The 'stasis-core-control' task processor queue reached 500 scheduled tasks again. I'm using AMI at several hundred lines of traffic per second to control the Asterisk instance, spawn new calls, get queue and agent statuses, etc. - standard AMI stuff. Where can I start to look for how to fix this "session count exceeded 100 sessions" error? Sometimes, it doesn't come up for weeks (loads remain much the same) and then on one day it will happen four to six times in quick succession, load broadly the same. Any ideas? Thanks! Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Asterisk 13.22.0 unstable on Azure Centos 7 & cannot encode .gsm files
Hi all, I'm running a Centos 7 instance in Azure with Asterisk 13. The Centos VM has 24GB of RAM and identifies the CPU as Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz. This is a virtual copy of a physical Centos 7 machine which has 16GB of RAM and the physical CPU identifies itself as the same in /proc/cpuinfo. I'm running up to 150 to 200 callers without problems on the physical machine, usually have about 320 to 370 channels open simultaneously. The physical box encodes to .gsm for recordings. The virtual Centos 7 box keeps crashing with the same dialplan, at around 100 callers (200+- channels). Symptoms are that these will appear in the CLI on the virtual Asterisk instance: May 11 11:54:32 asterisk: [May 11 11:54:32] #033[1;31mWARNING#033[0m[8830][C-0d02]: #033[1;37mtaskprocessor.c#033[0m:#033[1;37m895#033[0m #033[1;37mtaskprocessor_push#033[0m: The 'subp:ast_channel_topic_all-064d' task processor queue reached 500 scheduled tasks again. May 11 11:54:32 asterisk: [May 11 11:54:32] #033[1;31mWARNING#033[0m[8830][C-0d02]: #033[1;37mtaskprocessor.c#033[0m:#033[1;37m895#033[0m #033[1;37mtaskprocessor_push#033[0m: The 'subp:ast_channel_topic_all-0683' task processor queue reached 500 scheduled tasks. May 11 11:54:32 asterisk: [May 11 11:54:32] #033[1;31mWARNING#033[0m[8830][C-0d02]: #033[1;37mtaskprocessor.c#033[0m:#033[1;37m895#033[0m #033[1;37mtaskprocessor_push#033[0m: The 'subp:ast_channel_topic_all-0673' task processor queue reached 500 scheduled tasks again. May 11 11:54:32 asterisk: [May 11 11:54:32] #033[1;31mWARNING#033[0m[8773][C-0cfc]: #033[1;37mtaskprocessor.c#033[0m:#033[1;37m895#033[0m #033[1;37mtaskprocessor_push#033[0m: The 'subp:ast_channel_topic_all-0517' task processor queue reached 500 scheduled tasks again. May 11 11:54:32 asterisk: [May 11 11:54:32] #033[1;31mWARNING#033[0m[8755][C-0cf9]: #033[1;37mtaskprocessor.c#033[0m:#033[1;37m895#033[0m #033[1;37mtaskprocessor_push#033[0m: The 'subp:ast_channel_topic_all-0645' task processor queue reached 500 scheduled tasks again. Mixed with 100s of lines of these: May 11 11:48:31 asterisk: [May 11 11:48:31] #033[1;31mWARNING#033[0m[115959][C-0937]: #033[1;37mast_expr2.fl#033[0m:#033[1;37m470#033[0m #033[1;37mast_yyerror#033[0m: ast_yyerror(): syntax error: syntax error, unexpected '', expecting $end; Input: Then there will be a few 100 of these: [May 11 12:10:33] WARNING[63930]: pbx.c:4548 increase_call_count: Maximum loadavg limit of 50.00 load exceeded by 'Local/3155@local-2d4e;2' (currently 50.19)! And then the virtual Asterisk instance will go into a state where no call hangs up and no new calls can be made via the AMI, calls to the AMI just being indefinitely suspended and not receiving a response. Neither can the virtual asterisk be shut down using a "core stop now" or "core stop gracefully", and it doesn't respond to kill -1, I have to kill -9 the PID. The virtual equivalent Centos 7 Asterisk 13.22.0 machine with 8GB more RAM than the physical cannot nearly handle even half of what the real-metal equivalent machine handles, without any of the above CLI errors and warnings. Also, the virtual asterisk encodes corrupt .gsm files, none it produces are readable or playable by other Asterisk instances and not by VLC. Is there anything I can do about the crashes - except get off Azure? I've bypassed the corrupt .gsms by encoding to .wav and hooking into the recording hook that ther mixmonitor app offers. -ANY- ideas? Thanks, -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Asterisk 13.22.0 under very high load conditions - freezes in H exten and blocks new calls
Hi Dovid No NFS connections are in use. Directly mounted EXT4 SSD (emulated, this is in a virtual environment). Yes, I'm using ODBC to connect to the MySQL instance that records my CDRs. Thanks for the reply! Stefan --- From: Dovid Bender Sent: Tuesday, 21 April 2020 16:53 To: viljo...@verishare.co.za; Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Asterisk 13.22.0 under very high load conditions - freezes in H exten and blocks new calls Are you using NFS? Any ODBC connections? On Tue, Apr 21, 2020 at 10:23 AM Stefan Viljoen <mailto:viljo...@verishare.co.za> wrote: Hi all I'm running an Asterisk on an Intel XEON E5-2660 virtual with Centos 7 - 32GB RAM. When I approach about 320 channels, I -sometimes- get thousands of these messages suddenly streamed in the CLI / Asterisk log: WARNING[60753][C-00022cb9] channel.c: Exceptionally long voice queue length queuing to Local/xx@local-0002dbea;2 WARNING[71993][C-00022dcc] channel.c: Exceptionally long voice queue length queuing to Local/xx@local-0002dd10;2 WARNING[72848][C-00022dd1] channel.c: Exceptionally long voice queue length queuing to Local/@local-0002dd30;1 Top reports system load as 30.0, but the box is still very responsive over SSH. Asterisk is shown as consuming 600% CPU when NOT in this state (but close to it) and doesn't consume more as this state comes into effect. Top also shows that HT CPU instances are idle 40% of their time. What then happens when these messages appear is Asterisk stops accepting originates on the AMI, and that no CDRs write through to the CDR DB anymore - MySQL itself is idle and has no locks or running inserts indicated in "show processlist" in MySQL CLI. The Asterisk instance will then effectively freeze, never hanging up terrminated calls, and never allowing new cals to start, keeping around 320 channels open, forever. Thing is I can sometimes peak at over 350 channels, then come back down as answers, hangups, etc. take place - no problem. But -sustaining- more than 320 channels over a two or three minutes seems to reliably cause the above to happen. Asterisk has to be kill -9'ed to get it restarted, it ignores kill -1 / sighup / cli "core stop now" CLI does work and is still repsonsive in this state, until I do a "core stop now", which doesn't stop the instance even after 20 to 30 minutes. Asterisk max load is set to 40 and max calls to 350. Any idea what I can look at? Any tips for running specifically 13 under high load? Thanks Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Asterisk 13.22.0 under very high load conditions - freezes in H exten and blocks new calls
Hi all I'm running an Asterisk on an Intel XEON E5-2660 virtual with Centos 7 - 32GB RAM. When I approach about 320 channels, I -sometimes- get thousands of these messages suddenly streamed in the CLI / Asterisk log: WARNING[60753][C-00022cb9] channel.c: Exceptionally long voice queue length queuing to Local/xx@local-0002dbea;2 WARNING[71993][C-00022dcc] channel.c: Exceptionally long voice queue length queuing to Local/xx@local-0002dd10;2 WARNING[72848][C-00022dd1] channel.c: Exceptionally long voice queue length queuing to Local/@local-0002dd30;1 Top reports system load as 30.0, but the box is still very responsive over SSH. Asterisk is shown as consuming 600% CPU when NOT in this state (but close to it) and doesn't consume more as this state comes into effect. Top also shows that HT CPU instances are idle 40% of their time. What then happens when these messages appear is Asterisk stops accepting originates on the AMI, and that no CDRs write through to the CDR DB anymore - MySQL itself is idle and has no locks or running inserts indicated in "show processlist" in MySQL CLI. The Asterisk instance will then effectively freeze, never hanging up terrminated calls, and never allowing new cals to start, keeping around 320 channels open, forever. Thing is I can sometimes peak at over 350 channels, then come back down as answers, hangups, etc. take place - no problem. But -sustaining- more than 320 channels over a two or three minutes seems to reliably cause the above to happen. Asterisk has to be kill -9'ed to get it restarted, it ignores kill -1 / sighup / cli "core stop now" CLI does work and is still repsonsive in this state, until I do a "core stop now", which doesn't stop the instance even after 20 to 30 minutes. Asterisk max load is set to 40 and max calls to 350. Any idea what I can look at? Any tips for running specifically 13 under high load? Thanks Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] What are "non critical" invites?
Hi All I'm getting tens of thousands of these messages ever hour in the Asterisk CLI for Asterisk 13.22.0: [Apr 20 15:59:46] WARNING[45462]: chan_sip.c:4127 retrans_pkt: Timeout on 192420-502043860-301870737 on non-critical invite transaction. [Apr 20 15:59:46] WARNING[45462]: chan_sip.c:4127 retrans_pkt: Timeout on 301794058-652332923-1834701069 on non-critical invite transaction. [Apr 20 15:59:47] WARNING[45462]: chan_sip.c:4127 retrans_pkt: Timeout on 393288224-685421081-2030967079 on non-critical invite transaction. [Apr 20 15:59:48] WARNING[45462]: chan_sip.c:4127 retrans_pkt: Timeout on 1724665510-1751083232-677093666 on non-critical invite transaction. [Apr 20 15:59:49] WARNING[45462]: chan_sip.c:4127 retrans_pkt: Timeout on 1958221882-69806522-85947083 on non-critical invite transaction. [Apr 20 15:59:49] WARNING[45462]: chan_sip.c:4127 retrans_pkt: Timeout on 1013186441-666073546-1030482332 on non-critical invite transaction. If an invite is non-critical, why do it then? What is the purpose of a "non-critical" invite. My server mostly works, with occassional channels that get stuck and need to be hung up manually, but otherwise is working fine. I'm trying to identify what a non-critrical invite is, and if it is non-critical, can it be turned off somehow? Since it is explictily shown as "non-critical" - it means it can be dispensed with, as it is non-critical. Clearly, it IS critical, since it exists, but why the strange semantic of calling it "non critical" - why do something that is non-critical and therefore not necessary. Thanks! Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Predictive call - agent talking to a customer, then suddenly talking to another customer
Hi, do you have NAT between Asterisk and agent phones? S pozdravem Tomáš Holý Hi Tomas Thanks for replying. Yes, the phones are in one location in a LAN and are then NATed to enable them to contact the Asterisk which is hosted in the cloud. A typical sip.conf phone configuration on the remote server for the site is [general] session-timers=refuse disallow=all allow=g729:20 allow=ulaw allow=alaw fromuser=xxx useragent=xxx callcounter=yes alwaysauthreject=yes allowguest=no jbnable=yes jbforce=no jbimpl=adaptive jblog=no jbmaxsize=200 jbresyncthreshold=1000 externaddr=xx.xx.xx.xx localnet=xx.xx.xx.xx/255.255.255.0 [] type=peer user= secret= host=dynamic disallow=all allow=g729 allow=ulaw allow=alaw dtmfmode=rfc2833 context= call-limit=1 limitonpeers=yes callgroup=1 pickupgroup=1 deny=0.0.0.0/0.0.0.0 permit=xxx.xxx.xxx.xxx/255.255.255.255 nat=force_rport,comedia Not sure if that helps much. Thanks for the reply! > 13. 2. 2020 v 19:06, Stefan Viljoen : > > > Hi all > > Asterisk 13 instance - I’ve got a situation in an agent queue that an agent > will be talking to one person, then suddenly the same agent will be talking > to another person who was talking to another agent. > > The calls do not switch around between the two agents, the “losing” agent > will just suddenly have silence in his handset and the other agent will now > be talking to “his” customer. > > The original customer is simply cut off instantly the moment this happens. > > This happens randomly. I have yet to collect log output and capture the CLI, > etc. but anybody ever heard of this happening? > > It is as if agent channels get randomly reassigned / lose their audio channel > from outside the Asterisk - one channel is disconneted that a customer was on > and certain agents are suddenly talking to someone else and lose the original > caller they were busy with. > > Where can I even being to look? > > Thx! > -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Predictive call - agent talking to a customer, then suddenly talking to another customer
Hi all Asterisk 13 instance - I've got a situation in an agent queue that an agent will be talking to one person, then suddenly the same agent will be talking to another person who was talking to another agent. The calls do not switch around between the two agents, the "losing" agent will just suddenly have silence in his handset and the other agent will now be talking to "his" customer. The original customer is simply cut off instantly the moment this happens. This happens randomly. I have yet to collect log output and capture the CLI, etc. but anybody ever heard of this happening? It is as if agent channels get randomly reassigned / lose their audio channel from outside the Asterisk - one channel is disconneted that a customer was on and certain agents are suddenly talking to someone else and lose the original caller they were busy with. Where can I even being to look? Thx! -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Asterisk 13 on Microsoft Azure Centos 7 instance cannot encode gsm via MixMonitor
Hi Patrick Wow ok thanks. I was not aware of this. As far as I can determine the Azure VM we're using was set up on the "stock" Centos 7 option Azure offers. So you're correct, it then won't be an official Centos 7 image. The one we are running on our bare-metal hosts IS installed from an official Centos 7 ISO burned to DVD... then yum updated fully once the base install is done. This changes things a bit. THANKS! I'll try and investigate further. Still wonder what the "RogueWave" or "OpenLogic" repos then have different that -only- GSM encoding doesn't work in Ast 13.22.0. Thanks for the help. Kind regards, -Original Message- From: Patrick Laimbock Sent: Friday, 13 September 2019 13:37 To: viljo...@verishare.co.za; asterisk-users@lists.digium.com Subject: RE: [asterisk-users] Asterisk 13 on Microsoft Azure Centos 7 instance cannot encode gsm via MixMonitor Hi Stefan, > Hi all > > I maintain the above - it was set up by an external party with whom relations > have now been severed by my employer. > > Quite early after the deployment it became evident that all .gsm audio files > produced on this virtual instance at Azure via MixMonitor are corrupt. [snip] Is the CentOS 7 installation/image the same across your bare-metal hosts and the one on azure? AFAIK there is still no official CentOS 7 image provided by the CentOS Project on the azure marketplace. Instead it's created by a third party [1]. So there may be differences that could cause issues. On your azure host, check the repo files in /etc/yum.repos.d/. If the mirrorlist/basurl points to openlogic or roguewave than it's a third-party image. IIRC Amazon and GCP have official CentOS 7 images provided by the CentOS Project. Maybe try one of those to see if the issue persists? Alternatively create your own CentOS 7 VM from the official CentOS 7 repositories using kickstart and try that on azure. Best, Patrick [1] https://azuremarketplace.microsoft.com/en-us/marketplace/apps/RogueWave.CentOS76?tab=Overview -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Asterisk 13 on Microsoft Azure Centos 7 instance cannot encode gsm via MixMonitor
Hi all I maintain the above - it was set up by an external party with whom relations have now been severed by my employer. Quite early after the deployment it became evident that all .gsm audio files produced on this virtual instance at Azure via MixMonitor are corrupt. If you play back the file in an audio player the audio almost sounds reversed and is severely distorted to the extent of being completely unintelligble. You can still convert the file to .wav with SOX, and if you look at the waveform in something like audacity the amplitude all over is near maximum and visually there IS no waveform to see... e. g. apparently the .gsm file itself is valid, but the GSM audio data itself is effectively gibbrerish. But anyway: The Asterisk config files and dialplan are identical to 17 other sites where Asterisk 13 is used in the same way as at Azure. All the other sites are physical bare-metal hardware, and they work fine on the exact same Centos 7 based setup. No errors are emitted at any verbosity level (in the Asterisk CLI or the log files) when the Azure Centos 7 Linux instance is writing corrupt .gsm files. The problem most definitely is the fact that Asterisk runs in a Centos 7 instance on a virtual machine in the Azure cloud. Move the exact same config with the same updated Centos 7 kernel to a physical box, and the corrupt .gsm file problem disappears. What can possibly be the problem that deploying Asterisk 13 in an Azure instance / VM breaks .gsm encoding? (I have managed to do a workaround by encoding conversations via MixMonitor to .wav, and then using the MixMonitor hook to convert the .wav back to .gsm with SOX - which works fine.) Why can SOX on the same Azure instance happily encode .wav to .gsm, but Asterisk "live" via MixMonitor produced corrupt .gsm files, with no errors emitted during encoding? How can one fix this? Thanks Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Odd one-way audio problem (Mike Diehl)
Hi Mike Oh yes, this: --- Note that the call ID is much longer than in the column display, e. g. a visual call ID in the sip show channelstats display may be 31f867c50ce but the full call ID is then 32d867a55cfb563b7f59da01de84d...@xxx.xxx.xxx.xxx:5060 The full ID can be obtained by typing the partial ID as displayed in the list in the Asterisk CLI and then hitting TAB on the keyboard. --- will only work if you go sip show channel 31f867c50ce and THEN press TAB on the keyboard. Apologies. Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Odd one-way audio problem (Mike Diehl
Hi Mike No rtp.conf in /etc/asterisk?! This might be part of your problem, AFAIK rtp.conf is part of any standard installation might it be that you have a corrupted Asterisk install and / or -other- missing conf files as well? Might this not also be part of your problem? I installed Asterisk 13 by downloading the 13.22.0 version from Digium as a source .tar.gz and compiling and installig it myself, by hand. Not sure if yours comes from a distro repo or something similar which has been modified or is not a standard install. That might also be something to try, e. g. see if you can compile a "clean" instance, from canon community version source, from Digium itself directly, and see if that changes anything. Note that the 1 and 2 ranges I show below was mandated by my voice service provider, yours may differ! For example, I run 17 instances of Asterisk in South Africa with Centracom (my voice service provider) and in South Africa I have to use 1 - 2. However, we also run a branch in Colorado in the United States with Twilio LLC as voice service provider in the USA, and they -require- 1 - 65535 to be used in rtp.conf... or you get exactly what you describe, e. g. random calls have no audio in either of the two directions. For reference, your /etc/asterisk/rtp.conf file has a set format, e. g. it has to look like this (to parse, and work, I assume): /etc/asterisk/rtp.conf --- ; ; RTP Configuration ; [general] ; ; RTP start and RTP end configure start and end addresses ; ; Defaults are rtpstart=5000 and rtpend=31000 ; rtpstart=1 rtpend=2 ; ; Whether to enable or disable UDP checksums on RTP traffic ; ;rtpchecksums=no ; ; The amount of time a DTMF digit with no 'end' marker should be ; allowed to continue (in 'samples', 1/8000 of a second) ; ;dtmftimeout=3000 ; rtcpinterval = 5000 ; Milliseconds between rtcp reports ;(min 500, max 6, default 5000) --- As you can see, defaults (if no rtp.conf specified) is 5000 and 31000 which is probably what you have been using up to this point, since you state that there was no rtp.conf on your system. Also, you might need to do a "core reload" to make any changes to rtp.conf effective. A sip reload only re-parses sip.conf and reloads the SIP substructure and channel drivers, AFAIK it a sip reload doesn't affect RTP and doesn't parse and apply rtp.conf. As regards the problems, are you sure that (for example) the audio codecs used are fully specified on, for example, the phones on either side? With Yealink T-21 phones for example (and older ATCOM 820's and some older Polycoms) it is possible to turn off some codecs, and turn others on - I once had this kind of intermittent voice issue but only on a certain extension, and it turned out that the particular Yealink's codec mix was set too narrow (it would only accept ulaw and alaw, not G729) and this was precluding that phone from receiving incoming calls from our service provider (which only offer G729) while in-office calls to and from it worked fine as the other phones in the office were allowing running ulaw and alaw, -and- G729 so that any phone could take an incoming call (in G729) and have audio. Not sure of the dynamics (as Asterisk AFAIK should handle this situation transparently, transcoding as needed AFAIK) but it was definitively fixed by allowing G729 on the particular Yealink phone's web interface. The only remaining issue may be NATing, e. g. for a particular network path to / from a particular client, the intervening firewalls and / or routers might not allow the required UDP ports to be opened to allow RTP flow. You can set what you like in rtp.conf, but all the intervening network segments you use to get to the phone (and your VOIP trunk provider / service provider) -also- need to allow all the necessary UDP ports to be opened so RTP can flow back and forth. This might again be why it sometimes works, e. g. sometimes RTP ports are negotiated on port numbers that are too low / too high for a particular network segment or network edge device like a router or hardware / software firewall, and then there's no audio. The RTP port number is too low or too high for the intervening routers / firewalls, even though Asterisk is perfectly fine with that RTP port number, the intervening network(s) is incapable of carrying the RTP flow as the port number is invalid according to a router / firewall configuration on a device between you and the phone. If a customer is in a state of no audio, what does sip show channelstats in the Asterisk CLI, show? E. g. the "sip show channelstats" display shows RTCP (RTP control protocol) statistics, e. g. how bad the jitter and packet loss for a particular call is on a certain extension for the incoming and outgoing legs of the call. In a situation with no audio, can you check on this to see if (for example) -any- RTP packets flow at all? E. g. a particular readout
Re: [asterisk-users] Odd one-way audio problem (Mike Diehl)
Hi Mike In rtp.conf, what are the port ranges you specify? I had almost exactly the same problem not too long ago. People will phone, and sometimes it will work, sometimes not - one way audio would happen, then start working, then stop working. The problem turned out to be that the port specification for RTP traffic in /etc/asterisk/rtp.conf was too wide. It was set to rtpstart=1 rtpend=65535 (apparently by a previous maintainer / technician who worked on the system.) The high port number was too high, and only after I investigated in detail with our trunk provider, were they able to determine that somtimes the Asterisk on my side was negotiating too high port numbers for RTP with their system. I changed rtp.conf to read rtpstart=1 rtpend=2 and all the random one-way audio problems have been gone for more than two months. This client now has had thousads of successful calls so far after this change was made. I also had the issue where MOST calls in their office was fine (with rtp.conf at 1 to 65535) though some would still fail, I'm guessing that was due to NATing not being done in the office (e. g. a wider "range" of RTP ports worked) vs. when they connected to their provider's SIP trunk on the internet to negotiate calls where it was ignoring the higher ports ("too high" ports) or their local firewall wasn't allowing some high ports to be opened that were "too high". Restricting the RTP port range between 1 and 2 in this case solved their problem definitively and forever. E. g. something similar given that you start that "most of the time" things worked fine - which is exactly the symptom I had with this client. Just a thought... Regards Stefan --- Hi all, I have a user who is reporting one-way audio, but only when a call is made to or from particular PSTN (cell) numbers. Their phones are behind a NAT router and my server is on the open Internet. Calls within their office sound fine. Calls to/from most numbers sound fine. When they took their phones home, those same phone numbers still had problems. So, I don't think it's their network. I've taken pcaps of both legs of example calls. On the provider-side, I see 2-way audio. On the client-side, I only hear one side. Most of the time, though, their phones work correctly. Any ideas where to look to fix this? Thanks in advance. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Asterisk users survey
Hi Joshua Does the survey imply that there are big changes coming for Asterisk? E. g. features or facilities will be dropped / deprecated from the open source version in new releases, big changes to existing facilities / protocols, what is supported officialy by Digium for the official version, and what not, etc. Given that you are now owned by Sangoma & all and there are different people in control now than before. Can you confirm / deny? Thanks, > We are in the same situation as Jean Denis, running 1.4 to 16 version as > integrator/service provider/user/... > > Difficult to replay the survey for each scenarios ;) The most active deployment, or a few deployments, is fine. -- Joshua C. Colp Digium - A Sangoma Company | Senior Software Developer -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Problem with the DB() function (Ira)
>So the new install is coming along. I hooked up the new box for a couple of >hours and got a bunch more problems worked out. And yet some still remain. I >have this subroutine I call occasionally: >. >. >. >Also, when I installed asterisk it did not set itself up to start when the >machine boots. Is there something else I need to do? It's the most recent >Fedora. If you're on the latest Fedora you're probably using systemd for init and startup / control of background functions. On Centos7, to get Asterisk to start up with the system on boot I do the following as root: # cd /etc/systemd/system # vim asterisk.service - In this file, then put --- [Unit] Description=Asterisk After=network.target After=network-online.target After=startup.service After=mysql.service Wants=mysql.service [Service] Type=idle User=root Group=root ExecStart=/usr/sbin/asterisk -f ExecStop=/usr/sbin/asterisk -rx 'core stop now' ExecReload=/usr/sbin/asterisk -rx 'core reload' TimeoutSec=300 LimitCORE=infinity LimitNOFILE=16384 Restart=always RestartSec=5 [Install] WantedBy=multi-user.target --- # systemctl enable asterisk.service Now, on reboot, systemd should start up asterisk for you. Hope this helps. Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Asterisk 1.8.7.0 connectivity to Avaya SM (Thomas Peters)
E. g. You can also then try in /etc/hosts to put 10.10.0.103 mcts.org e. g. if any local reverse lookup is done "10.10.0.103" resolves to "mcts.org" and the converse for normal DNS lookups. You can even try in /etc/asterisk/asterisk.conf to make the "systemname" line be systemname=10.10.0.103 This is also why if you have systemname=mcts.org in /etc/asterisk/asterisk.conf a DNS lookup on "mcts.org" on the linux box itself will give "10.10.0.103" or "127.0.0.1" depending on what is in /etc/hosts, e. g. to try and force your Asterisk instance if it needs / tries to ID itself when sending SIP messages it will identify itself as "10.10.0.103" in one part of the sip message, while you also set its domain name to be "mcts.org" hopefully forcing it to put that to the right of the "@" in 10.10.0@mcts.org<mailto:10.10.0@mcts.org> Also, does the Avaya device behave at all like a Linux / WIndows machine e. g. maybe it needs to do R-DNS on itself as well, e. g. if the Avaya people on their side can edit their version of the Linux "/etc/hosts" and put in there 10.10.0.103 mcts.org so that if THEY do a R-DNS lookup on "mcts.org" (if your Asterisk co-operates and passes this in to them in SIP, see above & previous message) and they do reverse dns lookup on it they get "10.10.0.103" in 10.10.0@mcts.org<mailto:10.10.0@mcts.org> All conjecture and guesswork though, but maybe something makes a light-bulb light up... Not probably relevant, but I had once to do this with Asterisk 1.8.32.3 in much the same situation, e. g. we had a 2nd Linux box running ViciDial (bascially also Asterisk) that would sometimes dial through to "our" Asterisk server to get outgoing lines. I put together this in "our" Asterisk server's sip.conf: [9090] ;This is the SIP identity VICIDial uses to dial out when it wants to type=peer user=9090 host=10.1.51.174 disallow=all allow=g729 allow=alaw allow=ulaw context=local call-limit=20 limitonpeer=yes canreinvite=yes qualify=no deny=0.0.0.0/0.0.0.0 permit=10.1.51.174/255.0.0.0 This caused "our" Asterisk to treat "their" Asterisk as just another SIP device, e. g. no difference at all between it and a normal VOIP phone on the network as far as "our" Asterisk was concerned. "Our" Asterisk could not distinguish if it was getting a call from a phone, or from this ViciDial server. Hope some of this helps. Regards Stefan -Original Message- From: Stefan Viljoen Sent: Thursday, 28 February 2019 08:18 To: 'asterisk-users@lists.digium.com' Subject: Asterisk 1.8.7.0 connectivity to Avaya SM (Thomas Peters) Hi Thomas What is your IVR box's domain name in Linux? With a hostname of, for example, "mcts.org" do you have a line like this in /etc/hosts: 127.0.0.1 mcts.org in your /etc/hosts? Additionally, in /etc/asterisk/asterisk.conf, is there a line systemname = that is -uncommented- and contains the string you need to the right of the @ e. g. mcts.org ? The immediate above just a shot in the dark but could affect how your IVR box identifies itself. If the Linux system host name of the IVR machine is not "mcts.org" maybe you can change the machine's name via (for Centos 7 at least - if you have NetworManager running): nmcli general hostname mcts.org systemctl restart systemd-hostnamed and then reboot the machine which implies also restarting asterisk. If I remember right this will cause the Asterisk instance to identify itself as "mcts.org" sip:mcts@mcts.org:0;tag=... ^ ^ || From asterisk.conf | From nmcli general hostname mcts.org ? Might still not solve your precise issue but might be a step in the right direction?? Stefan --- >We have a brand-new Avaya phone system in place and we will be cutting over to >it in late March 2019. > Presently: > * We have an Asterisk 13.3.2 server with no phones registered to it, > acting as a PSTN gateway. Calls come into it and get distributed to other > Asterisk boxes with phones. > * If a call comes in from the provider marked as having been dialed as > xxx-xxx-6711 (those are digits, not a pattern) it gets routed to the IVR box > * The IVR box runs Asterisk 1.8.7.0 and a custom IVR. >Where we have to get to: > * The new Avaya Session Manager has to have a working SIP trunk to the IVR > so it can pass calls that come into xxx-xxx-6711 to it. >What the problem is: > * I don't fully understand what's going on here, neither how it works now, > nor what I need to do to make Avaya's SM happy. -- ___
[asterisk-users] Asterisk 1.8.7.0 connectivity to Avaya SM (Thomas Peters)
Hi Thomas What is your IVR box's domain name in Linux? With a hostname of, for example, "mcts.org" do you have a line like this in /etc/hosts: 127.0.0.1 mcts.org in your /etc/hosts? Additionally, in /etc/asterisk/asterisk.conf, is there a line systemname = that is -uncommented- and contains the string you need to the right of the @ e. g. mcts.org ? The immediate above just a shot in the dark but could affect how your IVR box identifies itself. If the Linux system host name of the IVR machine is not "mcts.org" maybe you can change the machine's name via (for Centos 7 at least - if you have NetworManager running): nmcli general hostname mcts.org systemctl restart systemd-hostnamed and then reboot the machine which implies also restarting asterisk. If I remember right this will cause the Asterisk instance to identify itself as "mcts.org" sip:mcts@mcts.org:0;tag=... ^ ^ || From asterisk.conf | From nmcli general hostname mcts.org ? Might still not solve your precise issue but might be a step in the right direction?? Stefan --- >We have a brand-new Avaya phone system in place and we will be cutting over to >it in late March 2019. > Presently: > * We have an Asterisk 13.3.2 server with no phones registered to it, > acting as a PSTN gateway. Calls come into it and get distributed to other > Asterisk boxes with phones. > * If a call comes in from the provider marked as having been dialed as > xxx-xxx-6711 (those are digits, not a pattern) it gets routed to the IVR box > * The IVR box runs Asterisk 1.8.7.0 and a custom IVR. >Where we have to get to: > * The new Avaya Session Manager has to have a working SIP trunk to the IVR > so it can pass calls that come into xxx-xxx-6711 to it. >What the problem is: > * I don't fully understand what's going on here, neither how it works now, > nor what I need to do to make Avaya's SM happy. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] trying to upgrade asterisk and Debian -- not working
Hi John I've jumped around between several Asterisk versions on Centos 7 by doing 1. Copying the asterisk binary in /usr/sbin/asterisk to /usr/sbin/asterisk.1.8.11.0 (or whatever version number) 2. Tar'ing up the /usr/lib/asterisk/modules directory's contents # cd /usr/lib/asterisk/modules # tar cvf asterisk.1.8.11.0.tar * 3. Deleting all the old / different version's module object files, e. g. still in /usr/lib/asterisk/modules rm -rf *.so 4. Untarring and ungzipping the new / different version I downloaded manually into my /usr/src folder, e. g. cd /usr/src gunzip asterisk-1.8.32.3.tar.gz tar xvf asterisk-1.8.32.3.tar 5. Then the usual # cd asterisk-1.8.32.3 # ./configure # make menuconfig then set options then # make # make install # make samples # make progdocs Ok, so now I'm on 1.8.32.3 and if I go # asterisk I will start up the "new" 1.8.32.3 version. To revert to Asterisk 1.8.11.0 (or whatever) I then stop asterisk, and then I simply rename the current /usr/sbin/asterisk to asterisk.18.32.3 and the /usr/sbin/asterisk.1.8.11.0 that is still there to /usr/sbin/asterisk thereby making that binary active again. Then I tar up all the .so files in /usr/lib/asterisk/modules into asterisk.1.8.32.3.tar and delete all .so files in /usr/lib/asterisk/modules, then extract tar xvf asterisk.1.8.11.0.tar to revert to the older version's modules. I can then go # asterisk and now I'm back to running Asterisk 1.8.11.0 I've done this with three or four different Asterisk versions in the past, switching between them for testing. A bit more manual procedure that you've done, but it does work to try out similar Asterisk versions / subversions for testing? Regards, Message: 2 Date: Thu, 24 Jan 2019 02:49:52 -0500 From: John Covici To: viljo...@verishare.co.za, Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] trying to upgrade asterisk and Debian -- not working (John Covici) Message-ID: Content-Type: text/plain; charset=US-ASCII I checked out 13.15.0, ./configure, make delete all modules, followed by make install. On Thu, 24 Jan 2019 01:17:32 -0500, Stefan Viljoen wrote: > > What procedure did you follow to revert back to the old version? -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] trying to upgrade asterisk and Debian -- not working (John Covici)
What procedure did you follow to revert back to the old version? It sounds like your binary has been revereted, but the modules it needs to load are still the 13.24.0-rc1 modules... --- Hi. I am trying to upgrade my asterisk from 13.15 to the latest of asterisk 13 which seems to be 13.24.0-rc1. At the same time I want to go from Debian 8 to DEbian 9 to get a more recent operating system and applications. I ran in to the following problems when trying to do this. When trying to use asterisk 13.24.0-rc1, I ran into some strange problems with some of my custom scripts. It seems the following statement immediately disconnects the user exten => s,n,Read(digit,,1,,1,20) ; read a digit In the log after that statement it says user disconnected. I have an agi which speaks some text before the read and that agi does not even say anything, although it does complete. Now, if I try to go back to 13.15.0, it does not work at all because it keeps telling in my log that modules support is not available, so no modules get loaded. Any ideas on thispuzzle would be appreciated. -- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici wb2una cov...@ccs.covici.com -- Subject: Digest Footer ___ --Bandwidth and Colocation Provided by http://www.api-digital.com-- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- End of asterisk-users Digest, Vol 173, Issue 21 *** -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Cannot originate to extension unless /etc/hosts is edited constantly? [Tony Mountfield]
Hi Tony Ok, got this solved. I discovered my AMI message was corrupt due to a bug in our third party dialer app we wrote ourselves...! E. g. this worked on Asterisk 1.8: ActionID=12edad43-e817-427b-aa21-31a9659f86e1 =Originate =SIP/local/3035@local = =local =1 =3035 =recordinglisten =12edad43-e817-427b-aa21-31a9659f86e1 =12edad43-e817-427b-aa21-31a9659f86e1B =CallLimit=3600,recfile=/var/spool/asterisk/monitor/archive/1901/15/201901151654r1g4679,altfile=/var/spool/asterisk/monitor/archive/1901/15/201901151654r1g4679 =true But doesn't on Asterisk 13 - for a very good reason: =SIP/local/3035@local was acceptable to Asterisk 1.8, but NOT to Asterisk 13 - and I kind of agree. It was a bug in our third party dialer app that instead of passing to Asterisk 13 =SIP/3035@local was passing =SIP/local/3035@local which is just WRONG. This was why 13 was replying [Jan 15 18:19:23] ERROR[10519]: netsock2.c:305 ast_sockaddr_resolve: getaddrinfo("local", "(null)", ...): Name or service not known [Jan 15 18:19:23] WARNING[10519]: chan_sip.c:6316 create_addr: No such host: local which makes perfect sense...! So I fixed the incorrect variable reference in our app that was generating the wrong SIP/local/3035@local channel, and recording playback started working correctly and no more of the above error messages. So all not Asterisk fault, though 13 does appear to interpret the channel name differently as SIP/local/3035@local DOES work on 1.8.32.3 (which it shouldn't, but it does.) Thanks for taking the time to reply. Regards Stefan --- Date: Tue, 15 Jan 2019 17:32:40 + (UTC) From: t...@softins.co.uk (Tony Mountifield) To: asterisk-users@lists.digium.com Subject: Re: [asterisk-users] Cannot originate to extension unless /etc/hosts is edited constantly? Message-ID: In article <018201d4acef$898a4b10$9c9ee130$@verishare.co.za>, Stefan Viljoen wrote: > Hi Guys > > I've run into a weird problem on Asterisk 13. Again something that worked > fine on 1.8 but is now broken on Asterisk 13. > > I have an extension 3015. I'm trying to originate a recording playback call > on it via AMI by sending > > Action: Originate > ActionID: test > Channel: SIP/3015 > Exten: > Context: local > Priority: 1 > CallerID: 3015 > Account: recordinglisten > ChannelID: abc > OtherChannelID: def > Variable: > CallLimit=3600,recfile=/var/spool/asterisk/monitor/1807/25/2507180836591192526,altfile=/var/spool/asterisk/monitor/archive/1807/25/2507180836591192526 > Async: true > > My dialplan code: > > exten=>,1,Answer() > exten=>,n,NoOp(Requesting File ${recfile}) > exten=>,n,Set(${__recfile}=${recfile}) > exten=>,n,Set(${__altfile}=${altfile}) > exten=>,n,NoOp(Rec file set to ${recfile}) > exten=>,n,NoOp(Alt file set to ${altfile}) > exten=>,n,NoOp(Requesting Alt File ${altfile}) > exten=>,n,Set(__numbertarget=) > exten=>,n(play),ControlPlayback(${recfile},2,6,4,8,5,9) > exten=>,n(play2),ControlPlayback(${altfile},2,6,4,8,5,9) > exten=>,n,hangup() > > However, on sending the above to the AMI I get in the console of Asterisk 13: > > [Jan 15 18:19:23] ERROR[10519]: netsock2.c:305 ast_sockaddr_resolve: > getaddrinfo("local", "(null)", ...): Name or service not known > [Jan 15 18:19:23] WARNING[10519]: chan_sip.c:6316 create_addr: No such host: > local > > and no recording playback takes place. > > I've found that by editing /etc/hosts and adding > > 172.56.4.11 local > > where 172.56.4.11 is the phone SIP/3015's IP address, it works perfectly and > the recording starts playing once 3015 is answered. What does your sip.conf look like? (without comments, e.g. grep -v '^;' sip.conf | grep -v '^$') Particularly, do you have a separate section for each phone, e.g. [3015] ? > On Asterisk 1.8 the above worked without having to constantly edit /etc/hosts > and having to constantly map and remap the one phone that is then capable of > playing back a recording. > > This appears to be some kind of DNS / name resolution issue exclusive to > Asterisk 13 (for me) - how can I fix this, e. g. NOT get > > [Jan 15 18:19:23] ERROR[10519]: netsock2.c:305 ast_sockaddr_resolve: > getaddrinfo("local", "(null)", ...): Name or service not known > [Jan 15 18:19:23] WARNING[10519]: chan_sip.c:6316 create_addr: No such host: > local > > and constantly having to edit /etc/hosts to get one of my phones (the one > tied to "local") to be able to play back a recording on Asterisk 13? > > (This obviously is fatal anyway as I got lots of phones on which I want to > playback recordings and editing /etc/hosts for each phone is impossible if
Re: [asterisk-users] Various extensions ring once and go to voicemail
Subject: Re: [asterisk-users] Various extensions ring once and goto voicemail - Thomas Peters >Carlos and Stefan (and other who have helped): >I DON'T HAVE the res_timing_timerfd.so file. Can I build it? Recompiling >Asterisk is unrealistic in my position but I wonder if I can build the one >module. Here's what I do have: >apbx:~ $ locate *res_timing_timerfd* >/usr/src/asterisk-1.8.23.1/res/.res_timing_timerfd.makeopts >/usr/src/asterisk-1.8.23.1/res/.res_timing_timerfd.moduleinfo >/usr/src/asterisk-1.8.23.1/res/res_timing_timerfd.c >/usr/src/asterisk-1.8.7.0/res/.res_timing_timerfd.makeopts >/usr/src/asterisk-1.8.7.0/res/.res_timing_timerfd.moduleinfo >/usr/src/asterisk-1.8.7.0/res/res_timing_timerfd.c >Why I have 1.8.23 and 1.8.7 I don't know. Asterisk on this system is version >1.8.7.0. Ouch. Sounds like you're maybe sitting with a hybrid package install setup and a partial source based install - did you setup this box yourself? It appears that the binaries of asterisk were compiled, then the source was deleted or the binaries that comprise your instance were installed from a package... You can probably build only timerfd, but it does imply running menuconfig (I think) and for that you need a properly configured Asterisk source tree, of the correct version you want. >NEXT QUESTION: There are NO timing modules listed in >/etc/asterisk/modules.conf at all. The only ones that are explicitly loaded >are format_wav format_pcm format_mp3 and res_musiconhold. And there are >"preload" directives for pbx_config.so and chan_local.so. >Is res_timing_dahdi.so getting loaded somewhere else? Or is it a default of >some kind? AFAIK it is a default, but as default, again AFAIK, res_timing_dahdi.so won't get loaded, the pthread timer or timerfd will be used. Since you don't even have the timerfd module, you are running by implication on timerfd. >SYSTEM TIME OF DAY CLOCK which someone asked about, seems accurate. I did >watch -n1 date >and watched the time tick up, perfectly synchronized to my mobile phone. It >might be off by a second or so, I'd have a hard time knowing for sure. NTPD is >running, but not working for some reason. I fixed it (ownership of ntp.conf >wrong) so now ntpq -pn returns a server ID. Ok... well scratch that theory then. As I said earlier, we have had very strange misbehaviour with Asterisk in virtually hosted environments, and after bitter experience resolved to run it only in real physical boxes as it seems to perform best there and be the most stable and reliable. All I might suggest is getting the latest asterisk source in the 1.8 series (1.8.32.2 if I'm not mistaken - we ran it for years) and compile it from scratch. But do not install it, e. g. if you do make install it will overwrite your current setup irretrivably. Rather, compile it, and then make actual physical copies of your current asterisk binary (/usr/sbin/asterisk, I think) and of your /usr/lib/asterisk/modules folder, -then- make install it. Start it up and see if it works better. If it is a success, great. If not, simply copy back your copied asterisk binary and copy back all the files in /usr/lib/asterisk/modules, and restart your old version which at least is working partially. Again, no guarantees, the fact that you apparently already have a disjointed setup (at least three asterisk versions?) might mitigate against this - your milage may vary and doing what I describe might also destroy your entire current setup. The reader must beware. It sounds as if you will need to recompile Asterisk from a known clean source to begin troubleshooting it anyway? Kind regards, Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Cannot originate to extension unless /etc/hosts is edited constantly?
Hi Guys I've run into a weird problem on Asterisk 13. Again something that worked fine on 1.8 but is now broken on Asterisk 13. I have an extension 3015. I'm trying to originate a recording playback call on it via AMI by sending Action: Originate ActionID: test Channel: SIP/3015 Exten: Context: local Priority: 1 CallerID: 3015 Account: recordinglisten ChannelID: abc OtherChannelID: def Variable: CallLimit=3600,recfile=/var/spool/asterisk/monitor/1807/25/2507180836591192526,altfile=/var/spool/asterisk/monitor/archive/1807/25/2507180836591192526 Async: true My dialplan code: exten=>,1,Answer() exten=>,n,NoOp(Requesting File ${recfile}) exten=>,n,Set(${__recfile}=${recfile}) exten=>,n,Set(${__altfile}=${altfile}) exten=>,n,NoOp(Rec file set to ${recfile}) exten=>,n,NoOp(Alt file set to ${altfile}) exten=>,n,NoOp(Requesting Alt File ${altfile}) exten=>,n,Set(__numbertarget=) exten=>,n(play),ControlPlayback(${recfile},2,6,4,8,5,9) exten=>,n(play2),ControlPlayback(${altfile},2,6,4,8,5,9) exten=>,n,hangup() However, on sending the above to the AMI I get in the console of Asterisk 13: [Jan 15 18:19:23] ERROR[10519]: netsock2.c:305 ast_sockaddr_resolve: getaddrinfo("local", "(null)", ...): Name or service not known [Jan 15 18:19:23] WARNING[10519]: chan_sip.c:6316 create_addr: No such host: local and no recording playback takes place. I've found that by editing /etc/hosts and adding 172.56.4.11 local where 172.56.4.11 is the phone SIP/3015's IP address, it works perfectly and the recording starts playing once 3015 is answered. On Asterisk 1.8 the above worked without having to constantly edit /etc/hosts and having to constantly map and remap the one phone that is then capable of playing back a recording. This appears to be some kind of DNS / name resolution issue exclusive to Asterisk 13 (for me) - how can I fix this, e. g. NOT get [Jan 15 18:19:23] ERROR[10519]: netsock2.c:305 ast_sockaddr_resolve: getaddrinfo("local", "(null)", ...): Name or service not known [Jan 15 18:19:23] WARNING[10519]: chan_sip.c:6316 create_addr: No such host: local and constantly having to edit /etc/hosts to get one of my phones (the one tied to "local") to be able to play back a recording on Asterisk 13? (This obviously is fatal anyway as I got lots of phones on which I want to playback recordings and editing /etc/hosts for each phone is impossible if two phones want to listen to different recordings at the same time- /etc/hosts can only contain one "local"). How can I fix this? Thanks Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Various extensions ring once and go to voicemail - Thomas Peters
Here’s what I get: apbx*CLI> module show like timing Module Description Use Count res_timing_pthread.so pthread Timing Interface 0 res_timing_dahdi.soDAHDI Timing Interface 4 2 modules loaded So what would you suggest? (And thanks in advance.) Thomas I've had some good experience with res_timing_dahdi both when we ourselves were still on 1.8 and now with us on Asterisk 13 as well. To force usage of a certain timer, specify in your modules.conf, e. g. to force use of DAHDI timing only, I did the following in my modules.conf: . . . load => res_timing_dahdi.so noload => res_timing_pthread.so noload => res_timing_timerfd.so That said, we have had some weird issues trying to run Asterisk in virtual machines - all our instances (16 of them) are physical machines. We did a deployment at Azure in a Centos 7 "stock Azure" VM awhile ago and it suddenly lost the capability to encode .gsm audio files. All .gsm files the virtualised Asterisk 13 instances produced were all corrupt and no player would want to play the .gsm files. Neither could SOX convert them to anything. So we had to switch over to .wav, and then use a mixmonitor hook and manually convert the .wav files back to .gsm in SOX after each recording was written by Asterisk in .wav format. There were no errors logged, Asterisk just mysteriously lost the capacity to encode .gsm files when running on the Azure VM instance we had. So quite probably the virtual environment / hypervisor you're using is part of the issue and switching timing modules around won't solve anything... Have you checked that the system time is sane, and that one second on a stop watch externally to the VM instance, equates to one second inside it? Because the symptoms described could indicate that the clock in the VM is just running too fast - or that some timing implementation detail inside Asterisk itself is running too fast. Regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Outbound caller ID ignored
Hi Mitch I don't think you can expect it to work on the analog lines at all out of the box. What kind of hardware are you using to connect to the analog lines? We used Xorcom Astribanks at a stage, but could never (ever) figure out the signalling needed to set the caller ID at our local public phone company servicing our POTS lines (Telkom, South Africa). It was useless anyway, as they didn't support it and their software couldn't apply it. See below. It is a two-pronged problem, e. g. your hardware and drivers need to be able to signal the caller-id to the carrier / public telephone company, and, if you CAN communicate this to the local telephone company, they need to be able to interpret this and set it on calls they process for you. In our case (if I remember right, we've long since dumped all analog lines) there were double problems there as well, e. g. the POTS network here ignored our signalling (and their hardware / software mix doesn't support it anyway, so even if they interpreted and understood the protocol and number being sent, they couldn't apply it) and some legislation that prohibited "CID masquerading" for calls made through the government-owned public telephone network. Our current SIP trunk provider cannot do it either, their systems simply do not support it and all numbers going out are always fixed to the constant trunk outgoing number. E. g. we also spent several days of dev trying to get it to work, eventually checking with them and being informed it is impossible anyway and they do not support changing the number from traffic we pass them. However, they can easily spin up extra logical SIP trunks at miniscule cost (several US cents in local currency equivalent), so if we need a custom number for callees to dial back for a temporary sales campaign or whatever, we simply request it and that trunks fixed, constant number will appear on callee phones. We then simply route the correct internal dialout calls to the temporary virtual trunk by whatever logic we want. Hope this helps. Kind regards, -- Message: 2 Date: Sun, 13 Jan 2019 09:45:27 -0600 From: Mitch Claborn Subject: [asterisk-users] Outbound caller ID ignored Setting the outbound caller ID works fine on our PRI (T1) lines, but does not work on our local POTS lines. No errors in the logs, the new caller ID just seems to be ignored. Should I expect it to work on the analog lines? Dial plan: same =>n,Set(CALLERID(all)=111222) same =>n(dialit),Dial(DAHDI/50/1222333,30) Channels: signalling=fxs_ks callerid=asreceived group=20,21 context=from-pstn faxdetect=incoming faxdetect_timeout=0 faxbuffers => 12,half channel => 49-53 -- Mitch -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Switched from Asterisk 1.8 to 13 - CDR ringtime now always zero (Joel)
>Hi, >On the other side.. There is a specific note regarding CDR behavior changes >from asterisk 12 onwards. So going from 1.8 to 13 means it applies to you. >Have a look at: >https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+12 >And >https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+CDR+Specification Hi Joel I've read the above in detail, and studied them, but I cannot find anything that explains the CDR behaviour I'm seeing in Asterisk 13. The only thing relevant is the following in the Upgrade Notes: --- The duration, billsec, start, answer, and end times now reflect the times associated with the current CDR for the channel, as opposed to a cumulative measurement of all CDRs for that channel. --- That is exactly where the problem lies, e. g. the above behaviour is exactly what is NOT happening... E. g. instead of the origination channel created by the AMI call we make as previously described, having its CDR written and done with, its CDR data for the originating call leg apparently gets propagated into the resulting outgoing call leg of the call to the AMI originate command. E. g. my origination channel's CDR is Start: 2019-01-11 08:22:07 Answer: 2019-01-11 08:22:12 End: 2019-01-11 08:24:09 and the associated outgoin channel's CDR is Start: 2019-01-11 08:22:12 Answer: 2019-01-11 08:22:12 End: 2019-01-11 08:24:09 e.g. it appears that the origination channel's pickup time of Answer: 2019-01-11 08:22:12 gets propagated into the outgoing channel's answer time of Answer: 2019-01-11 08:22:12. E. g. the above in the release notes is 180 degrees the opposite of how Asterisk 13 actually behaves in practice? Despite the above release note, it DOES appear in fact that CDR measurement is cumulative... very definitely not distinct Thanks for the reply! Regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Switched from Asterisk 1.8 to 13 - CDR
>> Is it possible that the setup part of the call (between initiation and >> answer) >> is recorded in a separate CDR? >An excellent question. Unlike in the past versions calls can actually generate >multiple CDRs because CDRs now represent the flow of communication between >things. >Providing the actual CDR records that were generated as well as console output >would allow better understanding of what is going on. >-- >Joshua C. Colp >Digium - A Sangoma Company | Senior Software Developer Hi Joshua That is exactly what is happening. I get a separate CDR for the originate of the call to the agent's extension, and then a separate CDR for the call that then goes out to the client. The separate CDR for an originate event DOES appear to be correct, there is usually a second or two seconds worth of ringtime indicated, e. g. start and answer will vary (as outgoing calls did on 1.8) under 13: Start | Answer | End 2019-01-11 08:01:20 | 2019-01-11 08:01:22 | 2019-01-11 08:01:25 E. g. the agent originated by calling the AMI via our app at 2019-01-11 08:01:20, he picked up the phone at 2019-01-11 08:01:22 (e. g. he let it ring for 2 seconds) etc. So the "originate call" to the agent's local channel has correct difference between start and and start, but the actual call going out to the client from the agent has the "13 sickness" e. g. start and answer times are exactly the same. Here are sample actual CDR records (apologies for the format): id clidsrc dst dcontextchannel dstchannel lastapp lastdatastart answer end durationbillsec disposition amaflagsaccountcode uniqueiduserfield linkedid sequencecustomdata 8132380b-1569-11e9-9184-18d6c702b3d76140_ctd61406140local Local/6140@local-0006232d;2 SIP/6140-004e99bd DialSIP/6140,120,tT 2019-01-11 08:22:07 2019-01-11 08:22:12 2019-01-11 08:24:09 122 116 ANSWERED3 201901110822sobtpb8 201901110822sobtpb8B /var/spool/asterisk/monitor/1901/11/201901110822sobtpb8.gsm 201901110822sobtpb8 9217937 813671dc-1569-11e9-9184-18d6c702b3d7614061405554567781 local Local/6140@local-0006232d;1 SIP/centra-out-rng-004e99c5 Dial SIP/centra-out-rng/5554567781,120,TL(390:6:3) 2019-01-11 08:22:12 2019-01-11 08:22:12 2019-01-11 08:24:09 116 116 ANSWERED3 201901110822sobtpb8 201901110822sobtpb8 /var/spool/asterisk/monitor/1901/11/201901110822sobtpb8.gsm 201901110822sobtpb8 9217936 E. g. the first line is the originate to extension 6140. As you can see on the times, the agent waited 5 seconds after the phone started ringing internally, to pick up the originated call: Start: 2019-01-11 08:22:07 Answer: 2019-01-11 08:22:12 End: 2019-01-11 08:24:09 As you can see the "origination call" CDR's end time exactly spans the "actual call" duration. The second line is the actual call to the customer at 5554567781. As you can see on the times, apparently the client picked up instantly (which they did not, if I listend to the recording in /var/spool/asterisk/monitor/1901/11/201901110822sobtpb8.gsm): Start: 2019-01-11 08:22:12 Answer: 2019-01-11 08:22:12 End: 2019-01-11 08:24:09 As you can see the "actual call" CDR's start and end times are exactly the same, even though the client picked up only after several seconds (8, in this case, if you listen to the recording with a stopwatch and time start of audio and actual pickup.) E. g. it is impossible to now tell how long the agent waited for the client to pick up using the above model of originating calls, whereas it was working with 1.8, 13 always emits the same times to the second for both start and answer in the outgoing leg of the call in the above scenario. The "origination leg" of the call's total time spans the outgoing leg, but the start / answer times in the "origination leg" is the internal pickup of the agent of his phone after he click "Originate call" in our app which calls the AMI. Again, on 1.8, both CDRs as above were created with the same dialplan code as communicated yesterday, but on 1.8 each of the two CDRs start and answer times differ, the one CDR emitted indicating how long the agent took to pickup the phone after it started ringing for his click of the Originate button, and the other CDR emitted indicating (in varying start and answer times) how long the client took to pickup the phone. - Console output for a typical originated call: core set verbose 3 Console verbose was OFF and is now 3. -- Called 6062@local -- Executing [6062@local:1] Dial("Local/6062@local-0001984b;2", "SIP/6062,120,t") in new stack == Using SIP RTP CoS mark 5 -- Called SIP/6062 -- SIP/6062-000600f5 is ringing -- Local/6062@local-0001984b;1 is
Re: [asterisk-users] Switched from Asterisk 1.8 to 13 - CDR ringtime now always zero (Tony)
In article <009d01d4a7e0$af2e0a50$0d8a1ef0$@verishare.co.za>, Stefan Viljoen wrote: >> Regarding this I've read the specs linked to in detail, but I can find >> no mention anywhere of any change that implies or states that no ring >> time will be recorded anymore in Asterisk 13 and that all times in start and >> answer columns will now be equal for all calls. >> >> Can this be because I nowhere use the Answer() application in my dialplan >> when dialing out? >You shouldn't Answer() the originating channel before calling Dial() on it. >You should allow Dial() to propagate the answer, busy or other failure from >the destination channel back to the originating channel. Hi Tony Yes, that is exactly what I'm doing... no Answer() calls anywhere in the dialout parts of my dialplan, as detailed in my previous posts. >Is it possible that the setup part of the call (between initiation and answer) >is recorded in a separate CDR? Yes, that is correct, I get a separate CDR for the originate of the call to the agent's extension, and then a separate CDR for the call that then goes out to the client. The separate CDR for an originate event DOES appear to be correct, there is usually a second or two seconds worth of ringtime indicated, e. g. start and answer will vary (as outgoing calls did on 1.8) under 13: Start | Answer | End 2019-01-11 08:01:20 | 2019-01-11 08:01:22 | 2019-01-11 08:01:25 E. g. the agent originated by calling the AMI via our app at 2019-01-11 08:01:20, he picked up the phone at 2019-01-11 08:01:22 (e. g. he let it ring for 2 seconds) etc. This is exactly what I need to have, but not on the origination calls, the outgoing calls under Asterisk 13 - e. g. that there is a difference between the Start and Answer times, which = ringtime. For the origination calls, duration and billsec is correct as well, just as it was under 1.8 too. It is just with 13 that the origination calls are STILL correct, as they were under 1.8, but with 13 the outgoing calls now indicate no ringtime. Thanks for the reply! Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Switched from Asterisk 1.8 to 13 - CDR ringtime now always zero (Joshua C. Colp)
Message: 2 Date: Mon, 07 Jan 2019 06:07:54 -0500 From: "Joshua C. Colp" >> On Mon, Jan 7, 2019, at 3:04 AM, Stefan Viljoen wrote: >> Hi guys . . . >> E. g. on 13, I see this (zero ringtime) for a call that I make to my >> cellphone to test, with my cellphone ringing for at least 10 seconds >> and ringing heard on the Yealink connected to the asterisk - e. g. >> completely wrong: >This is the way it is supposed to work[1], but it ultimately depends on your >dialplan. Are you using Local channels? Are you doing Answer in the dialplan? >What is the complete flow? Hi Joshua Thank you for the reply. I'll go read the spec in detail (which is probably what I should have done in the first place anyway.) Yes, I am using local channels and generating the calls via AJAM by calling the Originate AMI / AJAM application. The "local" extension that is calling out is defined as local/@local where is the extension number, e. g. 3509, 3175, or whatever. So my AJAM Originate command is ActionID=201901080814t4qn82v Action=Originate Channel=local/3916@local Exten=0825588996 Context=local Priority=1 CallerID=3916_ctd Account=201901080814t4qn82v ChannelID=201901080814t4qn82v OtherChannelID=201901080814t4qn82vB Variable=__CallLimit=3600 Async=true I'm not calling the Answer application in the dialplan when dialing out. Effectively the flow is the user clicks dial in our external application. This sends the above AJAM command to Asterisk, with parameters as specified. Asterisk originates the call on his extension as passed in the AJAM command, he picks up and the call then goes into the local context and gets routed. The STDOUT macro is called which does some prep (lots of 1.8 legacy stuff still in here) and this then calls VCCALLOUT, which contains the call to the dial() application. VCCALLOUT calls exten=>s,n(dialNoLimit),Dial(${chantouse}/${numtodial},60,TL(390:6:3)) ${chantouse} will be something like SIP/sip-trunk-name ${numtodial} will be the target number, e. g. 27825588996 to dial out. --- Detail: My local context (simplified): [local] exten=>_082xxx,1,Macro(STDOUT,SIP/centra-out,27${EXTEN:1}) and the STDOUT macro, edited for brevity: [macro-STDOUT] ;${ARG1} = channel ;${ARG2} = number exten=>s,1,Macro(WAITCHANNEL) exten=>s,n,Macro(WAITCDR) exten=>s,n,Macro(VCRECORD,${MACRO_CONTEXT}X${CALLERID(num)}ACC${CHANNEL(accountcode)},${ARG2}) exten=>s,n(dodial),Macro(VCCALLOUT,${ARG1},${ARG2},${ARG3},${ARG4}) exten=>s,n,NoOp(Setting Userfield after call completion) exten=>s,n,Set(CDR(userfield)=${MIXMONITOR_FILENAME}) exten=>s,dodial+101,Busy() exten=>s,n,Hangup() exten=>s,n,MacroExit exten=>h,1,NoOp(Call hangup MACROSTDOUT) exten=>h,n,UserEvent(RecordingToFile,Uniqueid: ${UNIQUEID},Channel: ${Channel},Filename: ${MIXMONITOR_FILENAME}) exten=>h,n,NoOp(Recorded to ${MIXMONITOR_FILENAME}) exten=>h,n,Set(CDR(userfield)=${MIXMONITOR_FILENAME}) exten=>h,n,NoOp(Account code is ${CHANNEL(accountcode)}) exten=>h,n,NoOp(call link var is ${call_Link}) exten=>h,n,GotoIf($["${CHANNEL(accountcode)}" != ""]?done) exten=>h,n(setacc),Set(CHANNEL(accountcode)=${call_Link}) exten=>h,n(done),noOp(Call Completed) and the VCCALLOUT macro: [macro-VCCALLOUT] ;macro to dial numbers ; ${ARG1} Channel To Use ; ${ARG2} Number To Dial ; ${ARG3} FailOver Channel ; ${ARG4} FailOverNumber exten=>s,n(setchan),Set(chantouse=${ARG1}) exten=>s,n,Set(numtodial=${ARG2}) exten=>s,n(makecall),GotoIf($["${timeLimit}" = ""]?dialNoLimit:dialLimit) exten=>s,n(dialNoLimit),Dial(${chantouse}/${numtodial},60,TL(390:6:3)) exten=>s,n,NoOp(Dial Status: ${DIALSTATUS}) exten=>s,n,GoTo(s-${DIALSTATUS},1) exten=>s,n(dialLimit),Dial(${chantouse}/${numtodial},60,TL(390:6:3)) exten=>s,n,NoOp(Dial Status: ${DIALSTATUS}) exten=>s,n,GoTo(s-${DIALSTATUS},1) exten=>s,dialNoLimit+101,Goto(s-${DIALSTATUS},1) exten=>s,dialLimit+101,Goto(s-${DIALSTATUS},1) exten=>s,n(endcall),busy() exten=>s,n,NoOp(Call Completed - setting userfield to recording) exten=>s,n,Set(CDR(userfield)=${MIXMONITOR_FILENAME}) exten=>s,n,Hangup() exten=>s,n,MacroExit exten=>s-NOANSWER,1,goto(s,endcall) exten=>s-CANCEL,1,goto(s,endcall) exten=>s-BUSY,1,goto(s,endcall) exten=>h,1,NoOp(Call Hungup) exten=>h,n,UserEvent(RecordingToFile,Uniqueid: ${UNIQUEID},Channel: ${Channel},Filename: ${MIXMONITOR_FILENAME}) exten=>h,n,NoOp(Recorded to ${MIXMONITOR_FILENAME}) exten=>h,n,Set(CDR(userfield)=${MIXMONITOR_FILENAME}) exten=>h,n,NoOp(Account code is ${CHANNEL(accountcode)}) exten=>h,n,NoOp(call link var is ${call_Link}) exten=>h,n,GotoIf($["${CHANNEL(accountcode)}" != ""]?done) exten=>h,n(setacc),Set(CHANNEL(accountcode)=${call_Link}) exten=>h,n(done),noOp(Call
Re: [asterisk-users] Switched from Asterisk 1.8 to 13 - CDR ringtime now always zero (Joshua C. Colp)
Regarding this I've read the specs linked to in detail, but I can find no mention anywhere of any change that implies or states that no ring time will be recorded anymore in Asterisk 13 and that all times in start and answer columns will now be equal for all calls. Can this be because I nowhere use the Answer() application in my dialplan when dialing out? -Original Message- From: Stefan Viljoen Sent: Tuesday, 08 January 2019 08:49 To: 'asterisk-users@lists.digium.com' Subject: RE: Re: Switched from Asterisk 1.8 to 13 - CDR ringtime now always zero (Joshua C. Colp) Message: 2 Date: Mon, 07 Jan 2019 06:07:54 -0500 From: "Joshua C. Colp" >> On Mon, Jan 7, 2019, at 3:04 AM, Stefan Viljoen wrote: >> Hi guys . . . >> E. g. on 13, I see this (zero ringtime) for a call that I make to my >> cellphone to test, with my cellphone ringing for at least 10 seconds >> and ringing heard on the Yealink connected to the asterisk - e. g. >> completely wrong: >This is the way it is supposed to work[1], but it ultimately depends on your >dialplan. Are you using Local channels? Are you doing Answer in the dialplan? >What is the complete flow? Hi Joshua Thank you for the reply. I'll go read the spec in detail (which is probably what I should have done in the first place anyway.) Yes, I am using local channels and generating the calls via AJAM by calling the Originate AMI / AJAM application. The "local" extension that is calling out is defined as local/@local where is the extension number, e. g. 3509, 3175, or whatever. So my AJAM Originate command is ActionID=201901080814t4qn82v Action=Originate Channel=local/3916@local Exten=0825588996 Context=local Priority=1 CallerID=3916_ctd Account=201901080814t4qn82v ChannelID=201901080814t4qn82v OtherChannelID=201901080814t4qn82vB Variable=__CallLimit=3600 Async=true I'm not calling the Answer application in the dialplan when dialing out. Effectively the flow is the user clicks dial in our external application. This sends the above AJAM command to Asterisk, with parameters as specified. Asterisk originates the call on his extension as passed in the AJAM command, he picks up and the call then goes into the local context and gets routed. The STDOUT macro is called which does some prep (lots of 1.8 legacy stuff still in here) and this then calls VCCALLOUT, which contains the call to the dial() application. VCCALLOUT calls exten=>s,n(dialNoLimit),Dial(${chantouse}/${numtodial},60,TL(390:6:3)) ${chantouse} will be something like SIP/sip-trunk-name ${numtodial} will be the target number, e. g. 27825588996 to dial out. --- Detail: My local context (simplified): [local] exten=>_082xxx,1,Macro(STDOUT,SIP/centra-out,27${EXTEN:1}) and the STDOUT macro, edited for brevity: [macro-STDOUT] ;${ARG1} = channel ;${ARG2} = number exten=>s,1,Macro(WAITCHANNEL) exten=>s,n,Macro(WAITCDR) exten=>s,n,Macro(VCRECORD,${MACRO_CONTEXT}X${CALLERID(num)}ACC${CHANNEL(accountcode)},${ARG2}) exten=>s,n(dodial),Macro(VCCALLOUT,${ARG1},${ARG2},${ARG3},${ARG4}) exten=>s,n,NoOp(Setting Userfield after call completion) exten=>s,n,Set(CDR(userfield)=${MIXMONITOR_FILENAME}) exten=>s,dodial+101,Busy() exten=>s,n,Hangup() exten=>s,n,MacroExit exten=>h,1,NoOp(Call hangup MACROSTDOUT) exten=>h,n,UserEvent(RecordingToFile,Uniqueid: ${UNIQUEID},Channel: ${Channel},Filename: ${MIXMONITOR_FILENAME}) exten=>h,n,NoOp(Recorded to ${MIXMONITOR_FILENAME}) exten=>h,n,Set(CDR(userfield)=${MIXMONITOR_FILENAME}) exten=>h,n,NoOp(Account code is ${CHANNEL(accountcode)}) exten=>h,n,NoOp(call link var is ${call_Link}) exten=>h,n,GotoIf($["${CHANNEL(accountcode)}" != ""]?done) exten=>h,n(setacc),Set(CHANNEL(accountcode)=${call_Link}) exten=>h,n(done),noOp(Call Completed) and the VCCALLOUT macro: [macro-VCCALLOUT] ;macro to dial numbers ; ${ARG1} Channel To Use ; ${ARG2} Number To Dial ; ${ARG3} FailOver Channel ; ${ARG4} FailOverNumber exten=>s,n(setchan),Set(chantouse=${ARG1}) exten=>s,n,Set(numtodial=${ARG2}) exten=>s,n(makecall),GotoIf($["${timeLimit}" = ""]?dialNoLimit:dialLimit) exten=>s,n(dialNoLimit),Dial(${chantouse}/${numtodial},60,TL(390:6:3)) exten=>s,n,NoOp(Dial Status: ${DIALSTATUS}) exten=>s,n,GoTo(s-${DIALSTATUS},1) exten=>s,n(dialLimit),Dial(${chantouse}/${numtodial},60,TL(390:6:3)) exten=>s,n,NoOp(Dial Status: ${DIALSTATUS}) exten=>s,n,GoTo(s-${DIALSTATUS},1) exten=>s,dialNoLimit+101,Goto(s-${DIALSTATUS},1) exten=>s,dialLimit+101,Goto(s-${DIALSTATUS},1) exten=>s,n(endcall),busy() exten=>s,n,NoOp(Call Completed - setting userfield to recording) exten=>s,n,Set(CDR(userfield)=${MIXMONITOR_FILENAME}) exten=>s,n,Hangup() exten=>s,n,MacroExit exten=>s-NOANSWER,1,goto(s,endcall) exten=>s-CANCEL
[asterisk-users] Switched from Asterisk 1.8 to 13 - CDR ringtime now always zero
Hi guys A few months ago I upgraded most of my Asterisk servers to 13 from 1.8. I've still got about 25% of my servers on 1.8. I've since noticed that ringtime on Asterisk 13 - the time difference between "start" and "answer" in the CDR record for any call, and between "duration" and "billsec" - has completely disappeared. E. g. the two times and two durations are now the same for all outgoing calls made on Asterisk 13. On 1.8 the time difference between "start" and "answer" and "duration" and "billsec" was always my ring time - e. g. if I phone out to my cellphone from one of my 1.8 servers, the amount of seconds the call rings on my cell in my 1.8 instances is the difference between "start" and "answer" in the 1.8-generated CDR record, and the difference between "duration" and "billsec". E. g. on 13, I see this (zero ringtime) for a call that I make to my cellphone to test, with my cellphone ringing for at least 10 seconds and ringing heard on the Yealink connected to the asterisk - e. g. completely wrong: Start | Answer | End | dur.| billsec 2019-01-07 08:13:49 | 2019-01-07 08:13:49 | 2019-01-07 08:14:35 | 45 | 45 when it should have shown duration 45 billsec 30, 'cause I let it ring 10 seconds before answering my cell / mobile. On 1.8, I see this for a call that I make to my cellphone to test, with the phone ringing for 10 seconds and ringing heard on the Yealink connected to the asterisk - e. g. correct: Start | Answer | End | dur. | billsec 2019-01-07 08:26:43 | 2019-01-07 08:26:53 | 2019-01-07 08:29:25 | 162 | 152 e. g. it shows clearly that the call was ringing for 10 seconds before I answered my cell / mobile. My billing logic can thus tell that on Asterisk 1.8 there was 10 seconds of ringtime, but on Asterisk 13 it says that there was 0 seconds of ringtime - which in reality was also 10 seconds, but is no longer written as such into the CDR on Asterisk 13. So on all my Asterisk 13 instances all my outgoing calls are "suddenly" immediately answered by whomever I'm calling, and clients' landlines / mobiles never ring at all, they just instantly answer... which is obviously incorrect. How can I get Asterisk 13 to behave like Asterisk 1.8 as regards CDRs, e. g. still recording ring time and not just make all call start and call answer times, and all durations and billsec counts, exactly the same? I'm using the same SIP trunk provider with 13 as with 1.8, and in all cases the same operating system (Centos 7, upgraded to date) with both my 1.8 and 13 instances, and almost always the same physical hardware, same network, etc. The CDRs are logging locally on the Asterisk itself in both my 1.8 and 13.22.0 instances, unixODBC connections to Percona 5.6 running locally on the same box. So why is there no longer any ringing recorded in CDRs Asterisk 13 generates? It seems some element of logic changed in the CDR engine, but I cannot find any references to such... anybody got any help or pointers? The holy grail would be to have Asterisk 13 record ringing time on its CDR records, e. g. have a variation between the time a call is shown as having started and the time it is shown as having answered, e. g. the time spent in ringing waiting for the callee to pick up. So 1.8 CDR ringtime behaviour - but in 13. Any ideas? Thanks, Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] CURL to post application/json (David P)
>We tried to use the CURL fn to POST json, but it's sent as form data and >there seems no support for changing the Content-Type header. We switched to >invoking curl in the shell. Hi David If you've got if fixed that way, great. Just thought I'd comment and share the scripts / manner we use this, using CURL, and mention one major gotcha I ran into that took me a few hours to solve related with using CURL in Centos 7 on Asterisk 1.8.32.3, and then switching to 13.22.0. This is what our dialplan logic looks like to get a UUID from a CURL call made in a BASH file to our back-end application's API. Dialplan: same=>n,Set(curlResult=${SHELL(/usr/src/bash/getUUID.sh)}) --- BASH file: getUUID.sh --- #!/bin/bash function jsonval { temp=`echo $jsonResult | sed 's/\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g'` echo ${temp##*|} } baseUrl=http://127.0.0.1/api/getUUID jsonResult=$(curl --connect-timeout 16 --max-time 32 -s -X GET $baseUrl) uuid=`jsonval` echo -n $uuid --- This returns our UUID (from the Java app) into the dialplan variable curlResult which we then use further on in the dialplan. The MAJOR gotcha in this above is the >echo -n $uuid line... On Asterisk 1.8.32.3, this worked fine in the BASH script: echo $uuid However, on Asterisk 13.22.0, it did NOT work - the dialplan variable curlResult stayed empty on any calls to the BASH script vir SET() in Asterisk. Turns out that 13.22.0 does NOT like line feed / new line (\n) in ANY strings that come back from BASH. So I had to change the above line in the BASH file to echo -n $uuid so that the line-feed / newline was omitted from being returned to the Asterisk 13 instance. Just some two cents worth. Regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Astricon is coming up October 9-11! Signup is available at: https://www.asterisk.org/community/astricon-user-conference Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Spontaneous reboot due to MySQL lookups ? (Jonas Kellens)
Hi Jonas We have more or less this behaviour with 1.8.32.3 when writing CDRs to ODBC on Percona 5.6 (MySQL drop-in replacement with some optimisations and extra features.) In our case the system does NOT reboot, but Asterisk itself crashes with a segfault inside unixODBC itself. We're running on Centos 7, so the first thing we tried was to upgrade the ODBC drivers to the most recent version, and also use the most recent MySQL ODBC connector. This did not solve the problem, and the spontaneous shutdowns (and then restarts via Centos 7 systemd) of the 1.8.32.3 instances continued. Eventually we traced this to contention on the CDR table itself in the associated MySQL / Percona instance. We had a stored procedure running on the CDR table at set intervals via a MySQL timed event that was converting the Asterisk CDR data into another table we use for our own purposes. This was effectively locking the CDR table in ways that wasn't allowing Asterisk 1.8.32.3 to enter CDRs when it wanted to. The practical effect in real-world terms was that people could make a call, but then NOT do another call on that same extension, for up to five or ten minutes at a time. This was because the Asterisk 1.8.32.3 instance was waiting to get access to the CDR table to write that extensions most-recent CDR record in, and was holding onto the extension to prevent a new call when it hadn't yet managed to write into the CDR table for the previous call. Also, if pushed hard enough with concurrent calls, the Asterisk instance would get segfaulted due to a segfault in the ODBC drivers, due to this contention and waiting for access to the CDR table. All I can recommend is to upgrade to, for example, Asterisk 13.22.0 which is relatively painless to upgrade to if you're on 1.8.32.3 or the 1.8 series (at least in our experience) - OR remove contention on the CDR table. We eventually removed the extra SP we had running on the MySQL / Percona CDR table, as the contention problems persisted with 13.22.0, BUT IT DOES NOT CRASH LIKE 1.8.32.3 - while running against the same Percona 5.6 MySQL version, with the same level of MySQL DB contention taking place. E. g. look for contention on the MySQL tables you use, or just SQL contention in general - generate enough contention (with tables locked when Asterisk tries to write to them) and it does seem that 1.8 series Asterisk instances will segfault in the ODBC driver, if the concurrent call count goes high enough. Or (the better option) upgrade to at least Asterisk 13 (in our experience). Even with the same contention on MySQL db's accessed with unixODBC 2.3.6, and our same table-access killer SP running, Asterisk 13.22.0 doesn't crash at all when writing with the same version unixODBC driver to the contentious tables in MySQL. (We still had the same problem with people only being capable of making one call and then waiting up to five minutes post-hangup before being able to make the next call, but we solved that by not running the SP on schedule anymore against the CDR and CEL tables.) E.g. effectively we solved the crashes by upgrading from 1.8.32.3 to 13.22.0 - the rest is incidentals unique to our usage case. Hope this helps. Date: Thu, 4 Oct 2018 17:10:01 +0200 From: Jonas Kellens To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Spontaneous reboot due to MySQL lookups ? Message-ID: Content-Type: text/plain; charset="utf-8"; Format="flowed" Hello using Asterisk 1.8.32. I notice that there is a spontaneous reboot of the Asterisk system from time to time. When I look in the logs (verbose file) I noticed that every time this occurs it's at a moment that there is a MySQL action, be it a lookup or an insert/update/delete. I must say I do have some MySQL queries that occur in my dialplan when a call comes in, to look up different actions to perform on this call. An idea how to overcome this problem ? Seems a "performance" issue, no ?! Is it better to have these MySQL queries to be done by an external script (like a php script that I call with the System()-command or a SHELL()-command) ? Here are some examples from the verbose file. [Aug 22 15:19:10] VERBOSE[2977] pbx.c: [Aug 22 15:19:10] -- Executing [s@sub-GetAlertInfo:3] MYSQL("SIP/SipAgenT01-317d", "Connect connid localhost myuser mypwd myDB") in new stack [Aug 22 15:19:10] VERBOSE[2977] pbx.c: [Aug 22 15:19:10] -- Executing [s@sub-GetAlertInfo:5] MYSQL("SIP/SipAgenT01-317d", "Query resultid 1 SELECT uri, callinfo FROM distringtone WHERE onoff='1'") in new stack [Aug 22 15:19:18] VERBOSE[3306] config.c: [Aug 22 15:19:18] == Parsing '/etc/asterisk/logger.conf': [Aug 22 15:19:18] VERBOSE[3306] config.c: [Aug 22 15:19:18] == Found [Aug 22 15:19:18] VERBOSE[3306] config.c: [Aug 22 15:19:18] == Parsing '/etc/asterisk/asterisk.conf': [Aug 22 15:19:18] VERBOSE[3306] config.c: [Aug 22 15:19:18] == Found [Aug 22
Re: [asterisk-users] Asterisk 13.22.0 - No channel type registered for 'Agent' when queue rings - solved
Hi Guys Found the solution for this...! https://wiki.asterisk.org/wiki/display/AST/New+in+12#Newin12-channels_chan_a gent and https://reviewboard.asterisk.org/r/2657/diff/1/ and https://blogs.asterisk.org/2016/02/10/converting-from-chan_agent-to-app_agen t_pool/ clarifies the situation. After Asterisk 12, chan_agent was removed from Asterisk. It has been replaced with the AgentRequest application. So I had to adapt my previously posted configs as follows to get queued agents working and answering incoming calls to the queue. My agents.conf stayed unchanged from my original post. My queues.conf had to change from my original post to: --- member=> Local/3997@internal,,3997,Agent:3997 member=> Local/3998@internal,,3998,Agent:3998 --- with the rest of the queue settings remaining the same. The agent login extension had to change to: --- exten=>1007,1,NoOp(Login agent from ${CALLERID(num)}) same=>n,Set(MONITOR_OPTIONS=b) same=>n,UnpauseQueueMember(,Local/${CALLERID(num)}@internal) same=>n,AgentLogin(${CALLERID(num)},s) --- In my [internal] context (where my phones live - including my test phones 3997 and 3998) I had to add extensions that would call the AgentRequest() dialplan application on each of them if that extension was dialled. This is effectively how the queue is answered: --- [internal] . . . exten=>3997,1,AgentRequest(3997) same=>n,Hangup() exten=>3998,1,AgentRequest(3998) same=>n,Hangup() . . . --- Then I set up a testing extension in [internal] called '48' that would trigger the queue and let me test: [internal] . . . exten=>48,1,NoOp(Sending test call to testq) same=>n,Queue(testq,trhc) . . . --- So, my test procedure was: 1. Phone 1007 on phone 3997 (1007 - see my original post - is my agent login extension that calls AgentLogin on the dialing extension.) This logs me into the queue 'testq' as Agent 3997. 2. Phone 1007 on phone 3998. This logs me into the queue 'testq' as Agent 3998. 3. Phone 48 from any other phone, which calls the Queue application on the testq, which is defined in queues.conf as consisting of agents / phones 3997 and 3998. 4. Due to my queue being set to " strategy = leastrecent" on repeated calls to extension 48, either 3997 or 3998 would pick up calls made. This is exactly the functionality desired and I now have a working model of Agent queues in Asterisk 13 using the new (to me) app_agent_pool interface via AgentRequest instead of trying to use "chan_agent" which no longer exists post Asterisk 12. All that is now needed is to GOTO from my incoming extension to local,48,1 or simply do Queue(testq,trhc) from my incoming extension directly. If I have logged in agents in the testq queue, the most least recently dialled agent will get connected to the caller. Maybe this helps someone. Kind regards, Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Asterisk 13.22.0 - No channel type registered for 'Agent' when queue rings
Hi All With the below config, I just keep gettings this in the Asterisk 13.22.0 CLI: WARNING[15872][C-0051]: channel.c:6343 ast_request: No channel type registered for 'Agent' whenever a caller gets sent to that agent queue with logged in agents waiting for calls on Asterisk 13. 3997 and 3998 are my two agents. They can call each other and receive calls from other extensions. They can phone out of my PBX, no problems. My agents.conf: --- [agents](!) autologoff=15 wrapuptime=5000 custom_beep=beep [3997](agents) fullname=>AGENT 1 [3998](agents) fullname=>AGENT 2 --- My queues.conf: --- [testq] musicclass = default strategy = leastrecent timeout = 10 retry = 5 autofill = yes member => Agent/3997,0,3997,hint:3997@default,no member => Agent/3998,0,3998,hint:3998@default,no --- Also, setting ringinuse on (change member line above to have "yes" at the end) has no effect except to make the error "No channel type..." appear twice in the 13.22.0 CLI per external ring heard by caller, instead of once per external ring if ringinuse is set to "no" in the two lines above. Logging in an agent in extensions.conf: --- exten=>1007,1,NoOp(Login agent from ${CALLERID(num)}) same=>n,Set(MONITOR_OPTIONS=b) same=>n,UnpauseQueueMember(,Agent/${CALLERID(num)}) same=>n,AgentLogin(${CALLERID(num)},s) --- Queue show with agents logged in: --- localhost*CLI> queue show testq has 0 calls (max unlimited) in 'leastrecent' strategy (0s holdtime, 0s talktime), W:0, C:0, A:16, SL:0.0% within 0s Members: 3997 (Agent/3997 from hint:3997@default) (ringinuse disabled) (In use) has taken no calls yet 3998 (Agent/3998 from hint:3998@default) (ringinuse disabled) (In use) has taken no calls yet No Callers --- Then, if the queue is called from outside: --- localhost*CLI> queue show testq has 1 calls (max unlimited) in 'leastrecent' strategy (0s holdtime, 0s talktime), W:0, C:0, A:16, SL:0.0% within 0s Members: 3997 (Agent/3997 from hint:3997@default) (ringinuse disabled) (In use) has taken no calls yet 3998 (Agent/3998 from hint:3998@default) (ringinuse disabled) (In use) has taken no calls yet Callers: 1. SIP/3916-0055 (wait: 0:08, prio: 0) --- 3916 is never answered, and neither 3997 or 3998 receive the call, both continuing with MOH indefinitely. Constantly on the CLI this comes up, timed with each ring of 3916 (the "outside" phone): --- localhost*CLI> queue show testq has 1 calls (max unlimited) in 'leastrecent' strategy (0s holdtime, 0s talktime), W:0, C:0, A:16, SL:0.0% within 0s Members: 3997 (Agent/3997 from hint:3997@default) (ringinuse disabled) (In use) has taken no calls yet 3998 (Agent/3998 from hint:3998@default) (ringinuse disabled) (In use) has taken no calls yet Callers: 1. SIP/3916-0055 (wait: 0:08, prio: 0) localhost*CLI> [Aug 2 10:37:39] WARNING[16925][C-0056]: channel.c:6343 ast_request: No channel type registered for 'Agent' [Aug 2 10:37:44] WARNING[16925][C-0056]: channel.c:6343 ast_request: No channel type registered for 'Agent' [Aug 2 10:37:49] WARNING[16925][C-0056]: channel.c:6343 ast_request: No channel type registered for 'Agent' What am I doing wrong? The expectation is that either 3997 or 3998 will receive the incoming call placed by SIP/3916. As of now, 3916 rings forever, and 3997 and 3998 just play MOH forever, with the above error emitted with each ring heard on 3916 which is calling into the queue looking for someone to pick up. Thanks! -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] SHELL() function Asterisk 13 - can only accept one paramter in string?
Hi Ludovic Thank you very much for replying! Ok, I’ll give up on the dialplan apps then in total and try out AGI. Thanks again, From: Ludovic Gasc Sent: Friday, 27 July 2018 13:37 To: viljo...@verishare.co.za; Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] SHELL() function Asterisk 13 - can only accept one paramter in string? Hi Stefan, You might use AGI instead of SHELL, it's better because you can interact with the call via AGI and you don't have a risk of remote execution you might have if you add arguments that come from outside, for example via a SIP header. Regards. -- Ludovic Gasc (GMLudo) Le ven. 27 juil. 2018 à 09:37, Stefan Viljoen mailto:viljo...@verishare.co.za> > a écrit : Hi all This is a followup on my post "Asterisk 13 - system() dialplan app cannot call bash scripts" from yesterday I've given up trying to use system() to call BASH scripts with parameters from Asterisk 13. Turned out under Asterisk 13.22.0 System() DOES work, but only if you do NOT attempt to pass any parameters to the called script. This works, and reliably calls the script: same=>n,System(/bin/bash /usr/src/bash/setData.sh) However, the moment you do this: same=>n,System(/bin/bash /usr/src/bash/setData.sh ${CHANNEL(accountcode)}) you get WARNING[30982][C-0238] app_system.c: Unable to execute '/usr/src/bash/setData.sh' I therefore tried to use SHELL() to do what I was trying to do with SYSTEM(). This also does not work, as SHELL() apparently can only ever parse ONE asterisk parameter in the string sent to it. All the rest are sent as blank. If I do this: same=>n,Set(nothing=${SHELL(/usr/src/verdi/bash/verdiLogIncomingCall.sh NA 201807270838t49hgzs SIP/centra-out-6d9a IN SIP/3027-6db1 SIP/3027-6db1 ApiLogIncomingCall.java 1)}) The script sees, on dialplan execution: [root@acasterisk bash]# cat passed_param.txt http://127.0.0.1/api/logIncomingCall?account_reference=NA <http://127.0.0.1/api/logIncomingCall?account_reference=NA_reference=201807270838t49hgzs_channel_id=SIP/centra-out-6d9a=IN_endpoint=SIP/3027-6db1_id=SIP/3027-6db1_from=ApiLogIncomingCall.java_sent_to_server=1> _reference=201807270838t49hgzs_channel_id=SIP/centra-out-6d9a=IN_endpoint=SIP/3027-6db1_id=SIP/3027-6db1_from=ApiLogIncomingCall.java_sent_to_server=1 [root@acasterisk bash]# E. g. all params present - because no variable references need to be parsed. If I use this: [macro-verdianswer] exten=>s,1,NoOp(Entering Verdi answer macro - picked up by ${CHANNEL}) same=>n,NoOp(Source Channel: ${sourceChannel}) same=>n,NoOp(Answering Channel: ${CHANNEL}) same=>n,NoOp(Lodging CDR accountcode: ${curIncAccCode} as an incoming call from ${numbersource} with VerDi and answered by ${CHANNEL}...) same=>n,Set(CHANNEL(accountcode)=${curIncAccCode}) same=>n,Set(nothing=${SHELL(/usr/src/verdi/bash/verdiLogIncomingCall.sh NA ${curIncAccCode} ${sourceChannel} IN ${CHANNEL} ${numbersource} ApiLogIncomingCall.java 1)}) same=>n,MacroExit() giving this on exection: -- SIP/3002-70c2 answered SIP/centra-out-70bf -- Executing [s@macro-verdianswer:1] NoOp("SIP/3002-70c2", "Entering Verdi answer macro - picked up by SIP/3002-70c2") in new stack -- Executing [s@macro-verdianswer:2] NoOp("SIP/3002-70c2", "Source Channel: SIP/centra-out-70bf") in new stack -- Executing [s@macro-verdianswer:3] NoOp("SIP/3002-70c2", "Answering Channel: SIP/3002-70c2") in new stack -- Executing [s@macro-verdianswer:4] NoOp("SIP/3002-70c2", "Lodging CDR accountcode: 2018072709061hrriyu -- as an incoming call from 27182941000 with VerDi and answered by SIP/3002-70c2...") in new stack -- Executing [s@macro-verdianswer:7] Set("SIP/3002-70c2", "nothing=Incoming call NOT stored. Contact software support. -- ") in new stack e. g. my variables ARE populated, and if I NoOp them, they have values. In this situation, the script called via SHELL() sees: [root@acasterisk bash]# cat passed_param.txt http://127.0.0.1/api/logIncomingCall?account_reference=NA <http://127.0.0.1/api/logIncomingCall?account_reference=NA_reference=2018072709061hrriyu_channel_id==_endpoint=_id=_from=_sent_to_server=> _reference=2018072709061hrriyu_channel_id==_endpoint=_id=_from=_sent_to_server= E. g. SHELL() apparently only ever parses the FIRST Asterisk variable passed into it as a string, and never parses subsequent variable references. Can anybody confirm or suggest a solution? I desperately need to be able to execute external BASH scripts and pass multiple parameters to them, somehow. Nothing that worked in 1.8 for this works in 13... Thanks! Stefan -- _ -- Bandw
Re: [asterisk-users] asterisk-users Digest, Vol 167, Issue 17
Hi Daniel Thanks for the reply! Yes, turns out it was all my fault, I had a line feed character (0x0a a.k.a printf("\n")) in one of the Asterisk channel variables passed via system() / shell() to my target script. It seems 13.22.0 (I'm using the same version as you) reacts to a line feed in the parameter string by not processing or parsing the string any further one the line feed is encountered. I removed the line feed (by using "echo -n" instead of just "echo" in a related BASH script that was providing input to Asterisk also via SHELL) and the problem disappeared and system() (and shell() itself ) started working correctly. So, the moral is just keep the data clean that is fed through SYSTEM() and SHELL() from having any line-feeds in them. On Asterisk 1.8 (my previous version) line-feeds in an Asterisk channel variable dereferenced in a SYSTEM() or SHELL() call did NOT stop parsing of the rest of the string - so apparently a relevant difference between the two versions there. Kind regards, --- Message: 2 Date: Fri, 27 Jul 2018 10:24:56 +0200 From: Administrator TOOTAI To: asterisk-users@lists.digium.com Subject: Re: [asterisk-users] SHELL() function Asterisk 13 - can only accept one paramter in string? Message-ID: <008fecea-e2c0-9230-7cb4-cd1b6990c...@tootai.net> Content-Type: text/plain; charset=utf-8; format=flowed Le 27/07/2018 à 09:36, Stefan Viljoen a écrit : > Hi all > > This is a followup on my post "Asterisk 13 - system() dialplan app > cannot call bash scripts" from yesterday > > I've given up trying to use system() to call BASH scripts with parameters > from Asterisk 13. > > Turned out under Asterisk 13.22.0 System() DOES work, but only if you do NOT > attempt to pass any parameters to the called script. [...] *CLI> core show version Asterisk 13.22.0 built by root @ pabx on a x86_64 running Linux on 2018-07-14 13:36:49 UTC This works for us same = n,system(/bin/echo "To: ${CALLED_CHANNEL} From: ${ORI_CALL}" | /usr/bin/mail -s "TOOTAiAudio - Congestion Gateway ${CONGESTION_GW} used" ${AUDIO_ADMIN}) -- Daniel -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Asterisk 13 - system() dialplan app cannot call bash scripts
Hi Guys Just feedback on this particular thread, this issue is SOLVED. The reason why SYSTEM() and SHELL() was not working for me was that I was passing a linefeed character (\n, hex 0x0a) in one of the channel variables in Asterisk that was then parsed in the call to SYSTEM() and SHELL(). It appears that a big difference between 1.8 (where this code was developed) and Asterisk 10 / 11 / 12 / 13 et al is that if SYSTEM() or SHELL() encounters a linefeed in the parsed parameters passed in the string they are called on, they stop parsing and evaluating any other Asterisk variables passed in to the right of the parameter string given to SYSTEM() and SHELL(). I eliminated the spurious \n character from a UUID generation BASH script and SYSTEM() and SHELL() now appear to be working correctly, parsing and evaluating all Asterisk channel variables passed into them as parameters, and then calling the external BASH script 100% correctly with these parameters. So the issue was "bad data" on my side, and the apparent fact that Asterisk 13.22.0 is sensitive to \n in parameter strings passed to the SHELL() function and SYSTEM() dialplan application, and stops processing the string if a \n is encountered in a call to SHELL() or SYSTEM(). Hope this helps someone. Regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] SHELL() function Asterisk 13 - can only accept one paramter in string?
With thanks to Ludovic Gasc --- Turns out there is nothing wrong with the SYSTEM() or SHELL() dialplan functions in Asterisk 13.22.0. After several hours of painstaking debugging, the problem turned out to be a linefeed (\n character, 0x0a hex) in the first parameter passed from Asterisk to the bash script in the call to the SYSTEM() or SHELL() applications. Ludovic's suggestion to try AGI revealed the issue - it has nothing to do with AGI or SYSTEM() but rather my data for one parameter passed through system containing a linefeed (\n) E. g. I was calling this: same=>n,System(/usr/src/verdi/bash/verdiLogIncomingCall.sh NA ${curIncAccCode} ${sourceChannel} IN ${CHANNEL} ${numbersource} ApiLogIncomingCall.java 1) but ${curIncAccCode} appeared to contain a UUID I generate in a JAVA application. In fact it contained uuidtexthere\n instead of just uuidtexthere E. g. it had an appended \n (hex 0a) linefeed character appended. My script that generated this UUID looked like this: --- #!/bin/bash function jsonval { temp=`echo $jsonResult | sed 's/\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g'` echo ${temp##*|} } baseUrl=http://127.0.0.1/api/getVerdiUUID jsonResult=$(curl --connect-timeout 16 --max-time 32 -s -X GET $baseUrl) uuid=`jsonval` echo $uuid --- So all that I actually needed to fix was to change echo $uuid to echo -n $uuid and all my problems were solved, SYSTEM() started working perfectly everywhere in the dialplan as the script wasn't emitting a trailing \n anymore. So the germane difference between Asterisk 1.8 and Asterisk 13 / 12 / 11 / 10 in this case was that SYSTEM() and SHELL() in the later versions are sensitive to \n being passed in inside any of the Asterisk variables passed into those applications' parameter string. Maybe this helps somebody else. Regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] SHELL() function Asterisk 13 - can only accept one paramter in string?
Hi all This is a followup on my post "Asterisk 13 - system() dialplan app cannot call bash scripts" from yesterday I've given up trying to use system() to call BASH scripts with parameters from Asterisk 13. Turned out under Asterisk 13.22.0 System() DOES work, but only if you do NOT attempt to pass any parameters to the called script. This works, and reliably calls the script: same=>n,System(/bin/bash /usr/src/bash/setData.sh) However, the moment you do this: same=>n,System(/bin/bash /usr/src/bash/setData.sh ${CHANNEL(accountcode)}) you get WARNING[30982][C-0238] app_system.c: Unable to execute '/usr/src/bash/setData.sh' I therefore tried to use SHELL() to do what I was trying to do with SYSTEM(). This also does not work, as SHELL() apparently can only ever parse ONE asterisk parameter in the string sent to it. All the rest are sent as blank. If I do this: same=>n,Set(nothing=${SHELL(/usr/src/verdi/bash/verdiLogIncomingCall.sh NA 201807270838t49hgzs SIP/centra-out-6d9a IN SIP/3027-6db1 SIP/3027-6db1 ApiLogIncomingCall.java 1)}) The script sees, on dialplan execution: [root@acasterisk bash]# cat passed_param.txt http://127.0.0.1/api/logIncomingCall?account_reference=NA_reference=201807270838t49hgzs_channel_id=SIP/centra-out-6d9a=IN_endpoint=SIP/3027-6db1_id=SIP/3027-6db1_from=ApiLogIncomingCall.java_sent_to_server=1 [root@acasterisk bash]# E. g. all params present - because no variable references need to be parsed. If I use this: [macro-verdianswer] exten=>s,1,NoOp(Entering Verdi answer macro - picked up by ${CHANNEL}) same=>n,NoOp(Source Channel: ${sourceChannel}) same=>n,NoOp(Answering Channel: ${CHANNEL}) same=>n,NoOp(Lodging CDR accountcode: ${curIncAccCode} as an incoming call from ${numbersource} with VerDi and answered by ${CHANNEL}...) same=>n,Set(CHANNEL(accountcode)=${curIncAccCode}) same=>n,Set(nothing=${SHELL(/usr/src/verdi/bash/verdiLogIncomingCall.sh NA ${curIncAccCode} ${sourceChannel} IN ${CHANNEL} ${numbersource} ApiLogIncomingCall.java 1)}) same=>n,MacroExit() giving this on exection: -- SIP/3002-70c2 answered SIP/centra-out-70bf -- Executing [s@macro-verdianswer:1] NoOp("SIP/3002-70c2", "Entering Verdi answer macro - picked up by SIP/3002-70c2") in new stack -- Executing [s@macro-verdianswer:2] NoOp("SIP/3002-70c2", "Source Channel: SIP/centra-out-70bf") in new stack -- Executing [s@macro-verdianswer:3] NoOp("SIP/3002-70c2", "Answering Channel: SIP/3002-70c2") in new stack -- Executing [s@macro-verdianswer:4] NoOp("SIP/3002-70c2", "Lodging CDR accountcode: 2018072709061hrriyu -- as an incoming call from 27182941000 with VerDi and answered by SIP/3002-70c2...") in new stack -- Executing [s@macro-verdianswer:7] Set("SIP/3002-70c2", "nothing=Incoming call NOT stored. Contact software support. -- ") in new stack e. g. my variables ARE populated, and if I NoOp them, they have values. In this situation, the script called via SHELL() sees: [root@acasterisk bash]# cat passed_param.txt http://127.0.0.1/api/logIncomingCall?account_reference=NA_reference=2018072709061hrriyu_channel_id==_endpoint=_id=_from=_sent_to_server= E. g. SHELL() apparently only ever parses the FIRST Asterisk variable passed into it as a string, and never parses subsequent variable references. Can anybody confirm or suggest a solution? I desperately need to be able to execute external BASH scripts and pass multiple parameters to them, somehow. Nothing that worked in 1.8 for this works in 13... Thanks! Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Edit: Asterisk 13.22.0 - "stat" dialplan function clears channel vars?
Sorry, I see I have submitted a testing version of the dialplan fragment. Actual extension is: ;listen to recording exten=>,1,Answer() exten=>,n,NoOp(Requesting File ${recfile}) exten=>,n,NoOp(Rec file set to ${recfile}) exten=>,n,NoOp(Alt file set to ${altfile}) exten=>,n,NoOp(Requesting Alt File ${altfile}) exten=>,n,Set(__numbertarget=) exten=>,n,Set(haveFile=${STAT(e,${recfile}.gsm)}) exten=>,n,NoOp(Original File Exist ${haveFile}) exten=>,n,GotoIf($["${haveFile}" = "1"]?play) exten=>,n,NoOp(rec File not found using alt file) exten=>,n,Set(recfile=${altFile}) exten=>,n(play),ControlPlayback(${recfile},2,6,4,8,5,9) exten=>,n,hangup() for my previous post. Thanks! -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Asterisk 13.22.0 - "stat" dialplan function clears channel vars?
Hi Guys I have the following dialplan code that I use to play back recordings, the filename being provided in an originate statement to the AMI (AJAM) interface: Action: Originate ActionID: test Channel: SIP/3015 Exten: Context: local Priority: 1 CallerID: 3015 Account: recordinglisten ChannelID: abc OtherChannelID: def Variable: CallLimit=3600,recfile=/var/spool/asterisk/monitor/1807/25/2507180836591192526,altfile=/var/spool/asterisk/monitor/archive/1807/25/2507180836591192526 Async: true Extension is: ;listen to recording exten=>,1,Answer() exten=>,n,NoOp(Requesting File ${recfile}) exten=>,n,Set(${__recfile}=${recfile}) exten=>,n,Set(${__altfile}=${altfile}) exten=>,n,NoOp(Rec file set to ${recfile}) exten=>,n,NoOp(Alt file set to ${altfile}) exten=>,n,NoOp(Requesting Alt File ${altfile}) exten=>,n,Set(__numbertarget=) exten=>,n,Set(haveFile=${STAT(e,${recfile}.gsm)}) exten=>,n,NoOp(Original File Exist ${haveFile}) exten=>,n,GotoIf($["${haveFile}" = "1"]?play) exten=>,n,NoOp(rec File not found using alt file) exten=>,n,Set(recfile=${altFile}) exten=>,n(play),ControlPlayback(${recfile},2,6,4,8,5,9) exten=>,n,hangup() However, if the above originate is done, when this line is executed in the dialplan Asterisk 13.22.0 exten=>,n,Set(haveFile=${STAT(e,${recfile}.gsm)}) it clears the variables recfile and altfile - if you NoOp them out below this line they are blank. Why would the "STAT" dialplan function in 13.22.0 apparently clear all variables set on the channel, instead of checking if the given file exists (as it did in previous Asterisk versions) and leaving the channel variables alone... Additionally, not only "recfile" which is passed as a STAT parameter is clear, "altfile" is -also- cleared to blank. Can anybody assist? Thank you Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Recompiling Ast results in a binary with differing SHA256 sums?
Hi Guys If I recompile Asterisk (on a Centos 7 test box, Asterisk 1.8.32.3) multiple times in a row, e. g. make clean;configure;make menuselect;make I note that the asterisk binary in the /main folder in the source tree, has a different SHA256 hash each time I recompile Asterisk using the above commands. I do not change anything on the system or in the menuselect configs for each run. But each time the checksum for the "asterisk" binary is different. Why is that? Shouldn't a freshly compiled binary off the same source, with no changes in the Asterisk menuselect, with nothing changed on the rest of the system, result each time in an IDENTICAL binary, down to the last byte? Why am I getting a completely different "asterisk" ELF binary each time I recompile asterisk, according to checksum? Can someone shed light... Thanks, Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Big leap - 1.8 to 15.4.0
Hi all We have to upgrade soon from prehistoric Asterisk 1.8.32.0 to Asterisk 15.x.x (whatever minversion is current at the time.) We are quite heavily invested into 1.8.32.0 at about 17 sites locally and internationally and have a LOT of custom software running our sites via AMI from various applications. What are big gotchas to watch out for? Especially regarding PJSip as I've been following posts and forums and it seems theres massive changes there, nevermind just overall changes in jumping years of dev ahead on the Asterisk version... What should I watch out for so that our sites don't collapse completely on telecoms functionality when we go to 15 from 1.8? Any resources I can refer to? No upgrade guide I can find cover -this- wide a leap in versions. I assume virtually every site's dialplan will have to be rewritten from scratch, which in itself is already a massive undertaking. Anybody with some advice? Thanks, Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Passing parameter to Queue-called macro
Hi Marie That's why I asked about thread safety for global vars, cause it was appearing that global variables was going to be the only way to send data between the two instances - e. g. between the running call and the queue-triggered macro. So the inherited (_ prepend) channel variables are exactly what I needed, e. g. a way to definitively isolate the unique ID for a call from the unique IDs for all other concurrent queued calls when the relevant macro is triggered by users picking up calls in a very busy queue. And I need to pass a variable in from the calling context into the macro being called. So all's good, at least my solution will now start to work in the way I envisioned it to. Thanks! -Original Message- From: Marie Fischer <ma...@vtl.ee> Sent: Friday, 11 May 2018 15:28 To: viljo...@verishare.co.za; Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users@lists.digium.com> Subject: Re: [asterisk-users] Passing parameter to Queue-called macro Hi Stefan, glad you got it solved. Just to clarify, those are not global, but channel variables you are using - so they should be visible only to their respective channel (and child channels with inheritance). Global variables are defined in a [globals] section in extensions.conf. (https://wiki.asterisk.org/wiki/display/AST/Global+Variables+Basics) -- BR, marie On 11.05.2018, at 9:01, Stefan Viljoen <viljo...@verishare.co.za> wrote: > Hi Marie > > Thanks! > > I was just worried about thread safety if I had to use a global variable, e. > g. it might be set to a value by one call (since I'm using the same > global for every incoming call to transfer the accountcode gotten from > my HTTP endpoint to the same macro, and there can be several calls > simultaneously all inserting HTTP-sourced values at more or less the > same instant) and then another call is in such a state that it then > reads this call's data - and never reads its logical "own" data. The > classic concurrently accessed single variable issue. > > Anyway, I've managed to solve this by declaring a variable in the main > dialplan as inheritable and storing my back-office relevant GUID in > there, then referencing that variable without the pre-prended _ in the macro: > > E. g. > > [verdianswer] > exten=>s,n,NoOp(Lodging CDR accountcode: ${curIncAccCode} as an > incoming call from ${numbersource} with VerDi and answered by > ${MEMBERINTERFACE}...) exten=>s,n,MacroExit > > [telkomin] > . > . > . > same=>n,Set(curlResult=${SHELL(/usr/src/verdi/bash/verdiIncGetUUID.sh) > }) > same=>n,Set(_curIncAccCode=${curlResult}) > same=>n,Queue(stefantest,trhc,,,60,,verdianswer) > > The above works just fine for doing what I want to do, e. g. pass a > parameter from an Asterisk dialplan context into a queue-triggered > "agent just answered in the queue" Asterisk macro. > > Thanks for the reply! > > Kind regards > > Stefan > -Original Message- > From: Marie Fischer <ma...@vtl.ee> > Sent: Thursday, 10 May 2018 15:08 > To: viljo...@verishare.co.za; Asterisk Users Mailing List - > Non-Commercial Discussion <asterisk-users@lists.digium.com> > Subject: Re: [asterisk-users] Passing parameter to Queue-called macro > > Hi, > > maybe I am overlooking something, but channel variables should be > thread safe, shouldn't they? > > I am using the following (sorry, in ael): > > macro dial-queue (number) { > Set(_ORIG_UNIQUEID=${UNIQUEID}); > Queue(${number},rCt,,,${timeout},,set-dst-agent); > .. > } > > // the "context macro-..." things is an ael-specific workaround to get > transfer working (macro sets context to > app_queue_gosub_virtual_context) context macro-set-dst-agent { > s => { > Noop(${ORIG_UNIQUEID}); > (${ORIG_UNIQUEID},${MEMBERNAME}); > } > } > > macro add-current-call-agent (id,num) { > Set(ODBC_ADD_CURRENT_AGENT(${id},${num})=1); > return; > } > > -- > > marie > > On 08.05.2018, at 16:16, Stefan Viljoen <viljo...@verishare.co.za> wrote: > >> Hi all >> >> I need to pass a parameter in a thread-safe manner to the Queue >> pickup macro. This is to know when (and who) picked up an incoming >> call to a queue and log that to my back-office system with a CURL to >> a HTTP > endpoint. >> >> However, the Queue application does not appear to allow passing of >> parameters to the called queue pickup macro. >> >> E. g. non-working code is: >> >> [queuetest] >> timeout = 60 >> retry = 2 >> member=>SIP/testnum >> >> [macro-verdian
Re: [asterisk-users] Passing parameter to Queue-called macro
Hi Marie Thanks! I was just worried about thread safety if I had to use a global variable, e. g. it might be set to a value by one call (since I'm using the same global for every incoming call to transfer the accountcode gotten from my HTTP endpoint to the same macro, and there can be several calls simultaneously all inserting HTTP-sourced values at more or less the same instant) and then another call is in such a state that it then reads this call's data - and never reads its logical "own" data. The classic concurrently accessed single variable issue. Anyway, I've managed to solve this by declaring a variable in the main dialplan as inheritable and storing my back-office relevant GUID in there, then referencing that variable without the pre-prended _ in the macro: E. g. [verdianswer] exten=>s,n,NoOp(Lodging CDR accountcode: ${curIncAccCode} as an incoming call from ${numbersource} with VerDi and answered by ${MEMBERINTERFACE}...) exten=>s,n,MacroExit [telkomin] . . . same=>n,Set(curlResult=${SHELL(/usr/src/verdi/bash/verdiIncGetUUID.sh)}) same=>n,Set(_curIncAccCode=${curlResult}) same=>n,Queue(stefantest,trhc,,,60,,verdianswer) The above works just fine for doing what I want to do, e. g. pass a parameter from an Asterisk dialplan context into a queue-triggered "agent just answered in the queue" Asterisk macro. Thanks for the reply! Kind regards Stefan -Original Message- From: Marie Fischer <ma...@vtl.ee> Sent: Thursday, 10 May 2018 15:08 To: viljo...@verishare.co.za; Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users@lists.digium.com> Subject: Re: [asterisk-users] Passing parameter to Queue-called macro Hi, maybe I am overlooking something, but channel variables should be thread safe, shouldn't they? I am using the following (sorry, in ael): macro dial-queue (number) { Set(_ORIG_UNIQUEID=${UNIQUEID}); Queue(${number},rCt,,,${timeout},,set-dst-agent); .. } // the "context macro-..." things is an ael-specific workaround to get transfer working (macro sets context to app_queue_gosub_virtual_context) context macro-set-dst-agent { s => { Noop(${ORIG_UNIQUEID}); (${ORIG_UNIQUEID},${MEMBERNAME}); } } macro add-current-call-agent (id,num) { Set(ODBC_ADD_CURRENT_AGENT(${id},${num})=1); return; } -- marie On 08.05.2018, at 16:16, Stefan Viljoen <viljo...@verishare.co.za> wrote: > Hi all > > I need to pass a parameter in a thread-safe manner to the Queue pickup > macro. This is to know when (and who) picked up an incoming call to a > queue and log that to my back-office system with a CURL to a HTTP endpoint. > > However, the Queue application does not appear to allow passing of > parameters to the called queue pickup macro. > > E. g. non-working code is: > > [queuetest] > timeout = 60 > retry = 2 > member=>SIP/testnum > > [macro-verdianswer] > exten=>s,1,NoOp(Entering Verdi answer macro) > exten=>s,n,NoOp(Value: ${ARG1}) > exten=>s,n,MacroExit > > [incomingcontext] > > exten=>tstqueue,1,NoOp(Incoming call for VerDi) > same=>n,Set(curlResult=${SHELL(/usr/src/verdi/bash/verdiIncGetUUID.sh) > }) > same=>n,Set(curlResultLength=${LEN(${curlResult})}) > same=>n,NoOp(Curl result for incoming call UUID from VerDi: > ${curlResult}) > same=>n,Set(CDR(accountcode)=${curlResult}) > same=>n,Set(curIncAccCode=${curlResult},g) > same=>n,Macro(VCRECORD,stefantestEXT${CALLERID(num)}ACC${CDR(accountco > de)},$ > {EXTEN}) > same=>n,Queue(queuetest,trhc,,,60,,verdianswer(${curIncAccCode})) > same=>n,Hangup() > > This results, when executed, in: > > [May 8 15:14:50] WARNING[20921]: app_macro.c:309 _macro_exec: No such > context 'macro-verdianswer(2018050815141huzzu4 > ' for macro 'verdianswer(2018050815141huzzu4 > > How can one pass a paramter into the macro called by the Asterisk > queue application on queue pickup? > > Alternatively, how can a global variable or ASTDB entry be made thread > safe to do the same? > > Thank you > > Stefan > > > > > -- > _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Passing parameter to Queue-called macro
Hi all I need to pass a parameter in a thread-safe manner to the Queue pickup macro. This is to know when (and who) picked up an incoming call to a queue and log that to my back-office system with a CURL to a HTTP endpoint. However, the Queue application does not appear to allow passing of parameters to the called queue pickup macro. E. g. non-working code is: [queuetest] timeout = 60 retry = 2 member=>SIP/testnum [macro-verdianswer] exten=>s,1,NoOp(Entering Verdi answer macro) exten=>s,n,NoOp(Value: ${ARG1}) exten=>s,n,MacroExit [incomingcontext] exten=>tstqueue,1,NoOp(Incoming call for VerDi) same=>n,Set(curlResult=${SHELL(/usr/src/verdi/bash/verdiIncGetUUID.sh)}) same=>n,Set(curlResultLength=${LEN(${curlResult})}) same=>n,NoOp(Curl result for incoming call UUID from VerDi: ${curlResult}) same=>n,Set(CDR(accountcode)=${curlResult}) same=>n,Set(curIncAccCode=${curlResult},g) same=>n,Macro(VCRECORD,stefantestEXT${CALLERID(num)}ACC${CDR(accountcode)},$ {EXTEN}) same=>n,Queue(queuetest,trhc,,,60,,verdianswer(${curIncAccCode})) same=>n,Hangup() This results, when executed, in: [May 8 15:14:50] WARNING[20921]: app_macro.c:309 _macro_exec: No such context 'macro-verdianswer(2018050815141huzzu4 ' for macro 'verdianswer(2018050815141huzzu4 How can one pass a paramter into the macro called by the Asterisk queue application on queue pickup? Alternatively, how can a global variable or ASTDB entry be made thread safe to do the same? Thank you Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Call picked up from queue and transferred gets disconnected - about 0.01% of calls
Hi Khalil Thanks for the reply. Yup, I’ve switched out the phone with another new-from-box Yealink, also moved that network endpoint to another RJ45 port on the switch... Regards, From: Khalil Khamlichi [mailto:khamlichi.kha...@gmail.com] Sent: Sunday, 11 February 2018 16:48 To: viljo...@verishare.co.za; Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users@lists.digium.com> Subject: Re: [asterisk-users] Call picked up from queue and transferred gets disconnected - about 0.01% of calls maybe extension 3082 has some sort of network issue or maybe hardphone issue. test on another phone / network plug. On Feb 9, 2018 2:48 PM, "Stefan Viljoen" <viljo...@verishare.co.za <mailto:viljo...@verishare.co.za> > wrote: Hi Guys I have an issue where a call is picked up from a queue. The caller asks the person who answered to attended transfer to extension 3082 (for argument’s sake.) 3082 picks up the attended transfer and speaks with the outside caller picked up initially from the queue. A few seconds after 3082 has started speaking to the outside caller - 3082’s call goes dead in their handset. - The outside caller goes back into the queue, hears queue MOH and gets answered by another person in the office as if they are dialing in all over again. - 3082’s phone starts ringing again after they hang up in puzzlement and if they then pick up they speak to another person who is trying to make an OUTGOING call in their call center. This is for a medium sized call center which (along with 17 other centers in the same country) run the same dialplan on Asterisk 1.8.32.3 - only happens at this location. Literally 100 000+ calls are handled across these 18 centers every day, only about 10 or 20 at this one center (with carbon-copy dialplan and SIP phone hardware types - Yealink T-21Ps - as at every other branch) keeps disconnecting people picked up and transferred from the incoming queue from the person transferred to, and then connects them and the transferree to other phones - the caller as if he is phoning in AGAIN into the incoming queue, the transferred-to person to someone else who is trying to dial out once the transferred-to person has hung up after losing the incoming caller. Anybody ever encountered something similar? The same dialplan on the same Ast version runs fine in 17 other locations, some with ten or twenty times more traffic and none of these issues. No errors or strangeness apparent in the CLI, verbose log, DTMF log... Thanks! -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Call picked up from queue and transferred gets disconnected - about 0.01% of calls
Hi Guys I have an issue where a call is picked up from a queue. The caller asks the person who answered to attended transfer to extension 3082 (for argument's sake.) 3082 picks up the attended transfer and speaks with the outside caller picked up initially from the queue. A few seconds after 3082 has started speaking to the outside caller - 3082's call goes dead in their handset. - The outside caller goes back into the queue, hears queue MOH and gets answered by another person in the office as if they are dialing in all over again. - 3082's phone starts ringing again after they hang up in puzzlement and if they then pick up they speak to another person who is trying to make an OUTGOING call in their call center. This is for a medium sized call center which (along with 17 other centers in the same country) run the same dialplan on Asterisk 1.8.32.3 - only happens at this location. Literally 100 000+ calls are handled across these 18 centers every day, only about 10 or 20 at this one center (with carbon-copy dialplan and SIP phone hardware types - Yealink T-21Ps - as at every other branch) keeps disconnecting people picked up and transferred from the incoming queue from the person transferred to, and then connects them and the transferree to other phones - the caller as if he is phoning in AGAIN into the incoming queue, the transferred-to person to someone else who is trying to dial out once the transferred-to person has hung up after losing the incoming caller. Anybody ever encountered something similar? The same dialplan on the same Ast version runs fine in 17 other locations, some with ten or twenty times more traffic and none of these issues. No errors or strangeness apparent in the CLI, verbose log, DTMF log... Thanks! -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Random, uncommanded blind transfers
Hi Guys I've got a situation where an incoming call originated from a trunk provider will ring in a call center and be answered by an agent. Usually within 15 seconds of the incoming call being answered, it will randomly blind-transfer to another extension in the same call center. It is as if Asterisk is mis-reading some noise in-band as DTMF and doing the transfer, or the caller is emitting DTMF to transfer. An examination of CEL records for the relevant call shows the transfer taking place, but no party (the caller or callee) tried to transfer. The relevant queue application already has only small "t" in the parameter list (e. g. only let the called user - e. g. my agent inside - transfer the incoming call), thereby preventing the caller maybe emitting DTMF down the line and transferring at their behest. Yet the random, uncommanded blind transfers still take place, always withing about 15 seconds after call initiation in answering an incoming SIP call. We're using YeaLink SIP phones - T21P - got 17 branches, this only happens at 3 of them at random times. Same hardware and Asterisk versions (1.8.32.3) at all of them, same dialplans. Operating over about several years, about 10 000 000 incoming calls handled so far, and this only started happening now... dialplans are untouched for months. Any ideas, pointers, anybody encountered this before? Thanks -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] .gsm recordings corrupted when running Asterisk in virtual machine
Hi guys Has anybody encountered a situation where .gsm recordings are corrupted if the Asterisk instance is running in a virtual machine? Specifically running Asterisk in MS Azure cloud VMs on Centos 7 inside the hosted instance. Switching to .wav files solves the problem, I can only guess that .gsm encoding is very time sensitive or reliant on timer behaviour that cannot be guaranteed in a virtual instance. Is this assumption correct? Any pointers about how to make GSM encoding work right on a VM? Thanks! Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] CDR_TDS driver disappears - "does not provide a license key" on reload attempt
Hi All I have an Asterisk 1.8.32.3 instance that will at random intervals stop logging CDR data to MSSQL via FreeTDS. On investigation I'll find that the FreeTDS module has been unloaded somehow. It is not listed in cdr show status or show module like. Trying module load cdr_tds results in module cdr_tds does not provide a license key and the module is not loaded. The only way to get things working again is to kill Asterisk, and do a make install again. On restart, FreeTDS is back. Just replacing cdr_tds.so from a backup fails, Asterisk still won't load it. You have to replace the asterisk binary -and- the cdr_tds.so file - their sizes change as well, and a sha256sum when FreeTDS "does not provide a license key" varies for both the main asterisk binary and the cdr_tds.so module. I have this on multiple sites very far apart, different hardware, asterisk instances compiled at widely varying times. Anybody encountered this before? Thanks, -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] asterisk.conf ignored?
Hi all I'm trying to limit the maximum concurrent calls on my Asterisk to try and mitigate another problem I posted about earlier. I've edited /etc/asterisk/asterisk.conf And uncommented this line, and put a value of 60 in there: maxcalls = 60 in an effort to limit my Asterisk to 60 simultaneous calls. I did a core reload in the CLI after doing that. Any idea why my running instance totally ignores this setting? I still goes right ahead and services unlimited numbers of simultaneous calls - we have 90 extensions or so and it will happily service 90 simultaneous calls in spite of asterisk.conf clearly stating maxcalls = 60 The "maxload" specification is also ignored, load can go anywhere the Asterisk instance keeps taking more calls despite load exceeding, for example maxload = 10 in /etc/asterisk/asterisk.conf What am I doing wrong that the asterisk binary is apparently ignoring settings in /etc/asterisk/asterisk.conf? Thanks Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Asterisk sip_autodestruct messages - extensions locked
Hi guys Does anybody have any opinion on what causes tens of thousands of these messages per hour to pop up in the CLI: [Jun 30 14:24:59] WARNING[2209]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '7e9597ae6ce95fef23374f4b380a9b70@192.168.0.1:5060' with owner SIP/1148-0005bb2d in place (Method: BYE). Rescheduling destruction for 1 ms [Jun 30 14:25:01] WARNING[2209]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '6faefcc24547f1e774864ca87e3ff335@192.168.0.1:5060' with owner SIP/1028-0005bb3f in place (Method: BYE). Rescheduling destruction for 1 ms [Jun 30 14:25:02] WARNING[2209]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '0d64480f4052a9e9054153552f1af7ba@192.168.0.1:5060' with owner SIP/1412-0005bb5d in place (Method: BYE). Rescheduling destruction for 1 ms Symptoms are that an extension will dial, converse and hang up, but then be unable to dial for up to four minutes after the initial call that extension made - all the while thousands of the above messages scroll by in the CLI. Along with then hundreds of "too many calls" warnings for each extension which are limited to 1 call per extension at a time in sip.conf I've googled intensively, no AGI is being run, hangup literally calls Hangup(). I've already disabled and unloaded CDR-TDS, and ODBC CEL and CDR logging to MySQL (in case db issues are causing a lock or something when writing CDRs) I see on big G that many many people have had this issue, but nowhere is there any kind of concrete end result or answer to any of the questions. This has started to happen at our site this Monday... it comes and goes driven by no factor I can determine, except maybe workload. Server load average when this is going on is 8 in top for a quad-Core i7 machine with Centos 7 and 8GB of RAM, but the machine has hit 16 as load avg without this happening. It also sometimes happens with the load average at 4 or less... The particular server has been running undisturbed for about three years and has handled tens of millions of calls, and only this Monday started exhibiting this behaviour. The dialplan was last changed about three months (and about 3 million calls) ago. Any body got ANY advice or ideas where I can begin to diagnose this? Thanks, Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] ODBC locks warning in CLI - Asterisk 1.8.32.3
Hi all Just to report back if it is of interest to anybody, I managed to solve this. Had nothing to do with Asterisk, rather with Percona 5.6 / MySQL which is the database used via ODBC from Asterisk to store CELs and CDRs. I added the following in the /etc/my.cnf file for the Percona instance I am running: innodb_lock_wait_timeout=120 transaction-isolation=READ-COMMITTED and restarted the Percona instance. This appears to have definitively removed the below warning from my Asterisk instance's CLI. Using READ-COMMITTED (instead of the default REPEATABLE-READ) transaction isolation level apparently has optimised InnoDB table row locking (at least in my use case, Percona / MySQL version and load) to such a degree that I no longer see the warning below come up. Everything is still reliably logging as far as I can determine, and all my MySQL stored procedures which process my CDRs and CELs into useful form for my dialing back-end are still working fine. Just in case somebody can be helped by this. >Hi all >I get this warning in the Asterisk CLI about once every ten minutes or so: >[Nov 23 14:47:36] WARNING[2544]: res_odbc.c:647 ast_odbc_prepare_and_execute: SQL Execute returned an error -1: HY000: [MySQL][ODBC 5.1 Driver][mysqld-5.1.73]Deadlock found when trying to get lock; try restarting transaction (105) [Nov >23 14:47:36] WARNING[2544]: res_odbc.c:659 ast_odbc_prepare_and_execute: SQL Execute error -1! Verifying connection to cdr [asterisk-cdr]... >[Nov 23 14:47:36] WARNING[2544]: res_odbc.c:763 ast_odbc_sanity_check: Connection is down attempting to reconnect... >[Nov 23 14:47:36] NOTICE[2544]: res_odbc.c:1541 odbc_obj_connect: Connecting cdr [Nov 23 14:47:36] NOTICE[2544]: res_odbc.c:1573 odbc_obj_connect: res_odbc: Connected to cdr [asterisk-cdr] >Does this imply that I'm missing the ODBC CELs and / or CDRs that were trying to write to MySQL over ODBC when the above occurred? >Or will the ODBC module in Asterisk (or ODBC itself?) recover gracefully and re-emit the CEL or CDR insert that hit the lock and were therefore NOT written to MySQL? >Thanks, >Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Subject: Re: ODBC locks warning in CLI - Asterisk
Hi Jonathan Thx for the reply. Yup, have tried them, may just be our incompetence and inexperience with Asterisk, but cannot get either of them to work right with our particular setup. Due to legacy issues we run very different dialplans at 17 different sites, and some in-house custom software for Asterisk, and from testing 13 and 14 it appears each and every one of the sites will need custom rebuilding and redesigning to work right with the newer versions. We also use different hardware (DAHDI wise) at each site, different, -very- old PRI cards manufactured by different companies, etc. Plus, been monitoring the group closely for about two years now, the problems and bugs apparent with 13 and 14 (some of which were solved, granted) are spine chilling - if we run into some of the issues I've seen around, our business will collapse. PJSIP especially appears to be an absolutely horrendous nightmare - extremely complex and difficult to configure for the type of situations we have where 1.8.32.3 has been doing fine for years, over several tens of millions of calls. But just my two cents, I could be completely wrong - if I can put the below issue to bed definitively, the people I report to will probably stay on standard 1.8.32.3 till it can no longer be compiled in a whenever-contemporary Linux / libc / gcc environment... >It might be worth pointing out that 1.8x was released 6 years ago, went into security fix only over 2 years ago, and reached "end of life/no further fixes" over a year ago. >11.x went into "security fix only" last month - 13 and 14 are the current versions - can you try with them? On 23 November 2016 at 12:52, Stefan Viljoen <viljo...@verishare.co.za> wrote: > Hi all > > I get this warning in the Asterisk CLI about once every ten minutes or so: > > [Nov 23 14:47:36] WARNING[2544]: res_odbc.c:647 > ast_odbc_prepare_and_execute: SQL Execute returned an error -1: HY000: > [MySQL][ODBC 5.1 Driver][mysqld-5.1.73]Deadlock found when trying to > get lock; try restarting transaction (105) [Nov 23 14:47:36] > WARNING[2544]: res_odbc.c:659 > ast_odbc_prepare_and_execute: SQL Execute error -1! Verifying > connection to cdr [asterisk-cdr]... > [Nov 23 14:47:36] WARNING[2544]: res_odbc.c:763 ast_odbc_sanity_check: > Connection is down attempting to reconnect... > [Nov 23 14:47:36] NOTICE[2544]: res_odbc.c:1541 odbc_obj_connect: > Connecting cdr [Nov 23 14:47:36] NOTICE[2544]: res_odbc.c:1573 > odbc_obj_connect: res_odbc: > Connected to cdr [asterisk-cdr] > > Does this imply that I'm missing the ODBC CELs and / or CDRs that were > trying to write to MySQL over ODBC when the above occurred? > > Or will the ODBC module in Asterisk (or ODBC itself?) recover > gracefully and re-emit the CEL or CDR insert that hit the lock and > were therefore NOT written to MySQL? > > Thanks, > > Stefan > > > > > > > > -- > _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: >http://lists.digium.com/mailman/listinfo/asterisk-users -- Message: 3 Date: Wed, 23 Nov 2016 20:58:52 +0200 From: christopher kamutumwa <chriskamutu...@gmail.com> To: asterisk-users <asterisk-users@lists.digium.com> Subject: [asterisk-users] Asterisk Installation Message-ID:
[asterisk-users] ODBC locks warning in CLI - Asterisk 1.8.32.3
Hi all I get this warning in the Asterisk CLI about once every ten minutes or so: [Nov 23 14:47:36] WARNING[2544]: res_odbc.c:647 ast_odbc_prepare_and_execute: SQL Execute returned an error -1: HY000: [MySQL][ODBC 5.1 Driver][mysqld-5.1.73]Deadlock found when trying to get lock; try restarting transaction (105) [Nov 23 14:47:36] WARNING[2544]: res_odbc.c:659 ast_odbc_prepare_and_execute: SQL Execute error -1! Verifying connection to cdr [asterisk-cdr]... [Nov 23 14:47:36] WARNING[2544]: res_odbc.c:763 ast_odbc_sanity_check: Connection is down attempting to reconnect... [Nov 23 14:47:36] NOTICE[2544]: res_odbc.c:1541 odbc_obj_connect: Connecting cdr [Nov 23 14:47:36] NOTICE[2544]: res_odbc.c:1573 odbc_obj_connect: res_odbc: Connected to cdr [asterisk-cdr] Does this imply that I'm missing the ODBC CELs and / or CDRs that were trying to write to MySQL over ODBC when the above occurred? Or will the ODBC module in Asterisk (or ODBC itself?) recover gracefully and re-emit the CEL or CDR insert that hit the lock and were therefore NOT written to MySQL? Thanks, Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Asterisk 11.24.1 garbled audio
Date: Tue, 15 Nov 2016 17:52:07 +0100 From: OlivierTo: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Asterisk 11.24.1 garbled audio Message-ID: Content-Type: text/plain; charset="utf-8" >Hi, >How can I double check which timer is currently is use in a running system ? >core show settings doesn't tell anything, if I'm not mistaken. How about module show like timi ? I use DAHDI timing, and this command on my system it shows: module show like timi Module Description Use Count res_timing_dahdi.soDAHDI Timing Interface 147 1 modules loaded To get this in my modules.conf I specify (among other things): load => res_timing_dahdi.so noload => res_timing_pthread.so noload => res_timing_timerfd.so I'm using 1.8.32.3, but should apply to you as well. Using DAHDI timing as I have had extensive problems under a heavily loaded system with both pthread and timerfd timing. Not sure if this still applies on your more recent Asterisk version though, but anyway - this is how you should be able to see what timing is being used on a running system. Regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] 1.8.32.3 - billsec field does not not increment after call answer - what triggers it? (Joshua Colp)
Hi Joshua Thanks for the response. Interesting that you mention that toll-free numbers can do this, this problem trunk happens to receive calls from the national telecoms provider here (Telkom SA) sourced from a toll-free number. The SIP trunk provider has ported that toll free state telecoms company number for us to a local trunk number with which we authenticate as a SIP peer. (Not sure if what Telkom here in South Africa define as "toll free" on a technical level match what you mention as "toll free" on an American / United States model.) The thing is the number stays in the unanswered state (while in fact answered and working perfectly) for the entire duration of the call, so then it appears 200 OK is not received for the invite. I therefore assume that the actual RTP negotiation process does NOT need the 200 OK for the invite, for the call itself is fine - it is just that Asterisk never "realises", as regards the CDR, that the call was in fact answered. At least it is working and audio flows back and forth. I'll see if I can come up with a SIP trace. Thank you! --- Stefan Viljoen wrote: > > Only this one trunk consistenly has this problem for all calls received over > it. The trunk provider is using sippy on their side. > > What setting / config option for the particular SIP "problem trunk" have my > trunk provider changed on their side to stop Asterisk from recognising that > a call has been answered when it comes in over that trunk? > > It appears some SIP traffic is not being sent by them (or not received by my > Asterisk) that indicates to it a call has been ANSWERED and that it must > start the billsec timer? I can't really speak for the provider but some numbers will stay in inband progress (unanswered) for a bit. Some toll-frees for example. The specific SIP message that would show it as answered would be a 200 OK to the INVITE we sent though. If you provided the SIP log then we could see. Cheers, -- Joshua Colp -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] 1.8.32.3 - billsec field does not increment after call answer - what triggers it?
Hi Guys I've got a strange problem - on my asterisk instance, when a call starts to ring, I do core show channel and I get the usual output with the duration and billsec fields included. For most of my calls, things are normal, e. g. duration field starts incrementing as the SIP phone rings, and the moment it is answered / the call goes offhook the duration timer continues running, and the billsec timer starts up. Disposition goes from NO ANSWER to ANSWERED the moment billsec starts incrementing. However, for certain calls from a certain SIP trunk provided by a local trunk provider, this never happens. E. g. the call comes in on this "problem trunk" and duration timer starts running - RTP starts and the call is totally normal, both parties have crystal clear bi-directional audio and the call records correctly - but the billsec timer never starts incrementing and forever remains at 0. Disposition forever remains at NO ANSWER - even though the call is in progress and has been answered, and is working perfectly. Other calls from other trunks provided by the same provider on the same logical and physical Asterisk instance work correctly - if the call is answered, it becomes ANSWERED in "core show channel" display, and the billsec timer starts incrementing. Only this one trunk consistenly has this problem for all calls received over it. The trunk provider is using sippy on their side. What setting / config option for the particular SIP "problem trunk" have my trunk provider changed on their side to stop Asterisk from recognising that a call has been answered when it comes in over that trunk? It appears some SIP traffic is not being sent by them (or not received by my Asterisk) that indicates to it a call has been ANSWERED and that it must start the billsec timer? Thanks! Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Proper way to start Asterisk on CentOS 7? (Carlos Chavez)
Hi Carlos I have experienced something similar starting Asterisk 1.8.32.3 on Centos 7 on commodity / whitebox hardware. The problem was that Asterisk was starting "too quickly" in the systemd startup sequence, before the required services it needs to run were up and ready. I eventually came up with this systemd script to start it, and this now starts Asterisk on all our our new Centos 7-using deployments. Maybe you can try it out...? This starts our Asterisk 1.8 instances without problems on Centos 7 on boot: -- [Unit] Description=Asterisk After=network.target After=network-online.target After=startup.service After=mysql.service Wants=mysql.service [Service] Type=idle User=root Group=root ExecStart=/usr/sbin/asterisk -f ExecStop=/usr/sbin/asterisk -rx 'core stop now' ExecReload=/usr/sbin/asterisk -rx 'core reload' TimeoutSec=300 LimitCORE=infinity LimitNOFILE=8096 Restart=always RestartSec=4 [Install] WantedBy=multi-user.target -- I place this in /etc/systemd/system as "asterisk.service" and then install it via systemctl enable asterisk.service Hope this helps. Stefan - Message: 1 Date: Thu, 5 May 2016 12:07:37 -0500 From: Carlos ChavezTo: "asterisk-users@lists.digium.com" Subject: [asterisk-users] Proper way to start Asterisk on CentOS 7? Message-ID: <572b7dd9.4090...@telecomabmex.com> Content-Type: text/plain; charset=utf-8; format=flowed I am having a strange problem with Asterisk 13 on a CentOS 7 plataform. I have several servers running on this configuration but a particular installation on a Dell PowerEdge 220 server is the one giving me the most problems. All installations are automated via a script so there is no difference but the hardware. All dependencies are installed and there are no errors during installation. We use realtime mysql for our configurations. The problem comes when Asterisk is started from init.d/asterisk. Asterisk loads but phones will not register and the Asterisk CLI will not respond to commands. Something like "pjsip show endpoints" shows nothing and sometimes the CLI hangs. Asterisk itself is not crashing and if I open another terminal I can get into the CLI even though the other terminal is not responding. If I start Asterisk manually from the command line everything works as expected, phones register and calls flow. I tried a systemd startup script someone published but I get the same result as the initd script. I wonder why I am only getting this problem on the Dell 220 server but not on other servers (even a Dell T20 server does not have the same problem). My office server is an HP ML110 and has been working with Asterisk 13 and CentOS 7 for over 6 months now with no issues. It uses the init.d script that comes with Asterisk and it has never hanged. Anyone know if the PowerEdge 220 server has special issues with Linux or Asterisk in particular? How do you recommend starting Asterisk? -- Telecomunicaciones Abiertas de M?xico S.A. de C.V. Carlos Ch?vez +52 (55)9116-91161 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Best timing source? (Carlos Chavez)
Hi Carlos We had similar issues with Asterisk 1.8.11.0 and Asterisk 1.8.32.2 with timerfd and pthread timing. The server instance would run for 20 or 30 minutes and then producde legions of error lines about timerfd or pthread, whichever we were using. The symptoms were voice quality issues - jitter and packet drops spiked alarmingly during periods where these errors about timterFD and pthread were being emitted. This was also on Centos 7. The solution in our case was two fold. - We switched from Asterisk 1.8.11.0 to Asterisk 1.8.32.2 This was step one - since when we used timerfd or pthreads with 1.8.32.3 (even though it was much newer than 1.8.11.0) we STILL had the problem. - Once on Asterisk 1.8.32.2, we also switched to DAHDI timing This was step two - when we did this as well, the problems with voice quality and the tens of thousands of error messages disappeared from the console and it has been running fine for months since, done about 800 000+ calls so far. The interesting thing is we have no DAHDI hardware in that system, or any of the other systems (we run 17 Asterisk instances on Centos 7 real-metal machines countrywide) where we use DAHDI timing. AFAIK the DAHDI timer is then emulated in software in the res_timing_dahdi.so module. So it is not that it is "better" but the upgarding to 1.8.32.2 and using DAHDI timing definitely solved our voice quality problems along with making the constantly repeated timing error messages we were seeing in the console go away. Kind regards, On 4/5/16 3:17 PM, Joshua Colp wrote: > Carlos Chavez wrote: >> I am currently having a voice quality problem with one of our >> Asterisk servers. We have checked the network and we have found no >> problems that could cause the voice to sound cracked and with small >> interruptions. I am looking at the timing source for Asterisk and it >> is currently using timerfd even though we have an E1 card installed. >> Is timerfd better than dahdi? Any recommendations to test if timing >> may be a problem for voice quality and DTMF? > > What is the scenario and the channels involved? Timing is only used > for things such as playback, music on hold, and ConfBridge. If it's > strictly a two party call then Asterisk forwards media as received. > I am starting to think that the problem may be in the server hardware itself. We are using a Dell R220 with 8gb of ram and 2 hard disks in a Raid 1 configuration (Linux Raid). We are using CentOS 7. We had to remove the raid card from the server to install an E1 card (the raid card was Windows only so no loss there really). Internally everything sounds good (from E1 to a conference or music) but once you hit a network interface we start getting pops and drops. Anyone with this server and Asterisk ever had issues like these? -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CEL entries over ODBC several hours late (Vinicius Fontes)
Hi Vinicius Thanks for replying. >Sorry for the probably obvious question, but it's better to cover all bases. >The DBMS is running on the same box as Asterisk is? If that's the case then maybe the DBMS is using too much CPU and starving Asterisk? I don't think so - I think I have a locking issue in the DB specifically with my stored procedure -and- Asterisk trying to access the CEL table simultaneously. Load averages appear normal even if the DB is running in the background. The autodestruct problem occurs whenever the CEL table (InnoDB, so should NOT be locked for inserts while being queried in MySQL "nolock" equivalent, but it IS) is busy being read by the SP and Asterisk tries to write into it. This then back-flows to the Asterisk and delays the H extension execution to such a degree that handsets get locked tight until the CEL table lock held by the SP is released and Asterisk can write to it again over ODBC. I understand that CEL logging and call hangup should be an atomic operation (billing related) from there though the question about why it apparently (from observed effects) is a synchronous operation - but considering it must be atomic, it does make sense I suppose to write CELs synchronously with call teardown. It just requires that you keep the CEL table in MariaDB (or whatever) in an "un-locked" state at all times - which makes it pretty hard since to have any practical use out of the CEL table you should be able to query it without locking it - which InnoDB in MariaDB is supposd to provide, but clearly does not in my type of setup here. Anyway, thanks for the reply. Regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CEL entries over ODBC several hours late (Matthew Jordan)
Hi Matthew Thank you very much for the reply. I must have something seriously wrong somewhere else then - I retested now and the "apparent" effect is as I describe but your info definitely contradicts that. But you're obviously correct. One more question - I've noted that if I run a combination of queries in the CEL backing DB (MariaDB) and the CEL table is locked, this severely affects the Asterisk instance - thousands of occurrences of chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '6a9f5d3543b619655e07c81437373a32@172.17.12.3:5060' with owner SIP/3034-000207c8 in place (Method: BYE). Rescheduling destruction for 1 ms appear in the CLI and users complain that if they hang up then they cannot make another call on the same SIP handset for several minutes. This is obviously because the dialplan gets delayed in the H extension, and cannot write to the CEL table, waiting for the MariaDB instance to clear the locks so it can write again. The above apparently comes from a watchdog process that watches how "fast" the H extension is and if it takes "too long" it forces the channels closed. Is this assumption correct? Addtionally, it seems that the writing of CEL in Asterisk is NOT async? E.g. it appears the thread that was running the conversation ALSO does the CEL writing / pushing to the CEL core as you describe in a synchronous manner. For 1.8, is this correct that CELs are synchronous, and do newer Asterisk versions do it async? E. g. my point being if there are major DB issues, it is quite a bit kryptonite to have that "spill back" into Asterisk and start blocking off users from calling out - wouldn't it be much better to simply have failed CEL writes just die in a distal thread instead of the main call thread for the channels running on that handset. Or am I completely misunderstanding things? Anyway, thanks for the reply. :) Kind regards, > Hi guys > > I'm running 1.8.32.3 with CEL logging over ODBC to MariaDB 5.5.41 on the > same Centos 7 machine. > > I've noticed that the CDR entries made are all in-time, e. g. the call will > take place and the CDR entry is immediately written into the CDR table in > the MariaDB database. > > However, CEL events for that CDR (which I need to process for a realtime > display feature in my dialer software) are always several hours after the > fact. E. g. I will make a call at 09:30, see the call immediate pop up in > the MariaDB CDR table, but only at about 15:15 that afternoon will I see > that call's CEL events come into the CEL table, from Asterisk I have > examined the `show processlist` in MariaDB exhaustively to establish this > fact. > > The system doesn't appear loaded, load average is about 1.1 - it's a > quad-coare HT Intel Xeon E3-1225 with 8GB of DRAM running on an SSD for > main > storage. > > The system processes about 30 000 calls every 8 hour day, and services 90 > SIP phones. > > I can stop and restart the MariaDB instance for several minutes, when I > restart it it immediately picks up on the "slow" CELs from where it was > interrupted - more evidence that Asterisk is very slowly streaming the CELs > through. I thought MariaDB was the bottleneck, but apparently not? > > If I make test inserts from a script into the CEL table, all of them > complete so quickly a time indication does not even register for the query > in MariaDB. Simple test queries on the CEL table are also instant, not even > counting in the internal MariaDB query duration timer. > > Can anybody explain why this is that the CELs asterisk emits over ODBC are > so delayed? Are CELs intended NOT to be realtime? > > So, logically, Asterisk appears to be caching CELs to the tune of hundreds > of thousands of them at any given time - meaning if it is stopped (either > killed, or core stop gracefully'ed, or just "core stop now") potentially > hundreds of thousands of CELs will just evaporate irretrivably. > > What can I do to mitigate this extremely slow populating of CELs over ODBC? > > Asterisk does not buffer CEL entries. If anything, it pushes the entries out to ODBC much more aggressively than what you would get with CDRs. An event is generated in Asterisk that corresponds to the CEL entry. That entry is pushed over a message bus (the 'event' message bus in 1.8 - 11; 'stasis' in 12+) and is picked up by the CEL core. The events are immediately sent to the registered backends, who also immediately write it out to the backend they support. In the case of ODBC, this immediately does an INSERT into the appropriate table. In Asterisk 1.8, you can look for a verbose level 11 message that will show when this occurs: ast_verb(11, "[%s]\n", ast_str_buffer(sql)); In later versions, this was turned into a debug level 3 message (as anything over a verbose 5/debug 5 was cleaned up). If you see that message, then that will tell you when Asterisk *believes* it has written the CEL entry. If that doesn't show up in the database, then it is either in the ODBC
[asterisk-users] CEL entries over ODBC several hours late
Hi guys I'm running 1.8.32.3 with CEL logging over ODBC to MariaDB 5.5.41 on the same Centos 7 machine. I've noticed that the CDR entries made are all in-time, e. g. the call will take place and the CDR entry is immediately written into the CDR table in the MariaDB database. However, CEL events for that CDR (which I need to process for a realtime display feature in my dialer software) are always several hours after the fact. E. g. I will make a call at 09:30, see the call immediate pop up in the MariaDB CDR table, but only at about 15:15 that afternoon will I see that call's CEL events come into the CEL table, from Asterisk I have examined the `show processlist` in MariaDB exhaustively to establish this fact. The system doesn't appear loaded, load average is about 1.1 - it's a quad-coare HT Intel Xeon E3-1225 with 8GB of DRAM running on an SSD for main storage. The system processes about 30 000 calls every 8 hour day, and services 90 SIP phones. I can stop and restart the MariaDB instance for several minutes, when I restart it it immediately picks up on the "slow" CELs from where it was interrupted - more evidence that Asterisk is very slowly streaming the CELs through. I thought MariaDB was the bottleneck, but apparently not? If I make test inserts from a script into the CEL table, all of them complete so quickly a time indication does not even register for the query in MariaDB. Simple test queries on the CEL table are also instant, not even counting in the internal MariaDB query duration timer. Can anybody explain why this is that the CELs asterisk emits over ODBC are so delayed? Are CELs intended NOT to be realtime? So, logically, Asterisk appears to be caching CELs to the tune of hundreds of thousands of them at any given time - meaning if it is stopped (either killed, or core stop gracefully'ed, or just "core stop now") potentially hundreds of thousands of CELs will just evaporate irretrivably. What can I do to mitigate this extremely slow populating of CELs over ODBC? Thanks -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] 1.8.32.3 - no timing indicated, tens of thousands of __sip_autodestruct error messages
Hi list Just to let everybody know I think I've got to the bottom of the above problem / error. Turns out that the issues described in my previous post were caused by problems in an MSSQL database that the Asterisk 1.8.32.3 instance was writing to...! Once I dropped the FreeTDS driver (while trying to diagnose what was going on) the Asterisk instance immediately started performing normally and the __sip_autodestruct error messages disappeared. Channels linked to calls that were hung up closed normally once again and everything was golden. The problem on MSSQL turned out to be that some of the indices on the table to which the Asterisk instance was writing required rebuilding as the table had grown immensely since the Asterisk instance was created. The issue was that an insert that would have normally taken about 500 milliseconds was now taking up to 30 seconds to a minute. Therefore as a call is finished Asterisk attempted to write the call into the CDR database but was extremely delayed due to slow database performance. The __sip_autodestruct error messages apparently is a watchdog thread / process that then detects that channels that should be closed and gone have not been closed / disposed - it then posts a warning and then later tries to close the channels involved, which are still hanging around after the call they are linked to has finished. This had the effect that users could only make one call, then had to wait until the channels disappeared (sometimes up to a minute later as the DB managed to finish inserting that call's details in to the table with the index problems) before they could make a second call, while the above watchdog process complained loudly about channels that were hanging around that should not be as Asterisk waited for MSSQL. So the fix was simply to rebuild the indexes on the relevant tabe in MSSQL - this definitively solved the problem and tens of thousands of calls have now been made after the reindex in MSSQL and everything is fine. This is interesting as it seems that Asterisk does NOT use FreeTDS asynchronously, but synchronously as calls progress... Anyway, hope this helps someone who runs into something similar - the databases you touch from the CDR subsystem in Asterisk must be -FAST- and able to be inserted into in milliseconds. Apparently anything taking a second or more in a FreeTDS accessed DB linked to Asterisk can start causing problems in Asterisk itself. Regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] 1.8.32.3 - no timing indicated, tens of thousands of __sip_autodestruct error messages
Hi all I'm running a 1.8.32.3 instance of Asterisk on Centos 7. About 80 SIP phones connected. I'm getting tens of thousands of error messages in the CLI, and callers are having extreme difficulty dialing, they can dial once and then if they try to dial again their extension is shown as busy. The server has been running for a year and a half, until this Wedenesday. When I encountered this problem I then replaced the server with a new physical machine with the same version of Asterisk that has been working for the past year. E. g. the hardware on the server is completely new, still having the exact same problem as with the older server. This is what is appearing in the CLI: [Oct 30 11:02:16] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '702825cb5d9de4fc6a29675f158f000f@192.168.1.2:5060' with owner SIP/centra-out-0140 in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:02:24] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '18eea85e1c27f2fd533586452b41f9a7@172.7.1.3:5060' with owner SIP/3088-01b0 in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:02:37] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '4004649c0c903ee1676f5b5c2d47e0eb@172.7.1.3:5060' with owner SIP/3055-0137 in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:02:39] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '3dbbe75d30e0c7bd72ddf69716be8806@192.168.1.2:5060' with owner SIP/centra-out-01b1 in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:02:40] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '2ff26c957b75c41f11b6523c7c53a134@192.168.1.2:5060' with owner SIP/centra-out-00cb in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:02:40] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '1627933358aec1323968a60564e76d1a@172.7.1.3:5060' with owner SIP/3065-00ca in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:02:43] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '41a753fb01f16d5f0d366a314495685b@192.168.1.2:5060' with owner SIP/centra-out-0138 in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:02:46] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '1d90ffab7a7241d9236bd3816a9889fd@172.7.1.3:5060' with owner SIP/3054-013f in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:02:48] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '702825cb5d9de4fc6a29675f158f000f@192.168.1.2:5060' with owner SIP/centra-out-0140 in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:02:56] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '18eea85e1c27f2fd533586452b41f9a7@172.7.1.3:5060' with owner SIP/3088-01b0 in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:02:59] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '47c4a97d2d1a85e95c85a5b42ba9c27f@172.7.1.3:5060' with owner SIP/3008-01d2 in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:03:00] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '32fe9add31a3305674bca7e108ff9746@172.7.1.3:5060' with owner SIP/3014-01d7 in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:03:03] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '72e37d2a700418d12c9e5a2e645f5993@172.7.1.3:5060' with owner SIP/3061-01d5 in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:03:09] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '4004649c0c903ee1676f5b5c2d47e0eb@172.7.1.3:5060' with owner SIP/3055-0137 in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:03:11] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '3dbbe75d30e0c7bd72ddf69716be8806@192.168.1.2:5060' with owner SIP/centra-out-01b1 in place (Method: BYE). Rescheduling destruction for 1 ms [Oct 30 11:03:12] WARNING[16831]: chan_sip.c:4057 __sip_autodestruct: Autodestruct on dialog '2ff26c957b75c41f11b6523c7c53a134@192.168.1.2:5060' with owner SIP/centra-out-00cb in place (Method: BYE). Rescheduling destruction for 1 ms If I do asterisk*CLI>module show like timing I get module show like timing Module Description Use Count res_timing_dahdi.soDAHDI Timing Interface 0 asterisk*CLI> My modules.conf specifies that only dahdi timing. I have never seen any of my other 17 Asterisk servers at other sites showing NO use of ANY timing interface... What does these __sip_autodestruct messages mean? How can I fix this problem? Calls in
Re: [asterisk-users] 786 000 files limit Centos 7 - Asterisk (Stefan Viljoen)
Hi List Regarding this Asterisk instance as discussed previously (Asterisk 1.8.11.0) that was consuming enormous amounts of file descriptors (100 000+ for about 50 simultaneous calls) it appears I have managed to solve my problem by upgrading the 1.8.11.0 Asterisk instance to an 1.8.32.3 Asterisk instance. Also, the file descriptors apparently leaking were paired with timer problems in 1.8.11.0 whenever I went above about 50 concurrent calls on the box while running on 1.8.11.0. The thing is in our setup we have about 15 instances of 1.8.11.0 at the various branches of the company, all running 1.8.11.0, BUT at none of these sites do we ever exceed 40 simultaneous calls. The defining factor was (in our case, with our dialplan) to run 1.8.11.0 and try to run 50+ concurrent calls. What would happen was that thousands of these messages would come up in the CLI: [Aug 13 09:41:38] ERROR[25193]: res_timing_dahdi.c:89 dahdi_timer_set_rate: Failed to configure DAHDI timing fd for 0 sample timer ticks when we reached or exceeded 50 calls. The same happened whether pthread timing or kernel timerfd timing was used. Several other weird errors would manifest in the CLI, to whit: --- format_gsm.c:102 gsm_write: Bad write (32/33): Destination address required [Aug 12 12:23:33] WARNING[29436]: channel.c:1474 __ast_queue_frame: Exceptionally long voice queue length queuing to Local/number@local-3E1C;1 WARNING[8210]: res_rtp_asterisk.c:1773 ast_rtcp_read: RTCP Read error: Bad file descriptor. Hanging up. [Aug 12 09:56:55] WARNING[29931]: file.c:198 ast_writestream: Translated frame write failed --- when we were spamming the timer errors. Practical effects were dropped calls, calls with bad quality / what sounds like severe jitter, and mixmonitor recording files that were not written or corrupt. The solution (so far, still checking) was simply to upgrade to 1.8.32.0 and most of our problems disappeared, for us in our setup, with our dialplans. The upgrade was painless, since we stayed in the 1.8 range, we did not have to modify any of our config files or dialplans. Maybe this can assist someone else struggling with older 1.8 series timer issues. Regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] One way audio - doesn't seem to be NAT issue
Hi D'Arcy that the server IP for RTP as specified in the initial SIP is correct? Both the server and client are outside of NAT so I don't know what this might mean. They both have public IPs. This was a problem we had when the RTP server negotiated in SIP with our VOIP ITSP on one side of the connection, differed from the IP we were expecting on that side of the connection and was blocked in our firewall. Once we perused the SIP traffic we noted this and added the extra IP to the firewall for RTP traffic. We had slightly different parameters, e. g. that we would have no RTP at all, but a call that did connect to total silence, dialed from either side. Was NAT involved? Yes, NAT was being done at both ends, but it turned out that NATing was not the problem. Also check what RTP port ranges are being used - I have had this one-directional problem where the port range in /etc/asterisk/rtp.conf was too broad, and the firewall on my server was only allowing a smaller subset of RTP ports. rtpstart=1 rtpend=2 which is exactly what my packet filter allows through. I assume you have tried turning your packet filter or firewall off completely (just for a moment) to see if it helped? -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] One way audio - doesn't seem to be NAT issue
Hi D'arcy Have you checked your RTP port ranges (I'm sure you have), and also that the server IP for RTP as specified in the initial SIP is correct? Not sure how this will relate to your setup, but we had something similar here using Asterisk 1.8.11.0 on both sides of the connection, via a VOIP service provider in the middle. We had slightly different parameters, e. g. that we would have no RTP at all, but a call that did connect to total silence, dialed from either side. We subscribe to two trunk numbers provided by the VOIP service provider at each site in Asterisk. It turned out after carefully looking at the SIP flowing back and forth that the service provider was providing an RTP server IP that specified not the same IP as the SIP server (which is their standard practice) but a -different- RTP server IP. Due to the routing we have, neither system on either side of the SIP negotiated call could send packets to this new RTP server IP. We therefore added a route that specifically allowed that new RTP server IP to be reached by both machines on both sides of the VOIP service provider link. So can you carefully check that the SIP-negotiated RTP streams are going to IPs that are reachable in BOTH directions? Also check what RTP port ranges are being used - I have had this one-directional problem where the port range in /etc/asterisk/rtp.conf was too broad, and the firewall on my server was only allowing a smaller subset of RTP ports. E. g. /etc/asterisk/rtp.conf specified 1 - 5 as allowable RTP ports, but my firewalld firewall under Centos was only allowing 1 - 2 - so I'd regularly get that my SECOND call to test the server would have audio in one direction - because Asterisk was allocating an RTP port on one side of the SIP call that was outside the range my firewalld was allowing. It might require some careful tracing of SIP messages, maybe you can try this? Specifically try to determine what RTP port number is being negotiated when you have your zero-audio back from the remote party - what RTP port and RTP server IP is he using at that moment on his side? Is that port allowed through all the PPP / network segments between you? Is the IP / IPs between you used to transfer RTP reachable from his side? Message: 1 Date: Tue, 11 Aug 2015 15:10:44 -0400 From: D'Arcy J.M. Cain da...@vex.net To: Asterisk Users Mailing List - Non-Commercial Discussion asterisk-users@lists.digium.com Subject: [asterisk-users] One way audio - doesn't seem to be NAT issue Message-ID: 20150811151044.79872ce9@imp Content-Type: text/plain; charset=US-ASCII Given that both of us can make and accept calls and the server is simply connecting two separate channels I can't see where the problem might lie. Can anyone suggest a possible setup issue? I have tried so many things but I am willing to try them again. Feel free to make any suggestion no matter how silly. I really need to fix this. Cheers. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] 786 000 files limit Centos 7 - Asterisk
Hi Tony Thanks again for replying. Ok, I've set the SYSMAXFILES and MAXFILES in the script, hopefully it will have an effect. Kind regards, Message: 12 Date: Tue, 11 Aug 2015 16:50:29 + (UTC) From: t...@softins.co.uk (Tony Mountifield) To: asterisk-users@lists.digium.com Subject: Re: [asterisk-users] 786 000 files limit Centos 7 - Asterisk keepcomplaining Message-ID: assp.06651285b6.mqd94l$qb1$1...@softins.softins.co.uk In article 002b01d0d414$36af31b0$a40d9510$@verishare.co.za, Stefan Viljoen viljo...@verishare.co.za wrote: Anybody else ran into this? No, but I would ask myself why so many file descriptors are being used. It sounds like you have a file descriptor leak (not being closed when finished with). Hi Tony Thanks for replying. I suspected something like that, though repeatedly running lsof | wc -l Always stays quite low - 100 000 open files, which is still 8 times less than the system maximum as confirmed by running ulimit -n From what you said below, the above is probably not relevant... SOMETHING NEW I have now ran /usr/bin/prlimit --pid `pidof asterisk` and I have noticed that even though I have 800 000 files specified, the ACTUAL limit in place on Asterisk for numbers of files is only 1024?! Yes, this is likely. Have a look in /usr/sbin/safe_asterisk, at the commented-out settings for SYSMAXFILES and MAXFILES, and try setting those. Cheers Tony -- Tony Mountifield Work: t...@softins.co.uk - http://www.softins.co.uk Play: t...@mountifield.org - http://tony.mountifield.org -- ___ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users End of asterisk-users Digest, Vol 133, Issue 13 *** -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] 786 000 files limit Centos 7 - Asterisk
Hi Markus Thanks for the reply, I have set those files previously as well... It seems the problem for me is on my Centos 7 box that the Asterisk binary does not know that these are the limits, and imposes a 1024 open file limit count for some reason. It seems using prlimit to force the running binary to use a higher file limit is working - but it has to be done manually each time the asterisk process is started, the prlimit cronjob I set up to force the file limit higher does not seem to work - you have to physically type in /usr/bin/prlimit --pid `pidof asterisk` --nofile=786000:786000 and running that from a script (As root) doesn't seem to work. Anyway, thanks for the advice and taking the time to reply. Kind regards, Message: 11 Date: Tue, 11 Aug 2015 18:29:01 +0200 From: Markus Weiler markus_wei...@mailworks.org To: asterisk-users@lists.digium.com Subject: Re: [asterisk-users] 786 000 files limit Centos 7 - Asterisk keep complaining Message-ID: 55ca22cd.4060...@mailworks.org Content-Type: text/plain; charset=windows-1252; format=flowed Hi Stefan, we ran into a similar problem using Debian. There we are able to check the current limits using: pidof asterisk - 23351 cat /proc/23351/limits Output: Limit Soft Limit Hard Limit Units Max open files1024 1024 files I think that in the end /etc/security/limits.conf * hardnofile 50 * softnofile 50 root hardnofile 50 root softnofile 50 did the trick. We also tried vi /etc/sysctl.conf fs.file-max = 50 not sure what the solution in the end was. But I remember rebooting was important. Markus Am 11.08.2015 um 11:00 schrieb Stefan Viljoen: Anybody else ran into this? No, but I would ask myself why so many file descriptors are being used. It sounds like you have a file descriptor leak (not being closed when finished with). Hi Tony Thanks for replying. I suspected something like that, though repeatedly running lsof | wc -l Always stays quite low - 100 000 open files, which is still 8 times less than the system maximum as confirmed by running ulimit -n I also note that this number will increase to about 125 000 but never go higher than that, then, as calls hang up, decreate again - during times when the CLI is spammed with 100s of broken pipe errors due to insuffiecient file descriptors, this number never reaches beyond 125 000 out of the available 800 000 open files. You might also want to look at the output of lsof (or at least some of it) to see what all these file descriptors are pointing to, and whether it is indeed Asterisk that is consuming them. If I grep by asterisk on the output of lsof the few thousand lines I have looked at all seem to indicate legitimate uses - there are at least two files for each conversation in progress (I assume for inward and outward RTP) plus one for each file being mixmonitored (which also seems logical) and also number-of-active-calls connections to res_timing_dahdi - which all looks correct... If it is Asterisk, it's quite possible, even probable, that such a leak has been found and fixed, even in the 1.8 series. 1.8.11.0 is rather old - the latest is 1.8.32.3, so it would be best to update to that version and see if the problem persists. Ok, I will have to consider that. The thing is the problem is not consistent - I can (for example) run 60 calls, with no problems and no reported failures in opening files, then calls will -decrease- to about 40 and then later spike to 70, but around 50 calls I get the errors coming up thousands of times in the CLI, then suddenly stop as the calls -increase- which doesn't make sense. But this kind of behaviour does seem consistent with a possible leak. SOMETHING NEW I have now ran /usr/bin/prlimit --pid `pidof asterisk` and I have noticed that even though I have 800 000 files specified, the ACTUAL limit in place on Asterisk for numbers of files is only 1024?! # prlimit --pid `pidof asterisk` RESOURCE DESCRIPTION SOFT HARD UNITS AS address space limitunlimited unlimited bytes CORE max core file size unlimited unlimited blocks CPUCPU time unlimited unlimited seconds DATA max data size unlimited unlimited bytes FSIZE max file size unlimited unlimited blocks LOCKS max number of file locks held unlimited unlimited MEMLOCKmax locked-in-memory address space 65536 65536 bytes MSGQUEUE max bytes in POSIX mqueues819200819200 bytes NICE max nice prio allowed to raise 0 0 NOFILE max number of open files1024 4096 NPROC max number of processes30861 30861 RSSmax resident set size
Re: [asterisk-users] 786 000 files limit Centos 7 - Asterisk keep complaining
Hi Steve Just running about 50 calls?? If I do lsof | grep asterisk | wc -l to narrow the realm of what is reported I still get just under 100 000 files: lsof | grep asterisk | wc -l 95903 with 50 calls running. So apparently this is excessive? I can only guess that there must be a MAJOR bug in 1.8.11.0 given that you are running 347 calls on 2161 open files with Ast 11...? I'm on Centos 7. As I mentioned previously, I have found that my problem with Asterisk running out of files is that the Asterisk binary, on startup, does NOT detect that the open file limit it 768 000, it always selects 1024 as the soft limit for open files and 4096 as the hard limit for open files. I have to manually (cron does not work - wonder why?) do /usr/bin/prlimit --pid `pidof asterisk` --nofile=786000:786000 in order to get the running Asterisk instance to ACTUALLY have a soft and hard number of files limit of 786 000. The machine under discussion never runs more than about 60 calls, at which point it consumes about 125 000 file descriptors / handles in Asterisk (total open files in the kernel goes to about 195 000) - I thought this was normal! Note that besides some timer problems that pop up occassionally (unsure if it is related) the box is totally stable and has spent days at 100 000+ open file descriptors operating Asterisk 1.8.11.0 quite happily with no other problems save that when the binary started up for that run it did not have a sufficiently high file limit to actually work. Thanks for the reply! Kind regards, I suspected something like that, though repeatedly running lsof | wc -l Always stays quite low - 100 000 open files, which is still 8 times less than the system maximum as confirmed by running ulimit -n What the 'h' are you doing that takes x00,000 open files? I'm running Asterisk 11.17.0 on CentOS 6.7 and my 'numbers' seem insignificant by comparison. sudo /usr/sbin/asterisk -r -x 'core show channels' | grep active 347 active channels 344 active calls sudo lsof | wc -l 3945 sudo lsof | grep asterisk | wc -l 2161 -- Thanks in advance, - Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST -- ___ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users End of asterisk-users Digest, Vol 133, Issue 14 *** -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] 786 000 files limit Centos 7 - Asterisk keep complaining
Anybody else ran into this? No, but I would ask myself why so many file descriptors are being used. It sounds like you have a file descriptor leak (not being closed when finished with). Hi Tony Thanks for replying. I suspected something like that, though repeatedly running lsof | wc -l Always stays quite low - 100 000 open files, which is still 8 times less than the system maximum as confirmed by running ulimit -n I also note that this number will increase to about 125 000 but never go higher than that, then, as calls hang up, decreate again - during times when the CLI is spammed with 100s of broken pipe errors due to insuffiecient file descriptors, this number never reaches beyond 125 000 out of the available 800 000 open files. You might also want to look at the output of lsof (or at least some of it) to see what all these file descriptors are pointing to, and whether it is indeed Asterisk that is consuming them. If I grep by asterisk on the output of lsof the few thousand lines I have looked at all seem to indicate legitimate uses - there are at least two files for each conversation in progress (I assume for inward and outward RTP) plus one for each file being mixmonitored (which also seems logical) and also number-of-active-calls connections to res_timing_dahdi - which all looks correct... If it is Asterisk, it's quite possible, even probable, that such a leak has been found and fixed, even in the 1.8 series. 1.8.11.0 is rather old - the latest is 1.8.32.3, so it would be best to update to that version and see if the problem persists. Ok, I will have to consider that. The thing is the problem is not consistent - I can (for example) run 60 calls, with no problems and no reported failures in opening files, then calls will -decrease- to about 40 and then later spike to 70, but around 50 calls I get the errors coming up thousands of times in the CLI, then suddenly stop as the calls -increase- which doesn't make sense. But this kind of behaviour does seem consistent with a possible leak. SOMETHING NEW I have now ran /usr/bin/prlimit --pid `pidof asterisk` and I have noticed that even though I have 800 000 files specified, the ACTUAL limit in place on Asterisk for numbers of files is only 1024?! # prlimit --pid `pidof asterisk` RESOURCE DESCRIPTION SOFT HARD UNITS AS address space limitunlimited unlimited bytes CORE max core file size unlimited unlimited blocks CPUCPU time unlimited unlimited seconds DATA max data size unlimited unlimited bytes FSIZE max file size unlimited unlimited blocks LOCKS max number of file locks held unlimited unlimited MEMLOCKmax locked-in-memory address space 65536 65536 bytes MSGQUEUE max bytes in POSIX mqueues819200819200 bytes NICE max nice prio allowed to raise 0 0 NOFILE max number of open files1024 4096 NPROC max number of processes30861 30861 RSSmax resident set size unlimited unlimited pages RTPRIO max real-time priority 0 0 RTTIME timeout for real-time tasksunlimited unlimited microsecs SIGPENDING max number of pending signals 30861 30861 STACK max stack size 8388608 unlimited bytes Accordingly I have put this into a cronjob ran each minute: prlimit --pid `pidof asterisk` --nofile=786000:786000 to try and force the running binary to keep a high file limit (sources say to keep it less than the ACTUAL system file limit, in my case 800 000 files) on the live Asterisk process. I'll see if this maybe helps - the above runs via cron each minute. So it appears for some reason somehow the live running asterisk process loses track of how many open files it may have, or when it starts it somehow does not start with the correct number of maximum open files, as set in the system / kernel config? Anyway, thank you for replying, I'll monitor this new Cronjob fixup I'm trying and see if it helps. No wonder it is complaining about running out of file handles if it ACTUALLY was only using 1024! Kind regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] 786 000 files limit Centos 7 - Asterisk keeps complaining
Hi Guys I keep getting messages in the Asterisk 1.8.11.0 CLI that there are not enough file descriptors available on my Centos 7 box. I also get regular error messages that RTP connections are failing due to bad file descriptors. I have already edited /etc/sysctl.conf by setting fs.file-max to 786 000 files, and running sysctl -p afterward. I have also edited /etc/security/limits.conf and entered * soft nofile 786000 * hard nofile 786000 and rebooted my system. When I ge the Asterisk error messages in the CLI that there are not enough file descriptors, I immediately ran lsof | wc -l and I only get around 100 000 files open - while my limit is 786 000 - yet still Asterisk keeps complaining. I have also edited /etc/asterisk/asterisk.conf to have maxfiles = 786000 and restarted Asterisk / rebooted, but this has no effect. Why does Asterisk 1.8.11.0 complain that there are insufficient file descriptors when my limit is 786 000 and the kernel itself states that only 100 000+ handles / decriptors are in use at the moment Asterisk is complaining about insuffiecient descriptors? Anybody else ran into this? Thanks Stefan -Original Message- From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of asterisk-users-requ...@lists.digium.com Sent: Wednesday,August 5, 2015 07:00 PM To: asterisk-users@lists.digium.com Subject: asterisk-users Digest, Vol 133, Issue 5 Send asterisk-users mailing list submissions to asterisk-users@lists.digium.com To subscribe or unsubscribe via the World Wide Web, visit http://lists.digium.com/mailman/listinfo/asterisk-users or, via email, send a message with subject or body 'help' to asterisk-users-requ...@lists.digium.com You can reach the person managing the list at asterisk-users-ow...@lists.digium.com When replying, please edit your Subject line so it is more specific than Re: Contents of asterisk-users digest... Today's Topics: 1. Re: Looking for PRI Card with automatic fail over (Eric Klein) 2. Re: Looking for PRI Card with automatic fail over (Sam Basan) 3. Re: Looking for PRI Card with automatic fail over (Technical Support) 4. Update: Planned NASA trip around Astricon (Eric Klein) -- Message: 1 Date: Wed, 5 Aug 2015 12:01:15 +0300 From: Eric Klein eric.kl...@greenfieldtech.net To: asterisk-users asterisk-users@lists.digium.com Subject: Re: [asterisk-users] Looking for PRI Card with automatic fail over Message-ID: CAD4dZ0mvbu+yc=wsOGJLcjKE_K717tMVoG+1XQ1J6=8x6r_...@mail.gmail.com Content-Type: text/plain; charset=utf-8 Responding to Matt Riddell, M Shokuie, A J Stiles, and Telium Support (all below) Thanks for the suggestions, but a separate gateway is a problem in the design as the configuration is basically: Carrier --- PRI --- Asterisk (with failover) Legacy PBX | - SIP / IAX2 -- our service or remote office As this is already acting as a gateway adding another box to the mix seems a bit over kill (unless I can embed it and the asterisk PBX into a 2 U pizza box). But since most gateways are designed to be used for fail over servers / PBXs not lines I am not sure that this would benefit us. So far I have found 1 company that seems to have a gateway card and that is the beroNet PCI / PCIe Gateway Cards which they say has the card level failover. I will update the list should this meet the use case. Eric -- Message: 1 Date: Mon, 3 Aug 2015 13:54:05 -0500 From: Matt Riddell li...@venturevoip.com To: Asterisk Users Mailing List - Non-Commercial Discussion asterisk-users@lists.digium.com Subject: Re: [asterisk-users] Looking for PRI Card with automatic fail over Message-ID: 2539d3b3-4981-468f-95af-34d9d6a17...@venturevoip.com Content-Type: text/plain; charset=us-ascii Yep it was red fone http://red-fone.com 7 years ago :-) http://www.venturevoip.com/detail.php?news_id=1927 -- Cheers, Matt Riddell ___ http://www.venturevoip.com/news.php (Daily Asterisk News) http://www.venturevoip.com/pabx_on_disk.php (PABX on a Disk) http://www.venturevoip.com/exchange.php (Full ITSP Solution) http://www.venturevoip.com/cc.php (Call Centre Solutions) -- next part -- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20150803/ f8f1bd57/attachment-0001.html -- Message: 2 Date: Mon, 3 Aug 2015 23:31:29 +0430 From: M Shokuie sena...@gmail.com To: Asterisk Users Mailing List - Non-Commercial Discussion asterisk-users@lists.digium.com Subject: Re: [asterisk-users] Looking for PRI Card with automatic fail over Message-ID:
[asterisk-users] CEL eventtime incorrect, but CDR times are correct - 1.8.11.0
Hi list I have a huge problem with a 1.8.11.0 Asterisk instance not logging CEL events with the correct eventtimes. I'm logging via ODBC to MariaDB 15.1 Distrib 10.0.20-MariaDB I'm logging into a MyISAM table. If I start the Asterisk instance, logged times are correct, but the longer the box runs the more the eventtime in the CEL rows created by Asterisk via ODBC drift backwards. E. g. the clock on the server says 08:15 for example (I enter the date command in the terminal) and if I run a query and check the most recent CELs immediately and about ten minutes after startup, they are correct. However, from about 15 minutes onward the CEL eventtime starts regressing. It will be 08:30 according to the server clock, but the CELs logged will have a time of 08:20. The longer the asterisk instance runs the more time on the CEL eventtime field falls behind. After four hours, when real time on the server clock is 12:00 (for example) the CELs entered into the db by Asterisk are only up to 10:45... while CDRs are 100% correct and show times of 11:59, 12:00, 12:01, etc I thought this was load, but in normal use the CEL table entries will go idle was my users stop phoning - e. g. it is not as if the entries are lagging due to the table being too slow to write into from Asterisk's side. If a new user phones after, say, ten minutes of inactivity, his new CELs will still be behind, just as far as they were behind on eventime when calls stopped and CELs stopped being entered. The only way to fix it is to stop and restart the Asterisk instance. Strangely, CDR times (logged to the same MariaDB db via ODBC) are 100% correct and totally accurate no matter how long the Asterisk instance runs, or how high the load goes. What causes this? How can I correct it? Any replies appreciated! Thanks Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Filters
Hi list I'm using Asterisk 1.8.11.0 - is there any way to apply (for example) a bandpass filter to Asterisk RTP audio in the realtime audio stream? I'm looking for a way to (for example) filter out a 50Hz AC hum present in some calls I push through my asterisk. Thanks Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Centos 6.5 Asterisk 1.8.11.0 - starts in rc.local, but not contactible?
Hi JG Thanks for replying. Depending on the hardware you are using, simply calling asterisk might not be enough, as there could be dependencies on third party drivers. Depending on how asterisk was installed, one probably also has to look at various permissions. For example, asterisk -r might fail simply because you are calling it from an account with insufficient rights. It's difficult to tell given your information. Maybe the following will help. If you look into the contrib/init.d directory (inside the src tree) you'll find the rc.redhat.asterisk script. Rename it and put it into the /etc/init.d directory and issue chkconfig --add asterisk as well as chkconfig asterisk on and your problem should be solved. You can check the current settings with chkconfig --list asterisk. The Redhat script works nicely under CentOS. Hmm ok - I made sure to run make config in the Asterisk source folder which installed the correct scripts into rc.d and so forth. I then did chkconfig asterisk on and rebooted the box. The parameters remain the same, asterisk is there if you do a ps -aux | grep asterisk but it still is in a non-working state and not contacible via asterisk -r. Since it is an old box and the reason for trying to get it going is mostly academic, I think I'm just going to dump the box and reformat it with Centos 7. Strange though, I have installed about 17 other boxes exactly this way on broadly the same hardware and all are currently running fine with Centos 6.5 and Asterisk 1.8.11.0 Thanks anyway, the problem is clearly deeper than I though since even the official way you detail above fails to start Asterisk as an account that can start it on system boot. Even when root is the only account on the machine - which leads me to believe I have some basic error in my Centos 6.5 installation so I'll just try it again or try Centos 7. Thanks a lot. Kind regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Centos 6.5 Asterisk 1.8.11.0 - starts in rc.local, but not contactible?
Hi list I'm trying to get Asterisk 1.8.11.0 to start automatically when my Centos 6.5 box boots. I've done this many times before, but for some reason, on this box and hardware (older Core i3 system, 4GB RAM) I cannot get Asterisk to be contactible after boot. E. g. in rc.local I have, as the last line --- asterisk --- as in all my other Asterisk boxes with Centos 6.5 and Asterisk 1. 8.11.0 This -does- start asterisk on boot, but you cannot connect to it using asterisk -r the error being --- [root@asterisk ~]# asterisk -r Asterisk 1.8.11.0, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer marks...@digium.com Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. = Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?) [root@asterisk ~]# --- And I note that /var/run/asterisk.ctl does NOT exist, which is why asterisk -r does not work... I do note that there are error messages in /var/log/asterisk/messages, to whit: --- [Jul 23 10:59:31] WARNING[1863] loader.c: Error loading module 'codec_g729.so': /usr/lib/asterisk/modules/codec_g729.so: cannot enable executable stack as shared object requires: Permission denied [Jul 23 11:02:22] ERROR[1900] cdr_tds.c: Unable to connect: Adaptive Server is unavailable or does not exist (20009) [Jul 23 11:02:22] ERROR[1900] cdr_tds.c: Permission denied (13) [Jul 23 11:02:22] ERROR[1900] cdr_tds.c: Unable to connect to sqlserver --- However, if I kill -9 the uncontactible asterisk process and start it manually as root, everything works and runs fine, and I can connect to the running asterisk instance via asteriskr -r in a terminal. The above error messages are not emitted if asterisk is started by hand like this. Why does Asterisk have persmission problems when started out of /etc/rc.local (as root) vs. when I start it by hand while logged in as root? No config changes made to Centos 6.5 except for installing it from DVD and running a yum update. Thanks Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] CEL eventtime drift
Hi list I'm running MariaDB with Asterisk 1.8.11.0 over ODBC for CEL and CDR logging. CDRs work fine, times logged in the DB are correct consistently. However, I've noticed that for CELs eventtimes start lagging severely. E. g. I'd start Asterisk at 12:15 and entries made into CEL and CDR immediately as users start phoning away have the correct times in the relevant fields. However, as time passes CELs start lagging behind. E. g. at 12:30 real-time, CDRs still log as 12:30, but by now CELs have lagged behind and are showing 12:24 (for example) for -current- entries which should be in the 12:30 range. The longer the Asterisk stays up, the larger the lag, e. g. afer an hour CDRs still log correct at current time, but CELs have drifted almost 30 minutes back... e. g. real-world time on the Asterisk's clock is 14:00, CDRs log as 14:00 but CEL log as if it is 12:40. Anybody encountered this before - how can I stop CEL time drift? Thank you, Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Asterisk 13.4.0 - mixmonitor only records one side's perspective
Hi All I have a problem with mixmonitor in 13.4.0 doing the following: 1. Caller phones in 2. Reception picks up 3. Talks to caller 4. Does attended transfer, talks to manager to screen the caller wanting to speak to him 5. Complete the transfer by putting down her handset so the caller can speak to the manager 6. Caller talks to the manager The problem is that mixmonitor only records steps (3) and (6) - for step (4) in the recording file, you hear the MOH the outside caller hears while the receptionist is screeing the call. We want to record the -entire- conversation, including the receptionist screening with the manager. E. g. you literally only hear the perspective of the originator of the call - you never hear the receptionist - manager leg of the call if a transfer occurs during a call. Here's how an incoming call is handled - on 1.8 the below code recorded the entire conversation flawlessly, including the screening conversation of reception - manager [inc] exten=_[123]xxx,1,Macro(VCRECORD,${MACRO_CONTEXT}EXT${CALLERID(num)}ACC${CD R(accountcode)},${ARG2}) exten=_[123]xxx,n,Set(__TRANSFER_CONTEXT=call-redirect) exten=_[123]xxx,n(checkacc),NoOp(MY Account code is ${CDR(accountcode)}) ;exten=_[123]xxx,n(checkacc),NoOp(OTHER Account code is ${CDR(accountcode)}) exten=_[123]xxx,n(dodial),Dial(Sip/${EXTEN},120,tTg) exten=_[123]xxx,n,NoOp(Dialstatus: ${DIALSTATUS}) exten=_[123]xxx,n,GotoIf($[${DIALSTATUS}=NOANSWER]?takevoicemail:checkd ont) exten=_[123]xxx,n(checkdont),GotoIf($[${DIALSTATUS}=DONTCALL]?takevoice mail:donecall) exten=_[123]xxx,n,NoOp(Taking a voicemail...) exten=_[123]xxx,n(takevoicemail),VoiceMail(${EXTEN}@default) exten=_[123]xxx,n(donecall),Hangup() [call-redirect] include = parkedcalls exten=_[123]xxx,1,NoOp(Transferring Call. This Channel ${CHANNEL}, Other channel ${BLINDTRANSFER}) exten=_[123]xxx,n(dodial),Dial(Sip/${EXTEN},120,tTg) [macro-VCRECORD] ; MACRO To setup Recording ;${ARG1} Description To Save ;${ARG2} Dialed Number exten=s,1,NoOp(Start of MixMonitor recording) exten=s,n,Set(IAXVAR(accountcode)=${CDR(accountcode)}) exten=s,n,GoToIf($[${MIXMONITOR_FILENAME} = ]?startrec:finrec) exten=s,n(startrec),Set(recDir=${STRFTIME(${EPOCH},,%y%m/%d)}) exten=s,n,Set(recFile=${recDir}/${STRFTIME(${EPOCH},,%y%m%d%H%M%S)}D${ARG1} N${ARG2}ID${UNIQUEID}.gsm) exten=s,n(setacc),set(recFile=${recDir}/${CDR(linkedid)}.gsm) exten=s,n(makedir),System(/bin/mkdir -p /var/spool/asterisk/monitor/${recDir}) exten=s,n,MixMonitor(${recFile},a) exten=s,n(finrec),Set(AUDIOHOOK_INHERIT(MixMonitor)=yes) exten=s,n,Set(CDR(userfield)=${MIXMONITOR_FILENAME}) exten=s,n,Set(__chanrecording=/var/spool/asterisk/monitor/${recFile}) exten=s,n,NoOp(Recording to ${MIXMONITOR_FILENAME}) exten=s,n,UserEvent(RecordingToFile,Uniqueid: ${UNIQUEID},Channel: ${CHANNEL},FileName: ${MIXMONITOR_FILENAME}) exten=s,n,MacroExit Can somebody help or offer a suggestion how to get MixMonitor to record an ENTIRE conversation in 13.4.0, not just record from the perspective of the initiator of a call? Thanks -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] For a failed retransmission - what were the IP addresses?
Hi Guys Given these occassional errors on my Asterisk CLI: [Jul 2 10:23:36] WARNING[2060]: chan_sip.c:3641 retrans_pkt: Retransmission timeout reached on transmission 17bb3a993ad10f8818970ae952b81e73@192.168.11.31:5060 for seqno 102 (Critical Request) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions Packet timed out after 32000ms with no response [Jul 2 10:23:49] WARNING[2060]: chan_sip.c:3641 retrans_pkt: Retransmission timeout reached on transmission 2f6fa425581373c11c2ae58a276751bb@192.168.11.31:5060 for seqno 102 (Critical Request) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions Packet timed out after 32000ms with no response E. g. I have the transmission numbers 17bb3a993ad10f8818970ae952b81e73 and 2f6fa425581373c11c2ae58a276751bb on which packets timed out. Is there any way I can determine the IP addresses where those packets referred to by these errors timed out on? What is Sequence 102? 192.168.11.31 is my Asterisk 1.8.11.0 server. Thanks! Regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Strange and complete failure of Asterisk 1.8
Re: Strange and complete failure of Asterisk 1.8 (Duncan Turnbull) Re: Strange and complete failure of Asterisk 1.8 (Markus Weiler) Thanks Marcus Duncan Pulled the machine and replaced it with a brand new one. Same network and same DNS server active there. New system is running the same Asterisk (1.8.11.0) and the same Centos, same Asterisk config files - still running beautifully since yesterday. Got the sick system at our lab now and pulling it apart - even isolated from the LAN (e. g. with no access at all to a DNS server) it still is exhibiting the same problem. Connecting it to the LAN with our HeadOffice DNS server present (which also serves our live HO asterisk) it still exhibits the problem. But thanks anyway, if it happens again well just pull the live system and replace from the ready-reserve we maintain of already configured Ast boxes. I'll keep digging awhile with the sick system and see if I can come up with something, will focus on DNS - thanks for the pointers! Kind regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] FW: Strange and complete failure of Asterisk 1.8 - part 2
Hi guys I just did a ps -Af | grep asterisk on the machine and got several screens full of this: root 6970 6946 0 13:10 ?00:00:00 rasterisk rxcore show channels verbose root 6987 6948 0 13:10 ?00:00:00 rasterisk rxcore show channels verbose root 7005 6985 0 13:10 ?00:00:00 rasterisk rxcore show channels verbose root 7021 7003 0 13:10 ?00:00:00 rasterisk rxcore show channels verbose root 7062 7053 0 13:11 ?00:00:00 rasterisk rxcore show channels verbose root 7077 7058 0 13:11 ?00:00:00 rasterisk rxcore show channels verbose root 7097 7060 0 13:11 ?00:00:00 rasterisk rxcore show channels verbose root 7118 7093 0 13:12 ?00:00:00 rasterisk rxcore show channels verbose root 7137 7095 0 13:12 ?00:00:00 rasterisk rxcore show channels verbose root 7155 7135 0 13:12 ?00:00:00 rasterisk rxcore show channels verbose root 7170 7152 0 13:12 ?00:00:00 rasterisk rxcore show channels verbose root 7196 7186 0 13:13 ?00:00:00 rasterisk rxcore show channels verbose I see that rasterisk is a symlink in /usr/sbin that points to whatever is at /usr/sbin/asterisk - and that /usr/sbin/asterisk is the normal asterisk binary. Trying to killall rasterisk or kill -9 a specific PID of rasterisk just results in it being immediately respawned... Same with killall asterisk or kill -9 the single running asterisk instance. It immediate respawns. I have no scripts or facilities running which will restart it. Any ideas? -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Strange and complete failure of Asterisk 1.8
Hi all We've had a very strange failure on an Asterisk 1.8 install that has been running for about a year at a customer site. The physical hardware is fine, all other services off the Centos 6.5 server are running. Only Asterisk is not working... The first symptom was that no calls can be made over the SIP phones used with it, and no calls could be received over the SIP trunk connected to it. I checked and noted that sip show peers in the CLI would either do nothing (e. g. just show asterisk*cli again, with no response) or it would return only this: asterisk*CLI sip show peers Name/username HostDyn Forcerport ACL Port Status asterisk*CLI A module show like sip also does literally nothing, just asterisk*cli module show like sip asterisk*CLI Soon after this, I lost the capacity to get any response if I do an asterisk -r on the commandline - it would just hang indefintely. Did a reboot, and then, I couldnt start asterisk at all - entering # asterisk would also just hang. So, I recompiled asterisk from source and reinstalled the executable and all the module files. Still the same. I happened to have an older asterisk executable from a few months before laying around and sha256summed it - and there was a difference in the checksum vs. the non-working asterisk binary - BUT it turned out that the newly recompiled asterisk binary has the SAME SHA256 checksum as the non-working asterisk binary. System seems fine otherwise, nothing relevant in /var/log/messages or dmesg indicating a hardware failure. /var/log/asterisk/messages also contains no strange warnings or errors. Anybody got any idea why I cannot resuscitate my Asterisk install, even after recompiling it from scratch from source? Why would asterisk die like this in the first place? Thanks -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Too many open files - 786 000 already specified as max num open files?
Hi guys I have a site on Asterisk 1.8.11.0 running in Centos 6.5 that has about 150 concurrent callers. I keep getting these types of messages in the CLI: [May 21 11:39:21] WARNING[18469]: channel.c:1189 __ast_channel_alloc_ap: Channel allocation failed: Can't create alert pipe! Try increasing max file descriptors with ulimit -n [May 21 11:39:21] WARNING[18469]: chan_sip.c:7041 sip_new: Unable to allocate AST channel structure for SIP channel [May 21 11:39:21] WARNING[18469]: res_rtp_asterisk.c:459 create_new_socket: Unable to allocate RTCP socket: Too many open files [May 21 11:39:21] ERROR[18469]: acl.c:706 ast_ouraddrfor: Cannot create socket I have specified this on the commandline: ulimit -n 768000 I have also tried ulimit -n 512000 ulimit -n 65535 before going up to 768000 and then restarted Asterisk. In /etc/sysctl.conf I have at the bottom fs.file-max=768000 after also trying 65535, then 512000 . I have run sysctl -p as root asfter adjusting the fs.file-max limit in /etc/sysctl.conf Furthermore in /etc/security/limits.conf I have at the bottom asterisk soft nofile 768000 asterisk hard nofile 768000 /etc/asterisk/asterisk.conf contains in the maxfiles line 768 000 and the line has been uncommented After changing all of the above I have restarted asterisk. SELinux is completely disabled. I'm still getting the CLI error messages that there are too many open files - can I really be exceeding 768 000 open files with 150 callers using normal SIP phones? The system is a fairly standard Core i7 with 8GB of RAM, load averages on it rarely go about 0.5 with all callers running, and memory usage never going above 4GB of 8GB physical ram accoridng to top. Anybody got any advice or comments? Thanks! Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Monitoring SIP Service (Jai Rangi)
Interesting approach. What we've done is to write an app that runs on a separate machine that simply does some asterisk -rx calls to the running Asterisk instance via an SSH library and then evaluate the string returned. For example, to monitor our registered SIP service providers, we compare the output for the sip show registry CLI command when the system is in the correct state, to the output we get on timed checks every five minutes. If a SIP trunk goes down, the just-obtrained string does not match the stored, correct string anymore, and our app starts sending SMSes / raising alarms. Been running for about three years now and works suffieciently for our widely separated branches all over South Africa. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] asterisk-users Digest, Vol 130, Issue 14
- Original Message - From: Steve Davies davies...@gmail.com To: Asterisk Users Mailing List - Non-Commercial Discussion asterisk-users@lists.digium.com Sent: Wednesday, May 13, 2015 11:39:29 AM Subject: Re: [asterisk-users] Retransmission Timeout results in dropped calls after 32 seconds Hi, In my experience, all Yealink phones work just fine with Asterisk, we have hundreds (perhaps even low-thousands) out there with customers on Asterisk 1.2, 1.6.2, 1.8 and 11. If you are accurately representing the SIP trace on the phone and the SIP trace on Asterisk, then I would strongly suggest a SIP ALG exists in the network between the two devices and that SIP ALG does not understand SIP properly. The two halves simply do not match, so something must surely be interfering. In my experience it is often an innocent looking Cisco router. Cisco's SIP implementation is SIP By Cisco rather than RFC compliant SIP. If that is the case Cisco call it a SIP fixup and you just need to disable it. Hope that helps, Steve Steve, That is an interesting point - the server and the phone are both connected to Netgear switches where I have enabled their Auto-VoIP feature, which remarks packets based on protocol (SIP, SCCP, etc) for better QoS: http://kb.netgear.com/app/answers/detail/a_id/21758 I wonder if this remarking process is modifying another part of the packet too? Both devices are on the same subnet, so although these switches do route traffic as well, that shouldn't be coming into play here. We had a very specific issue at a client recently with Yealink phones and Cisco routers. No Yealink we plugged in would pick up an IP from the DHCP server so it could be configured. To correct it we had to explicitly turn off LLDP (link layer discovery protocol) on the Yealinks in order to get them to work on the Cisco'ed network. Did not fool around with the Cisco to try and solve the issue, and still don't know exactly what was going wrong, but it seems defined that using recent model Yealink phones on a network with a recent Cisco router, either turn off LLDP on the phones or the router to prevent problems. The above still did not solve the issues completely, still getting one or two complaints from this customer every few days which also seem to be related to the fact of using Yealink phones with a network where a Cisco router is present... so your milage may vary. Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Linking Asterisk 1.8 to late model Samsung PABX over PRI - transfer issues
Hi all I've got a setup where I use a Sangoma PRI card driven via Sangoma WanPipe to connect to a legacy Samsung PABX (I'm not sure which model) form Asterisk 1.8.11.0. The reason is the customer has a large installed base of Samsung phones physically connected to it and on each users desk. They did not want to spring for a complete replace of all their Samsung phones with generic, and dump their existing Samsung PABX (worth several hundred thousand in local currency) for a 100% SIP phone + Asterisk setup. They do want the calls recorded and accessed in a custom system, ergo Asterisk - raison d'etre for the setup - it records and the 3rd party system interfaces to it via the AMI to playback and record. The Asterisk stands between the Samsung and the telco's SIP trunk, and presents PRI NET to the Samsung, so it thinks it is directly connected to the telco PRI trunk. The Asterisk in turn connects to the telco --SIP-- trunk. (E. g. we protocol translate on Asterisk level - it speaks PRI to the Samsung and SIP to the telco) Everything works fine, EXCEPT when users do transfers. If they Asterisk transfer (#number) on the Samsung phones, it works fine, but ONLY if the target Samsung phone is not busy with a conversation. If the target Samsung phone IS busy with a conversation, that conversation on the Samsung is cut off, and the person outside wanting to talk to the consultant is also cut off - MOH ends and Asterisk emits standard CLI info and runs the H extension on the call, as it should for a normal hangup. If they Samsung transfer (e. g. use the physical transfer button on the Samsung handset) it works fine - if the user is busy, it rings back, if not, the call goes through. The reason they have to Asterisk transfer is that Asterisk can keep track of which extension is actually linked to a call - this is vital for the 3rd party system we have interrogating asterisk for extensions status for business logic purposes over AMI. If they Samsung transfer asterisk is oblivious of the new extension on which the call is running, and therefore business logic breaks - it only has that 1000 (reception) is busy, and has no inlking of the fact that, in the Samsung, 1000 has transferred to 1023 (for example) and business logic should run on 1023, NOT 1000... Can anybody offer any comments? Thanks Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] System() command refuses to execute bash script
Hi all I got this solved. Turns out the script WAS executing, but I forgot that apparently you need to follow cron rules in any BASH scripts executed via System() from an Asterisk dialplan. E. g. all paths must be fully and absolutely specified, there are no relative path references available. So I changed the the file wireless.sh which was: #!/bin/bash touch wireless-executed to #!/bin/bash touch /root/wireless-executed and now if I phone 800 on my Asterisk context I can see that the file wireless-executed is created by the touch binary, which indicates that Asterisk has run the script successfully. So the problem was not Asterisk or BASH or permissions, but rather that it appears that all paths in any System() script must be absolutely, not relatively, specified. Hope this helps somebody - simply follow cron rules when writing Asterisk-callable BASH scripts which you plan to trigger via the System() Asterisk dialplan application. Regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] System() command refuses to execute bash script
Hi All I'm using this extension to try and get Asterisk 1.8.11.0 to run a bash script: exten=802,n,System(/bin/sh -f /root/wireless.sh) This file is -rwxr-xr-x 1 root root 171 Mar 2 16:23 wireless.sh e.g. root owns the file, and it has execute permissions for all users. Asterisk runs as root as well. Asterisk executes the command without any errors at max verbosity. The file wireless.sh contains: #!/bin/bash touch wireless-executed In my /root folder however, the file wireless-executed is never written - indicating the script does not execute, even though it is owner by the same user asterisk runs as, and is world-executable. How can I use System to run a bash script? Thanks! Regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] TimerFD errors if MTU size is set incorrectly - SIP trunk
Hi Guys Regarding this I found the following links which appear relevant: https://issues.asterisk.org/jira/browse/ASTERISK-19347 https://issues.asterisk.org/jira/browse/ASTERISK-18223 It seems that this issue is related to that, NOT to a too-large MTU size. Don't know if anybody can comment? Is the MTU size a red-herring as relates the timer-fd errors? Thank you very much Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Timer_fd, pthreads, or DAHDI timer for timing under 1.8.11.0?
Hi guys I have some questions regarding the above 1. Why are there different options for timing? 2. What are the differences between these types of timing sources? 3. When should you use what? 4. Is one timer type more reliable for an Asterisk system under heavy loads than another while NOT using any DAHDI hardware - SIP only? I'm of course referring to the familiar spamming timer_fd error messages in the CLI with increasing load until asterisk crashes phenomenon. Using 1.8.11.0 on Centos 6.5 Any thoughts appreciated! Thank you Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] TimerFD errors if MTU size is set incorrectly - SIP trunk
Hi all Is there a relation between the above? I'm having a problem where I suspect my internet access provider (through whom I go to a SIP trunk provider) have got MTU size problems. My asterisk (1.8.11.0) is constantly going into the situation where a TimerFD error is spammed in the CLI, load goes up and up until the system is completely unusable. I have an admission by the ISP that their MTU size on their fiber NTU may be incorrect. Can an incorrect MTU size on an ethernet connection cause Asterisk to experience errors with the kernel timing source? Thank you Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] 1.8.11.0 - CLI error res_timing_timerfd
Hi all Sometimes (about every three months) some of my Asterisk 1.8 boxes will start running this message thousands of times in the CLI: [Feb 12 14:18:23] ERROR[28129]: res_timing_timerfd.c:180 timerfd_timer_ack: Call to timerfd_gettime() error: Invalid argument [Feb 12 14:18:23] ERROR[28129]: res_timing_timerfd.c:180 timerfd_timer_ack: Call to timerfd_gettime() error: Invalid argument [Feb 12 14:18:23] ERROR[28129]: res_timing_timerfd.c:180 timerfd_timer_ack: Call to timerfd_gettime() error: Invalid argument [Feb 12 14:18:23] ERROR[28129]: res_timing_timerfd.c:180 timerfd_timer_ack: Call to timerfd_gettime() error: Invalid argument [Feb 12 14:18:23] ERROR[28129]: res_timing_timerfd.c:180 timerfd_timer_ack: Call to timerfd_gettime() error: Invalid argument [Feb 12 14:18:23] ERROR[28129]: res_timing_timerfd.c:180 timerfd_timer_ack: Call to timerfd_gettime() error: Invalid argument [Feb 12 14:18:23] ERROR[28129]: res_timing_timerfd.c:180 timerfd_timer_ack: Call to timerfd_gettime() error: Invalid argument ad infinitum Sometimes, this will disappear after a few minutes, and not re-appear. On other occassions, after this started appearing in the CLI, the Asterisk will crash without any slowdown or problems. On yet other occassions, the box will start getting slower, load average rising and rising until it become virtually frozen and it has to be rebooted in order to come back up in a functional state again. I've also noticed that stopping the Asterisk process and restarting it does not help if this error is in effect and a slowdown (rising load average) has started - the whole physical machine has to be rebooted in toto. I'm running on Centos 6.5. Anybody else seen this message before? What does it mean? Thanks Kind regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] constantly increasing load in Asterisk 11.14 (Sebastian Damm)
Have you considered doing a daily reboot? In our shop (about 14 sites, busiest doing about 90 000 calls per day) we found it best to reboot each Asterisk instance at 23:45 - we're still running an ancient version (1.8.0.11). Once this regime was instituted our major Asterisk issues stopped, especially load-related issues linked to uptime. Note that we do not just restart the Asterisk process, we reboot the entire machine. We're running on bare-metal on Centos 6.5. Maybe you can try doing that, if at all practical? Our business needs fortunately this side is telecoms are only requires 08:00 - 17:00... Regards Stefan Message: 2 Date: Thu, 5 Feb 2015 11:53:38 +0100 From: Sebastian Damm d...@sipgate.de To: Asterisk asterisk-users@lists.digium.com Subject: [asterisk-users] constantly increasing load in Asterisk 11.14 Message-ID: cabkwsfwpe_cnaj8hnezkminys6odrocf6cv+vzyezh+tfty...@mail.gmail.com Content-Type: text/plain; charset=utf-8 Hi, we have quite a few Asterisk machines running and try to keep them on a current version of the Asterisk 11 branch. But since we upgraded to 11.14.0 a couple weeks ago, we have to restart the Asterisk process every week because the load gets too high and our monitoring complains. Those machines are doing only SIP-to-SIP call relay, the dialplan is quite complex, transcoding is done only on a few percent of the calls processed. During the daytime, there are at max around 200 SIP channels (100 calls) running at the same time. After one week, one machine has processed about 170k calls. I have uploaded a comparison of cacti load graphs for one week of a machine running with 11.14.0 and one running with 11.6.0: http://pbrd.co/1v0SO3R As you can see, after a restart, both machines have about the same load. -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Meaning of core show hint output
Hi all If I have the following in my dialplan: exten=25001,hint,SIP/25001 Doing a core show hint 25001 results in 25001@local : SIP/25001 State:IdleWatchers 0 1 hint matching extension 25001 in the Asterisk CLI. What does the Watchers 0 mean? I use the hints table output via core show hints for logic in my dialler application - but what is a watcher in the context of dialplan hints? Is this something I can make use of? My dialler app uses SSH to get the asterisk -rx output of core show hints and then string processes the result to determine which extensions are busy, et al. Can I for example somehow subscribe as a watcher to a hint or somesuch? Thank you Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Asterisk executable suddenly about 40KB
What you may want to consider is if you have a network management system such as Nagios is create a service that checks the size of the binary every 5 minutes. You're notified if the size goes over a certain threshold. You can also take the perf data and graph it using one of the many Nagios graphing tools available. You can even use something like Munin for a task like this. I couldn't get along without this. On some PBX's I have, I monitor over 600 different metrics spread out every 1,5,10,15,30, and 60 minutes. Because they're spread out, the load average from these checks is zero. Just a suggestion. Regards; John Hi John Thanks for the suggestions I'll keep them in mind. Just to confirm back to the list, the chattr +i and turning off prelinking seems to have solved the issue with the executable file being corrupted / touched. Been running fine for a week now. We have a very simple monitoring app running which we wrote ourselves which monitors some metrics on the Asteisk, but nothing near as comprehensive as you apparently use... Anyway, thanks for the reply! Kind regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Asterisk executable suddenly about 40KB larger - modules (Andres)
I would also start by putting an audit rule on the binary. Something like this: auditctl -w /usr/sbin/asterisk -p war -k asterisk-bin then you can get a report on who modified it and when by using: ausearch -f /usr/sbin/asterisk Its a start, but eventually you might need to monitor even keystrokes with pam_tty_audit.so to understand who is doing this: http://poorlydocumented.com/2014/05/enabling-pam_tty_audit-on-rhel-centos-o r-scientific-linux/ Thanks I'll keep that in mind. Just to report back, stopping pre-linking as detailed yesterday and setting immutable with chattr on the Asterisk executable on the Head Office box here appears to have solved the problem. The box did not crash this morning as it did the previous two days and is working fine... strange, but good. Previous to the problem starting on Tuesday, the box had been running fine for about three years 24/7 - so I might still have some kind of compromise going on. Anyway thanks for the assistance everyone Regards Stefan -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users