Skip to content

Commit

Permalink
custom header thins are removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Emre TUFEKCI committed Feb 15, 2022
1 parent ec1b0f9 commit 21c01af
Showing 1 changed file with 0 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ std::string onIncomingCallHeader;

bool registerState = false;

void setOnIncomingCallerHeader(std::string onIncomingCallerHeaderStr){
onIncomingCallHeader = onIncomingCallerHeaderStr;
}

std::string getOnIncomingCallerHeader(){
return onIncomingCallHeader;
}

void setCallerId(std::string callerIdStr){
callerId = callerIdStr;
Expand Down Expand Up @@ -93,13 +86,7 @@ class MyCall : public Call
// Notification when call's state has changed.
virtual void onCallState(OnCallStateParam &prm){
CallInfo ci = getInfo();
static std::string remoteHeader = "";

if (prm.e.body.tsxState.tsx.statusText == "OK" && prm.e.body.tsxState.tsx.statusCode == 200){
if(remoteHeader.empty() == true){
remoteHeader = prm.e.body.tsxState.src.rdata.wholeMsg;
}
}

if (ci.state == PJSIP_INV_STATE_INCOMING) {
/**
Expand Down Expand Up @@ -127,9 +114,6 @@ class MyCall : public Call
}

if (ci.state == PJSIP_INV_STATE_CONFIRMED) {
if(remoteHeader.empty() != true){
std::cout<<remoteHeader.substr(remoteHeader.find("DEV-ID") + 8 , 4);
}
callStatusListenerPtr(1);
}

Expand Down Expand Up @@ -198,7 +182,6 @@ void MyAccount::onIncomingCall(OnIncomingCallParam &iprm) {
incomingCallPtr();

//Incoming DevID
setOnIncomingCallerHeader(iprm.rdata.wholeMsg.substr(iprm.rdata.wholeMsg.find("DEV-ID") + 8 , 4));
call = new MyCall(*this, iprm.callId);

}
Expand Down Expand Up @@ -432,17 +415,6 @@ void PJSua2::call_listener(void (* funcpntr)(int)){
void PJSua2::answerCall(){
CallOpParam op;
op.statusCode = PJSIP_SC_OK;

SipHeader sHeader;
SipHeaderVector sHeaderVector;
SipTxOption sTxOption;

sHeader.hName = "DEV-ID";
sHeader.hValue = "1100";
sHeaderVector.push_back(sHeader);
sTxOption.headers = sHeaderVector;
op.txOption = sTxOption;

call->answer(op);
}

Expand Down Expand Up @@ -502,16 +474,6 @@ void PJSua2::unholdCall(){
void PJSua2::outgoingCall(std::string dest_uri) {
CallOpParam prm(true); // Use default call settings

SipHeader sHeader;
SipHeaderVector sHeaderVector;
SipTxOption sTxOption;

sHeader.hName = "DEV-ID";
sHeader.hValue = "1155";
sHeaderVector.push_back(sHeader);
sTxOption.headers = sHeaderVector;
prm.txOption = sTxOption;

try {
call = new MyCall(*acc);
call->makeCall(dest_uri, prm);
Expand Down

0 comments on commit 21c01af

Please sign in to comment.