Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pjsua-2 Android- How to add custom header to INVITE request while making a call?

I need to add a Subject header to the invite request while making a call. I am using the PJSUA library.

I found this question. But I couldn't implement it. Please help.

Thanks in advance

like image 641
rya Avatar asked Mar 09 '23 17:03

rya


1 Answers

i figured it out. SipTxOption should be added to CallOpParam:

    CallOpParam prm = new CallOpParam(true);
    SipHeader sipHeader = new SipHeader();
    sipHeader.setHName("Subject");
    sipHeader.setHValue("paid call");
    SipHeaderVector sipHeaderVector = new SipHeaderVector();
    sipHeaderVector.add(sipHeader);
    SipTxOption sipTxOption = new SipTxOption();
    sipTxOption.setHeaders(sipHeaderVector);
    prm.setTxOption(sipTxOption);
    call.makeCall(buddy_uri, prm);
like image 180
rya Avatar answered Apr 06 '23 01:04

rya