-
Notifications
You must be signed in to change notification settings - Fork 11
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
ua,call: add API for rejecting incoming call #57
Conversation
eec1d63
to
e7a584e
Compare
506bbd9
to
ef6975d
Compare
Did some basic tests. |
@zucher please could you test this? Does it fit to your needs? |
@cspiel1 sure, thank you, I take a look tomorrow. |
I just take a look shortly on the code, as static setting it's seems fine, but in my currently wish , I expect to manage the hangup rejection on demand dynamically according to the incoming number, so in such case static configuration doesn't fit. |
This sounds useful in general. So, I'll try to find a solution for this. With an async query to the app currently I see the problem, that the answer has to come very quickly from the app in order to avoid sending of SIP retries. But I'll check the details for the timing. |
I manage on my side some test to reject on SIP RINGING, and it's working, so the delay seems not an issue, and the divert on microsip use also the same method on ringing state. |
but this means not treating the rejection/hhangup at application side but directly into baresip lib due to session depends, not accessible ouside the lib. |
Working on an API function: void call_reject(struct call *call, uint16_t scode, const char *reason, const char *fmt, ...);
/* usage example */
call_reject(call, scode, reason,
"Contact: <%r>%s\r\n"
"Diversion: <%s>%r\r\n"
"Content-Length: 0\r\n\r\n",
¶ms.contact,
expstr,
account_aor(ua_account(ua)),
¶ms.divparams); Edit: Maybe the name will change. |
That's sound good, I'm working with callid's to be able to manage multiple incoming calls at a time. The integration of this function into an app becomes simpler |
Here is what we need in baresip core: baresip/baresip#3228. The commit that follows add a new command the is able to reject a call with given Contact, expiry, Diversion parameters, scode and reason. I have to change the title of this PR in order to switch to the right baresip branch. |
@cspiel1 , Thank you that's working very fine ! |
You're welcome! In order to keep menu/dynamic_menu.c in the baresip repo small and simple I suggest to keep the command I suggest also to keep the other commands |
Implements: baresip/baresip#3207
config
The
redirect
module has to be loaded first, at least before modulemenu
because it stops theUA_EVENT_SIPSESS_CONN
event if a redirect is set by the user.