[arm-allstar] scripting - last dtmf digit received in client display
Doug Crompton
doug at crompton.com
Mon Dec 7 23:01:59 EST 2015
Neil,
Unfortunately usually things are often not as easy as you describe. It sounds simple on paper but sometimes implementing even simple things and checking them out is usually more complicated.
What is your application that you need the last digit? You do know there is full script interface through DTMF now via defined functions in rpt.conf. We call many scripts via this method. You would have to enter more than one key but lets say you wanted to do 10 different things. I use this method to turn relays on and off or any other type of control. Here is an example -
881=cmd,/etc/asterisk/local/control.sh 1 882=cmd,/etc/asterisk/local/control.sh 2
883=cmd,/etc/asterisk/local/control.sh 3
884=cmd,/etc/asterisk/local/control.sh 4
885=cmd,/etc/asterisk/local/control.sh 5
etc.
So DTMF *881 would send the variable 1 to the control.sh script. The script would then interpret this and do whatever you wanted. You could have as many codes as you desired as long as they did not overlap existing codes.
You can send multiple variables to a script so as another example -
881=cmd,/etc/asterisk/local/relay_control.sh 1 ON 882=cmd,/etc/asterisk/local/relay_control.sh 1 OFF
etc.
This could be used to turn on and off relays as defined by the script using the passed variables.
There is a lot of power in the code now and it is our thought to not add more complexity but rather simplify the existing code and make external scripts do the work. The external scripts could be bash, perl, php, C, etc.
73 Doug
WA3DSP
http://www.crompton.com/hamradio
> From: k8it at cac.net
> To: arm-allstar at hamvoip.org
> Date: Mon, 7 Dec 2015 19:46:43 -0500
> Subject: Re: [arm-allstar] scripting - last dtmf digit received in client display
>
> I am not a C programmer or I would offer to help.
> It seems to me that since the last received DTMF digit is written to the
> client display, that maybe adding one line of C code to write the digit to a
> temporary variable which a user script could poll, could be a quick and easy
> solution
> of course it would be over written as soon as the next DTMF digit arrived.
>
> Thanks
> 73 Neil Sablatzky K8IT
> Allstar Node 41838 KITLINK
> Allstar Node 42087 KITLINK HUB
> IRLP Node exp0068
> Echolink K8IT-L
> WIRES-X K8IT 11479 Room 21479
>
> --------------------------------------------------
> From: "David McGough" <kb4fxc at inttek.net>
> Sent: Monday, December 07, 2015 5:07 PM
> To: "ARM Allstar" <arm-allstar at hamvoip.org>
> Subject: Re: [arm-allstar] scripting - last dtmf digit received in client
> display
>
> >
> > Hi Neil,
> >
> > Yes, I agree that simpler access to DTMF sequences, etc., would be very
> > nice. These are hacks which would get added to the app_rpt.c code and my
> > notion is that expanding the current command ("cmd") scripting capability
> > would be useful...On a side note, this capability should already be
> > available directly via AGI scripting from Asterisk. However, I haven't
> > investigated if AGI scripts would suffice for some more complex
> > applications--perhaps like remote base control. (Anybody got any ideas
> > here?)
> >
> > I'm not going to make any promises for the upcoming release, since I'm
> > feverishly trying to get some MAJOR changes completed. However, if other
> > programmers out there want to have a look at this request, I'm all for it!
> > Your efforts won't fall on deaf ears!
> >
> > 73, David KB4FXC
> >
> >
> >
> >
> > On Mon, 7 Dec 2015, Neil k8it wrote:
> >
> >> I just had a thought for a neat script.
> >> What temporary variable or other method can I use in a script to return
> >> the
> >> last entered DTMF digit as displayed in the client ? If it does not
> >> exsist,
> >> can it be included in the upcoming code release?
> >>
> >>
> >> Thanks
> >> 73 Neil Sablatzky K8IT
> >> Allstar Node 41838 KITLINK
> >> Allstar Node 42087 KITLINK HUB
> >> IRLP Node exp0068
> >> Echolink K8IT-L
> >> WIRES-X K8IT 11479 Room 21479
> >>
> >> --------------------------------------------------
> >> From: "David McGough" <kb4fxc at inttek.net>
> >> Sent: Friday, December 04, 2015 1:34 PM
> >> To: "ARM Allstar" <arm-allstar at hamvoip.org>
> >> Subject: Re: [arm-allstar] Fob not recognized
> >>
> >> >
> >> > Hi Lito,
> >> >
> >> > Outstanding!!! Thanks for contributing! I'll review and integrate your
> >> > patches.
> >> >
> >> > For everyone else who is interested, I'll copy a couple beta-test
> >> > binaries
> >> > up to the hamvoip download site this weekend and provide install
> >> > instruction.
> >> >
> >> >
> >> > 73, David KB4FXC
> >> >
> >> >
> >> >
> >> > On Fri, 4 Dec 2015, Roselito de los Reyes wrote:
> >> >
> >> >> Here is the patched file.
> >> >>
> >> >> > Date: Thu, 3 Dec 2015 10:26:23 -0500
> >> >> > From: kb4fxc at inttek.net
> >> >> > To: arm-allstar at hamvoip.org
> >> >> > Subject: Re: [arm-allstar] Fob not recognized
> >> >> >
> >> >> >
> >> >> > I'll patch chan_simpleusb and chan_usbradio, initially. Once tested,
> >> >> > I'll
> >> >> > add it to our new drivers, too.
> >> >> >
> >> >> >
> >> >> > On Thu, 3 Dec 2015, Roselito de los Reyes wrote:
> >> >> >
> >> >> > > Hi David,
> >> >> > >
> >> >> > > I would love to!
> >> >> > > Are the changes going to be in the chan_simpleusb.c only?
> >> >> > >
> >> >> > > Best regards,
> >> >> > >
> >> >> > > Roselito De Los Reyes
> >> >> > >
> >> >> > >
> >> >> > > > On Dec 3, 2015, at 6:14 AM, David McGough <kb4fxc at inttek.net>
> >> >> > > > wrote:
> >> >> > > >
> >> >> > > >
> >> >> > > > Hi Lito,
> >> >> > > >
> >> >> > > >
> >> >> > > > That Product ID (0x0014) isn't currently recognized by the
> >> >> > > > channel
> >> >> > > > drivers as a CM108/CM119 compatible sound chip. Currently, the
> >> >> > > > only
> >> >> > > > recognized Product IDs are: 0x000c, 0x013c, 0x0008, 0x013a and
> >> >> > > > 0x6a00.
> >> >> > > >
> >> >> > > > I'll try to confirm which variant of the CM108/CM119 that ID
> >> >> > > > corresponds
> >> >> > > > to and add it to the upcoming firmware release, which we're
> >> >> > > > looking
> >> >> > > > forward to this month!
> >> >> > > >
> >> >> > > > Are you willing to do some beta testing before the new release?
> >> >> > > >
> >> >> > > >
> >> >> > > > 73, David KB4FXC
> >> >> > > >
> >> >> > > >
> >> >> > > >
> >> >> > > >
> >> >> > > >> On Wed, 2 Dec 2015, Roselito de los Reyes wrote:
> >> >> > > >>
> >> >> > > >> Hi Doug,
> >> >> > > >>
> >> >> > > >> I built a new fob using the same manufacturer Sabrent. This new
> >> >> > > >> batch that I got has a different id showing as
> >> >> > > >>
> >> >> > > >> 0003:0D8C:0014.0005 instead of
> >> >> > > >> 0003:0D8C:000C.0004 in the models I purchased a couple months
> >> >> > > >> ago
> >> >> > > >> and is not picked up on simpleusb.
> >> >> > > >>
> >> >> > > >> Here is the result from dmesg
> >> >> > > >>
> >> >> > > >> [ 670.561777] usb 1-1.5: new full-speed USB device number 4
> >> >> > > >> using
> >> >> > > >> dwc_otg
> >> >> > > >> [ 670.690063] usb 1-1.5: New USB device found, idVendor=0d8c,
> >> >> > > >> idProduct=0014
> >> >> > > >> [ 670.697166] usb 1-1.5: New USB device strings: Mfr=1,
> >> >> > > >> Product=2, SerialNumber=0
> >> >> > > >> [ 670.704667] usb 1-1.5: Product: USB Audio Device
> >> >> > > >> [ 670.709401] usb 1-1.5: Manufacturer: C-Media Electronics
> >> >> > > >> Inc.
> >> >> > > >> [ 670.723289] input: C-Media Electronics Inc. USB Audio Device
> >> >> > > >> as
> >> >> > > >> /devices/platform/bcm2708_usb/usb1/1-1/1-1.5/1-1.5:1.3/0003:0D8C:0014.0001/input/input0
> >> >> > > >> [ 670.737628] hid-generic 0003:0D8C:0014.0001: input,hidraw0:
> >> >> > > >> USB
> >> >> > > >> HID v1.00 Device [C-Media Electronics Inc. USB Audio Device] on
> >> >> > > >> usb-bcm2708_usb-1.5/input3
> >> >> > > >> [ 670.835956] usbcore: registered new interface driver
> >> >> > > >> snd-usb-audio
> >> >> > > >> [ 703.615739] usb 1-1.5: USB disconnect, device number 4
> >> >> > > >> [ 711.532519] usb 1-1.5: new full-speed USB device number 5
> >> >> > > >> using
> >> >> > > >> dwc_otg
> >> >> > > >> [ 711.660783] usb 1-1.5: New USB device found, idVendor=0d8c,
> >> >> > > >> idProduct=0014
> >> >> > > >> [ 711.667872] usb 1-1.5: New USB device strings: Mfr=1,
> >> >> > > >> Product=2, SerialNumber=0
> >> >> > > >> [ 711.675404] usb 1-1.5: Product: USB Audio Device
> >> >> > > >> [ 711.680143] usb 1-1.5: Manufacturer: C-Media Electronics
> >> >> > > >> Inc.
> >> >> > > >> [ 711.718468] input: C-Media Electronics Inc. USB Audio Device
> >> >> > > >> as
> >> >> > > >> /devices/platform/bcm2708_usb/usb1/1-1/1-1.5/1-1.5:1.3/0003:0D8C:0014.0002/input/input1
> >> >> > > >> [ 711.733088] hid-generic 0003:0D8C:0014.0002: input,hidraw0:
> >> >> > > >> USB
> >> >> > > >> HID v1.00 Device [C-Media Electronics Inc. USB Audio Device] on
> >> >> > > >> usb-bcm2708_usb-1.5/input3
> >> >> > > >> [ 713.345041] usb 1-1.5: USB disconnect, device number 5
> >> >> > > >> [ 715.632593] usb 1-1.2: new full-speed USB device number 6
> >> >> > > >> using
> >> >> > > >> dwc_otg
> >> >> > > >> [ 715.760943] usb 1-1.2: New USB device found, idVendor=0d8c,
> >> >> > > >> idProduct=0014
> >> >> > > >> [ 715.768049] usb 1-1.2: New USB device strings: Mfr=1,
> >> >> > > >> Product=2, SerialNumber=0
> >> >> > > >> [ 715.775555] usb 1-1.2: Product: USB Audio Device
> >> >> > > >> [ 715.780293] usb 1-1.2: Manufacturer: C-Media Electronics
> >> >> > > >> Inc.
> >> >> > > >> [ 715.818392] input: C-Media Electronics Inc. USB Audio Device
> >> >> > > >> as
> >> >> > > >> /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.3/0003:0D8C:0014.0003/input/input2
> >> >> > > >> [ 715.833072] hid-generic 0003:0D8C:0014.0003: input,hidraw0:
> >> >> > > >> USB
> >> >> > > >> HID v1.00 Device [C-Media Electronics Inc. USB Audio Device] on
> >> >> > > >> usb-bcm2708_usb-1.2/input3
> >> >> > > >>
> >> >> > > >> and this is the one that simpleusb picks up.
> >> >> > > >> [ 716.929536] usb 1-1.2: USB disconnect, device number 6
> >> >> > > >> [ 723.312723] usb 1-1.5: new full-speed USB device number 7
> >> >> > > >> using
> >> >> > > >> dwc_otg
> >> >> > > >> [ 723.434976] usb 1-1.5: New USB device found, idVendor=0d8c,
> >> >> > > >> idProduct=000c
> >> >> > > >> [ 723.442026] usb 1-1.5: New USB device strings: Mfr=0,
> >> >> > > >> Product=1, SerialNumber=0
> >> >> > > >> [ 723.449569] usb 1-1.5: Product: C-Media USB Headphone Set
> >> >> > > >> [ 723.489585] input: C-Media USB Headphone Set as
> >> >> > > >> /devices/platform/bcm2708_usb/usb1/1-1/1-1.5/1-1.5:1.3/0003:0D8C:000C.0004/input/input3
> >> >> > > >> [ 723.503045] hid-generic 0003:0D8C:000C.0004: input,hidraw0:
> >> >> > > >> USB
> >> >> > > >> HID v1.00 Device [C-Media USB Headphone Set ] on
> >> >> > > >> usb-bcm2708_usb-1.5/input3
> >> >> > > >>
> >> >> > > >>
> >> >> > > >> Thanks
> >> >> > > >>
> >> >> > > >> Lito
> >> >> > > >
> >> >> > > > _______________________________________________
> >> >> > > >
> >> >> > > > arm-allstar mailing list
> >> >> > > > arm-allstar at hamvoip.org
> >> >> > > > http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
> >> >> > > >
> >> >> > > > Visit the BBB and RPi2 web page - http://hamvoip.org
> >> >> > > _______________________________________________
> >> >> > >
> >> >> > > arm-allstar mailing list
> >> >> > > arm-allstar at hamvoip.org
> >> >> > > http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
> >> >> > >
> >> >> > > Visit the BBB and RPi2 web page - http://hamvoip.org
> >> >> > >
> >> >> >
> >> >> > _______________________________________________
> >> >> >
> >> >> > arm-allstar mailing list
> >> >> > arm-allstar at hamvoip.org
> >> >> > http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
> >> >> >
> >> >> > Visit the BBB and RPi2 web page - http://hamvoip.org
> >> >>
> >> >
> >> > _______________________________________________
> >> >
> >> > arm-allstar mailing list
> >> > arm-allstar at hamvoip.org
> >> > http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
> >> >
> >> > Visit the BBB and RPi2 web page - http://hamvoip.org
> >> >
> >> _______________________________________________
> >>
> >> arm-allstar mailing list
> >> arm-allstar at hamvoip.org
> >> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
> >>
> >> Visit the BBB and RPi2 web page - http://hamvoip.org
> >>
> >
> > _______________________________________________
> >
> > arm-allstar mailing list
> > arm-allstar at hamvoip.org
> > http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
> >
> > Visit the BBB and RPi2 web page - http://hamvoip.org
> >
> _______________________________________________
>
> arm-allstar mailing list
> arm-allstar at hamvoip.org
> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>
> Visit the BBB and RPi2 web page - http://hamvoip.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hamvoip.org/pipermail/arm-allstar/attachments/20151207/3a8c17e3/attachment-0001.html>
More information about the arm-allstar
mailing list