Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
622 views
in Technique[技术] by (71.8m points)

sip - Asterisk API - How to redirect a call?

EDIT: When I use uniqueId of the call instead of channel name it works!

I want to redirect a call with PAMI library for PHP. If I do it manually on SIP handle, I can see this event:

Event: BlindTransfer 
Privilege: call,all 
Result: Success 
TransfererChannel: PJSIP/1006-00000b5b 
TransfererChannelState: 6 
TransfererChannelStateDesc: Up
TransfererCallerIDNum: *********
TransfererCallerIDName: **
TransfererConnectedLineNum: *********
TransfererConnectedLineName: <unknown> 
TransfererLanguage: cz 
TransfererAccountCode: 
TransfererContext: macro-trunkdial-failover-0.3 
TransfererExten: 1-dial 
TransfererPriority: 23 
TransfererUniqueid: 1611568498.4261
TransfererLinkedid: 1611568498.4261 
TransfereeChannel: PJSIP/trunk-*****-endpoint-00000b5c 
TransfereeChannelState: 6 
TransfereeChannelStateDesc: Up 
TransfereeCallerIDNum: *********
TransfereeCallerIDName: <unknown> 
TransfereeConnectedLineNum: *********
TransfereeConnectedLineName: **
TransfereeLanguage: cz 
TransfereeAccountCode: 
TransfereeContext: callin_trunk_****
TransfereeExten: 
TransfereePriority: 1 
TransfereeUniqueid: 1611568498.4262 
TransfereeLinkedid: 1611568498.4261 
BridgeUniqueid: 317de6e1-a68b-4160-aecf-c7c8c96e2fa1 
BridgeType: basic 
BridgeTechnology: simple_bridge 
BridgeCreator: <unknown> 
BridgeName: <unknown> 
BridgeNumChannels: 2 
IsExternal: No 
Context: DLPN_DialPlan1006 
ContactUri: sip:1006@192.168.0.100:5060 
Extension: 1009

But if I put BlindTransferAction through asterisk API like this:

PAMIMessageActionBlindTransferAction #b35d
  keys protected => array (5)
  |  action => "BlindTransfer"
  |  actionid => "1611574784,2356"
  |  channel => "PJSIP/1006-00000b5b"
  |  exten => "1009"
  |  context => "DLPN_DialPlan1006"

I receive error: Channel specified does not exist

In the event log, I can see different channels for the same call, but I have tried all of them and also with different context, but I'm still not able to succesfully redirect a call to different extension. Can you please give me a hint, what channel and what context should I put to transfer action?

question from:https://stackoverflow.com/questions/65884232/asterisk-api-how-to-redirect-a-call

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...