header
# support
l
Debug Sip headers? I am sending sip headers for custom fields like first_name, address etc and its not showing up in vapi.ai , how can i integrate this into the conversation for dynamic custom fields in the conversation? exten => 9999,1,NoOp(DEBUGGING: lead_id=${lead_id} vendor_lead_code=${vendor_lead_code}) same => n,AGI(agi://127.0.0.1:4577/call_log) ; Required logging same => n,AGI(agi-set_variables.agi) ; Load all VICIdial lead variables ; Set individual headers after AGI populates variables same => n,Set(SIPAddHeader=X-FIRST_NAME: ${first_name}) same => n,Set(SIPAddHeader=X-LASTNAME: ${last_name}) same => n,Set(SIPAddHeader=X-ADDRESS: ${address1}) same => n,Set(SIPAddHeader=X-CITY: ${city}) same => n,Set(SIPAddHeader=X-ZIP: ${postal_code}) same => n,Set(SIPAddHeader=X-PHONE: ${phone_number}) same => n,Set(SIPAddHeader=X-STATE: ${state}) same => n,Dial(SIP/vapi) same => n,Hangup() The headers are being passed in the call log but vapi isnt displaying them.
v
According to [Vapi's SIP documentation](https://docs.vapi.ai/advanced/sip), there's currently a UI bug affecting how headers are processed. Try using the following workaround:
Copy code
javascript
// In your Vapi configuration, use the x-vapi-secret header
const transferDestination = {
  type: 'sip',
  sipUri: 'sip:your-endpoint@domain.com',
  sipHeaders: {
    'x-vapi-secret': 'your-secret',
    'X-FIRST_NAME': '${first_name}'
  }
};
This approach should help your custom headers get properly processed for template variables. Sources: - [Vapi SIP Documentation](https://docs.vapi.ai/advanced/sip) - [Discord Discussion](https://discord.com/channels/1211482211119796234/1340958485994803210)
c
Hey! To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!
n
@Leo Hackett Judging from the above Asterisk dialplan - you're doing it wrong, in fact, after examining a different Vicidial installation - I'm not fully confident this is even possible to do. Here is the primary reason - when you issue
same => n,Dial(SIP/vapi)
in Asterisk, it means that your agent is configured as a "client peer" - from Asterisk's perspective, you're not supposed to pass customer SIP headers to it. Remember, Asterisk behaves as a B2BUA server, which means, you need to setup VAPI as a trunk, not as a user - in order to do these fancy things. For example, in Cloudonix we do it like this:
Copy code
<Response>
  <Dial>
     <Header name="X-First-Name" value="John Doe" />
     <Header name="X-Zip" value="10010" />
     <Header name="X-Phone" value="+12127773456" />
     <Service provider="vapi"> 
       +12127128523
     </Service>
  <Dial>
</Response>
But again, Cloudonix is a different tool completely.
2 Views