[Asterisk-Dev] Parking, MOH, and Other Goodness

Jayson Vantuyl kagato at chaosium.net
Mon Mar 1 16:31:28 MST 2004


When you put someone on hold and park them, what determines the moh to play?

I've got a few interesting scenarios:

Scenario 1:

A calls B.  A flashes B to hold and parks them.  B always seems to get the
default hold music.

Scenario 2:

A calls B.  B flashes A to hold and parks them.  A gets the hold music set on
their channel.

This leads me to believe that a channel's MOH is set first by the entry in
zapata.conf and the overridden by SetMusicOnHold if you call it.

How do I set the other channel's MOH when I park them?  I'd like for it to park
a channel on the same MOH and the number that parked it.

I've currently been able to do that with this:

Index: res/res_parking.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_parking.c,v
retrieving revision 1.17
diff -u -r1.17 res_parking.c
--- res/res_parking.c   27 Feb 2004 06:15:49 -0000      1.17
+++ res/res_parking.c   1 Mar 2004 23:29:00 -0000
@@ -127,7 +127,7 @@

                        pu->chan = chan;
                        /* Start music on hold */
-                       ast_moh_start(pu->chan, NULL);
+                       ast_moh_start(pu->chan, peer->musicclass);
                        gettimeofday(&pu->start, NULL);
                        pu->parkingnum = x;
                        if (timeout > 0)
@@ -164,7 +164,6 @@
                                 "From: %s\r\n"
                                 "Timeout: %ld\r\n"
                                 "CallerID: %s\r\n"
-                                "\r\n"
                                 ,pu->parkingnum, pu->chan->name, peer->name
                                 ,(long)pu->start.tv_sec + (long)(pu->parkingtime/1000) - (long)time(NULL)
                                 ,(pu->chan->callerid ? pu->chan->callerid : "")


Is this right?  Do we need another option to Park to set the MOH?  Since
parkedcalls is autogenerated how would we specify it?

-- 
Jayson Vantuyl



More information about the asterisk-dev mailing list