Hello, I was trying to build user directory file dynamically via a lua script at a dial-in event to listen to/leave a voice message, looking to pass some values from particular SIP headers. But the session object seems to be unavailable at that moment - next are the relevant config snippets, the dialplan: <extension name="vbox"> <condition field="destination_number" expression="^vb-(.+)$"> <action application="answer"/> <action application="voicemail" data="default ${domain_name} $1"/> </condition> </extension> and lua.conf: <param name="xml-handler-script" value="/usr/local/freeswitch/scripts/dp.lua"/> <param name="xml-handler-bindings" value="directory"/> The event message is like the one from: http://wiki.freeswitch.org/wiki/Mod_lua/Serving_Configuration#when_being_cal... The Core-UUID is different that channel UUID, so I could not find any API commands that could be used to get channel variables. Do I miss any setting/command that should get me access to channel variables or SIP headers inside the dp.lua? My quick workaround was to patch to be able to add extra headers to the internal event message (most of the time diving in the sources is the fast way to get things done :-) ). I am attaching the patch for the case there is no other solution and someone else is interested - by now it adds extra headers only when checking voicemail or recording a new message, but should be straightforward to add to other places across voicemail module if it has to (I can make the patch if one points other types of voicemail events that can benefit of extra headers). The patch adds a new channel variable, locate_event_extra_headers, that can be set to a prefix of the channel variable names that have to be passed as extra headers in the internal event message fired to locate user directory. An example is in the patch comments. If there is no solution to pass channel variables/SIP headers to the lua scripts used for generating user directories, would it be a good feature to add to devel branch? My particular need comes from using Kamailio as the SIP server and when user is offline, the call is directed to FreeSwitch for voicemail service. Also users can dial in to listed to messages. I want to pass voicemail box id, pincode and email via SIP headers, as I have them already loaded in Kamailio config script, avoiding another database lookup from freeswitch lua script. Cheers, Daniel -- Daniel-Constantin Mierla - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - http://asipto.com/u/kat Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - http://asipto.com/u/katu