|
@@ -361,8 +361,8 @@ class MyCall(pj.Call):
|
|
self.agent.hangup(self.user_part)
|
|
self.agent.hangup(self.user_part)
|
|
elif action_code == 'transfer': # 转人工
|
|
elif action_code == 'transfer': # 转人工
|
|
print('todo 转人工')
|
|
print('todo 转人工')
|
|
- sip_headers = {'bye_h_X-CIN-HangUpReason':'transferToAgent'}
|
|
|
|
- self.agent.hangup(self.user_part, sip_headers=sip_headers)
|
|
|
|
|
|
+ sip_headers = {'P-LIBRA-HangUpReason':'transferToAgent', 'P-LIBRA-ServiceId':'00000000000000000'}
|
|
|
|
+ self.agent.hangup(self.user_part, **sip_headers)
|
|
|
|
|
|
class ToTextBotAgent:
|
|
class ToTextBotAgent:
|
|
def __init__(self, user_asr_text, call_agent):
|
|
def __init__(self, user_asr_text, call_agent):
|
|
@@ -551,8 +551,15 @@ class BotAgent:
|
|
call_op_param = pj.CallOpParam(True)
|
|
call_op_param = pj.CallOpParam(True)
|
|
call_op_param.statusCode = pj.PJSIP_SC_OK
|
|
call_op_param.statusCode = pj.PJSIP_SC_OK
|
|
call_op_param.reason = reason
|
|
call_op_param.reason = reason
|
|
- for k, v in sip_headers:
|
|
|
|
- call_op_param.headers.append(pj.SipHeader(f"sip_h_{k}", v))
|
|
|
|
|
|
+ call_op_param.txOption = pj.SipTxOption()
|
|
|
|
+ sip_header_vector = pj.SipHeaderVector()
|
|
|
|
+ for k, v in sip_headers.items():
|
|
|
|
+ _sip_header = pj.SipHeader()
|
|
|
|
+ _sip_header.hName = str(k)
|
|
|
|
+ _sip_header.hValue = str(v)
|
|
|
|
+ print('hangup, header_name=%s, header_value=%s' % (k, v))
|
|
|
|
+ sip_header_vector.push_back(_sip_header)
|
|
|
|
+ call_op_param.txOption.headers = sip_header_vector
|
|
acc = self.accounts.get(user_part)
|
|
acc = self.accounts.get(user_part)
|
|
if acc:
|
|
if acc:
|
|
for k, v in acc.calls.items():
|
|
for k, v in acc.calls.items():
|