Home AMX User Forum AMX General Discussion

Dialer Help

Although the below code is for XAP units and is for G4 panels, is there any reason for the phone number not to appear in the variable text box on a G5 panel, i have replaced the Text11 command with ^TXT-11,0 and when i put in a manual test string for a button event like SEND_COMMAND vdvTPa,"'^TXT-11,0, 123456'" it works and shows 123456 in the variable text box 11, but using the above code the CHAR cPHONE_NUMBER does not appear in the variable text box 11 but the actual code works and the unit dials and connects etc, what any i missing here any help greatly appreciated, i know it will be something simple, the code and variable text box both work on a TP4 touchscreens as i just copied and pasted previous working examples and changed the TEXT11- where ever it was used.

DEFINE_CONSTANT
// ATC Functions
atcDEV_XAP800 = '#5' //XAP 800
atcDEV_XAP400 = '#7' //XAP 400
atcDEV_ID = '0'
atc0 = 100
atc1 = 101
atc2 = 102
atc3 = 103
atc4 = 104
atc5 = 105
atc6 = 106
atc7 = 107
atc8 = 108
atc9 = 109
atcSTAR = 110
atcPOUND = 111
atcCALL_ANSWER = 112
atcHANG_UP = 113
atcFLASH = 114
atcCLEAR = 115
atcBACKSPACE = 116
atcANSWER = 118

DEFINE_VARIABLE
VOLATILE CHAR cXAP_RX[50]
VOLATILE INTEGER iPHONE_OFF_HOOK
VOLATILE CHAR cKEYPAD_ENTRY[1]
VOLATILE CHAR cPHONE_NUMBER[255]

DEVCHAN devATC_KEYPAD[] =
{{vdvTPd,atc0},{vdvTPd,atc1},{vdvTPd,atc2},{vdvTPd,atc3},{vdvTPd,atc4},
{vdvTPd,atc5},{vdvTPd,atc6},{vdvTPd,atc7},{vdvTPd,atc8},{vdvTPd,atc9},
{vdvTPd,atcSTAR},{vdvTPd,atcPOUND}}



BUTTON_EVENT[devATC_KEYPAD]
{
PUSH:
{
TO[vdvTPd,BUTTON.INPUT.CHANNEL]
IF(BUTTON.INPUT.CHANNEL = atcSTAR)
{
cKEYPAD_ENTRY = '*'
}
ELSE IF(BUTTON.INPUT.CHANNEL = atcPOUND)
{
cKEYPAD_ENTRY = '#'
}
ELSE
{
cKEYPAD_ENTRY = ITOA(BUTTON.INPUT.CHANNEL - 100)
}
IF(iPHONE_OFF_HOOK = 1)
{
SEND_STRING dvXAP,"atcDEV_XAP400,atcDEV_ID,' DIAL 1 ',cKEYPAD_ENTRY,$0D"
cPHONE_NUMBER = "cPHONE_NUMBER,cKEYPAD_ENTRY"
SEND_COMMAND vdvTPa,"'TEXT11-',cPHONE_NUMBER"
}
ELSE
{
cPHONE_NUMBER = "cPHONE_NUMBER,cKEYPAD_ENTRY"
SEND_COMMAND vdvTPa,"'TEXT11-',cPHONE_NUMBER"
}
}
}

BUTTON_EVENT[vdvTPd,atcFLASH] // Flash
{
PUSH:
{
TO[vdvTPd,BUTTON.INPUT.CHANNEL]
SEND_STRING dvXAP,"atcDEV_XAP400,atcDEV_ID,' HOOK 1',$0D"
}
}

BUTTON_EVENT[vdvTPd,atcCALL_ANSWER] // Call / Answer
{
PUSH:
{
TO[vdvTPd,BUTTON.INPUT.CHANNEL]
IF(LENGTH_STRING(cPHONE_NUMBER) > 0)
{
SEND_STRING dvXAP,"atcDEV_XAP400,atcDEV_ID,' DIAL 1 ',cPHONE_NUMBER,$0D"
}
ELSE
{
SEND_STRING dvXAP,"atcDEV_XAP400,atcDEV_ID,' TE 1 1',$0D"
}
}
}

BUTTON_EVENT[vdvTPd,atcANSWER] // Answer
{
PUSH:
{
TO[vdvTPd,BUTTON.INPUT.CHANNEL]
SEND_STRING dvXAP,"atcDEV_XAP400,atcDEV_ID,' TE 1 1',$0D"
SEND_COMMAND vdvTPa,'@PPF-Incoming Call'
IF(!iSYSTEM_POWER)
{
CALL 'SYSTEM ON' (* REV0 *)
DO_PUSH(vdvTPa,14) (* SELECT ATC MODE *)
}
}
}
BUTTON_EVENT[vdvTPd,atcCLEAR] // Clear
{
PUSH:
{
cPHONE_NUMBER = ''
cKEYPAD_ENTRY = ''
SEND_COMMAND vdvTPa,"'TEXT11-',cPHONE_NUMBER"
}
}

BUTTON_EVENT[vdvTPd,atcBACKSPACE] // Backspace
{
PUSH:
{
IF(LENGTH_STRING(cPHONE_NUMBER) > 0)
{
SET_LENGTH_STRING(cPHONE_NUMBER,(LENGTH_STRING(cPHONE_NUMBER) - 1))
}
SEND_COMMAND vdvTPa,"'TEXT11-',cPHONE_NUMBER"
}
}
BUTTON_EVENT[vdvTPd,atcHANG_UP] // Hang Up
{
PUSH:
{
TO[vdvTPd,BUTTON.INPUT.CHANNEL]
cPHONE_NUMBER = ''
cKEYPAD_ENTRY = ''
SEND_COMMAND vdvTPa,"'TEXT11-',cPHONE_NUMBER"
SEND_STRING dvXAP,"atcDEV_XAP400,atcDEV_ID,' TE 1 0',$0D"
}
}

Comments

  • GregGGregG Posts: 251
    Your devchan uses vdvTPd for the buttons, but the TEXT send_command is referring to vdvTPa, is that intentional?
  • alanhalanh Posts: 30
    Multiple panels connected to the system but only one for the XAP control so although not probably the neatest solution i have combined the vdvTPd and vdvTPa in the start up so that shouldnt really be an issue and as i said the send_command vdvTPa, "'^TXT-11,1,123456'" works and fills in the t variable text box, going to use ^UTF instead of text when back on site to see if it makes a difference. Thanks for your comments anyway.
  • alanhalanh Posts: 30
    Sorted, missing a comma, the command should have been send_command vdvTPa, "'^TXT-11,0,',cPhone_Number", you needed a commaafter the 0 (button state), fustrating frustrating to say the least.
Sign In or Register to comment.