Sponsored Content
Top Forums Shell Programming and Scripting vi : inserting non-printing characters Post 82196 by Kelam_Magnus on Monday 29th of August 2005 04:01:09 PM
Old 08-29-2005
Too little info to give a good answer, what is the reason for the control characters?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

printing control characters

using c-shell, does anyone know how to send control characters to the printer before the job? I need to set a printer to print in condensed mode HELP (1 Reply)
Discussion started by: mglinsk
1 Replies

2. Shell Programming and Scripting

inserting characters before each line...

Hi , the fog is fulling my brain after holidays , somebody can help me ? I have a file in input like that : toto tata tutu and trying with awk to insert the compete file string as : /dir1/dir2/toto /dir1/dir2/tata /dir1/dir2/tutu i used to write : awk 'BEGIN {FS="\\"} {print... (4 Replies)
Discussion started by: Nicol
4 Replies

3. UNIX for Dummies Questions & Answers

Printing 5 raw characters to a printer

Hi there, I want to open a cash drawer remotely. The cash drawer is commanded by a printer. I need to connect to the cash drawer which is connected over a network (and shared) and simply send a sequence of five ASCII commands (see http://pages.prodigy.net/daleharris/popopen2.htm) to a... (5 Replies)
Discussion started by: Friğrik
5 Replies

4. Shell Programming and Scripting

printing last two characters of each line

Hello, any trick to print line number and last two characters of each line ? (4 Replies)
Discussion started by: Bashar
4 Replies

5. UNIX for Dummies Questions & Answers

printing password having special characters

Hi I have a password stored in a file (which is a user input) The password is having the special character $ say the password is pw$ord and is stored in the file pw_note I am using the following statement to store the passowrd in a variable $schema_pwd = `cat $dir/pwd_note` ; Now if i print... (4 Replies)
Discussion started by: ssuresh1999
4 Replies

6. UNIX for Dummies Questions & Answers

Inserting control characters at the end of each line

How to add control characters at the end of each line in a file? Can anyone help me with this? Thanks, Shobana (2 Replies)
Discussion started by: Shobana_s
2 Replies

7. Linux

Removing non printing characters from a csv file

Hi, I have an csv file and there are some non printable characters(extended ascii) so I am trying to create a clean copy of the csv file . I am using this command: tr -cd "" < /opt/informatica/PowerCenter8.6.0/server/infa_shared/SrcFiles/ThirdParty/locations.csv > ... (4 Replies)
Discussion started by: gerkus
4 Replies

8. UNIX for Dummies Questions & Answers

inserting characters based on condition

hi i have a file that contains the data like this 12345 12453 8990998987 0989876656 12345678 12344 133678999 12345677 i should insert "+" and "-" signs for each line i,e., + 12345 - 12453 + 8990998987 - 0989876656 + 12345678 - 12344 (2 Replies)
Discussion started by: anurupa777
2 Replies

9. Shell Programming and Scripting

Remove non printing characters from file

How do I remove the printer escape sequence, the first 5 characters, that occurs on every 33rd line in a file, see hex dump of line 1. 0000 1e 00 00 00 00 0a 0a 0a 20 0a 20 20 20 20 20 20 .... 0010 20 20 20 20 20 20 20 20 20 20 0a 42 49 4c 4c 20 Thanks, (2 Replies)
Discussion started by: jgt
2 Replies

10. UNIX for Beginners Questions & Answers

Inserting n characters to beginning of line if match

I would like to insert n number of characters at the beginning of each line that starts with a given character. If possible, I would be most appreciative for a sed or awk solution. Given the data below, I would like to be able to insert either 125 spaces or 125 "-" at the beginning of every line... (6 Replies)
Discussion started by: jvoot
6 Replies
How-To initiate, modify or terminate calls.(3)			    libeXosip2			    How-To initiate, modify or terminate calls.(3)

NAME
How-To initiate, modify or terminate calls. - eXosip2 offers a flexible API to help you controling calls. Initiate a call To start an outgoing call, you typically need a few headers which will be used by eXosip2 to build a default SIP INVITE request. The code below is used to start a call: osip_message_t *invite; int i; i = eXosip_call_build_initial_invite (&invite, '<sip:to@antisip.com>', '<sip:from@antisip.com>', NULL, // optional route header 'This is a call for a conversation'); if (i != 0) { return -1; } osip_message_set_supported (invite, '100rel'); { char tmp[4096]; char localip[128]; eXosip_guess_localip (AF_INET, localip, 128); snprintf (tmp, 4096, 'v=0 ' 'o=josua 0 0 IN IP4 %s ' 's=conversation ' 'c=IN IP4 %s ' 't=0 0 ' 'm=audio %s RTP/AVP 0 8 101 ' 'a=rtpmap:0 PCMU/8000 ' 'a=rtpmap:8 PCMA/8000 ' 'a=rtpmap:101 telephone-event/8000 ' 'a=fmtp:101 0-11 ', localip, localip, port); osip_message_set_body (invite, tmp, strlen (tmp)); osip_message_set_content_type (invite, 'application/sdp'); } eXosip_lock (); i = eXosip_call_send_initial_invite (invite); if (i > 0) { eXosip_call_set_reference (i, reference); } eXosip_unlock (); return i; The above code is using eXosip_call_build_initial_invite to build a default SIP INVITE request for a new call. You have to insert a SDP body announcing your audio parameter for the RTP stream. The above code also show the flexibility of the eXosip2 API which allow you to insert additionnal headers such as 'Supported: 100rel' (announcing support for a SIP extension). Thus you can enterely control the creation of SIP requests. The returned element of eXosip_call_send_initial_invite is the call identifier that you can use to send a CANCEL. In future events other than 100 Trying, you'll also get the dialog identifier that will also be needed to control established calls. eXosip_call_set_reference is also a mean to attach one of your own context to a call so that you'll get your pointer back in eXosip_event. Answer a call The code below is another example that teach you how to answer an incoming call. You'll usually need to send a '180 Ringing' SIP answer when receiving a SIP INVITE: eXosip_lock (); eXosip_call_send_answer (ca->tid, 180, NULL); eXosip_unlock (); Note: The above code also shows that the stack is sometimes able to build and send a default SIP messages with only one API call Then, when the user wants to answer the call, you'll need to send a 200 ok and insert a SDP body in your SIP answer: osip_message_t *answer = NULL; eXosip_lock (); i = eXosip_call_build_answer (ca->tid, 200, &answer); if (i != 0) { eXosip_call_send_answer (ca->tid, 400, NULL); } else { i = sdp_complete_200ok (ca->did, answer); if (i != 0) { osip_message_free (answer); eXosip_call_send_answer (ca->tid, 415, NULL); } else eXosip_call_send_answer (ca->tid, 200, answer); } eXosip_unlock (); Note: In the above code, you can note that to send a response to a request, you have to use the transaction identifier (and not a call identifier or a dialog identifier!) Note2: For sending a 200ok, you'll usually need to insert a SDP body in the answer and before this, to negotiate the parameters and codecs that you want to support. In the test tool, provided by eXosip2 (josua application), you'll find a very basic implementation of the SDP negotiation. Sending other request The call control API allows you to send and receive REFER, UPDATE, INFO, OPTIONS, NOTIFY and INVITEs whitin calls. A few limitations still exist for answering other requests within calls, but it should be already possible to send any kind of request. Here you have a code sample to send an INFO requests used to send an out of band dtmf within the signalling layer. osip_message_t *info; char dtmf_body[1000]; int i; eXosip_lock (); i = eXosip_call_build_info (ca->did, &info); if (i == 0) { snprintf (dtmf_body, 999, 'Signal=%c Duration=250 ', c); osip_message_set_content_type (info, 'application/dtmf-relay'); osip_message_set_body (info, dtmf_body, strlen (dtmf_body)); i = eXosip_call_send_request (ca->did, info); } eXosip_unlock (); Author Generated automatically by Doxygen for libeXosip2 from the source code. Version 3.1.0 Sun Jun 24 2012 How-To initiate, modify or terminate calls.(3)
All times are GMT -4. The time now is 12:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy