tomek-o / tSIP

SIP softphone
https://tomeko.net/software/SIPclient/
157 stars 34 forks source link

Number buttons cannot be modified #22

Closed tomek-o closed 3 years ago

tomek-o commented 3 years ago

It seems the number buttons cannot be modified. Any way to make them show the letters, e.g. 2 = ABC, 7 = PRS... 0 = OPER? MicroSIP has letters on the buttons. I can't seem to be able to add these using Caption 2 either, there are no modification options. This makes dialing using letters difficult.

Originally posted by @InterLinked1 in https://github.com/tomek-o/tSIP/issues/10#issuecomment-808792854

tomek-o commented 3 years ago

With awfully huge changeset https://github.com/tomek-o/tSIP/commit/284ba31d9de450fbaa2f8161ad11c1ecc563d338 I've made most of the dialpad (excluding volume trackbars and transfer edit, but this should be separate change) configurable. Button container covers whole dialpad area, each of the 215 buttons can be assigned (parentId) to either dialpad or "main" container. There is automatic settings conversion from versions 0.1.x and 0.2.0.x.

Compiled exe is at http://tomeko.net/tmp/tSIP.exe. It is not thoroughly tested yet and may be subject of further changes, so if you have put work into your current configuration, backup it first.

Example settings for two-line button is attached below. Using bitmaps might be another option. ABC ABC2 Side note: if you would have number in clipboard (though this is I suppose less likely than having number on flyer or something like that) then using script to change letters to digits would be more convenient than using keypad.

InterLinked1 commented 3 years ago

With awfully huge changeset 284ba31 I've made most of the dialpad (excluding volume trackbars and transfer edit, but this should be separate change) configurable. Button container covers whole dialpad area, each of the 215 buttons can be assigned (parentId) to either dialpad or "main" container. There is automatic settings conversion from versions 0.1.x and 0.2.0.x.

Thank you! It only took me a few minutes to get this set up: image

Being able to move/remove the volume/transfer stuff would be nice as well but isn't directly as important functionality-wise.

Compiled exe is at http://tomeko.net/tmp/tSIP.exe. It is not thoroughly tested yet and may be subject of further changes, so if you have put work into your current configuration, backup it first.

Right now, I'm still tinkering around, and probably will be for a little bit. I can tell that this is the program of the future, but I need to figure some things out before I commit to all of the settings.

Example settings for two-line button is attached below. Using bitmaps might be another option.

I actually did try that as well. It was an epic fail for me, I couldn't get the bitmap to work, but maybe a custom skin is more what I was looking for (I did see that on the site). I was thinking it would be neat if I had this as the keypad: image

So the program would look like a real telephone keypad. Are the BLFs customizable as well? It would neat if I skin the whole program out to look like a 1A2 call director phone or something, where it had a nice 16-button keypad, a flash button (probably labeled "T" or "F" or "R" as they typically are), and then a bunch of line appearances which were solidly lit yellow for in use, blinking yellow for ringing, and then blinking yellow at a difference cadence for on hold. That's maybe a long term vision of mine I think might be possible with tSIP.

ABC ABC2 Side note: if you would have number in clipboard (though this is I suppose less likely than having number on flyer or something like that) then using script to change letters to digits would be more convenient than using keypad.

I have the softphone set up like an ATA as much as possible on a traditional telephone switch, so I can't send #s to it directly. A shortcut button like "DIAL TONE" or "LINE 1" or "L1" will dial a pseudocode to get real dial tone from the switch, and then I dial there. So I can't paste anything in using the clipboard anyways; I have to dial the number using the keypad. Incidentally, is there any way that the tones can be audible? It's a bit jarring to my senses that I don't hear the DTMF. A bonus would be being able to hold down a key and have the DTMF sound for as long as the key is held down, like on a real telephone. Obviously the single tone DTMF trick won't work on a softphone really, but more natural audio characteristics would be nice, even optionally. Likewise, would it be possible to hide the dialing box without hiding the answer/hangup buttons. Because of what I described, I don't have much use for seeing the digits, but if I hide that panel then I can't hang up a call since the button goes away.

What I really like about this program is that it is the closest I have seen in software to achieving all the functionality of a hardware analog telephone adapter, the "Flash" button being one example. I noticed that it even supports up to 8 ring cadences, which maybe most people have no use for, but I certainly do. I have a standard stock of 10 cadences, but all the important ones are in the first 8 since some ATAs only support 8 cadences. So now I can have it ring distinctively just like a real telephone - swell!

tomek-o commented 3 years ago

I actually did try that as well. It was an epic fail for me, I couldn't get the bitmap to work, but maybe a custom skin is more what I was looking for (I did see that on the site). I was thinking it would be neat if I had this as the keypad: image

This is conversion of my previous "0.2" example, based on your bitmap and one another I've found at https://www.jklmuseum.com/misc/vex3/FCBE97C0-54AA-4EF7-9BA2-411975009648.htm (not quite in same scale, so this is only aproximation): _demo_0_2__1A2.zip 1A2 Working: 16 DTMF buttons + CALL + HANGUP. In this type of kiosk-like application most functionality would be probably provided by scripts. For practical reasons functionality like registration (if used) state indication and call state indication would be valuable - there are script events for this and several button properties can be changed/updated from scripts. After pressing "3" four times and then "CALL" it should call sip:3333@sip2sip.info test number/URI. This is defined by "on_btn_call.lua" script assigned to "CALL" button. Button bitmaps for normal and pressed states are specified in static configuration and inside on_button_mouse_up_down.lua script.

If there would be any problem it is probably either missing microphone (might be replaced with "nullaudio" in settings) or need for manual network interface selection in settings. Buttons "pressed" state is just the same as basic state, only darker (two layers in Paint.net) - easy to create but it turns out it does not look convincing.

"FLASH" might be hit or miss depending on PABX. There are few different "standards" how it can be passed and I'm not sure if asterisk handles anything out of the box. I've seen it only in Grandstream Budgetone 100 and some old Aastra phone. There is also possibility that PABX would accept some feature code as FLASH.

"BLF" (or dialog-info subscription to be more precise) provides 3 states: terminated/early/confirmed (well much more actually with remote identity and this can be multiplied by a number of calls, but 3 states is typical situation) and you mentioned 4 states including hold. This can of course be done by subscribing another resource (this might be second, non-visible "BLF" button) and combining states with scripting, but I'm not sure if it would be easy to do on asterisk or any other PABX.

For local audible tones there is only https://tomeko.net/software/SIPclient/howto/local_dtmfs.php at the moment.

npstn-soft commented 3 years ago

Wow that's awesome.

InterLinked1 commented 3 years ago

I actually did try that as well. It was an epic fail for me, I couldn't get the bitmap to work, but maybe a custom skin is more what I was looking for (I did see that on the site). I was thinking it would be neat if I had this as the keypad: image

This is conversion of my previous "0.2" example, based on your bitmap and one another I've found at https://www.jklmuseum.com/misc/vex3/FCBE97C0-54AA-4EF7-9BA2-411975009648.htm (not quite in same scale, so this is only aproximation): _demo_0_2__1A2.zip 1A2 Working: 16 DTMF buttons + CALL + HANGUP. After pressing "3" four times and then "CALL" it should call sip:3333@sip2sip.info test number/URI. If there would be any problem it is probably either missing microphone (might be replaced with "nullaudio" in settings) or need for manual network interface selection in settings.

WOW!!! This is awesome. Words fail me. This is incredible - thank you!

Is there any particularly special about this or could one start tweaking settings from here to get it to work nicely?

Since the button fonts are changeable, I could import the font used for printing the numbers on the line buttons and use that instead for the most authentic look.

It looks like there are 18 buttons here, including the hold button (the red one). I'm going to try to stitch together a bigger bitmap - since tSIP supports 200+ buttons, no reason I can't make a 100 button call director, even if it never existed ;)

This particular call directory seems a bit non-standard in that I have never seen a "XMIT KEY" button before. It looks like you put the keypad on top of the phone here. I'll ask around and see if I can get some nice HD pictures of call directors. For busy lamp fields, I could get a GIF recorded to be used as the picture for status. To originate and get dial tone, one could press one of the line buttons (e.g. 555-2368) and get dial tone (button would change to solidly yellow lit), and to hang up, just press that again. Same for answering an incoming call on that line. I'm not sure if FLASH was in a consistent place but maybe the button above Hold would make sense. I'll do some research.

Buttons "pressed" state is just the same as basic state, only darker (two layers in Paint.net) - easy to create but it turns out it does not look convincing.

"FLASH" might be hit or miss depending on PABX. There are few different "standards" how it can be passed and I'm not sure if asterisk handles anything out of the box. I've seen it only in Grandstream Budgetone 100 and some old Aastra phone. There is also possibility that PABX would accept some feature code as FLASH.

All ATAs that I have encountered have the ability to send either SIP INFO or RFC2833 RTP flash events (or both).

Asterisk does not handle flashing out of the box, but probably not for much longer. In fact, I have been writing code to modify Asterisk to do it and just finished today. I'll be submitting my patches to Digium soon so that Asterisk will handle them by default. Otherwise, it propagates them but can't do anything with them, and certain event types were either not implemented or improperly implemented. I have fixed all that, with a little help, so that flash is now a first class citizen in Asterisk. Works correctly on my system so hopefully the patches will be merged soon.

tomek-o commented 3 years ago

Is there any particularly special about this or could one start tweaking settings from here to get it to work nicely?

Well, this basic bitmap is not the highest quality, I'm not sure if I haven't messed something with scaling. There is some issue with button positions moving (or background stretching? I'm not sure) when enabling/disabling main menu. I left main menu for now, as it is essential for debugging. Typically this is not the big issue as in kiosk application it would be always hidden, except when servicing (for servicing I was using "magic" button sequences so far). I've added setting to use ClientWidth/ClientHeight instead of Width/Height today - this is supposed to help with different window bar sizing in different Windows versions, but I haven't tested it yet. The hard part might be combining "standard" parts of the softphone using Windows components and custom graphics, but here it is only custom graphics (+3 text labels on buttons). Scripting in general has many parts that are specific to application (custom functions, events, communicating through variables and queues between scripts, using "Sleep" in scripts to yield if necessary - all scripts are running in GUI thread), so it is not the easiest. Luacheck in script editor helps with some types of errors.

It looks like there are 18 buttons here, including the hold button (the red one). I'm going to try to stitch together a bigger bitmap - since tSIP supports 200+ buttons, no reason I can't make a 100 button call director, even if it never existed ;)

Assuming that screen space would allow it.

This particular call directory seems a bit non-standard in that I have never seen a "XMIT KEY" button before. It looks like you put the keypad on top of the phone here. I'll ask around and see if I can get some nice HD pictures of call directors. For busy lamp fields, I could get a GIF recorded to be used as the picture for status.

GIFs are not supported, so at the moment only option for blinking seems to be switching bitmaps with script called by "on timer"/"on timer 2" event (after script from "on BLF change" event would set some flag-type variable). I'm not sure yet if some optimizations would not be necessary for larger numbers of buttons.

InterLinked1 commented 3 years ago

I've been doing some more playing around slowly, today with the "OOBE" version since it's easier to modify stuff that way. Got the BLFs working:

image

Those are two pictures of 1A2 lamps I quickly found online, though not the best quality but it's so small it does the job. At first, I put the idle one in as "idle" and then they all showed that, so it looks like "terminated" is actually the idle state and idle is reserved for non-BLFs only. I guess "early" would be ringing and "confirmed" is in an active call?

Even though GIFs are not supported now, do you think they ever would be? It seems it would be logical to then use a GIF of blinking for the ringing state. Right now it just shows the same way as busy which is good enough for now. Only a true phone guy would know the difference, but if I wanted to add it, wondering if I should wait for that eventually or try to script that sometime.

Even without GIFs, this is, once again, a huge improvement over MicroSIP, which frustratingly uses all the wrong colors for presence state. Love being able to customize it to something that makes sense to me.

On an actual 1A2 phone, pressing such a button would bridge you onto that line, which had a physical presence at the set. Pressing a BLF key would not call that number, but either bridge onto it or originate a call on that line. Technically, since numbers on my system have to be dialed at switch dial tone, if a call came in for an extension, that could be interpreted as a request to bridge onto that line, if the user had permission to do so. I don't have it set up that way currently, and am not sure if I will, but that's an interesting idea!

tomek-o commented 3 years ago

Those are two pictures of 1A2 lamps I quickly found online, though not the best quality but it's so small it does the job. At first, I put the idle one in as "idle" and then they all showed that, so it looks like "terminated" is actually the idle state and idle is reserved for non-BLFs only. I guess "early" would be ringing and "confirmed" is in an active call?

Bitmap described as "idle/invalid/non-BLF" is kind of default bitmap and in case of BLF button would be shown before subscription is active or if subscription would fail. "Normal" BLF/dialog-info states are terminated/early/confirmed.

Even though GIFs are not supported now, do you think they ever would be? It seems it would be logical to then use a GIF of blinking for the ringing state. Right now it just shows the same way as busy which is good enough for now. Only a true phone guy would know the difference, but if I wanted to add it, wondering if I should wait for that eventually or try to script that sometime.

I don't know how to handle GIFs and multiple GIFs with short frame intervals might be tricky to optimize. I've added state = GetButtonBlfState(buttonId) Lua function minute ago - this might be handy for "on timer" script as "on blf state" script event would not be necessary then. I don't have example at the moment, but timer (~500 ms period?) script could define a list of button identifiers, check each button state and set bitmaps depending on state and how many times it was running (example 6 from script window - even/uneven) for blinking effect.