Changeset 5834 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_legacy.c
- Timestamp:
- Jul 23, 2018 7:32:54 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_legacy.c
r5461 r5834 1247 1247 PJ_LOG(3,(THIS_FILE, "No current call")); 1248 1248 } else { 1249 const pj_str_t SIP_INFO = pj_str("INFO");1250 pj_str_t digits;1251 1249 int call = current_call; 1252 int i;1253 1250 pj_status_t status; 1254 1251 char buf[128]; 1252 pjsua_call_send_dtmf_param param; 1255 1253 1256 1254 if (!simple_input("DTMF strings to send (0-9*#A-B)", buf, … … 1263 1261 puts("Call has been disconnected"); 1264 1262 return; 1265 } 1266 1267 digits = pj_str(buf); 1268 for (i=0; i<digits.slen; ++i) { 1269 char body[80]; 1270 pjsua_msg_data msg_data_; 1271 1272 pjsua_msg_data_init(&msg_data_); 1273 msg_data_.content_type = pj_str("application/dtmf-relay"); 1274 1275 pj_ansi_snprintf(body, sizeof(body), 1276 "Signal=%c\r\n" 1277 "Duration=160", 1278 buf[i]); 1279 msg_data_.msg_body = pj_str(body); 1280 1281 status = pjsua_call_send_request(current_call, &SIP_INFO, 1282 &msg_data_); 1283 if (status != PJ_SUCCESS) { 1284 return; 1285 } 1263 } 1264 pjsua_call_send_dtmf_param_default(¶m); 1265 param.digits = pj_str(buf); 1266 param.method = PJSUA_DTMF_METHOD_SIP_INFO; 1267 status = pjsua_call_send_dtmf(current_call, ¶m); 1268 if (status != PJ_SUCCESS) { 1269 pjsua_perror(THIS_FILE, "Error sending DTMF", status); 1286 1270 } 1287 1271 }
Note: See TracChangeset
for help on using the changeset viewer.