vm-mailto is just the value of your email address if you want to send or not which is more specific than email-addr<br>vm-email-all-messages is the actual param to adjust the functionality.<br><br><br><div class="gmail_quote">
On Tue, Jun 3, 2008 at 12:39 PM, Peder @ NetworkOblivion <<a href="mailto:peder@networkoblivion.com">peder@networkoblivion.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
So I was messing with the voicemail to email and notify and ran into an<br>
"issue". It appears that you have to have vm-email-all-messages set to<br>
true and have an address in vm-mailto to send a notify. This may or may<br>
not be the intention, but it just doesn't sound right to me. I should<br>
be able to send a notify without sending an email as well. I think I<br>
found the culprit at line 1926, it is:<br>
<br>
if (send_mail && !switch_strlen_zero(email_vm) &&<br>
switch_file_exists(file_path, switch_core_session_get_pool(session)) ==<br>
SWITCH_STATUS_SUCCESS) {<br>
<br>
<br>
My thought was to instead say "if you have email-all and an email, or<br>
you have notify", then you are ok, which I think the below will do:<br>
<br>
if (((send_mail && !switch_strlen_zero(email_vm)) ||<br>
!switch_strlen_zero(email_vm_notify)) && switch_file_exists(file_path,<br>
switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) {<br>
<br>
<br>
The issue is that I kind of got lost in the logic below as to how I<br>
would change these lines. This sends an email with attach AND a notify<br>
if notify is set. If both are set, that is fine, but if only notify is<br>
set, I don't want to send an email. Line 2014:<br>
<br>
<br>
if (email_attach) {<br>
switch_simple_email(email_vm, from,<br>
header_string, body, file_path);<br>
} else {<br>
switch_simple_email(email_vm, from,<br>
header_string, body, NULL);<br>
}<br>
if (!switch_strlen_zero(email_vm_notify)) {<br>
switch_simple_email(email_vm_notify, from,<br>
header_string, body, NULL);<br>
}<br>
<br>
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,<br>
"Sending message to %s\n", email_vm);<br>
<br>
<br>
I wasn't sure if I needed to say "if email_attach and send_mail and<br>
!zero(email_vm)" and then the else would be an elseif of "if<br>
email_attach and send_mail and zero(email_vm)" to make sure that I don't<br>
match either of these with only notify set. Or is there an easier way<br>
to say it to make sure I don't miss something?<br>
<br>
Also, I think the log message would be better if there was one per<br>
if/then/if so that we can see if it is with an attach, without, or just<br>
a notify.<br>
<br>
if (email_attach) {<br>
switch_simple_email(email_vm, from,<br>
header_string, body, file_path);<br>
switch_log_printf(SWITCH_CHANNEL_LOG,<br>
SWITCH_LOG_DEBUG, "Sending email with attachment to %s\n", email_vm);<br>
} else {<br>
switch_simple_email(email_vm, from,<br>
header_string, body, NULL);<br>
switch_log_printf(SWITCH_CHANNEL_LOG,<br>
SWITCH_LOG_DEBUG, "Sending email without attachment to %s\n", email_vm);<br>
}<br>
if (!switch_strlen_zero(email_vm_notify)) {<br>
switch_simple_email(email_vm_notify, from,<br>
header_string, body, NULL);<br>
switch_log_printf(SWITCH_CHANNEL_LOG,<br>
SWITCH_LOG_DEBUG, "Sending email notify to %s\n", email_vm_notify);<br>
}<br>
<br>
switch_safe_free(body);<br>
<br>
<br>
And before anybody says it, I don't have cvs commit access and I am a<br>
rookie programmer and don't want to commit something that is totally f'd up.<br>
<br>
Peder<br>
<br>
_______________________________________________<br>
Freeswitch-dev mailing list<br>
<a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400