Re: [asterisk-users] Which tool to automatically restart Asterisk ?

2017-02-27 Thread Tahir Almas
Thanks for your  suggestions

*Tahir Almas*

Managing Partner
ICT Innovations
http://www.ictinnovations.com
http://www.ictbroadcast.com

On Mon, Feb 27, 2017 at 6:38 AM, Tzafrir Cohen 
wrote:

> On Mon, Feb 27, 2017 at 06:00:30PM +0500, Tahir Almas wrote:
> > Sorry  ,  I  forget  it  for another monitoring tool  monit  that we have
> > used  in  our production systems  to restart  asterisk  in case of
> asterisk
> > crash or  halt.
>
> [snip]
>
> Some notes regarding the asterisk monit configuration:
>
> > check process asterisk with pidfile /var/run/asterisk/asterisk.pid
> > group asterisk
> > start program = "/bin/bash -c 'ulimit -n 16386 &&
> /etc/init.d/asterisk start'"
>
> If you use systemd, this ulimit will have no effect: when you restart a
> service, it is restarted from a separate systemd context (cgroup) and
> not directly under your own.
>
> It would generalyl be a good idea not to embed such settings in your
> scripts and rather put them in a proper configuration file. What happens
> in you happen to run '/etc/init.d/asterisk restart'? It seems that all's
> well, until you're suddenly out of file descriptors.
>
> > stop program = "/etc/init.d/asterisk stop"
> > if does not exist for 2 cycles then restart
> > if failed port 5060 type udp protocol SIP
> > and target "011@127.0.0.1" maxforward 10
> > for 2 cycles then restart
> > if failed host 127.0.0.1 port 5038 with timeout 15 seconds for 2
> cycles then restart
> > if 5 restarts within 5 cycles then timeout
>
> Nice.
>
> Also: what happens when you run 'core stop now' from within asterisk?
>
> --
>Tzafrir Cohen
> icq#16849755  jabber:tzafrir.co...@xorcom.com
> +972-50-7952406   mailto:tzafrir.co...@xorcom.com
> http://www.xorcom.com
>
> --
> _
> -- 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

Re: [asterisk-users] Turn on SIP debugging from DialPlan

2017-02-27 Thread Derek Andrew
Perfect, exactly what I needed. Thanks.

On Mon, Feb 27, 2017 at 6:32 AM, Igor Zamocky  wrote:

> Hi,
>
> If you are ok with starting debug via external system call, why not to use
> something like this (I used to use something similar, it worked):
>
> exten =>* _XXX*,1,System(/usr/sbin/asterisk -rx ‘sip set debug peer *PEER*
> ’)
> same => n,Set(debug_on=1)
> same => n,Dial(SIP/*PEER*/${EXTEN})
>
> exten => *h*,1,GotoIf($[${debug_on} == 1]?undebug)
> same => n,Hangup
> same => n(undebug),System(( sleep 3 \; /usr/sbin/asterisk -rx 'sip set
> debug off' ) &)
> same => n,Set(debug_on=0)
> same => n,Hangup
>
> I don’t know your setup, your dialplan logic, but I’m sure you can adapt
> it to your needs.
>
> I.
>
> On 18 Feb 2017, at 00:26, Rafael dos Santos Saraiva 
> wrote:
>
> Hi
>
> I don't know if works, but you can try this:
>
> System(tcpdump -nq -s 0 -i eth0 -w /tmp/sip.pcap port 5060
> or udp portrange 1-2 &);
> Wait(1);
> Dial(SIP/${EXTEN});
> System(pkill tcpdump);
> Hangup;
>
> Or whitout RTP:
>
> System(tcpdump -nq -s 0 -i eth0 -w /tmp/sip.pcap port 5060
> &);
> Wait(1);
> Dial(SIP/${EXTEN});
> System(pkill tcpdump);
> Hangup;
>
> Probably the last messages of SIP will be lost, BYE for example.
>
>
>
>
>
> 2017-02-17 20:43 GMT-02:00 Derek Andrew :
>
>> I have some troublesome numbers that I would like to capture the SIP
>> dialogue when I am calling them. When I am about to dial the number, is
>> there any way to turn on SIP debugging in the dial plan before I make the
>> call? (and turn it off after the call is completed?)
>>
>>
>>
>>
>> --
>> _
>> -- 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
>>
>
>
>
> --
> Att,
> Rafael Saraiva
> --
> _
> -- 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
>
>
>


-- 
Copyright 2017 Derek Andrew (excluding quotations)

+1 306 966 4808
Communication and Network Services
Information and Communications Technology
Infrastructure Services

*University of Saskatchewan*Peterson 120; 54 Innovation Boulevard
Saskatoon,Saskatchewan,Canada. S7N 2V3
Timezone GMT-6

Typed but not read.
-- 
_
-- 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] SIP reload not changing codecs

2017-02-27 Thread Annus Fictus

Hello,

on Asterisk 13.13.1 working correctly

Regards


El 27/02/2017 a las 10:59, Steve Edwards escribió:

Asterisk 13.3.2

I change the allowed codec from ulaw to g729 in sip.conf and enter 
'sip reload' on the console, but calls continue to use ulaw until 
restart.


Before reload:

lc10*CLI> sip show settings
Global Signalling Settings:
---
  Codecs: (ulaw)

lc10*CLI> core show channel SIP/poly-e637-
  NativeFormats: (ulaw)
WriteFormat: slin
 ReadFormat: ulaw

After reload:

lc10*CLI> sip show settings
Global Signalling Settings:
---
  Codecs: (g729)

lc10*CLI> core show channel SIP/poly-e637-0001
  NativeFormats: (ulaw)
WriteFormat: slin
 ReadFormat: ulaw

After restart:

lc10*CLI> sip show settings
Global Signalling Settings:
---
  Codecs: (g729)

lc10*CLI> core show channel SIP/poly-e637-
  NativeFormats: (g729)
WriteFormat: slin
 ReadFormat: g729

Why do I need to restart to get calls to actually use the new codec?




--
_
-- 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] SIP reload not changing codecs

2017-02-27 Thread Steve Edwards

Asterisk 13.3.2

I change the allowed codec from ulaw to g729 in sip.conf and enter 'sip 
reload' on the console, but calls continue to use ulaw until restart.


Before reload:

lc10*CLI> sip show settings
Global Signalling Settings:
---
  Codecs: (ulaw)

lc10*CLI> core show channel SIP/poly-e637-
  NativeFormats: (ulaw)
WriteFormat: slin
 ReadFormat: ulaw

After reload:

lc10*CLI> sip show settings
Global Signalling Settings:
---
  Codecs: (g729)

lc10*CLI> core show channel SIP/poly-e637-0001
  NativeFormats: (ulaw)
WriteFormat: slin
 ReadFormat: ulaw

After restart:

lc10*CLI> sip show settings
Global Signalling Settings:
---
  Codecs: (g729)

lc10*CLI> core show channel SIP/poly-e637-
  NativeFormats: (g729)
WriteFormat: slin
 ReadFormat: g729

Why do I need to restart to get calls to actually use the new codec?

--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
https://www.linkedin.com/in/steve-edwards-4244281

--
_
-- 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] How to show codec packetization?

2017-02-27 Thread Steve Edwards

Asterisk 13.3.2

The console command 'sip show settings' shows the allowed codecs in the 
'Global Signalling Settings' but does not include the packetization 
setting.


Similarly, both 'core show channel' and 'sip show channel' will show the 
codec(s), but not the packetization.


How can I show the the configured and the actual (in use) packetization?

--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
https://www.linkedin.com/in/steve-edwards-4244281

--
_
-- 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] Some SIP and IAX Asterisk unreachable after server restart

2017-02-27 Thread Gokan Atmaca
>
> Everything is working again if we restart the customers Asterisk.

Have you looked at the error logs?

On Mon, Feb 27, 2017 at 3:03 PM, Administrator TOOTAI  wrote:
> Hi all,
>
> we have a running Asterisk 11.25.1 in a VM (qemu/kvm) OS being Debian 7.11
> (wheezy), the host OS being the same.
>
> Problem: when we restart the server (eg host + VM), all customers Asterisk
> connecting without a VPN (doesn't matter which Asterisk version) are no more
> reachable. Same for IAX users.
>
> On the host side, after restart, SIP packet are entering the host but NOT to
> the VM (tshark debug). In IAX, POKE packets sended by the VM are reaching
> the client Asterisk but no packet answer.
>
> Everything is working again if we restart the customers Asterisk.
>
> Any clue ?
>
> Regards
>
> --
> 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

-- 
_
-- 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] Looking for Speech Recognition (ASR) suggestions

2017-02-27 Thread Dan Cropp
Thank you Luca.

Have a great day!

Dan


From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Luca Pradovera
Sent: Friday, February 24, 2017 4:09 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Looking for Speech Recognition (ASR) suggestions

Hello,
using UniMRCP and the MRCPRecog() dialplan function with "f" option 
(https://www.unimrcp.org/manuals/html/AsteriskManual.html#_Toc424230605), you 
can use ASR with Nuance/Lumenvox and have Asterisk play prompts locally.
You can alternatively have the MRCP server play audio, but that does tie up 
ports and require you to copy the files over.
We have done both in the past, but on Asterisk it is preferable to use local 
playback, it uses less resources and does not need to be managed.

Best regards,

Luca

On Fri, Feb 24, 2017 at 6:35 PM, Dan Cropp 
> wrote:
Hello Luca,

Thank you for your response.  I’m familiar with speech recognition and TTS, but 
new to MRCP.

Yes, the 100k options is used for names in a directory listing.

In the pre-MRCP support, Nuance ASR used API events/methods for the application 
to tell ASR when the prompt was playing and when it stopped.  If ASR detected 
speech, it would signal an event so we would stop playing the prompt.

When using MRCP for ASR, is MRCP responsible for playing any prompts during the 
recognition?
Basically, I’m wondering if I need to copy all the prompts stored on our 
Asterisk box to the MRCP box so it can use them during the play/ASR.  Or would 
some form of bridging be used for the play on Asterisk while MRCP would perform 
only the ASR?

Have a great day!

Dan


From: 
asterisk-users-boun...@lists.digium.com
 
[mailto:asterisk-users-boun...@lists.digium.com]
 On Behalf Of Luca Pradovera
Sent: Thursday, February 23, 2017 5:39 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Looking for Speech Recognition (ASR) suggestions

Hello,
you are correct. Very large grammars are only feasible with UniMRCP, and there 
is recognition quality to keep in mind too, which is far better on Nuance or 
Lumenvox than you can get with Pocketsphinx.

We use Lumenvox with UniMRCP for most ASR use cases, but with 100,000 options 
it might very well be the only solution for you.

Mind if I ask what the 100k options are for? Person names for a directory?

Best regards,

Luca

On Wed, Feb 22, 2017 at 4:43 PM, Dan Cropp 
> wrote:
Is it correct that the unimrcp is the best approach for Asterisk and ASR/TTS?

Could anyone provide pros/cons for the various ASR options for Asterisk?
We need the ability for very large grammars (over 100,000 options).  Because of 
this, my initial thought is Nuance or Lumenvox.  Does this sound correct?

Have a great day!

Dan

--
_
-- 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

-- 
_
-- 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] Which tool to automatically restart Asterisk ?

2017-02-27 Thread Tzafrir Cohen
On Mon, Feb 27, 2017 at 06:00:30PM +0500, Tahir Almas wrote:
> Sorry  ,  I  forget  it  for another monitoring tool  monit  that we have
> used  in  our production systems  to restart  asterisk  in case of asterisk
> crash or  halt.

[snip]

Some notes regarding the asterisk monit configuration:

> check process asterisk with pidfile /var/run/asterisk/asterisk.pid
> group asterisk
> start program = "/bin/bash -c 'ulimit -n 16386 && /etc/init.d/asterisk 
> start'"

If you use systemd, this ulimit will have no effect: when you restart a
service, it is restarted from a separate systemd context (cgroup) and
not directly under your own.

It would generalyl be a good idea not to embed such settings in your
scripts and rather put them in a proper configuration file. What happens
in you happen to run '/etc/init.d/asterisk restart'? It seems that all's
well, until you're suddenly out of file descriptors.

> stop program = "/etc/init.d/asterisk stop"
> if does not exist for 2 cycles then restart
> if failed port 5060 type udp protocol SIP 
> and target "011@127.0.0.1" maxforward 10 
> for 2 cycles then restart
> if failed host 127.0.0.1 port 5038 with timeout 15 seconds for 2 cycles 
> then restart
> if 5 restarts within 5 cycles then timeout

Nice.

Also: what happens when you run 'core stop now' from within asterisk?

-- 
   Tzafrir Cohen
icq#16849755  jabber:tzafrir.co...@xorcom.com
+972-50-7952406   mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com

-- 
_
-- 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] Which tool to automatically restart Asterisk ?

2017-02-27 Thread Tahir Almas
Sorry  ,  I  forget  it  for another monitoring tool  monit  that we have
used  in  our production systems  to restart  asterisk  in case of asterisk
crash or  halt.

I have attached a monit configuration for your reference. it  will work
almost in all cases

This configuration will check Asterisk for following

1. will check for Asterisk process.
2. will check Asterisk via AMI
3. will check Asterisk by sending a SIP request

You simply need to install monit and place attached file on your server as
/etc/monit.d/asterisk.conf and then restart monit service daemon



*Tahir Almas*

Managing Partner
ICT Innovations
http://www.ictbroadcast.com
http://www.ictinnovations.com
Leveraging open source in ICT



On Thu, Feb 23, 2017 at 3:45 PM, Olivier  wrote:

>
>
> 2017-02-21 14:09 GMT+01:00 Tahir Almas :
>
>> Why  not  to use  Fail2ban  https://www.voip-info.org/wiki
>> /view/Fail2Ban+%28with+iptables%29+And+Asterisk
>>
>> How would fail2ban detect that Asterisk needs to be restarted ?
>
>
>>
>>
>> *Tahir Almas*
>>
>> Managing Partner
>> ICT Innovations
>> http://www.ictinnovations.com
>> http://www.ictbroadcast.com
>> Leveraging open source in ICT
>>
>>
>>
>> On Tue, Feb 21, 2017 at 12:28 AM, Tzafrir Cohen > > wrote:
>>
>>> On Mon, Feb 20, 2017 at 11:36:24AM -0300, Victor Villarreal wrote:
>>> > Hi, Oliver.
>>> >
>>> > Maybe something like this (add this script to your crontab):
>>> >
>>> > 8<--
>>> >
>>> > #!/bin/bash
>>> > #
>>> > # File: asterisk-watchdog.sh
>>> > # Date: 2015.05.26
>>> > # Build:v1.0
>>> > # Brief:Secuencia para monitorizar procesos.
>>> > #
>>> > # ${PATH}: Variable de entorno con las rutas a los ejecutables.
>>> > PATH=/bin:/sbin:/usr/bin:/usr/sbin
>>> >
>>> > # ${DAEMON}: Demonio a monitorizar.
>>> > DAEMON="asterisk"
>>> >
>>> > # ${MSG}: Cuerpo del mensaje a enviar por mail.
>>> > MSG="$(date '+%F %T'): ${DAEMON} se ha caido!"
>>> >
>>> > pidof ${DAEMON} > /dev/null 2>&1
>>> >
>>> > [ $? -ne 0 ] && { echo ${MSG}; service ${DAEMON} start; }
>>> >
>>> > exit 0
>>>
>>> Both Debian 8 and Centos 7 have systemd. Systemd gives you this type of
>>> monitoring almost for free (see previous reply).
>>>
>>> Using cron is generally not a good idea here:
>>>
>>> 1. No way to stop Asterisk when you need it.
>>>
>>> 2. If Asterisk has failed, it may take up to a minute to restart it.
>>>
>>> --
>>>Tzafrir Cohen
>>> icq#16849755  jabber:tzafrir.co...@xorcom.com
>>> +972-50-7952406   mailto:tzafrir.co...@xorcom.com
>>> http://www.xorcom.com
>>>
>>> --
>>> _
>>> -- 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
>>
>
>
> --
> _
> -- 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
>
check process asterisk with pidfile /var/run/asterisk/asterisk.pid
group asterisk
start program = "/bin/bash -c 'ulimit -n 16386 && /etc/init.d/asterisk 
start'"
stop program = "/etc/init.d/asterisk stop"
if does not exist for 2 cycles then restart
if failed port 5060 type udp protocol SIP 
and target "011@127.0.0.1" maxforward 10 
for 2 cycles then restart
if failed host 127.0.0.1 port 5038 with timeout 15 seconds for 2 cycles 
then restart
if 5 restarts within 5 cycles then timeout
-- 
_
-- 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

Re: [asterisk-users] Turn on SIP debugging from DialPlan

2017-02-27 Thread Igor Zamocky
Hi,

If you are ok with starting debug via external system call, why not to use 
something like this (I used to use something similar, it worked):

exten => _XXX,1,System(/usr/sbin/asterisk -rx ‘sip set debug peer PEER’)
same => n,Set(debug_on=1)
same => n,Dial(SIP/PEER/${EXTEN})

exten => h,1,GotoIf($[${debug_on} == 1]?undebug)
same => n,Hangup
same => n(undebug),System(( sleep 3 \; /usr/sbin/asterisk -rx 'sip set debug 
off' ) &)
same => n,Set(debug_on=0)
same => n,Hangup

I don’t know your setup, your dialplan logic, but I’m sure you can adapt it to 
your needs.

I.

> On 18 Feb 2017, at 00:26, Rafael dos Santos Saraiva  
> wrote:
> 
> Hi
> 
> I don't know if works, but you can try this:
> 
> System(tcpdump -nq -s 0 -i eth0 -w /tmp/sip.pcap port 5060 or 
> udp portrange 1-2 &);
> Wait(1);
> Dial(SIP/${EXTEN});
> System(pkill tcpdump);
> Hangup;
> 
> Or whitout RTP:
> 
> System(tcpdump -nq -s 0 -i eth0 -w /tmp/sip.pcap port 5060 &);
> Wait(1);
> Dial(SIP/${EXTEN});
> System(pkill tcpdump);
> Hangup;
> 
> Probably the last messages of SIP will be lost, BYE for example.
> 
> 
> 
> 
> 
> 2017-02-17 20:43 GMT-02:00 Derek Andrew  >:
> I have some troublesome numbers that I would like to capture the SIP dialogue 
> when I am calling them. When I am about to dial the number, is there any way 
> to turn on SIP debugging in the dial plan before I make the call? (and turn 
> it off after the call is completed?)
> 
> 
> 
> 
> --
> _
> -- 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 
> 
> 
> 
> 
> -- 
> Att,
> Rafael Saraiva
> -- 
> _
> -- 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] Some SIP and IAX Asterisk unreachable after server restart

2017-02-27 Thread Administrator TOOTAI

Hi all,

we have a running Asterisk 11.25.1 in a VM (qemu/kvm) OS being Debian 
7.11 (wheezy), the host OS being the same.


Problem: when we restart the server (eg host + VM), all customers 
Asterisk connecting without a VPN (doesn't matter which Asterisk 
version) are no more reachable. Same for IAX users.


On the host side, after restart, SIP packet are entering the host but 
NOT to the VM (tshark debug). In IAX, POKE packets sended by the VM are 
reaching the client Asterisk but no packet answer.


Everything is working again if we restart the customers Asterisk.

Any clue ?

Regards

--
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] BUG or ???

2017-02-27 Thread A J Stiles
On Saturday 25 Feb 2017, Антон Сацкий wrote:
> Thanks U Richard
> i know about this solution
> but the main question why "${} substitution containing
> the SHELL is evaluated before anything else"

For the same reason why you do raising to powers before multiplications and 
divisions, and all those before you do additions and subtractions.  It's just 
a mathematical convention, agreed upon a long time ago and handed down 
verbatim from generation to generation ever since.

> Can U describe the rules   when and  why it happens?

The order goes something like this  (this is from memory; check docs for 
definitive version):

* ${} variable substitution / munging
* $[] expression evaluation
  - () round brackets
  - - arithmetical negation
  - * / % multiply and divide
  - + - add and subtract
  - < = > and =~ comparison
  - ! and ~ NOT
  - && and & AND
  - !! and | ^ OR and EOR
* ?: embedded IFELSE operator

Since ${} has a higher priority than ?: then the contents of the ${SHELL ...} 
expression will be evaluated *before* Asterisk decides whether to do the bit 
between the ? and the : or the bit after the : .  (And the most deepest 
embedded ${FROMEXTEN} needs to be evaluated before the shell can even be 
spawned to deal with the command).  Having performed the SHELL command and got 
a result for the ${}, it *then* begins dealing with the $[] expression. 
${CALLERID(num)} is compared against the target.  It's found to be false  
(empty string or numeric zero),  therefore the Set(var29=...) does *not* 
happen.  But, thanks to operator precedence, Asterisk has *already* evaluated 
what it would have set var29 to *before* it decides not to set it.

It is generally better to use a GotoIf() to skip past a step you don't want 
done, rather than embed it into an ExecIf() .  This is not the 1980s anymore, 
and the odd well-placed GOTO is perfectly OK  (and I'd reckon, actually *more* 
readable than the circumlocution necessary to avoid using it).

-- 
AJS

Note:  Originating address only accepts e-mail from list!  If replying off-
list, change address to asterisk1list at earthshod dot co dot uk .

-- 
_
-- 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