Re: [asterisk-users] res_fax_spandsp - information about used protocol t38 or g711?

2018-05-21 Thread Michael Maier
On 05/21/2018 at 06:46 PM Andre Gronwald wrote:
> after completion you find ${FAXMODE} filled with audio or T38, depending
> on what has been used.
> hope that is what you are looking for.

Yes, that's exactly what I've been looking for!


Thanks,
Michael

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Looking for better fax handling

2018-05-21 Thread John Kiniston
Lock files.

Create one when you start sending the fax, on your retry process check for
a lock file and if one exists don't retry.

On Mon, May 21, 2018 at 10:49 AM, D'Arcy Cain 
wrote:

> I am having troubles with sending faxes.  I hope someone can help me
> work out a better method.
>
> Basically we have a special address that our users can send to.  It
> winds up on our Asterisk server which runs a Python script that parses
> the message for attachments and the phone number from the recipient
> address.  The attachments are converted to TIFF and stored in a folder
> with various information encoded into the file name such as phone number
> and retry information.  That all works fine.
>
> A separate process picks up the files and sends them using an AMI script
> like this:
>
> Action: Originate
> Channel: SIP/provider/%(destination)s
> Context: LocalSets
> CallerID: Vybe Consulting Inc Fax Service <6475551212>
> Exten: sendfax
> Priority: 1
> Timeout: 3
> Variable: faxfile=%(faxfile)s
> Variable: uid=%(uid)s
> Variable: destination=%(destination)s
> Variable: sender_name=Vybe Consulting Inc Fax Service
> Variable: sender_num=6475551212
>
> It then renames the file encoding the next retry time and incrementing
> the number of retries.
>
> The same script checks for files in a success folder and sends the users
> a confirmation message that the fax was sent.  The files are moved into
> the success folder by Asterisk using this dialplan:
>
> sendfax,1,Verbose(0,FAX ${faxfile} to ${destination})
>   same => n,Set(FAXOPT(headerinfo)=${sender_name})
>   same => n,Set(FAXOPT(localstationid)=${sender_num})
>   same => n,SendFax(${faxfile},d)
>   same => n,Set(STATUS=Status: ${FAXOPT(status)})
>   same => n,Set(STATUS=${STATUS}\nRemote ID: ${FAXOPT(remotestationid)})
>   same => n,Set(STATUS=${STATUS}\nMaxrate: ${FAXOPT(maxrate)})
>   same => n,Set(STATUS=${STATUS}\nMinrate: ${FAXOPT(minrate)})
>   same => n,Set(STATUS=${STATUS}\nECM: ${FAXOPT(ecm)})
>   same => n,Set(STATUS=${STATUS}\nnumber of pages: ${FAXOPT(pages)})
>   same => n,Set(STATUS=${STATUS}\nRate: ${FAXOPT(rate)})
>   same => n,Set(STATUS=${STATUS}\nResolution: ${FAXOPT(resolution)})
>   same => n,GotoIf($["${FAXOPT(status)}" = "SUCCESS"]?faxok)
>   same => n,Set(STATUS=${STATUS}\nError: ${FAXOPT(error)})
>   same => n(faxok),Verbose(0,FAX ${destination} Status (S): ${STATUS})
>   same => n,Set(FAXNAME=${CUT(faxfile,/,6)})
>   same => n,Set(FILE(/fax_status/${FAXNAME})=${STATUS})
>   same => n,GotoIf($["${FAXOPT(status)}" != "SUCCESS"]?faxfail)
>   same => n,System(/bin/mv '${faxfile}' '/fax_success/${FAXNAME}')
>
>   same => n,Set(CDR(userfield)=${destination})
>   same => n,Verbose(0,FAX to ${destination} charged to ${uid})
>   same => n(faxfail),Verbose(0,FAX ${destination} Status (F): ${STATUS})
>   same => n,Hangup()
>
> My problem is that if the faxes get too big it starts sending it again
> before the previous one has finished.  I can't raise the retry limit too
> far because sometimes the receiver is busy and we have to retry in a
> reasonable time.
>
> Is there a way to get a token from the AMI script that I can use to
> determine later if Asterisk is still busy with the fax before I try
> sending it again?
>
> Or, am I approaching this all wrong?  Is there a better method of doing
> this?
>
> I am running Asterisk 13.19.0 on NetBSD/amd64 7.1.0.
>
> --
> D'Arcy J.M. Cain
> Vybe Networks Inc.
> http://www.VybeNetworks.com/
> IM:da...@vex.net VoIP: sip:da...@vybenetworks.com
>
>
>
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.
> org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>



-- 
A human being should be able to change a diaper, plan an invasion, butcher
a hog, conn a ship, design a building, write a sonnet, balance accounts,
build a wall, set a bone, comfort the dying, take orders, give orders,
cooperate, act alone, solve equations, analyze a new problem, pitch manure,
program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
---Heinlein
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Looking for better fax handling

2018-05-21 Thread D'Arcy Cain
I am having troubles with sending faxes.  I hope someone can help me
work out a better method.

Basically we have a special address that our users can send to.  It
winds up on our Asterisk server which runs a Python script that parses
the message for attachments and the phone number from the recipient
address.  The attachments are converted to TIFF and stored in a folder
with various information encoded into the file name such as phone number
and retry information.  That all works fine.

A separate process picks up the files and sends them using an AMI script
like this:

Action: Originate
Channel: SIP/provider/%(destination)s
Context: LocalSets
CallerID: Vybe Consulting Inc Fax Service <6475551212>
Exten: sendfax
Priority: 1
Timeout: 3
Variable: faxfile=%(faxfile)s
Variable: uid=%(uid)s
Variable: destination=%(destination)s
Variable: sender_name=Vybe Consulting Inc Fax Service
Variable: sender_num=6475551212

It then renames the file encoding the next retry time and incrementing
the number of retries.

The same script checks for files in a success folder and sends the users
a confirmation message that the fax was sent.  The files are moved into
the success folder by Asterisk using this dialplan:

sendfax,1,Verbose(0,FAX ${faxfile} to ${destination})
  same => n,Set(FAXOPT(headerinfo)=${sender_name})
  same => n,Set(FAXOPT(localstationid)=${sender_num})
  same => n,SendFax(${faxfile},d)
  same => n,Set(STATUS=Status: ${FAXOPT(status)})
  same => n,Set(STATUS=${STATUS}\nRemote ID: ${FAXOPT(remotestationid)})
  same => n,Set(STATUS=${STATUS}\nMaxrate: ${FAXOPT(maxrate)})
  same => n,Set(STATUS=${STATUS}\nMinrate: ${FAXOPT(minrate)})
  same => n,Set(STATUS=${STATUS}\nECM: ${FAXOPT(ecm)})
  same => n,Set(STATUS=${STATUS}\nnumber of pages: ${FAXOPT(pages)})
  same => n,Set(STATUS=${STATUS}\nRate: ${FAXOPT(rate)})
  same => n,Set(STATUS=${STATUS}\nResolution: ${FAXOPT(resolution)})
  same => n,GotoIf($["${FAXOPT(status)}" = "SUCCESS"]?faxok)
  same => n,Set(STATUS=${STATUS}\nError: ${FAXOPT(error)})
  same => n(faxok),Verbose(0,FAX ${destination} Status (S): ${STATUS})
  same => n,Set(FAXNAME=${CUT(faxfile,/,6)})
  same => n,Set(FILE(/fax_status/${FAXNAME})=${STATUS})
  same => n,GotoIf($["${FAXOPT(status)}" != "SUCCESS"]?faxfail)
  same => n,System(/bin/mv '${faxfile}' '/fax_success/${FAXNAME}')

  same => n,Set(CDR(userfield)=${destination})
  same => n,Verbose(0,FAX to ${destination} charged to ${uid})
  same => n(faxfail),Verbose(0,FAX ${destination} Status (F): ${STATUS})
  same => n,Hangup()

My problem is that if the faxes get too big it starts sending it again
before the previous one has finished.  I can't raise the retry limit too
far because sometimes the receiver is busy and we have to retry in a
reasonable time.

Is there a way to get a token from the AMI script that I can use to
determine later if Asterisk is still busy with the fax before I try
sending it again?

Or, am I approaching this all wrong?  Is there a better method of doing
this?

I am running Asterisk 13.19.0 on NetBSD/amd64 7.1.0.

-- 
D'Arcy J.M. Cain
Vybe Networks Inc.
http://www.VybeNetworks.com/
IM:da...@vex.net VoIP: sip:da...@vybenetworks.com





-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] res_fax_spandsp - information about used protocol t38 or g711?

2018-05-21 Thread Andre Gronwald

after completion you find ${FAXMODE} filled with audio or T38, depending on 
what has been used.
hope that is what you are looking for.

regards,
andre

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] setting contact within asterisk -rx 'channel originate local ...'

2018-05-21 Thread Andre Gronwald

hi,

i am using a script to initiate calls to some sip stations simply for 
notifying some people.


that is working fine and people like this simple way of getting an 
information (just by being pinged this way).


my problem is, that in this case the calling number is always 
"asterisk@".


i tried to set callerid(name) and callerid(all) to something describing, 
the header is set, but the sip-phones (android) seem to display the 
contact header.


can you tell me how to change the contact header? i would like to set up 
some further "ping-services", but for this i need to change the 
displayed name.


regards,
andre


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] res_fax_spandsp - information about used protocol t38 or g711?

2018-05-21 Thread Michael Maier
Hello!

I'm working on a fax solution, which reports the result of each sent or
received fax to the database.

When using option "F" or not using option "f", it's clear which protocol
has been used. But if "f" is used, it could be g711 or t38. Is there any
variable which contains this information at the end of the fax transmission?

I'm using asterisk 13.


Thanks for any hint,
Michael

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] AMI status events with res_fax_spandsp.so

2018-05-21 Thread Steven Wheeler
>> Is anyone else using the AMI with res_fax_spandsp.so for real-time status?
> 
> As far as I can tell there is no way to get worthwhile status/progress 
> information from AMI when using spandsp.
> 
>> I am working on migrating a FAX application from res_fax_digium.so to 
>> res_fax_spandsp.so. I have noticed that the spandsp module generates far 
>> fewer AMI status events than the Digium module and the generated events 
>> contain less information. For example when sending a fax there is no longer 
>> an event for every page. There are just a few FaxStatus events at the 
>> beginning and a couple at the end but they don’t contain many details. I can 
>> pull the required information from the Asterisk console by running  fax show 
>> session  but that output isn’t suitable for parsing.
> 
> The only way I have found to follow fax progress is to configure the logs to 
> include fax debug and "tail" the logs. ECM fax will produce log messages like 
> "res_fax.c: FLOW T.30 Starting page 2 of transfer". 
> Non-ECM fax does not produce any page information as far as I can see.
> 
> Neil Youngman

Thanks, I figured that was the case but wanted to be sure I hadn’t missed a 
configuration option or something else.

Steven Wheeler
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users