[asterisk-users] Turn on SIP debugging from DialPlan
Igor Zamocky
igor at zamocky.sk
Mon Feb 27 06:32:01 CST 2017
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 <rafaelsnsa at gmail.com> 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 10000-20000 &);
> 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 <Derek.Andrew at usask.ca <mailto:Derek.Andrew at usask.ca>>:
> 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 <http://www.api-digital.com/> --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/ <https://community.asterisk.org/>
>
> New to Asterisk? Start here:
> https://wiki.asterisk.org/wiki/display/AST/Getting+Started <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 <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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20170227/6e9f263d/attachment.html>
More information about the asterisk-users
mailing list