Hi,

you can use the small patch below to try from user/domain first before trying request uri user/domain.

alternatively, try a small DSM script, a combination of test_dbfile.dsm and early_media.dsm (warning, untested):
------------------------------------------
import(mod_dlg);
import(mod_mysql);
import(mod_uri);

initial state START ;
transition "on invite" START - invite -> runinvite;
transition "on sess start" START - sessionStart -> runstart;

state runinvite
      enter {
       -- we don't want to have the default 200 OK reply
       set(reply_request=0);
      };

state runstart
      enter {
       dlg.acceptInvite(183, progress);
       connectMedia();
       uri.parse(@remote_uri, "from.");
mysql.playDBAudio("SELECT audio FROM audio WHERE name=$from.user", anything.wav);
       setTimer(1, 10);
      };

transition FR runstart - timerTest(#id==1) /
   dlg.reply(500, denied);
   stop
  -> FIN;

transition bye runstart - hangup / stop -> FIN;

state FIN;
------------------------------------------


Index: EarlyAnnounce.cpp
===================================================================
--- EarlyAnnounce.cpp   (revision 1874)
+++ EarlyAnnounce.cpp   (working copy)
@@ -29,6 +29,7 @@
 #include "EarlyAnnounce.h"
 #include "AmConfig.h"
 #include "AmUtils.h"
+#include "AmUriParser.h"

 #include "sems.h"
 #include "log.h"
@@ -304,6 +305,14 @@

     if (language.empty()) language = DefaultLanguage;

+    AmUriParser parser;
+    parser.uri = req.from_uri;
+    if (parser.parse_uri()) {
+ get_announce_msg(AnnounceApplication, AnnounceMessage, parser.uri_user,
+                      parser.uri_host, "", &announce_file);
+      if (!announce_file.empty()) goto end;
+    }
+
     get_announce_msg(AnnounceApplication, AnnounceMessage, req.user,
                     req.domain, "", &announce_file);
     if (!announce_file.empty()) goto end;


hth
Stefan

Albert Paijmans wrote:
Hi,

I have been playing around with SEMS. I like the early_announce application with database support. Play an announcement to the caller.
But the *wav file is the dialed number and not the caller id.
It sends an 183 and then 404 not found wich works with a proxy.

Is it possible to have the early_announce application play the wav file corresponding to caller id? So if extensions 2345 would dial a number it hears 2345.wav and when extension 6789 would dial a number it would hear 6789.wav and then the call would continu.

Thanks Albert



------------------------------------------------------------------------

_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems


--
Stefan Sayer
VoIP Services Consulting and Development

Warschauer Str. 24
10243 Berlin

tel:+491621366449
sip:[email protected]
email/xmpp:[email protected]


_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to