added: autoconf environment
[lcr.git] / apppbx.cpp
index b7a8357..f4fa4c9 100644 (file)
@@ -309,9 +309,9 @@ void EndpointAppPBX::screen(int out, char *id, int idsize, int *type, int *prese
                        SCPY(suffix, strchr(ifscreen->match,'%') - ifscreen->match + id);
                        UNCPY(id, ifscreen->result, idsize);
                        id[idsize-1] = '\0';
-                       if (strchr(ifscreen->result,'%'))
+                       if (strchr(id,'%'))
                        {
-                               *strchr(ifscreen->result,'%') = '\0';
+                               *strchr(id,'%') = '\0';
                                UNCAT(id, suffix, idsize);
                                id[idsize-1] = '\0';
                        }
@@ -3443,10 +3443,13 @@ void EndpointAppPBX::join_notify(struct port_list *portlist, int message_type, u
                                /* unhold if */
                                if (new_state!=NOTIFY_STATE_HOLD && new_state!=NOTIFY_STATE_SUSPEND)
                                {
-                                       while(portlist)
+                                       if (!strcmp(e_tone, "hold")) // don't interrupt other tones
                                        {
-                                               set_tone(portlist, "");
-                                               portlist = portlist->next;
+                                               while(portlist)
+                                               {
+                                                       set_tone(portlist, "");
+                                                       portlist = portlist->next;
+                                               }
                                        }
                                        portlist = ea_endpoint->ep_portlist;
                                        e_hold = 0;