[asterisk-commits] may: branch may/chan_ooh323_rework r210694 - in /team/may/chan_ooh323_rework/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Aug 5 16:37:37 CDT 2009
Author: may
Date: Wed Aug 5 16:37:33 2009
New Revision: 210694
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=210694
Log:
added adaptation of tx framing if remote reduce it
(now work for alaw/ulaw/g729 only)
changed t38 control frames interface to latest trunk
generate fast start response based our capability not remote olc
element received
separate logchan status from proposed to proposed (opened by OLC
request) and proposedfs (proposed by our fast start element)
Modified:
team/may/chan_ooh323_rework/addons/chan_ooh323.c
team/may/chan_ooh323_rework/addons/chan_ooh323.h
team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.c
team/may/chan_ooh323_rework/addons/ooh323c/src/ooGkClient.h
team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.c
team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.h
team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.c
team/may/chan_ooh323_rework/addons/ooh323c/src/ooq931.c
team/may/chan_ooh323_rework/addons/ooh323cDriver.c
Modified: team/may/chan_ooh323_rework/addons/chan_ooh323.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/chan_ooh323.c?view=diff&rev=210694&r1=210693&r2=210694
==============================================================================
--- team/may/chan_ooh323_rework/addons/chan_ooh323.c (original)
+++ team/may/chan_ooh323_rework/addons/chan_ooh323.c Wed Aug 5 16:37:33 2009
@@ -97,7 +97,9 @@
.fixup = ooh323_fixup,
.send_html = 0,
.queryoption = ooh323_queryoption,
- /* .bridge = ast_rtp_bridge, */
+ .bridge = ast_rtp_instance_bridge, /* XXX chan unlocked ? */
+ .early_bridge = ast_rtp_instance_early_bridge,
+
};
static struct ast_rtp_glue ooh323_rtp = {
@@ -1215,13 +1217,15 @@
ast_rtp_instance_new_source(p->rtp);
break;
- case AST_CONTROL_T38:
+ case AST_CONTROL_T38_PARAMETERS:
if (p->t38support != T38_FAXGW) {
- enum ast_control_t38 message = AST_T38_REFUSED;
- ast_queue_control_data(ast, AST_CONTROL_T38, &message, sizeof(message));
+ struct ast_control_t38_parameters parameters = { .request_response = 0 };
+ parameters.request_response = AST_T38_REFUSED;
+ ast_queue_control_data(ast, AST_CONTROL_T38_PARAMETERS,
+ ¶meters, sizeof(parameters));
break;
}
- if (datalen != sizeof(enum ast_control_t38)) {
+ if (datalen != sizeof(struct ast_control_t38_parameters)) {
ast_log(LOG_ERROR, "Invalid datalen for AST_CONTROL_T38. "
"Expected %d, got %d\n",
(int)sizeof(enum ast_control_t38), (int)datalen);
@@ -1361,7 +1365,7 @@
}
-void ooh323_set_write_format(ooCallData *call, int fmt)
+void ooh323_set_write_format(ooCallData *call, int fmt, int txframes)
{
struct ooh323_pvt *p = NULL;
char formats[512];
@@ -1396,6 +1400,8 @@
ast_verbose("Writeformat before update %s/%s\n",
ast_getformatname_multiple(formats,512, p->owner->writeformat),
ast_getformatname_multiple(formats,512, p->owner->nativeformats));
+ if (txframes)
+ ast_codec_pref_setsize(&p->prefs, fmt, txframes);
p->owner->nativeformats = fmt;
ast_set_write_format(p->owner, p->owner->writeformat);
ast_set_read_format(p->owner, p->owner->readformat);
@@ -1819,6 +1825,7 @@
p = find_call(call);
if (!p) {
ast_log(LOG_ERROR, "Failed to find a matching call.\n");
+ ast_mutex_unlock(&call->Lock);
return -1;
}
ast_mutex_lock(&p->lock);
@@ -2602,7 +2609,7 @@
ast_config_destroy(cfg);
- /* Determine ip address if neccessary */
+ /* Determine ip address if necessary */
if (ast_strlen_zero(gIP)) {
ooGetLocalIPAddress(gIP);
if (!strcmp(gIP, "127.0.0.1")) {
@@ -3876,10 +3883,8 @@
p->t38_tx_enable = 1;
p->lastTxT38 = time(NULL);
if (p->t38support == T38_FAXGW) {
- enum ast_control_t38 message = AST_T38_NEGOTIATED;
- struct ast_control_t38_parameters parameters = { 0, };
- parameters.request_response = message;
- ast_queue_control_data(p->owner, AST_CONTROL_T38, &message, sizeof(message));
+ struct ast_control_t38_parameters parameters = { .request_response = 0 };
+ parameters.request_response = AST_T38_NEGOTIATED;
ast_queue_control_data(p->owner, AST_CONTROL_T38_PARAMETERS, ¶meters, sizeof(parameters));
}
if (gH323Debug)
@@ -3929,10 +3934,8 @@
p->t38_tx_enable = 0;
if (p->t38support == T38_FAXGW) {
- enum ast_control_t38 message = AST_T38_TERMINATED;
- struct ast_control_t38_parameters parameters = { 0, };
- parameters.request_response = message;
- ast_queue_control_data(p->owner, AST_CONTROL_T38, &message, sizeof(message));
+ struct ast_control_t38_parameters parameters = { .request_response = 0 };
+ parameters.request_response = AST_T38_TERMINATED;
ast_queue_control_data(p->owner, AST_CONTROL_T38_PARAMETERS, ¶meters, sizeof(parameters));
}
@@ -4180,8 +4183,10 @@
if (p->t38support == T38_FAXGW) {
/* AST_T38_CONTROL mode */
- enum ast_control_t38 message = AST_T38_REQUEST_NEGOTIATE;
- ast_queue_control_data(p->owner, AST_CONTROL_T38, &message, sizeof(message));
+ struct ast_control_t38_parameters parameters = { .request_response = 0 };
+ parameters.request_response = AST_T38_REQUEST_NEGOTIATE;
+ ast_queue_control_data(p->owner, AST_CONTROL_T38_PARAMETERS,
+ ¶meters, sizeof(parameters));
p->faxmode = 1;
} else if (t38_gateway_init(&p->t38r_state, t38_tx_packet_handler, p)) {
@@ -4227,8 +4232,10 @@
}
} else {
if (p->t38support == T38_FAXGW) {
- enum ast_control_t38 message = AST_T38_REQUEST_TERMINATE;
- ast_queue_control_data(p->owner, AST_CONTROL_T38, &message, sizeof(message));
+ struct ast_control_t38_parameters parameters = { .request_response = 0 };
+ parameters.request_response = AST_T38_REQUEST_TERMINATE;
+ ast_queue_control_data(p->owner, AST_CONTROL_T38_PARAMETERS,
+ ¶meters, sizeof(parameters));
}
p->faxmode = 0;
p->t38_init = 0;
Modified: team/may/chan_ooh323_rework/addons/chan_ooh323.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/chan_ooh323.h?view=diff&rev=210694&r1=210693&r2=210694
==============================================================================
--- team/may/chan_ooh323_rework/addons/chan_ooh323.h (original)
+++ team/may/chan_ooh323_rework/addons/chan_ooh323.h Wed Aug 5 16:37:33 2009
@@ -98,7 +98,7 @@
struct ast_frame *ooh323_rtp_read
(struct ast_channel *ast, struct ooh323_pvt *p);
-void ooh323_set_write_format(ooCallData *call, int fmt);
+void ooh323_set_write_format(ooCallData *call, int fmt, int txframes);
void ooh323_set_read_format(ooCallData *call, int fmt);
int ooh323_update_capPrefsOrderForCall
Modified: team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.c?view=diff&rev=210694&r1=210693&r2=210694
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.c (original)
+++ team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.c Wed Aug 5 16:37:33 2009
@@ -463,6 +463,7 @@
}
curCap = curCap->next;
}
+ return 0;
}
int ooCapabilityAddGSMCapability(OOH323CallData *call, int cap,
@@ -1889,7 +1890,9 @@
{
if(((OOCapParams*)cur->params)->rxframes < framesPerPkt)
return NULL;
- else{
+ if(((OOCapParams*)cur->params)->rxframes > framesPerPkt)
+ ((OOCapParams*)cur->params)->rxframes = framesPerPkt;
+
OOTRACEDBGC4("We can receive Simple capability %s. (%s, %s)\n",
ooGetCapTypeText(cur->cap), call->callType,
call->callToken);
@@ -1918,7 +1921,6 @@
ooGetCapTypeText(cur->cap), call->callType,
call->callToken);
return epCap;
- }
}
/* Can we transmit compatible stream */
Modified: team/may/chan_ooh323_rework/addons/ooh323c/src/ooGkClient.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323c/src/ooGkClient.h?view=diff&rev=210694&r1=210693&r2=210694
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323c/src/ooGkClient.h (original)
+++ team/may/chan_ooh323_rework/addons/ooh323c/src/ooGkClient.h Wed Aug 5 16:37:33 2009
@@ -412,7 +412,7 @@
/**
- * This function is used to send an unregistration confirm messsage to
+ * This function is used to send an unregistration confirm message to
* gatekeeper.
* @param pGkClient Handle to gatekeeper client.
* @param reqNo Request Sequence number for the confirm message.
Modified: team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.c?view=diff&rev=210694&r1=210693&r2=210694
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.c (original)
+++ team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.c Wed Aug 5 16:37:33 2009
@@ -245,7 +245,8 @@
OOTRACEINFO6("Listing logical channel %d cap %d state %d for (%s, %s)\n",
pChannel->channelNo, pChannel->chanCap->cap, pChannel->state,
call->callType, call->callToken);
- if(!strcmp(pChannel->dir, "transmit") && pChannel->state == OO_LOGICALCHAN_IDLE)
+ if(!strcmp(pChannel->dir, "transmit") && pChannel->state != OO_LOGICALCHAN_IDLE &&
+ pChannel->state != OO_LOGICALCHAN_PROPOSEDFS)
return pChannel;
else
pChannel = pChannel->next;
Modified: team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.h?view=diff&rev=210694&r1=210693&r2=210694
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.h (original)
+++ team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.h Wed Aug 5 16:37:33 2009
@@ -41,7 +41,8 @@
OO_LOGICAL_CHAN_UNKNOWN,
OO_LOGICALCHAN_IDLE,
OO_LOGICALCHAN_PROPOSED,
- OO_LOGICALCHAN_ESTABLISHED
+ OO_LOGICALCHAN_ESTABLISHED,
+ OO_LOGICALCHAN_PROPOSEDFS
} OOLogicalChannelState;
/**
Modified: team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.c?view=diff&rev=210694&r1=210693&r2=210694
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.c (original)
+++ team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.c Wed Aug 5 16:37:33 2009
@@ -2740,6 +2740,8 @@
}
ooOnReceivedCloseChannelAck(call,
response->u.closeLogicalChannelAck);
+ if(!ooGetTransmitLogicalChannel(call))
+ ooOpenLogicalChannels(call);
break;
case T_H245ResponseMessage_requestChannelCloseAck:
OOTRACEINFO4("RequestChannelCloseAck received - %d (%s, %s)\n",
@@ -3815,7 +3817,7 @@
else {
/* Calling other ep, with SETUP message */
/* Call is "outgoing */
- pLogicalChannel->state = OO_LOGICALCHAN_PROPOSED;
+ pLogicalChannel->state = OO_LOGICALCHAN_PROPOSEDFS;
}
return OO_OK;
Modified: team/may/chan_ooh323_rework/addons/ooh323c/src/ooq931.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323c/src/ooq931.c?view=diff&rev=210694&r1=210693&r2=210694
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323c/src/ooq931.c (original)
+++ team/may/chan_ooh323_rework/addons/ooh323c/src/ooq931.c Wed Aug 5 16:37:33 2009
@@ -1065,7 +1065,7 @@
}
- ooPrepareFastStartResponseOLC(pCall, olc, epCap, pctxt, dir);
+ ooBuildFastStartOLC(pCall, olc, epCap, pctxt, dir);
pChannel = ooFindLogicalChannelByLogicalChannelNo
(pCall, olc->forwardLogicalChannelNumber);
@@ -1735,13 +1735,6 @@
Q931Message *q931msg=NULL;
/* OOCTXT *pctxt = &gH323ep.msgctxt; */
OOCTXT *pctxt = call->msgctxt;
-
-/* May 20090722
- this is needed to be tested more accurately
- */
-
- if(call->localTermCapState == OO_LocalTermCapExchange_Idle)
- ooSendTermCapMsg(call);
ret = ooCreateQ931Message(pctxt, &q931msg, Q931ConnectMsg);
if(ret != OO_OK)
Modified: team/may/chan_ooh323_rework/addons/ooh323cDriver.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323cDriver.c?view=diff&rev=210694&r1=210693&r2=210694
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323cDriver.c (original)
+++ team/may/chan_ooh323_rework/addons/ooh323cDriver.c Wed Aug 5 16:37:33 2009
@@ -357,7 +357,7 @@
if(gH323Debug)
ast_verbose("\tAdding g729 capability to call(%s, %s)\n",
call->callType, call->callToken);
- ret|= ooCallAddG729Capability(call, OO_G729, txframes, 4,
+ ret|= ooCallAddG729Capability(call, OO_G729, txframes, 24,
OORXANDTX, &ooh323c_start_receive_channel,
&ooh323c_start_transmit_channel,
&ooh323c_stop_receive_channel,
@@ -365,7 +365,7 @@
if(gH323Debug)
ast_verbose("\tAdding g729A capability to call(%s, %s)\n",
call->callType, call->callToken);
- ret= ooCallAddG729Capability(call, OO_G729A, txframes, 4,
+ ret= ooCallAddG729Capability(call, OO_G729A, txframes, 24,
OORXANDTX, &ooh323c_start_receive_channel,
&ooh323c_start_transmit_channel,
&ooh323c_stop_receive_channel,
@@ -373,7 +373,7 @@
if(gH323Debug)
ast_verbose("\tAdding g729B capability to call(%s, %s)\n",
call->callType, call->callToken);
- ret|= ooCallAddG729Capability(call, OO_G729B, txframes, 4,
+ ret|= ooCallAddG729Capability(call, OO_G729B, txframes, 24,
OORXANDTX, &ooh323c_start_receive_channel,
&ooh323c_start_transmit_channel,
&ooh323c_stop_receive_channel,
@@ -481,7 +481,17 @@
int fmt=-1;
fmt = convertH323CapToAsteriskCap(pChannel->chanCap->cap);
if(fmt>0) {
- ooh323_set_write_format(call, fmt);
+ switch (fmt) {
+ case AST_FORMAT_ALAW:
+ case AST_FORMAT_ULAW:
+ ooh323_set_write_format(call, fmt, ((OOCapParams *)(pChannel->chanCap->params))->txframes);
+ break;
+ case AST_FORMAT_G729A:
+ ooh323_set_write_format(call, fmt, ((OOCapParams *)(pChannel->chanCap->params))->txframes*10);
+ break;
+ default:
+ ooh323_set_write_format(call, fmt, 0);
+ }
}else{
ast_log(LOG_ERROR, "Invalid capability type for receive channel %s\n",
call->callToken);
More information about the asterisk-commits
mailing list