-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add transfer action type #10
base: master
Are you sure you want to change the base?
Conversation
…cted in a clearer fashion with XML
Hi sorry for the delay, I just made sure I will receive email notifications from now on. I will test and review asap, thank you ! |
interesting, however the transfer command is blocking everything else and affecting all the calls. |
One option would be to add Example :
What do you think ? |
Ah, ok. I did not realize that. So, any new calls coming into this scenario are blocked when the transfer is happening? Or it is blocking the whole |
It will block further action execution :
call coming in will not block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another idea came up in my mind but I don't know if it is a good one 😛 .
If we have a scope that defines a call behavior like this
<action type="accept" label="receive_and_transfer"
account="VP_ENV_CALLEE_USERNAME"
play="../voice_ref_files/reference_8000.wav"
code="200" reason="OK"
ring_duration="5"
rtp_stats
>
<behavior>
<action type="wait" until="CONNECTED">
<action type="dtmf" data="123">
<action type="wait" ms="1000">
<action type="hold">
<action type="wait" ms="1000">
<action type="unhold">
<action type="transfer" to_uri="12015555555@target.com"/>
</behavior>
</action>
It make things easy to improve more features like (DTMF, HOLD, UNHOLD)
What do you guys think about?
} else if (ci.state == PJSIP_INV_STATE_CONFIRMED) { | ||
CallOpParam prm(true); | ||
try { | ||
if (to_uri.empty() ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have already checked it before starting the loop! Are you still needing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, no, I think that was just an oversight.
I thinks this is making a lot of sense, with relatively little work we should be able to refactor It would execute them until a Not sure about the best way to refactor Optionally, the design/refactoring could support nested behavior ... |
I am still looking at integrating this work after we applying modifications based on the discussions. (behavior / action_group) |
This change implements a "transfer" action option. It only implements a "blind" transfer in the sense that it just sends the REFER and hangs up once it get the final NOTIFY with 200 OK. I think in theory you could construct an "attended" transfer scenario by adding a "hold" action, and setting up another call to be the transfer target. This is my first try at C++ and I reused a lot of the code that was already there, so please let me know if something is off or needs improvement.
I also added examples to the README on how to set up the new action.