diff options
author | Alexandr Anikin <may@telecom-service.ru> | 2010-10-09 14:04:35 +0000 |
---|---|---|
committer | Alexandr Anikin <may@telecom-service.ru> | 2010-10-09 14:04:35 +0000 |
commit | fb33eea971d15d45c3fa6179391dc9532fe78420 (patch) | |
tree | d932630200314ac80e8d6e30bc04fb2b25c4a091 /addons/ooh323c | |
parent | d1b1c17da860528cd216a244f805607cfb66e0bc (diff) |
Added fast start and h.245 tunneling options per user and peer.
Added options for faststart/h.245 tunneling per user/peer, properly
handle these and global options, correction of handling fs/tunneling
fields in signalling responses
(closes issue #17972)
Reported by: salecha
Patches:
fs-tunnel-per-point-3.patch uploaded by may213 (license 454)
Tested by: may213, salecha
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@291006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'addons/ooh323c')
-rw-r--r-- | addons/ooh323c/src/ooh245.c | 18 | ||||
-rw-r--r-- | addons/ooh323c/src/ooh323.c | 84 |
2 files changed, 68 insertions, 34 deletions
diff --git a/addons/ooh323c/src/ooh245.c b/addons/ooh323c/src/ooh245.c index d42f8bbc1..adbe1842e 100644 --- a/addons/ooh323c/src/ooh245.c +++ b/addons/ooh323c/src/ooh245.c @@ -957,10 +957,8 @@ int ooHandleMasterSlave(OOH323CallData *call, void * pmsg, /*Since Cap exchange and MasterSlave Procedures are done */ if(gH323ep.h323Callbacks.openLogicalChannels) gH323ep.h323Callbacks.openLogicalChannels(call); - else{ - if(!ooGetTransmitLogicalChannel(call)) - ooOpenLogicalChannels(call); - } + if(!ooGetTransmitLogicalChannel(call)) + ooOpenLogicalChannels(call); #if 0 if(!call->logicalChans){ if(!gH323ep.h323Callbacks.openLogicalChannels) @@ -2114,10 +2112,8 @@ int ooOnReceivedTerminalCapabilitySetAck(OOH323CallData* call) { if(gH323ep.h323Callbacks.openLogicalChannels) gH323ep.h323Callbacks.openLogicalChannels(call); - else{ - if(!ooGetTransmitLogicalChannel(call)) - ooOpenLogicalChannels(call); - } + if(!ooGetTransmitLogicalChannel(call)) + ooOpenLogicalChannels(call); #if 0 if(!call->logicalChans){ if(!gH323ep.h323Callbacks.openLogicalChannels) @@ -3141,10 +3137,8 @@ int ooOnReceivedTerminalCapabilitySet(OOH323CallData *call, H245Message *pmsg) if(gH323ep.h323Callbacks.openLogicalChannels) gH323ep.h323Callbacks.openLogicalChannels(call); - else{ - if(!ooGetTransmitLogicalChannel(call)) - ooOpenLogicalChannels(call); - } + if(!ooGetTransmitLogicalChannel(call)) + ooOpenLogicalChannels(call); #if 0 if(!call->logicalChans){ if(!gH323ep.h323Callbacks.openLogicalChannels) diff --git a/addons/ooh323c/src/ooh323.c b/addons/ooh323c/src/ooh323.c index c266b19eb..ed097d95e 100644 --- a/addons/ooh323c/src/ooh323.c +++ b/addons/ooh323c/src/ooh323.c @@ -751,9 +751,18 @@ int ooOnReceivedCallProceeding(OOH323CallData *call, Q931Message *q931Msg) } - /* Retrieve the H.245 control channel address from the connect msg */ + /* Retrieve tunneling info/H.245 control channel address from the connect msg */ + if(q931Msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent && + !q931Msg->userInfo->h323_uu_pdu.h245Tunneling) { + if (OO_TESTFLAG (call->flags, OO_M_TUNNELING)) { + OO_CLRFLAG (call->flags, OO_M_TUNNELING); + OOTRACEINFO3("Tunneling is disabled for call due to remote reject tunneling" + " (%s, %s)\n", call->callType, call->callToken); + } + } if(q931Msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent && q931Msg->userInfo->h323_uu_pdu.h245Tunneling && + OO_TESTFLAG (call->flags, OO_M_TUNNELING) && callProceeding->m.h245AddressPresent) { OOTRACEINFO3("Tunneling and h245address provided." "Using Tunneling for H.245 messages (%s, %s)\n", @@ -801,6 +810,7 @@ int ooOnReceivedCallProceeding(OOH323CallData *call, Q931Message *q931Msg) } } } + return OO_OK; } @@ -970,16 +980,27 @@ int ooOnReceivedAlerting(OOH323CallData *call, Q931Message *q931Msg) } - /* Retrieve the H.245 control channel address from the connect msg */ + /* Retrieve tunneling info/H.245 control channel address from the connect msg */ + if(q931Msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent && + !q931Msg->userInfo->h323_uu_pdu.h245Tunneling) { + if (OO_TESTFLAG (call->flags, OO_M_TUNNELING)) { + OO_CLRFLAG (call->flags, OO_M_TUNNELING); + OOTRACEINFO3("Tunneling is disabled for call due to remote reject tunneling" + " (%s, %s)\n", call->callType, call->callToken); + } + } if(q931Msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent && q931Msg->userInfo->h323_uu_pdu.h245Tunneling && - alerting->m.h245AddressPresent) { - OOTRACEINFO3("Tunneling and h245address provided." - "Giving preference to Tunneling (%s, %s)\n", - call->callType, call->callToken); - } - else if(alerting->m.h245AddressPresent) - { + OO_TESTFLAG (call->flags, OO_M_TUNNELING)) { + if (alerting->m.h245AddressPresent) + OOTRACEINFO3("Tunneling and h245address provided." + "Giving preference to Tunneling (%s, %s)\n", + call->callType, call->callToken); + ret =ooSendTCSandMSD(call); + if (ret != OO_OK) + return ret; + + } else if(alerting->m.h245AddressPresent) { if (OO_TESTFLAG (call->flags, OO_M_TUNNELING)) { OO_CLRFLAG (call->flags, OO_M_TUNNELING); @@ -1019,13 +1040,12 @@ int ooOnReceivedAlerting(OOH323CallData *call, Q931Message *q931Msg) return OO_FAILED; } } - } else if (OO_TESTFLAG (call->flags, OO_M_TUNNELING)) { - ret =ooSendTCSandMSD(call); + } else if (!call->pH245Channel && !call->h245listener) { + ret = ooSendStartH245Facility(call); if (ret != OO_OK) return ret; } - return OO_OK; } @@ -1195,15 +1215,26 @@ int ooOnReceivedProgress(OOH323CallData *call, Q931Message *q931Msg) } /* Retrieve the H.245 control channel address from the connect msg */ + /* Retrieve tunneling info/H.245 control channel address from the connect msg */ + if(q931Msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent && + !q931Msg->userInfo->h323_uu_pdu.h245Tunneling) { + if (OO_TESTFLAG (call->flags, OO_M_TUNNELING)) { + OO_CLRFLAG (call->flags, OO_M_TUNNELING); + OOTRACEINFO3("Tunneling is disabled for call due to remote reject tunneling" + " (%s, %s)\n", call->callType, call->callToken); + } + } if(q931Msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent && q931Msg->userInfo->h323_uu_pdu.h245Tunneling && - progress->m.h245AddressPresent) { - OOTRACEINFO3("Tunneling and h245address provided." - "Giving preference to Tunneling (%s, %s)\n", - call->callType, call->callToken); - } - else if(progress->m.h245AddressPresent) - { + OO_TESTFLAG (call->flags, OO_M_TUNNELING)) { + if (progress->m.h245AddressPresent) + OOTRACEINFO3("Tunneling and h245address provided." + "Giving preference to Tunneling (%s, %s)\n", + call->callType, call->callToken); + ret =ooSendTCSandMSD(call); + if (ret != OO_OK) + return ret; + } else if(progress->m.h245AddressPresent) { if (OO_TESTFLAG (call->flags, OO_M_TUNNELING)) { OO_CLRFLAG (call->flags, OO_M_TUNNELING); @@ -1243,8 +1274,8 @@ int ooOnReceivedProgress(OOH323CallData *call, Q931Message *q931Msg) return OO_FAILED; } } - } else if (OO_TESTFLAG (call->flags, OO_M_TUNNELING)) { - ret =ooSendTCSandMSD(call); + } else if (!call->pH245Channel && !call->h245listener) { + ret = ooSendStartH245Facility(call); if (ret != OO_OK) return ret; } @@ -1444,9 +1475,18 @@ int ooOnReceivedSignalConnect(OOH323CallData* call, Q931Message *q931Msg) OO_SETFLAG(call->flags, OO_M_FASTSTARTANSWERED); } - /* Retrieve the H.245 control channel address from the CONNECT msg */ + /* Retrieve tunneling info/H.245 control channel address from the connect msg */ + if(q931Msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent && + !q931Msg->userInfo->h323_uu_pdu.h245Tunneling) { + if (OO_TESTFLAG (call->flags, OO_M_TUNNELING)) { + OO_CLRFLAG (call->flags, OO_M_TUNNELING); + OOTRACEINFO3("Tunneling is disabled for call due to remote reject tunneling" + " (%s, %s)\n", call->callType, call->callToken); + } + } if(q931Msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent && q931Msg->userInfo->h323_uu_pdu.h245Tunneling && + OO_TESTFLAG (call->flags, OO_M_TUNNELING) && connect->m.h245AddressPresent) { OOTRACEINFO3("Tunneling and h245address provided." "Giving preference to Tunneling (%s, %s)\n", |