Using DblQuote char in SIP Headers Causes Mayhem

I tested this with the PJSIP_HEADER function by adding this simple dialplan to extensions_custom.conf:

[addheaderhandler]
exten => addheader,1,Set(PJSIP_HEADER(add,x-test-header)="tommy tutone" <8008675309>)

[from-internal-custom]
exten => 10000,1,Dial(PJSIP/THENUMBER@Signalwire,,b(addheaderhandler^addheader^1))
same => n,hangup()

Result from dialing 10000:

INVITE sip:[email protected] SIP/2.0
Via: ...
...
x-test-header: "tommy tutone" <8008675309>
...

So, strictly speaking, quotes are not a problem. Maybe the custom function you are using doesn’t like them.