Changeset 5222

Changed the boolean SDP entries for T.38 to comply withe the T.38 spec.

Committed by:  coppice
Date:  Nov 29 2008 * 05:26 (about 1 month ago)

Affected files:

callweaver/branches/rel/1.2/channels/chan_sip.c (unified diff)

r5181r5222
50955095 break;
50965096 old = iterator;
50975097
5098 if ((sscanf(a, "T38FaxMaxBuffer:%d", &x) == 1))
5098 if (sscanf(a, "T38FaxMaxBuffer:%d", &x) == 1)
50995099 {
51005100 found = 1;
51015101 cw_log(LOG_DEBUG,"MaxBufferSize:%d\n",x);
51025102 }
5103 else if ((sscanf(a, "T38MaxBitRate:%d", &x) == 1))
5103 else if (sscanf(a, "T38MaxBitRate:%d", &x) == 1)
51045104 {
51055105 found = 1;
5106 cw_log(LOG_DEBUG,"T38MaxBitRate: %d\n",x);
5106 cw_log(LOG_DEBUG,"T38MaxBitRate: %d\n", x);
51075107 switch (x)
51085108 {
51095109 case 33600:
------
51295129 break;
51305130 }
51315131 }
5132 else if ((sscanf(a, "T38FaxVersion:%d", &x) == 1))
5132 else if (sscanf(a, "T38FaxVersion:%d", &x) == 1)
51335133 {
51345134 found = 1;
51355135 cw_log(LOG_DEBUG,"FaxVersion: %d\n",x);
------
51385138 else if (x == 1)
51395139 peert38capability |= T38FAX_VERSION_1;
51405140 }
5141 else if ((sscanf(a, "T38FaxMaxDatagram:%d", &x) == 1))
5141 else if (sscanf(a, "T38FaxMaxDatagram:%d", &x) == 1)
51425142 {
51435143 found = 1;
51445144 cw_log(LOG_DEBUG,"FaxMaxDatagram: %d\n",x);
51455145 cw_udptl_set_far_max_datagram(p->udptl, x);
51465146 cw_udptl_set_local_max_datagram(p->udptl, x);
51475147 }
5148 else if ((sscanf(a, "T38FaxFillBitRemoval:%d", &x) == 1))
5148 else if ((sscanf(a, "T38FaxFillBitRemoval:%d", &x) == 1 && x == 1)
5149 ||
5150 strcmp(a, "T38FaxFillBitRemoval") == 0)
51495151 {
51505152 found = 1;
51515153 cw_log(LOG_DEBUG,"FillBitRemoval: %d\n",x);
5152 if (x == 1)
5153 peert38capability |= T38FAX_FILL_BIT_REMOVAL;
5154 peert38capability |= T38FAX_FILL_BIT_REMOVAL;
51545155 }
5155 else if ((sscanf(a, "T38FaxTranscodingMMR:%d", &x) == 1))
5156 else if ((sscanf(a, "T38FaxTranscodingMMR:%d", &x) == 1 && x == 1)
5157 ||
5158 strcmp(a, "T38FaxTranscodingMMR") == 0)
51565159 {
51575160 found = 1;
51585161 cw_log(LOG_DEBUG,"Transcoding MMR: %d\n",x);
5159 if (x == 1)
5160 peert38capability |= T38FAX_TRANSCODING_MMR;
5162 peert38capability |= T38FAX_TRANSCODING_MMR;
51615163 }
5162 else if ((sscanf(a, "T38FaxTranscodingJBIG:%d", &x) == 1))
5164 else if ((sscanf(a, "T38FaxTranscodingJBIG:%d", &x) == 1 && x == 1)
5165 ||
5166 strcmp(a, "T38FaxTranscodingJBIG") == 0)
51635167 {
51645168 found = 1;
51655169 cw_log(LOG_DEBUG,"Transcoding JBIG: %d\n",x);
5166 if (x == 1)
5167 peert38capability |= T38FAX_TRANSCODING_JBIG;
5170 peert38capability |= T38FAX_TRANSCODING_JBIG;
51685171 }
5169 else if ((sscanf(a, "T38FaxRateManagement:%255s", s) == 1))
5172 else if (sscanf(a, "T38FaxRateManagement:%255s", s) == 1)
51705173 {
51715174 found = 1;
51725175 cw_log(LOG_DEBUG,"RateMangement: %s\n", s);
------
51755178 else if (!strcasecmp(s, "transferredTCF"))
51765179 peert38capability |= T38FAX_RATE_MANAGEMENT_TRANSFERED_TCF;
51775180 }
5178 else if ((sscanf(a, "T38FaxUdpEC:%255s", s) == 1))
5181 else if (sscanf(a, "T38FaxUdpEC:%255s", s) == 1)
51795182 {
51805183 found = 1;
51815184 cw_log(LOG_DEBUG,"UDP EC: %s\n", s);
------
51945197 ec_found = UDPTL_ERROR_CORRECTION_NONE;
51955198 }
51965199 }
5197 else if ((sscanf(a, "T38VendorInfo:%255s", s) == 1))
5200 else if (sscanf(a, "T38VendorInfo:%d %d %d", &x, &x, &x) == 3)
51985201 {
51995202 found = 1;
52005203 }
------
63166319 snprintf(a_modem, sizeof(a_modem), "a=T38MaxBitRate:%d",x);
63176320 add_line(resp, a_modem, SIP_DL_DONTCARE);
63186321 }
6319 snprintf(a_modem, sizeof(a_modem), "a=T38FaxFillBitRemoval:%d", (p->t38jointcapability & T38FAX_FILL_BIT_REMOVAL) ? 1 : 0);
6320 add_line(resp, a_modem, SIP_DL_DONTCARE);
6321 snprintf(a_modem, sizeof(a_modem), "a=T38FaxTranscodingMMR:%d", (p->t38jointcapability & T38FAX_TRANSCODING_MMR) ? 1 : 0);
6322 add_line(resp, a_modem, SIP_DL_DONTCARE);
6323 snprintf(a_modem, sizeof(a_modem), "a=T38FaxTranscodingJBIG:%d", (p->t38jointcapability & T38FAX_TRANSCODING_JBIG) ? 1 : 0);
6324 add_line(resp, a_modem, SIP_DL_DONTCARE);
6322 if (p->t38jointcapability & T38FAX_FILL_BIT_REMOVAL)
6323 {
6324 snprintf(a_modem, sizeof(a_modem), "a=T38FaxFillBitRemoval");
6325 add_line(resp, a_modem, SIP_DL_DONTCARE);
6326 }
6327 if (p->t38jointcapability & T38FAX_TRANSCODING_MMR)
6328 {
6329 snprintf(a_modem, sizeof(a_modem), "a=T38FaxTranscodingMMR");
6330 add_line(resp, a_modem, SIP_DL_DONTCARE);
6331 }
6332 if (p->t38jointcapability & T38FAX_TRANSCODING_JBIG)
6333 {
6334 snprintf(a_modem, sizeof(a_modem), "a=T38FaxTranscodingJBIG");
6335 add_line(resp, a_modem, SIP_DL_DONTCARE);
6336 }
63256337 snprintf(a_modem, sizeof(a_modem), "a=T38FaxRateManagement:%s", (p->t38jointcapability & T38FAX_RATE_MANAGEMENT_LOCAL_TCF) ? "localTCF" : "transferredTCF");
63266338 add_line(resp, a_modem, SIP_DL_DONTCARE);
63276339
------
63376349 add_line(resp, a_modem, SIP_DL_DONTCARE);
63386350 }
63396351 #if 0
6340 snprintf(a_modem, sizeof(a_modem), "a=T38VendorInfo:spandsp");
6352 snprintf(a_modem, sizeof(a_modem), "a=T38VendorInfo:0 0 0");
63416353 add_line(resp, a_modem, SIP_DL_DONTCARE);
63426354 #endif
63436355 /* Update lastrtprx when we send our SDP */