Understanding Lync client multipart SDP with MIME - mime

Could anybody give me some pure Insight how to create multipart sdp and what is the meaning of the all attribute of this given SDP.
Content-Type: multipart/alternative;boundary="----=_NextPart_000_001B_01CDC5AC.EC1E2DE0"
ms-routing-phase:from-uri-routing-done
------=_NextPart_000_001B_01CDC5AC.EC1E2DE0
Content-Type: application/sdp
Content-Transfer-Encoding: 7bit
Content-ID: <67c36ea12e87436e8fd1133d26194444#afdgs.com>
Content-Dis; handling=optional; ms-proxy-2007fallback
v=0
o=- 0 0 IN IP4 192.168.0.179
s=session
c=IN IP4 192.168.0.179
b=CT:99980
t=0 0
m=audio 19384 RTP/AVP 114 9 112 111 0 8 116 115 4 97 13 118 101
a=candidate:oKpwKDjMnfFmkSeXlIgoUEYW0BiriMilFQluFogmIQ8 1 XJoleCXuzzNJHAdN0G5MHg UDP 0.830 192.168.0.179 19384
a=candidate:oKpwKDjMnfFmkSeXlIgoUEYW0BiriMilFQluFogmIQ8 2 XJoleCXuzzNJHAdN0G5MHg UDP 0.830 192.168.0.179 19385
a=cryptoscale:1 client AES_CM_128_HMAC_SHA1_80 inline:28zhxoLlrww36J41bGxjePNf0ft/BbQkHXd2Pwf2|2^31|1:1
a=crypto:2 AES_CM_128_HMAC_SHA1_80 inline:EHIG0MBaCja1hyD1kJJvm3A8Ld8sIbCyeY26J5TI|2^31|1:1
a=crypto:3 AES_CM_128_HMAC_SHA1_80 inline:4y2YFeVNzH/rdIrbkSD+kMMFYP5OlccmnfBeELrW|2^31
a=maxptime:200
Specially the encrypted value of a=candidate: , How to decrypt and create it.
Is there any doc or rfc please indicate.
Thanks.

The answer is that it is an old ICE candidate and SDP ,which is supported by Lync client with
new ICE candidate support.So it is multipart which enable both old and new ICE support for a single client.(If the client have both ICE support)

Related

Trying to understand why curl calls are slow on codeigniter app

Previous note: I'm a Windows dev, to please bear with me since this is seems to be a Linux issue.
We're having some issues with a PHP app (which was built with codeigniter, I believe). The app is hosted on Ubuntun 16.04 Server (Apache) and I think it's using PHP 7.4.
The issue: the controllers which return the html shown by the browser call a couple of web services (which are hosted on a server that is on the same network) and these call are slow (each takes amore than 1 second to complete).
We've noticed this because we installed and enabled XDebug on both servers. For our test scenario (which envolves loading 2 or 3 pages), we've ended up with the following:
The main portal log file shows that curl_exec required around 32 seconds for performing around 25 calls
The services log files shows that it only run for about 2 second (for loading and returning the data consumed by the curl calls)
Since it looked like there were some issue with the network stack, we've activated wireshark and it looks like each web service call is taking more than one second to complete (so, it seems to confirm the xdebug logs that pointed to a communication issue). For instance, here's a screenshot of one of those calls:
It seems like the ACK for the 1st application data is taking more than one second (RTT time is over 1 second). This does not happen with the following ack (for instance, 122 entry is an ack for 121 and in this case the rtt is about 0.0002 seconds). Btw, here's the info that is shown for the application data entry that is being ack after 1 second:
Frame 116: 470 bytes on wire (3760 bits), 470 bytes captured (3760 bits)
Encapsulation type: Ethernet (1)
Arrival Time: Jul 7, 2020 15:46:23.036999000 GMT Daylight Time
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1594133183.036999000 seconds
[Time delta from previous captured frame: 0.000405000 seconds]
[Time delta from previous displayed frame: 0.000405000 seconds]
[Time since reference or first frame: 3.854565000 seconds]
Frame Number: 116
Frame Length: 470 bytes (3760 bits)
Capture Length: 470 bytes (3760 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ip:tcp:tls]
[Coloring Rule Name: TCP]
[Coloring Rule String: tcp]
Ethernet II, Src: Microsof_15:5a:5e (00:15:5d:15:5a:5e), Dst: Fortinet_09:03:22 (00:09:0f:09:03:22)
Destination: Fortinet_09:03:22 (00:09:0f:09:03:22)
Address: Fortinet_09:03:22 (00:09:0f:09:03:22)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: Microsof_15:5a:5e (00:15:5d:15:5a:5e)
Address: Microsof_15:5a:5e (00:15:5d:15:5a:5e)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 10.50.100.28, Dst: 10.50.110.100
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
0000 00.. = Differentiated Services Codepoint: Default (0)
.... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
Total Length: 456
Identification: 0x459c (17820)
Flags: 0x4000, Don't fragment
0... .... .... .... = Reserved bit: Not set
.1.. .... .... .... = Don't fragment: Set
..0. .... .... .... = More fragments: Not set
...0 0000 0000 0000 = Fragment offset: 0
Time to live: 64
Protocol: TCP (6)
Header checksum: 0x0cb0 [validation disabled]
[Header checksum status: Unverified]
Source: 10.50.100.28
Destination: 10.50.110.100
Transmission Control Protocol, Src Port: 34588, Dst Port: 443, Seq: 644, Ack: 5359, Len: 404
Source Port: 34588
Destination Port: 443
[Stream index: 5]
[TCP Segment Len: 404]
Sequence number: 644 (relative sequence number)
[Next sequence number: 1048 (relative sequence number)]
Acknowledgment number: 5359 (relative ack number)
1000 .... = Header Length: 32 bytes (8)
Flags: 0x018 (PSH, ACK)
000. .... .... = Reserved: Not set
...0 .... .... = Nonce: Not set
.... 0... .... = Congestion Window Reduced (CWR): Not set
.... .0.. .... = ECN-Echo: Not set
.... ..0. .... = Urgent: Not set
.... ...1 .... = Acknowledgment: Set
.... .... 1... = Push: Set
.... .... .0.. = Reset: Not set
.... .... ..0. = Syn: Not set
.... .... ...0 = Fin: Not set
[TCP Flags: ·······AP···]
Window size value: 319
[Calculated window size: 40832]
[Window size scaling factor: 128]
Checksum: 0x8850 [unverified]
[Checksum Status: Unverified]
Urgent pointer: 0
Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps
TCP Option - No-Operation (NOP)
Kind: No-Operation (1)
TCP Option - No-Operation (NOP)
Kind: No-Operation (1)
TCP Option - Timestamps: TSval 1446266633, TSecr 1807771224
Kind: Time Stamp Option (8)
Length: 10
Timestamp value: 1446266633
Timestamp echo reply: 1807771224
[SEQ/ACK analysis]
[This is an ACK to the segment in frame: 115]
[The RTT to ACK the segment was: 0.000405000 seconds]
[iRTT: 0.000474000 seconds]
[Bytes in flight: 404]
[Bytes sent since last PSH flag: 404]
[Timestamps]
[Time since first frame in this TCP stream: 0.010560000 seconds]
[Time since previous frame in this TCP stream: 0.000405000 seconds]
TCP payload (404 bytes)
Transport Layer Security
TLSv1.2 Record Layer: Application Data Protocol: http-over-tls
Content Type: Application Data (23)
Version: TLS 1.2 (0x0303)
Length: 399
Encrypted Application Data: 6611c266b7d32e17367b99607d0a0607f61149d15bcb135d…
Any tips on what's going on?
Thanks.

SIPP Scenario (version 1.0 don't send digits)

Folks,
I am trying to make calls to test a IVR Machine with SIPP.
First, I am using the Sipp v1.0 final version. But this version does not have support to send digits to IVR Machine. So system is unable to answer calls.
I tested using other versions too.
Here is my scenario:
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="Basic Sipstone UAC">
<send>
<![CDATA[
INVITE sip:12053#10.0.8.67 SIP/2.0
Via: SIP/2.0/UDP 10.0.4.147:5060;rport;branch=z9hG4bK386088
From: "sipp" <sip:11958251026#10.0.4.147:5070>;tag=8808
To: <sip:12053#10.0.8.67>
Call-ID: 1510678743-6088-NVT4147#10.0.4.147
CSeq: 45 INVITE
Max-Forwards: 70
User-Agent: NCH Software Express Talk 4.28
Contact: <sip:11958251026#10.0.4.147:5060>
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, INFO, REFER, NOTIFY
Supported: replaces
Content-Type: application/sdp
Content-Length: 328
v=0
o=NCHSoftware-Talk 1510678729 1510678743 IN IP4 10.0.4.147
s=Express Talk Call
c=IN IP4 10.0.4.147
t=0 0
m=audio 8000 RTP/AVP 0 8 96 3 13 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:96 G726-32/8000
a=rtpmap:3 GSM/8000
a=rtpmap:13 CN/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
]]>
</send>
<recv response="100" optional="true">
</recv>
<recv response="180" optional="true">
</recv>
<recv response="183" optional="true">
</recv>
<recv response="200">
</recv>
<send>
<![CDATA[
ACK sip:12053#10.0.8.67:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 10.0.4.147:5060;rport;branch=z9hG4bK396088
To: <sip:12053#10.0.8.67>;tag=7831-08A1
From: "sipp" <sip:11958251026#10.0.4.147:5070>;tag=8808
Call-ID: 1510678743-6088-NVT4147#10.0.4.147
CSeq: 45 ACK
Max-Forwards: 20
User-Agent: NCH Software Express Talk 4.28
Content-Length: 0
]]>
</send>
<nop>
<action>
<exec play_pcap_audio="pcap/g711a.pcap"/>
</action>
</nop>
<pause milliseconds="8000"/>
<nop>
<action>
<exec play_pcap_audio="pcap/dtmf_2833_1.pcap"/>
</action>
</nop>
<pause milliseconds="3000"/>
<send>
<![CDATA[
BYE sip:12053#10.0.8.67:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 10.0.4.147:5060;rport;branch=z9hG4bK26088
From: "sipp" <sip:11958251026#10.0.4.147:5070>;tag=8795
To: <sip:12053#10.0.8.67>;tag=7831-2E51
Call-ID: 1510678730-6088-NVT4147#10.0.4.147
CSeq: 107 BYE
Max-Forwards: 20
Subject: Performance Test
Content-Length: 0
]]>
</send>
<recv response="200" crlf="true">
</recv>
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
</scenario>
But, the answer is that (when I am using de version 1.0):
2017-11-16 19:31:46: Unknown element 'nop' in xml scenario file.
Please, help me.
SIPP can do complex SIP scripts but it is very limited for Voice interactions...
If you plan to test the IVR with Voice/DTMF interactions, try with Asterisk.
You can use a Dialer Script (We can provide one) to apply to your IVR a charge, with a Dialpan you can create complex scripting (with random).

How can I convert the qblast XML output into the NCBI BLAST -outfmt 17?

I started my project with the NCBI standalone BLAST and used the -outfmt 17 option. For my purpose that formatting is extremely helpful. However, I had to change to Biopython and I'm now using qblast to align my sequences to the NCBI NT database. Can I save/convert the qblast XML in a format which is comparable to the NCBI BLAST standalone -outfmt 17 format?
Thank you very much for your help!
Cheers,
Philipp
I'm going to assume you meant -outfmt 7 and you need an output with columns.
from Bio.Blast import NCBIWWW, NCBIXML
# This is the BLASTN query which returns an XML handler in a StringIO
r = NCBIWWW.qblast(
"blastn",
"nr",
"ACGGGGTCTCGAAAAAAGGAGAATGGGATGAGAAGGATATATGGGTAGTGTCATTTTTTAACTTGCAGAT" +
"TTCATCCTAGTCTTCCAGTTATCGTTTCCTAGCACTCCATGTTCCCAAGATAGTGTCACCACCCCAAGGA" +
"CTCTCTCTCATTTTCTTTGCCTGGGCCCTCTTTCTACTGAGGAGTCGTGGCCTTCCATCAGTAGAAGCCG",
expect=1E-5)
# Now we read that XML extracting the info
for record in NCBIXML.parse(r):
for alignment in record.alignments:
for hsp in alignment.hsps:
cols = "{}\t" * 10
print(cols.format(hsp.positives / hsp.align_length,
hsp.align_length,
hsp.align_length - hsp.positives,
hsp.gaps,
hsp.query_start,
hsp.query_end,
hsp.sbjct_start,
hsp.sbjct_end,
hsp.expect,
hsp.score))
Outputs something like:
1 210 0 0 1 210 89250 89459 8.73028e-102 420.0
0 206 19 2 5 210 46259 46462 5.16461e-73 314.0
1 210 0 0 1 210 68822 69031 8.73028e-102 420.0
0 206 19 2 5 210 25825 26028 5.16461e-73 314.0
1 210 0 0 1 210 65887 66096 8.73028e-102 420.0
...

Apk unzipping. Not a valid zip file, but unzip worked perfect

I have problem with golang zip reader. We have apk builder which build apk and then encrypted this apk with dex protector.
When i try to open apk file, go return err "zip: not a valid zip file". But when i try to open with unzip or zipinfo, worked fine.
(Also I noticed something interesting: in php 5.5 apk file opened with ZipArchive fine, but in 5.6 return error like golang)
I try open to debug golang archive/zip pckage and found that error returned in this line https://github.com/golang/go/blob/master/src/archive/zip/reader.go#L269.
Then i try to debug this line like this:
fmt.Printf("%+v", f)
fmt.Println(
"len(f.Extra):", len(f.Extra),
"len(b):", len(b),
"tag:", tag,
"size:", size,
)
And have this results:
&{FileHeader:{
Name:META-INF/MANIFEST.MF CreatorVersion:20 ReaderVersion:20 Flags:2056 Method:8
ModifiedTime:23093 ModifiedDate:18230 CRC32:2569174240
CompressedSize:359 UncompressedSize:570 CompressedSize64:359 UncompressedSize64:570
Extra:[] ExternalAttrs:0 Comment:
} zipr:0xc208038038 zipsize:276893 headerOffset:0}
&{FileHeader:{
Name:res/drawable/ic_launcher.png CreatorVersion:10 ReaderVersion:10 Flags:2048 Method:0
ModifiedTime:22030 ModifiedDate:18230 CRC32:2310989215
CompressedSize:20418 UncompressedSize:20418 CompressedSize64:20418 UncompressedSize64:20418
Extra:[] ExternalAttrs:0 Comment:
} zipr:0xc208038038 zipsize:276893 headerOffset:2066}
...
---------------->PROBLEM HERE:-------------------=>
&{FileHeader:{
Name:AndroidManifest.xml CreatorVersion:10 ReaderVersion:10 Flags:2048 Method:0
ModifiedTime:22030 ModifiedDate:18230 CRC32:1929033187
CompressedSize:7268 UncompressedSize:7268 CompressedSize64:7268 UncompressedSize64:7268
Extra:[204 94 136 27 148 14 49 95 154 4 231 53 127 242 4 199 243 207 229 161 103 90 116 69 45 31 54 220 113 43 172 4 159 109 211 57 217 2 161 17 196 16 168 19 174 138 107 15 36 181 223 22 15 21 106 153]
ExternalAttrs:0 Comment:
} zipr:0xc208038038 zipsize:276893 headerOffset:22954}
len(f.Extra): 56
len(b): 52
tag: 24268
size: 7048
Problem in extra headers (i think this extra headers add dex protector when encrypt apk). Size more then length of extra bytes.
But unzip util and ZipArchive in php5.5 woked perfect with this extras. How to fix this ?
I want to rewrite this piece in go archive/zip package, so that the extras do not interfere golang zip reader.
It's very important for me, because i rewrite build apk from php to golang and I came across a problem that can not decide :(. Please help me.

Encrypt and Decrypt AES with Golang and Ruby

I'm working on making two secure systems talk via a common encryption scheme. I picked AES as it seems a secure standard, but I'm not married to it, so long as I have two way encryption.
Here is the Go source and Ruby source simplified down to a really clear example to run from command line and see the differences. I'm outputting bytecode for easier literal comparison.
I'm using 128 bit CFB in both, and neither of them appear to have padding, any help is greatly appreciated!
You passed wrong key size in Ruby code. It should be 192. (because key.size is 24 bytes == 192 bits)
cipher = OpenSSL::Cipher::AES.new(192, :CFB)
cipher.encrypt
cipher.key = key
cipher.iv = iv
encrypted = cipher.update(input) + cipher.final()
puts "Output: [" + encrypted.bytes.join(" ") + "]"
output:
Output: [155 79 127 80 31 163 142 111 13 211 221 163 219 248]

Resources