Not able to get Header values. Please let me know if i am missing some thing
[from-internal]
exten => _1XX,1,NoOp(Starting call to ${EXTEN})
same => n,Set(mute_status=${PJSIP_HEADER(read,X-Call-Mute)})
same => n,NoOp(Mute Status: ${mute_status})
same => n,Set(CDR(Mute)=${mute_status})
same => n,Dial(PJSIP/${EXTEN},60)
same => n,Hangup()
Js code is
const extraHeaders = [X-Call-Mute: yes, X-Caller-ID: ${'202'}] ;
this.currentSession.invite({
extraHeaders: extraHeaders
}).then(() => {
console.log(this.currentSession);
console.log(‘Mute status sent to Asterisk’);
}).catch(error => {
console.error(‘Error sending mute status to Asterisk:’, error);
});
You haven’t provided a SIP trace to confirm that the header is present, or a console log from Asterisk. As well if this is a re-INVITE, then you can’t get headers from re-INVITEs.
That has nothing to do with Asterisk. This is at SIP and JsSIP level. I can’t comment on JsSIP, but for SIP it’s an additional header in the format of “Name: Value”.
As I mentioned before too, if you’re sending multiple of these during a call in the form of re-INVTIEs then you will not be able to get the header from them.
That has nothing to do with Asterisk. This is at SIP and JsSIP level. I can’t comment on JsSIP, but for SIP it’s an additional header in the format of “Name: Value”.
As I mentioned before too, if you’re sending multiple of these during a call in the form of re-INVTIEs then you will not be able to get the header from them.