Investiga por el lado de sobre que "channel" se establece dicha variable. Quizas en tu custom dialplan debas importar dicha variable desde el canal en cuestion.
[Jan 17 07:52:13] -- Executing [s@sub-oml-internalcall-connect:1] Verbose("PJSIP/1002-00000000", "2, The internal agent or camp call was attended !!! the new channel: SIP/AGENTXXXX is ready for varsset and bridge actions") in new stack
[Jan 17 07:52:13] == The internal agent or camp call was attended !!! the new channel: SIP/AGENTXXXX is ready for varsset and bridge actions
[Jan 17 07:52:13] -- Executing [s@sub-oml-internalcall-connect:2] Set("PJSIP/1002-00000000", "CHANNEL(language)=en") in new stack
[Jan 17 07:52:13] -- Executing [s@sub-oml-internalcall-connect:3] Goto("PJSIP/1002-00000000", "click2Call") in new stack
[Jan 17 07:52:13] -- Goto (sub-oml-internalcall-connect,s,27)
[Jan 17 07:52:13] -- Executing [s@sub-oml-internalcall-connect:27] Set("PJSIP/1002-00000000", "CHANNEL(hangup_handler_push)=rip-manualcall-agent-chan,s,1") in new stack
[Jan 17 07:52:13] -- Executing [s@sub-oml-internalcall-connect:28] AGI("PJSIP/1002-00000000", "omni-agent-status.py,GET,1") in new stack
[Jan 17 07:52:13] -- Launched AGI Script /var/lib/asterisk/agi-bin/omni-agent-status.py
[Jan 17 07:52:13] > 0x7f30540759b0 -- Strict RTP switching to RTP target address 10.12.12.2:20020 as source
ARGS: ['/var/lib/asterisk/agi-bin/omni-agent-status.py', 'GET', '1']
ENV LINE: agi_request: omni-agent-status.py
ENV LINE: agi_channel: PJSIP/1002-00000000
ENV LINE: agi_language: en
ENV LINE: agi_type: PJSIP
ENV LINE: agi_uniqueid: 1673952733.2
ENV LINE: agi_version: 20.0.0
ENV LINE: agi_callerid: 1002
ENV LINE: agi_calleridname: 1_Debra_Oliver
ENV LINE: agi_callingpres: 0
ENV LINE: agi_callingani2: 0
ENV LINE: agi_callington: 0
ENV LINE: agi_callingtns: 0
ENV LINE: agi_dnid: unknown
ENV LINE: agi_rdnis: unknown
ENV LINE: agi_context: sub-oml-internalcall-connect
ENV LINE: agi_extension: s
ENV LINE: agi_priority: 28
ENV LINE: agi_enhanced: 0.0
ENV LINE: agi_accountcode:
ENV LINE: agi_threadid: 139847719778048
ENV LINE: agi_arg_1: GET
ENV LINE: agi_arg_2: 1
ENV LINE:
class AGI: self.env = {'agi_accountcode': '',
'agi_arg_1': 'GET',
'agi_arg_2': '1',
'agi_callerid': '1002',
'agi_calleridname': '1_Debra_Oliver',
'agi_callingani2': '0',
'agi_callingpres': '0',
'agi_callingtns': '0',
'agi_callington': '0',
'agi_channel': 'PJSIP/1002-00000000',
'agi_context': 'sub-oml-internalcall-connect',
'agi_dnid': 'unknown',
'agi_enhanced': '0.0',
'agi_extension': 's',
'agi_language': 'en',
'agi_priority': '28',
'agi_rdnis': 'unknown',
'agi_request': 'omni-agent-status.py',
'agi_threadid': '139847719778048',
'agi_type': 'PJSIP',
'agi_uniqueid': '1673952733.2',
'agi_version': '20.0.0'}
COMMAND: SET VARIABLE "__OMLAGENTNAME" "Debra Oliver"
RESULT_LINE: 200 result=1
RESULT_DICT: {'result': ('1', '')}
COMMAND: SET VARIABLE "OMLAGENTSIP" "1002"
RESULT_LINE: 200 result=1
RESULT_DICT: {'result': ('1', '')}
COMMAND: SET VARIABLE "OMLAGENTSTATUS" "READY"
RESULT_LINE: 200 result=1
RESULT_DICT: {'result': ('1', '')}
COMMAND: SET VARIABLE "PAUSE_ID" ""
RESULT_LINE: 200 result=1
RESULT_DICT: {'result': ('1', '')}
[Jan 17 07:52:14] -- <PJSIP/1002-00000000>AGI Script omni-agent-status.py completed, returning 0
[Jan 17 07:52:14] -- Executing [s@sub-oml-internalcall-connect:29] ExecIf("PJSIP/1002-00000000", "0?QueueLog(ALL,1673952733.2,1,UNPAUSEALL,)") in new stack
[Jan 17 07:52:14] -- Executing [s@sub-oml-internalcall-connect:30] ExecIf("PJSIP/1002-00000000", "0?UnpauseQueueMember(,PJSIP/1002)") in new stack
[Jan 17 07:52:14] -- Executing [s@sub-oml-internalcall-connect:31] Set("PJSIP/1002-00000000", "SHARED(OMLCALLSTATUS,Local/1002@click2call-00000000;2)=CONNECT-AGENT") in new stack
[Jan 17 07:52:14] -- Executing [s@sub-oml-internalcall-connect:32] Set("PJSIP/1002-00000000", "SHARED(OMLAGENTID,Local/1002@click2call-00000000;2)=1") in new stack
[Jan 17 07:52:14] -- Executing [s@sub-oml-internalcall-connect:33] Set("PJSIP/1002-00000000", "SHARED(OMLAGENTNAME,Local/1002@click2call-00000000;2)=Debra Oliver") in new stack
[Jan 17 07:52:14] -- Executing [s@sub-oml-internalcall-connect:34] Set("PJSIP/1002-00000000", "SHARED(OMLAGENTSIP,Local/1002@click2call-00000000;2)=1002") in new stack
[Jan 17 07:52:14] -- Executing [s@sub-oml-internalcall-connect:35] Return("PJSIP/1002-00000000", "") in new stack
[Jan 17 07:52:14] == Spawn extension (from-oml, , 1) exited non-zero on 'PJSIP/1002-00000000'
[Jan 17 07:52:14] -- PJSIP/1002-00000000 Internal Gosub(sub-oml-internalcall-connect,s,1(click2Call)) complete GOSUB_RETVAL=
[Jan 17 07:52:14] -- Local/1002@click2call-00000000;1 answered