summaryrefslogtreecommitdiff
path: root/channels/chan_skinny.c
diff options
context:
space:
mode:
authorJason Parker <jparker@digium.com>2007-08-02 18:43:29 +0000
committerJason Parker <jparker@digium.com>2007-08-02 18:43:29 +0000
commit98ef35b9085add383478920ff01e5406cc92840a (patch)
tree468f4e7e25e66783da675a1055011216754cb0f0 /channels/chan_skinny.c
parent79b9bc6a2f169f7717d6ae301ff7cdd661ecfc28 (diff)
Merged revisions 77947 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 (closes issue #10299) ........ r77947 | qwell | 2007-08-02 13:42:36 -0500 (Thu, 02 Aug 2007) | 5 lines Make sure we clear the prompt status message on a hangup. Also rearrange messages to better fit with what a wireshark trace shows it should be. Issue 10299, initial patch and solution by sbisker, modified by me to fit with wireshark trace. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77948 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_skinny.c')
-rw-r--r--channels/chan_skinny.c87
1 files changed, 45 insertions, 42 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 079b85f20..78d6cb469 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -1629,48 +1629,6 @@ static void transmit_microphone_mode(struct skinnysession *s, int mode)
transmit_response(s, req);
}
*/
-static void transmit_callstate(struct skinnysession *s, int instance, int state, unsigned callid)
-{
- struct skinny_req *req;
-
- if (state == SKINNY_OFFHOOK) {
- if (!(req = req_alloc(sizeof(struct activate_call_plane_message), ACTIVATE_CALL_PLANE_MESSAGE)))
- return;
-
- req->data.activatecallplane.lineInstance = htolel(instance);
- transmit_response(s, req);
- } else if (state == SKINNY_ONHOOK) {
- transmit_speaker_mode(s, SKINNY_SPEAKEROFF);
-
- if (!(req = req_alloc(sizeof(struct activate_call_plane_message), ACTIVATE_CALL_PLANE_MESSAGE)))
- return;
-
- req->data.activatecallplane.lineInstance = htolel(instance);
- transmit_response(s, req);
-
- if (!(req = req_alloc(sizeof(struct close_receive_channel_message), CLOSE_RECEIVE_CHANNEL_MESSAGE)))
- return;
-
- req->data.closereceivechannel.conferenceId = htolel(callid);
- req->data.closereceivechannel.partyId = htolel(callid);
- transmit_response(s, req);
-
- if (!(req = req_alloc(sizeof(struct stop_media_transmission_message), STOP_MEDIA_TRANSMISSION_MESSAGE)))
- return;
-
- req->data.stopmedia.conferenceId = htolel(callid);
- req->data.stopmedia.passThruPartyId = htolel(callid);
- transmit_response(s, req);
- }
-
- if (!(req = req_alloc(sizeof(struct call_state_message), CALL_STATE_MESSAGE)))
- return;
-
- req->data.callstate.callState = htolel(state);
- req->data.callstate.lineInstance = htolel(instance);
- req->data.callstate.callReference = htolel(callid);
- transmit_response(s, req);
-}
static void transmit_callinfo(struct skinnysession *s, const char *fromname, const char *fromnum, const char *toname, const char *tonum, int instance, int callid, int calltype)
{
@@ -1884,6 +1842,51 @@ static void transmit_dialednumber(struct skinnysession *s, const char *text, int
transmit_response(s, req);
}
+static void transmit_callstate(struct skinnysession *s, int instance, int state, unsigned callid)
+{
+ struct skinny_req *req;
+
+ if (state == SKINNY_ONHOOK) {
+ if (!(req = req_alloc(sizeof(struct close_receive_channel_message), CLOSE_RECEIVE_CHANNEL_MESSAGE)))
+ return;
+
+ req->data.closereceivechannel.conferenceId = htolel(callid);
+ req->data.closereceivechannel.partyId = htolel(callid);
+ transmit_response(s, req);
+
+ if (!(req = req_alloc(sizeof(struct stop_media_transmission_message), STOP_MEDIA_TRANSMISSION_MESSAGE)))
+ return;
+
+ req->data.stopmedia.conferenceId = htolel(callid);
+ req->data.stopmedia.passThruPartyId = htolel(callid);
+ transmit_response(s, req);
+
+ transmit_speaker_mode(s, SKINNY_SPEAKEROFF);
+
+ transmit_displaypromptstatus(s, NULL, 0, instance, callid);
+ }
+
+ if (!(req = req_alloc(sizeof(struct call_state_message), CALL_STATE_MESSAGE)))
+ return;
+
+ req->data.callstate.callState = htolel(state);
+ req->data.callstate.lineInstance = htolel(instance);
+ req->data.callstate.callReference = htolel(callid);
+ transmit_response(s, req);
+
+ if (state == SKINNY_ONHOOK) {
+ transmit_selectsoftkeys(s, 0, 0, KEYDEF_ONHOOK);
+ }
+
+ if (state == SKINNY_OFFHOOK || state == SKINNY_ONHOOK) {
+ if (!(req = req_alloc(sizeof(struct activate_call_plane_message), ACTIVATE_CALL_PLANE_MESSAGE)))
+ return;
+
+ req->data.activatecallplane.lineInstance = htolel(instance);
+ transmit_response(s, req);
+ }
+}
+
static int skinny_extensionstate_cb(char *context, char *exten, int state, void *data)
{
struct skinny_speeddial *sd = data;