Re: [cisco-voip] CUCM Bulk TFTP File Upload

2018-06-06 Thread Ryan Ratliff (rratliff) via cisco-voip
If you’re really in a bind “file get tftp *”.

I agree syncing files between nodes with TFTP activated the way to go.

-Ryan

On Jun 6, 2018, at 11:43 AM, Charles Goldsmith 
mailto:wo...@justfamily.org>> wrote:

filelist doesn't work anymore, correct, and you can file get via the cli as 
well.  Neither is a "bulk" way to download and can be a lot of work.  :)  We 
just need a 1 click button to copy all extra files from one node to another

On Wed, Jun 6, 2018 at 10:35 AM Ryan Ratliff (rratliff) 
mailto:rratl...@cisco.com>> wrote:
If you know the files you can use curl or your favorite http package to get 
them http://tftp.ip:6970/.

On some versions you can get http://tftp.ip:6970/filelist.txt to get an index 
of files. I think that file went away in 11.5 or 12.0 with enhancements made to 
serving static files.

-Ryan

On Jun 6, 2018, at 10:18 AM, Charles Goldsmith 
mailto:wo...@justfamily.org>> wrote:

Thanks very much for this!  Has anyone worked out an easy way to bulk download 
this data?  Say you have to rebuild or add a node to an existing cluster and 
the customer doesn't have all of this info archived properly?


On Mon, Jun 4, 2018 at 1:20 PM Brian Meade 
mailto:bmead...@vt.edu>> wrote:
Now on Github- https://github.com/bmeade90/BulkTFTP

On Mon, Jun 4, 2018 at 8:47 AM, Brian Meade 
mailto:bmead...@vt.edu>> wrote:
Thanks for cleaning that up Anthony!

My main goal with this is to bulk upload entire directories and all the 
sub-directories so I can easily upload all the Desktops directories and such.

Since I'm bulk uploading so many files, I decided to just do a single node at a 
time but your edit should work fine to make this multi-node.

Attached my finalized script I was able to use to upload a few hundred files to 
a 4-node cluster on Friday.

On Sat, Jun 2, 2018 at 3:19 PM, Anthony Holloway 
mailto:avholloway+cisco-v...@gmail.com>> wrote:
Here's your code re-worked a little Brian, for you or for anyone else, and I 
tested it on 11.5 and it works.  I did not put in any error handling, so I'll 
leave that up to you.  You can do things like Try/Catch or checking for 
resp.status_code == 200, file existence checking, etc.  I figure, knowing how 
to make it work was the challenge, not error handling, so I left that out.

# Install Python 2.7 and choose the option to add to path (off by default)
# Then install two modules
#  C:\>pip install requests
#  C:\>pip install BeautifulSoup
# Then run the program
#  C:\>python tftp.py

import requests
from BeautifulSoup import BeautifulSoup
requests.packages.urllib3.disable_warnings()

tftp_host = ""
tftp_user = ""
tftp_pass = ""
tftp_file = ""
tftp_path = ""

url_base = "https://{}/cmplatform/".format(tftp_host)
url_login = "{}j_security_check".format(url_base)
url_upload = "{}tftpFileUpload.do".format(url_base)

# Allows us to keep track of our login session
print "\nLogging in to {}...".format(tftp_host),
connection = requests.Session()

# Start a new session by simply access a page on the server
resp = connection.get(url_base, verify = False)

# Our login form data
form_data = {
"appNav": "cmplatform",
"j_username": tftp_user,
"j_password": tftp_pass
}

# Our login submission to the server
resp = connection.post(url_login, verify = False, data = form_data)
print "Success!\n"

# We need to grab the token the server gives us, so we can pass it back upon 
upload
print "Grabbing a new token...",
soup = BeautifulSoup(connection.get(url_upload, verify = False).content)

# It's a hidden input element on the upload form with the name of "token"
token = soup.find("input", {"name": "token"}).get("value")
print "Found! [{}]\n".format(token)

# Our upload form submission data
payload = {
"struts.token.name": (None, "token"),
"token": (None, token),
"file": (tftp_file, open(tftp_file, "rb"), {"Content-Type": "text/plain"}),
"directory": (None, tftp_path)
}

# Our upload submission to the server
print "Uploading file: {}...".format(tftp_file),
resp = connection.post(url_upload, verify = False, files = payload)
print "Success!\n"

print "Done!"

If you want multiple server/multiple file support, it's really just a small 
modification (highlighted in red):

# Install Python 2.7 and choose the option to add to path (off by default)
# Then install two modules
#  C:\>pip install requests
#  C:\>pip install BeautifulSoup
# Then run the program
#  C:\>python tftp.py

import requests
from BeautifulSoup import BeautifulSoup
requests.packages.urllib3.disable_warnings()

tftp_hosts = [
"host1",
"hostN"
]
tftp_user = ""
tftp_pass = ""

tftp_files = [
"file1",
"fileN"
]
tftp_path = ""

for tftp_host in tftp_hosts:

url_base = "https://{}/cmplatform/".format(tftp_host)
url_login = "{}j_security_check".format(url_base)
url_upload = "{}tftpFileUpload.do".format(url_base)

# Allows us to keep track of our login session
print "\nLogging in to {}...".format(tftp_host),
connection = requests.Session()

# Start a new session by simply access a page on the 

Re: [cisco-voip] CUCM Bulk TFTP File Upload

2018-06-06 Thread Charles Goldsmith
filelist doesn't work anymore, correct, and you can file get via the cli as
well.  Neither is a "bulk" way to download and can be a lot of work.  :)
We just need a 1 click button to copy all extra files from one node to
another

On Wed, Jun 6, 2018 at 10:35 AM Ryan Ratliff (rratliff) 
wrote:

> If you know the files you can use curl or your favorite http package to
> get them http://tftp.ip:6970/.
>
> On some versions you can get http://tftp.ip:6970/filelist.txt to get an
> index of files. I think that file went away in 11.5 or 12.0 with
> enhancements made to serving static files.
>
> -Ryan
>
> On Jun 6, 2018, at 10:18 AM, Charles Goldsmith 
> wrote:
>
> Thanks very much for this!  Has anyone worked out an easy way to bulk
> download this data?  Say you have to rebuild or add a node to an existing
> cluster and the customer doesn't have all of this info archived properly?
>
>
> On Mon, Jun 4, 2018 at 1:20 PM Brian Meade  wrote:
>
>> Now on Github- https://github.com/bmeade90/BulkTFTP
>>
>> On Mon, Jun 4, 2018 at 8:47 AM, Brian Meade  wrote:
>>
>>> Thanks for cleaning that up Anthony!
>>>
>>> My main goal with this is to bulk upload entire directories and all the
>>> sub-directories so I can easily upload all the Desktops directories and
>>> such.
>>>
>>> Since I'm bulk uploading so many files, I decided to just do a single
>>> node at a time but your edit should work fine to make this multi-node.
>>>
>>> Attached my finalized script I was able to use to upload a few hundred
>>> files to a 4-node cluster on Friday.
>>>
>>> On Sat, Jun 2, 2018 at 3:19 PM, Anthony Holloway <
>>> avholloway+cisco-v...@gmail.com> wrote:
>>>
 Here's your code re-worked a little Brian, for you or for anyone else,
 and I tested it on 11.5 and it works.  I did not put in any error handling,
 so I'll leave that up to you.  You can do things like Try/Catch or checking
 for resp.status_code == 200, file existence checking, etc.  I figure,
 knowing how to make it work was the challenge, not error handling, so I
 left that out.

 # Install Python 2.7 and choose the option to add to path (off by
 default)
 # Then install two modules
 #  C:\>pip install requests
 #  C:\>pip install BeautifulSoup
 # Then run the program
 #  C:\>python tftp.py

 import requests
 from BeautifulSoup import BeautifulSoup
 requests.packages.urllib3.disable_warnings()

 tftp_host = ""
 tftp_user = ""
 tftp_pass = ""
 tftp_file = ""
 tftp_path = ""

 url_base = "https://{}/cmplatform/".format(tftp_host)
 url_login = "{}j_security_check".format(url_base)
 url_upload = "{}tftpFileUpload.do".format(url_base)

 # Allows us to keep track of our login session
 print "\nLogging in to {}...".format(tftp_host),
 connection = requests.Session()

 # Start a new session by simply access a page on the server
 resp = connection.get(url_base, verify = False)

 # Our login form data
 form_data = {
 "appNav": "cmplatform",
 "j_username": tftp_user,
 "j_password": tftp_pass
 }

 # Our login submission to the server
 resp = connection.post(url_login, verify = False, data = form_data)
 print "Success!\n"

 # We need to grab the token the server gives us, so we can pass it back
 upon upload
 print "Grabbing a new token...",
 soup = BeautifulSoup(connection.get(url_upload, verify = False).content)

 # It's a hidden input element on the upload form with the name of
 "token"
 token = soup.find("input", {"name": "token"}).get("value")
 print "Found! [{}]\n".format(token)

 # Our upload form submission data
 payload = {
 "struts.token.name": (None, "token"),
 "token": (None, token),
 "file": (tftp_file, open(tftp_file, "rb"), {"Content-Type":
 "text/plain"}),
 "directory": (None, tftp_path)
 }

 # Our upload submission to the server
 print "Uploading file: {}...".format(tftp_file),
 resp = connection.post(url_upload, verify = False, files = payload)
 print "Success!\n"

 print "Done!"

 If you want multiple server/multiple file support, it's really just a
 small modification (highlighted in red):

 # Install Python 2.7 and choose the option to add to path (off by
 default)
 # Then install two modules
 #  C:\>pip install requests
 #  C:\>pip install BeautifulSoup
 # Then run the program
 #  C:\>python tftp.py

 import requests
 from BeautifulSoup import BeautifulSoup
 requests.packages.urllib3.disable_warnings()

 tftp_hosts = [
 "host1",
 "hostN"
 ]
 tftp_user = ""
 tftp_pass = ""

 tftp_files = [
 "file1",
 "fileN"
 ]
 tftp_path = ""

 for tftp_host in tftp_hosts:

 url_base = "https://{}/cmplatform/".format(tftp_host)
 url_login = "{}j_security_check".format(url_base)
 

Re: [cisco-voip] CUCM Bulk TFTP File Upload

2018-06-06 Thread Ryan Ratliff (rratliff) via cisco-voip
If you know the files you can use curl or your favorite http package to get 
them http://tftp.ip:6970/.

On some versions you can get http://tftp.ip:6970/filelist.txt to get an index 
of files. I think that file went away in 11.5 or 12.0 with enhancements made to 
serving static files.

-Ryan

On Jun 6, 2018, at 10:18 AM, Charles Goldsmith 
mailto:wo...@justfamily.org>> wrote:

Thanks very much for this!  Has anyone worked out an easy way to bulk download 
this data?  Say you have to rebuild or add a node to an existing cluster and 
the customer doesn't have all of this info archived properly?


On Mon, Jun 4, 2018 at 1:20 PM Brian Meade 
mailto:bmead...@vt.edu>> wrote:
Now on Github- https://github.com/bmeade90/BulkTFTP

On Mon, Jun 4, 2018 at 8:47 AM, Brian Meade 
mailto:bmead...@vt.edu>> wrote:
Thanks for cleaning that up Anthony!

My main goal with this is to bulk upload entire directories and all the 
sub-directories so I can easily upload all the Desktops directories and such.

Since I'm bulk uploading so many files, I decided to just do a single node at a 
time but your edit should work fine to make this multi-node.

Attached my finalized script I was able to use to upload a few hundred files to 
a 4-node cluster on Friday.

On Sat, Jun 2, 2018 at 3:19 PM, Anthony Holloway 
mailto:avholloway+cisco-v...@gmail.com>> wrote:
Here's your code re-worked a little Brian, for you or for anyone else, and I 
tested it on 11.5 and it works.  I did not put in any error handling, so I'll 
leave that up to you.  You can do things like Try/Catch or checking for 
resp.status_code == 200, file existence checking, etc.  I figure, knowing how 
to make it work was the challenge, not error handling, so I left that out.

# Install Python 2.7 and choose the option to add to path (off by default)
# Then install two modules
#  C:\>pip install requests
#  C:\>pip install BeautifulSoup
# Then run the program
#  C:\>python tftp.py

import requests
from BeautifulSoup import BeautifulSoup
requests.packages.urllib3.disable_warnings()

tftp_host = ""
tftp_user = ""
tftp_pass = ""
tftp_file = ""
tftp_path = ""

url_base = "https://{}/cmplatform/".format(tftp_host)
url_login = "{}j_security_check".format(url_base)
url_upload = "{}tftpFileUpload.do".format(url_base)

# Allows us to keep track of our login session
print "\nLogging in to {}...".format(tftp_host),
connection = requests.Session()

# Start a new session by simply access a page on the server
resp = connection.get(url_base, verify = False)

# Our login form data
form_data = {
"appNav": "cmplatform",
"j_username": tftp_user,
"j_password": tftp_pass
}

# Our login submission to the server
resp = connection.post(url_login, verify = False, data = form_data)
print "Success!\n"

# We need to grab the token the server gives us, so we can pass it back upon 
upload
print "Grabbing a new token...",
soup = BeautifulSoup(connection.get(url_upload, verify = False).content)

# It's a hidden input element on the upload form with the name of "token"
token = soup.find("input", {"name": "token"}).get("value")
print "Found! [{}]\n".format(token)

# Our upload form submission data
payload = {
"struts.token.name": (None, "token"),
"token": (None, token),
"file": (tftp_file, open(tftp_file, "rb"), {"Content-Type": "text/plain"}),
"directory": (None, tftp_path)
}

# Our upload submission to the server
print "Uploading file: {}...".format(tftp_file),
resp = connection.post(url_upload, verify = False, files = payload)
print "Success!\n"

print "Done!"

If you want multiple server/multiple file support, it's really just a small 
modification (highlighted in red):

# Install Python 2.7 and choose the option to add to path (off by default)
# Then install two modules
#  C:\>pip install requests
#  C:\>pip install BeautifulSoup
# Then run the program
#  C:\>python tftp.py

import requests
from BeautifulSoup import BeautifulSoup
requests.packages.urllib3.disable_warnings()

tftp_hosts = [
"host1",
"hostN"
]
tftp_user = ""
tftp_pass = ""

tftp_files = [
"file1",
"fileN"
]
tftp_path = ""

for tftp_host in tftp_hosts:

url_base = "https://{}/cmplatform/".format(tftp_host)
url_login = "{}j_security_check".format(url_base)
url_upload = "{}tftpFileUpload.do".format(url_base)

# Allows us to keep track of our login session
print "\nLogging in to {}...".format(tftp_host),
connection = requests.Session()

# Start a new session by simply access a page on the server
resp = connection.get(url_base, verify = False)

# Our login form data
form_data = {
"appNav": "cmplatform",
"j_username": tftp_user,
"j_password": tftp_pass
}

# Our login submission to the server
resp = connection.post(url_login, verify = False, data = form_data)
print "Success!\n"
for tftp_file in tftp_files:

# We need to grab the token the server gives us, so we can pass it back upon 
upload
print "Grabbing a new token...",
soup = BeautifulSoup(connection.get(url_upload, verify = False).content)

# It's a hidden input 

Re: [cisco-voip] CUCM Bulk TFTP File Upload

2018-06-06 Thread Charles Goldsmith
Thanks very much for this!  Has anyone worked out an easy way to bulk
download this data?  Say you have to rebuild or add a node to an existing
cluster and the customer doesn't have all of this info archived properly?


On Mon, Jun 4, 2018 at 1:20 PM Brian Meade  wrote:

> Now on Github- https://github.com/bmeade90/BulkTFTP
>
> On Mon, Jun 4, 2018 at 8:47 AM, Brian Meade  wrote:
>
>> Thanks for cleaning that up Anthony!
>>
>> My main goal with this is to bulk upload entire directories and all the
>> sub-directories so I can easily upload all the Desktops directories and
>> such.
>>
>> Since I'm bulk uploading so many files, I decided to just do a single
>> node at a time but your edit should work fine to make this multi-node.
>>
>> Attached my finalized script I was able to use to upload a few hundred
>> files to a 4-node cluster on Friday.
>>
>> On Sat, Jun 2, 2018 at 3:19 PM, Anthony Holloway <
>> avholloway+cisco-v...@gmail.com> wrote:
>>
>>> Here's your code re-worked a little Brian, for you or for anyone else,
>>> and I tested it on 11.5 and it works.  I did not put in any error handling,
>>> so I'll leave that up to you.  You can do things like Try/Catch or checking
>>> for resp.status_code == 200, file existence checking, etc.  I figure,
>>> knowing how to make it work was the challenge, not error handling, so I
>>> left that out.
>>>
>>> # Install Python 2.7 and choose the option to add to path (off by
>>> default)
>>> # Then install two modules
>>> #  C:\>pip install requests
>>> #  C:\>pip install BeautifulSoup
>>> # Then run the program
>>> #  C:\>python tftp.py
>>>
>>> import requests
>>> from BeautifulSoup import BeautifulSoup
>>> requests.packages.urllib3.disable_warnings()
>>>
>>> tftp_host = ""
>>> tftp_user = ""
>>> tftp_pass = ""
>>> tftp_file = ""
>>> tftp_path = ""
>>>
>>> url_base = "https://{}/cmplatform/".format(tftp_host)
>>> url_login = "{}j_security_check".format(url_base)
>>> url_upload = "{}tftpFileUpload.do".format(url_base)
>>>
>>> # Allows us to keep track of our login session
>>> print "\nLogging in to {}...".format(tftp_host),
>>> connection = requests.Session()
>>>
>>> # Start a new session by simply access a page on the server
>>> resp = connection.get(url_base, verify = False)
>>>
>>> # Our login form data
>>> form_data = {
>>> "appNav": "cmplatform",
>>> "j_username": tftp_user,
>>> "j_password": tftp_pass
>>> }
>>>
>>> # Our login submission to the server
>>> resp = connection.post(url_login, verify = False, data = form_data)
>>> print "Success!\n"
>>>
>>> # We need to grab the token the server gives us, so we can pass it back
>>> upon upload
>>> print "Grabbing a new token...",
>>> soup = BeautifulSoup(connection.get(url_upload, verify = False).content)
>>>
>>> # It's a hidden input element on the upload form with the name of "token"
>>> token = soup.find("input", {"name": "token"}).get("value")
>>> print "Found! [{}]\n".format(token)
>>>
>>> # Our upload form submission data
>>> payload = {
>>> "struts.token.name": (None, "token"),
>>> "token": (None, token),
>>> "file": (tftp_file, open(tftp_file, "rb"), {"Content-Type":
>>> "text/plain"}),
>>> "directory": (None, tftp_path)
>>> }
>>>
>>> # Our upload submission to the server
>>> print "Uploading file: {}...".format(tftp_file),
>>> resp = connection.post(url_upload, verify = False, files = payload)
>>> print "Success!\n"
>>>
>>> print "Done!"
>>>
>>> If you want multiple server/multiple file support, it's really just a
>>> small modification (highlighted in red):
>>>
>>> # Install Python 2.7 and choose the option to add to path (off by
>>> default)
>>> # Then install two modules
>>> #  C:\>pip install requests
>>> #  C:\>pip install BeautifulSoup
>>> # Then run the program
>>> #  C:\>python tftp.py
>>>
>>> import requests
>>> from BeautifulSoup import BeautifulSoup
>>> requests.packages.urllib3.disable_warnings()
>>>
>>> tftp_hosts = [
>>> "host1",
>>> "hostN"
>>> ]
>>> tftp_user = ""
>>> tftp_pass = ""
>>>
>>> tftp_files = [
>>> "file1",
>>> "fileN"
>>> ]
>>> tftp_path = ""
>>>
>>> for tftp_host in tftp_hosts:
>>>
>>> url_base = "https://{}/cmplatform/".format(tftp_host)
>>> url_login = "{}j_security_check".format(url_base)
>>> url_upload = "{}tftpFileUpload.do".format(url_base)
>>>
>>> # Allows us to keep track of our login session
>>> print "\nLogging in to {}...".format(tftp_host),
>>> connection = requests.Session()
>>>
>>> # Start a new session by simply access a page on the server
>>> resp = connection.get(url_base, verify = False)
>>>
>>> # Our login form data
>>> form_data = {
>>> "appNav": "cmplatform",
>>> "j_username": tftp_user,
>>> "j_password": tftp_pass
>>> }
>>>
>>> # Our login submission to the server
>>> resp = connection.post(url_login, verify = False, data = form_data)
>>> print "Success!\n"
>>> for tftp_file in tftp_files:
>>>
>>> # We need to grab the token the server gives us, so we can pass it back
>>> upon upload
>>> print "Grabbing a new token...",
>>> soup = 

[cisco-voip] SBC and M-MOH

2018-06-06 Thread Ki Wi
Hi Folks,
In the past, most sites will have a PSTN voice gateway. MMOH will be used
for the users co-locating with a PSTN voice gateway.

Now, more and more providers in Europe/US/Canada are providing SIP trunk
now.
As we know, certain music will tend to be distorted when we used G.729.

When we move over to SIP trunk, what's the best design for MOH for various
scenario?

Scenario 1
Local voice gateway is available (acting as SBC). Preferably, MMOH will be
playback for local user and PSTN users.

Is there any special CUBE configuration to convert MMOH playback locally to
unicast MOH traffic before sending to SIP provider? Or I can only unicast
MOH from CUCM and send it towards the SIP provider?

Scenario 2
Site without voice gateway. The service provider SBC can directly integrate
with CUCM via SIP trunk.  SBC (1 leg - connected to PSTN service provider
network, 1 leg - connected to customer LAN) and CUCM sits in different
site. In this case, how can I provide MOH to the SIP trunk provider?
Unicast via G.711?
Is there better option out there? I feels that in this case, it's wasting
of bandwidth when all my regular on-net calls are using G.729 only.

-- 
Regards,
Ki Wi
___
cisco-voip mailing list
cisco-voip@puck.nether.net
https://puck.nether.net/mailman/listinfo/cisco-voip