SIP header blank?

Problem: Asterisk adds the SIP header Jitsi-Conference-Room:
We are recording a PIN to ${Pin}, but the variable ${JITSI} is not being updated inside Asterisk.

[2020-05-18 11:45:53] VERBOSE[8447] pbx.c:     -- Executing [[email protected]:2] Read("SIP/mediatrix-000350f8", "Pin,"custom/jitsi"") in new stack
[2020-05-18 11:45:53] VERBOSE[8447] pbx.c:     -- Executing [[email protected]:2] Read("SIP/mediatrix-000350f8", "Pin,"custom/jitsi"") in new stack
[2020-05-18 11:45:53] VERBOSE[8447] file.c:     -- <SIP/mediatrix-000350f8> Playing 'custom/jitsi.slin' (language 'en')
[2020-05-18 11:45:53] VERBOSE[8447] file.c:     -- <SIP/mediatrix-000350f8> Playing 'custom/jitsi.slin' (language 'en')
[2020-05-18 11:46:01] VERBOSE[8447] app_read.c:     -- User entered '55555555'
[2020-05-18 11:46:01] VERBOSE[8447] app_read.c:     -- User entered '55555555'
[2020-05-18 11:46:01] VERBOSE[8447] pbx.c:     -- Executing [[email protected]:3] Verbose("SIP/mediatrix-000350f8", "result is: 55555555") in new stack
[2020-05-18 11:46:01] VERBOSE[8447] pbx.c:     -- Executing [[email protected]:3] Verbose("SIP/mediatrix-000350f8", "result is: 55555555") in new stack
[2020-05-18 11:46:01] VERBOSE[8447] app_verbose.c: result is: 55555555
[2020-05-18 11:46:01] VERBOSE[8447] app_verbose.c: result is: 55555555
// Here we read in the PIN and are passing it to the AGI script.  Running manually returns the desired conference info. (Shown below)
[2020-05-18 11:46:01] VERBOSE[8447] pbx.c:     -- Executing [[email protected]:4] AGI("SIP/mediatrix-000350f8", "jitsi_curling.sh,55555555") in new stack
[2020-05-18 11:46:01] VERBOSE[8447] pbx.c:     -- Executing [[email protected]:4] AGI("SIP/mediatrix-000350f8", "jitsi_curling.sh,55555555") in new stack
[2020-05-18 11:46:01] VERBOSE[8447] res_agi.c:     -- Launched AGI Script /var/lib/asterisk/agi-bin/jitsi_curling.sh
[2020-05-18 11:46:01] VERBOSE[8447] res_agi.c:     -- Launched AGI Script /var/lib/asterisk/agi-bin/jitsi_curling.sh
[2020-05-18 11:46:01] VERBOSE[8447] res_agi.c:     -- <SIP/mediatrix-000750f8>AGI Script jitsi_curling.sh completed, returning 0
[2020-05-18 11:46:01] VERBOSE[8447] res_agi.c:     -- <SIP/mediatrix-000750f8>AGI Script jitsi_curling.sh completed, returning 0
--> [2020-05-18 11:46:01] VERBOSE[8447] pbx.c:     -- Executing [[email protected]:5] Verbose("SIP/mediatrix-000350f8", "result is: ") in new stack
--> [2020-05-18 11:46:01] VERBOSE[8447] pbx.c:     -- Executing [[email protected]:5] Verbose("SIP/mediatrix-000350f8", "result is: ") in new stack
// SET VARIABLE JITSI??????  This is not working....  Result is empty.
[2020-05-18 11:46:01] VERBOSE[8447] app_verbose.c: result is:
[2020-05-18 11:46:01] VERBOSE[8447] app_verbose.c: result is:
//SIPAddHeader is adding the Jitsi header, but w/o the result 
[2020-05-18 11:46:01] VERBOSE[8447] pbx.c:     -- Executing [[email protected]:6] SIPAddHeader("SIP/mediatrix-000350f8", "Jitsi-Conference-Room: ") in new stack
[2020-05-18 11:46:01] VERBOSE[8447] pbx.c:     -- Executing [[email protected]:6] SIPAddHeader("SIP/mediatrix-000350f8", "Jitsi-Conference-Room: ") in new stack
// We set the SIP header correctly, but it is blank.
[2020-05-18 11:46:01] VERBOSE[8447] pbx.c:     -- Executing [[email protected]:7] Macro("SIP/mediatrix-000350f8", "exten-vm,novm,800,0,0,0") in new stack
[2020-05-18 11:46:01] VERBOSE[8447] pbx.c:     -- Executing [[email protected]:7] Macro("SIP/mediatrix-000350f8", "exten-vm,novm,800,0,0,0") in new stack

Manually, can map conferences perfectly:

[[email protected] ~]# /var/lib/asterisk/agi-bin/jitsi_curling.sh 459802518

SET VARIABLE JITSI “jealouswolvescrawlcuriously”
-or-
SET VARIABLE JITSI “false”

Extension 800 in /etc/asterisk/extensions_override_freepbx.conf is this:

[ext-local]
exten => 800,1,Set(__RINGTIMER=${IF($["${DB(AMPUSER/800/ringtimer)}" > "0"]?${DB(AMPUSER/800/ringtimer)}:${RINGTIMER_DEFAULT})})
exten => 800,2,Read(Pin,"custom/jitsi")
exten => 800,3,Verbose(result is: ${Pin})
exten => 800,4,AGI(jitsi_curling.sh,${Pin})
exten => 800,5,Verbose(result is: ${JITSI})
exten => 800,6,SIPAddHeader(Jitsi-Conference-Room: ${JITSI})
exten => 800,7,Macro(exten-vm,novm,800,0,0,0)
exten => 800,8(dest),Set(__PICKUPMARK=)
exten => 800,9,Goto(${IVR_CONTEXT},return,1)
exten => 800,hint,SIP/800&Custom:DND800,CustomPresence:800

Unless your AGI is sharing the variable context with Asterisk, I wouldn’t expect this to work. You need to make sure the JITSI variable is actually passed back to the parent process for this to work correctly, just like function calls anywhere.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.